@kya-os/mcp-i 1.2.6 → 1.2.7

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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see stdio.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}}(this,()=>(()=>{var e={6069:(e,t,r)=>{"use strict";var a=r(72916).MissingRef;e.exports=function e(t,r,s){var i=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof r&&(s=r,r=void 0);var o=n(t).then(function(){var e=i._addSchema(t,void 0,r);return e.validate||l(e)});return s&&o.then(function(e){s(null,e)},s),o;function n(t){var r=t.$schema;return r&&!i.getSchema(r)?e.call(i,{$ref:r},!0):Promise.resolve()}function l(e){try{return i._compile(e)}catch(t){if(t instanceof a)return function(t){var a=t.missingSchema;if(c(a))throw new Error("Schema "+a+" is loaded but "+t.missingRef+" cannot be resolved");var s=i._loadingSchemas[a];return s||(s=i._loadingSchemas[a]=i._opts.loadSchema(a)).then(o,o),s.then(function(e){if(!c(a))return n(e).then(function(){c(a)||i.addSchema(e,a,void 0,r)})}).then(function(){return l(e)});function o(){delete i._loadingSchemas[a]}function c(e){return i._refs[e]||i._schemas[e]}}(t);throw t}}}},9717:(e,t,r)=>{"use strict";function a(e,t,r,a){var s=a?" !== ":" === ",i=a?" || ":" && ",o=a?"!":"",n=a?"":"!";switch(e){case"null":return t+s+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+i+"typeof "+t+s+'"object"'+i+n+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+s+'"number"'+i+n+"("+t+" % 1)"+i+t+s+t+(r?i+o+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+s+'"'+e+'"'+(r?i+o+"isFinite("+t+")":"")+")";default:return"typeof "+t+s+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t,r){if(1===e.length)return a(e[0],t,r,!0);var s="",o=i(e);for(var n in o.array&&o.object&&(s=o.null?"(":"(!"+t+" || ",s+="typeof "+t+' !== "object")',delete o.null,delete o.array,delete o.object),o.number&&delete o.integer,o)s+=(s?" && ":"")+a(n,t,r,!0);return s},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a<t.length;a++){var i=t[a];(s[i]||"array"===e&&"array"===i)&&(r[r.length]=i)}if(r.length)return r}else{if(s[t])return[t];if("array"===e&&"array"===t)return["array"]}},toHash:i,getProperty:l,escapeQuotes:c,equal:r(67371),ucs2length:r(61812),varOccurences:function(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0},varReplace:function(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0},schemaHasRulesExcept:function(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var a in e)if(a!=r&&t[a])return!0},schemaUnknownRules:function(e,t){if("boolean"!=typeof e)for(var r in e)if(!t[r])return r},toQuotedString:u,getPathExpr:function(e,t,r,a){return p(e,r?"'/' + "+t+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,r){return p(e,u(r?"/"+m(t):l(t)))},getData:function(e,t,r){var a,s,i,o;if(""===e)return"rootData";if("/"==e[0]){if(!d.test(e))throw new Error("Invalid JSON-pointer: "+e);s=e,i="rootData"}else{if(!(o=e.match(h)))throw new Error("Invalid JSON-pointer: "+e);if(a=+o[1],"#"==(s=o[2])){if(a>=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!s)return i}for(var n=i,c=s.split("/"),u=0;u<c.length;u++){var p=c[u];p&&(n+=" && "+(i+=l(f(p))))}return n},unescapeFragment:function(e){return f(decodeURIComponent(e))},unescapeJsonPointer:f,escapeFragment:function(e){return encodeURIComponent(m(e))},escapeJsonPointer:m};var s=i(["string","number","integer","boolean","null"]);function i(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}var o=/^[a-z$_][a-z$_0-9]*$/i,n=/'|\\/g;function l(e){return"number"==typeof e?"["+e+"]":o.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace(n,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function u(e){return"'"+c(e)+"'"}var d=/^\/(?:[^~]|~0|~1)*$/,h=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function p(e,t){return'""'==e?t:(e+" + "+t).replace(/([^\\])' \+ '/g,"$1")}function m(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},9931:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(a+="var "+d+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=n,h.errSchemaPath=l;var m="key"+s,f="idx"+s,v="i"+s,g="' + "+m+" + '",y="data"+(h.dataLevel=e.dataLevel+1),_="dataProperties"+s,b=e.opts.ownProperties,P=e.baseId;b&&(a+=" var "+_+" = undefined; "),a+=b?" "+_+" = "+_+" || Object.keys("+u+"); for (var "+f+"=0; "+f+"<"+_+".length; "+f+"++) { var "+m+" = "+_+"["+f+"]; ":" for (var "+m+" in "+u+") { ",a+=" var startErrs"+s+" = errors; ";var w=m,E=e.compositeRule;e.compositeRule=h.compositeRule=!0;var x=e.validate(h);h.baseId=P,e.util.varOccurences(x,y)<2?a+=" "+e.util.varReplace(x,y,w)+" ":a+=" var "+y+" = "+w+"; "+x+" ",e.compositeRule=h.compositeRule=E,a+=" if (!"+p+") { for (var "+v+"=startErrs"+s+"; "+v+"<errors; "+v+"++) { vErrors["+v+"].propertyName = "+m+"; } var err = ",!1!==e.createErrors?(a+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { propertyName: '"+g+"' } ",!1!==e.opts.messages&&(a+=" , message: 'property name \\'"+g+"\\' is invalid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),c&&(a+=" break; "),a+=" } }"}return c&&(a+=" if ("+d+" == errors) {"),a}},12269:e=>{"use strict";e.exports=JSON.parse('{"$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}')},12857:e=>{"use strict";e.exports=function(e,t,r){var a,s,i=" ",o=e.level,n=e.dataLevel,l=e.schema[t],c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(n||""),h="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,s="validate"):(a=!0===e.root.schema.$async,s="root.refVal[0]");else{var p=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===p){var m=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(m),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var f=i;i=y.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,m);e.logger.warn(m),u&&(i+=" if (true) { ")}}else if(p.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=p.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,p.code)+" ",u&&(i+=" if ("+g+") { ")}else a=!0===p.$async||e.async&&!1!==p.$async,s=p.code}if(s){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+s+".call(this, ":i+=" "+s+"( ",i+=" "+d+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var _=i+=" , "+(n?"data"+(n-1||""):"parentData")+" , "+(n?e.dataPathArr[n]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(i+=" var "+h+"; "),i+=" try { await "+_+"; ",u&&(i+=" "+h+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(i+=" "+h+" = false; "),i+=" } ",u&&(i+=" if ("+h+") { ")}else i+=" if (!"+_+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",u&&(i+=" else { ")}return i}},13215:e=>{"use strict";e.exports=JSON.parse('{"$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}')},13441:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=n,h.errSchemaPath=l,a+=" var "+d+" = errors; ";var m,f=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(m=h.opts.allErrors,h.opts.allErrors=!1),a+=" "+e.validate(h)+" ",h.createErrors=!0,m&&(h.opts.allErrors=m),e.compositeRule=h.compositeRule=f,a+=" if ("+p+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(a+=" if (false) { ");return a}},13749:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,s=1;s<a;++s)t[s]=t[s].slice(1,-1);return t[a]=t[a].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function a(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function s(e){return e.toUpperCase()}function i(e){var a="[A-Za-z]",s="[0-9]",i=t(s,"[A-Fa-f]"),o=r(r("%[EFef]"+i+"%"+i+i+"%"+i+i)+"|"+r("%[89A-Fa-f]"+i+"%"+i+i)+"|"+r("%"+i+i)),n="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",l=t("[\\:\\/\\?\\#\\[\\]\\@]",n),c=e?"[\\uE000-\\uF8FF]":"[]",u=t(a,s,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=r(a+t(a,s,"[\\+\\-\\.]")+"*"),h=r(r(o+"|"+t(u,n,"[\\:]"))+"*"),p=(r(r("25[0-5]")+"|"+r("2[0-4]"+s)+"|"+r("1"+s+s)+"|"+r("[1-9]"+s)+"|"+s),r(r("25[0-5]")+"|"+r("2[0-4]"+s)+"|"+r("1"+s+s)+"|"+r("0?[1-9]"+s)+"|0?0?"+s)),m=r(p+"\\."+p+"\\."+p+"\\."+p),f=r(i+"{1,4}"),v=r(r(f+"\\:"+f)+"|"+m),g=r(r(f+"\\:")+"{6}"+v),y=r("\\:\\:"+r(f+"\\:")+"{5}"+v),_=r(r(f)+"?\\:\\:"+r(f+"\\:")+"{4}"+v),b=r(r(r(f+"\\:")+"{0,1}"+f)+"?\\:\\:"+r(f+"\\:")+"{3}"+v),P=r(r(r(f+"\\:")+"{0,2}"+f)+"?\\:\\:"+r(f+"\\:")+"{2}"+v),w=r(r(r(f+"\\:")+"{0,3}"+f)+"?\\:\\:"+f+"\\:"+v),E=r(r(r(f+"\\:")+"{0,4}"+f)+"?\\:\\:"+v),x=r(r(r(f+"\\:")+"{0,5}"+f)+"?\\:\\:"+f),S=r(r(r(f+"\\:")+"{0,6}"+f)+"?\\:\\:"),k=r([g,y,_,b,P,w,E,x,S].join("|")),j=r(r(u+"|"+o)+"+"),O=(r(k+"\\%25"+j),r(k+r("\\%25|\\%(?!"+i+"{2})")+j)),R=r("[vV]"+i+"+\\."+t(u,n,"[\\:]")+"+"),$=r("\\["+r(O+"|"+k+"|"+R)+"\\]"),I=r(r(o+"|"+t(u,n))+"*"),T=r($+"|"+m+"(?!"+I+")|"+I),C=r(s+"*"),F=r(r(h+"@")+"?"+T+r("\\:"+C)+"?"),D=r(o+"|"+t(u,n,"[\\:\\@]")),A=r(D+"*"),N=r(D+"+"),Z=r(r(o+"|"+t(u,n,"[\\@]"))+"+"),q=r(r("\\/"+A)+"*"),L=r("\\/"+r(N+q)+"?"),z=r(Z+q),M=r(N+q),V="(?!"+D+")",H=(r(q+"|"+L+"|"+z+"|"+M+"|"+V),r(r(D+"|"+t("[\\/\\?]",c))+"*")),U=r(r(D+"|[\\/\\?]")+"*"),Q=r(r("\\/\\/"+F+q)+"|"+L+"|"+M+"|"+V),K=r(d+"\\:"+Q+r("\\?"+H)+"?"+r("\\#"+U)+"?"),B=r(r("\\/\\/"+F+q)+"|"+L+"|"+z+"|"+V),J=r(B+r("\\?"+H)+"?"+r("\\#"+U)+"?");return r(K+"|"+J),r(d+"\\:"+Q+r("\\?"+H)+"?"),r(r("\\/\\/("+r("("+h+")@")+"?("+T+")"+r("\\:("+C+")")+"?)")+"?("+q+"|"+L+"|"+M+"|"+V+")"),r("\\?("+H+")"),r("\\#("+U+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+T+")"+r("\\:("+C+")")+"?)")+"?("+q+"|"+L+"|"+z+"|"+V+")"),r("\\?("+H+")"),r("\\#("+U+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+T+")"+r("\\:("+C+")")+"?)")+"?("+q+"|"+L+"|"+M+"|"+V+")"),r("\\?("+H+")"),r("\\#("+U+")"),r("("+h+")@"),r("\\:("+C+")"),{NOT_SCHEME:new RegExp(t("[^]",a,s,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",u,n),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",u,n),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",u,n),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",u,n),"g"),NOT_QUERY:new RegExp(t("[^\\%]",u,n,"[\\:\\@\\/\\?]",c),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",u,n,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",u,n),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",u,l),"g"),PCT_ENCODED:new RegExp(o,"g"),IPV4ADDRESS:new RegExp("^("+m+")$"),IPV6ADDRESS:new RegExp("^\\[?("+k+")"+r(r("\\%25|\\%(?!"+i+"{2})")+"("+j+")")+"?\\]?$")}}var o=i(!1),n=i(!0),l=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],a=!0,s=!1,i=void 0;try{for(var o,n=e[Symbol.iterator]();!(a=(o=n.next()).done)&&(r.push(o.value),!t||r.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{!a&&n.return&&n.return()}finally{if(s)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=2147483647,u=36,d=/^xn--/,h=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,v=String.fromCharCode;function g(e){throw new RangeError(m[e])}function y(e,t){var r=e.split("@"),a="";return r.length>1&&(a=r[0]+"@",e=r[1]),a+function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(p,".")).split("."),t).join(".")}function _(e){for(var t=[],r=0,a=e.length;r<a;){var s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<a){var i=e.charCodeAt(r++);56320==(64512&i)?t.push(((1023&s)<<10)+(1023&i)+65536):(t.push(s),r--)}else t.push(s)}return t}var b=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:u},P=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,r){var a=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;a+=u)e=f(e/35);return f(a+36*e/(e+38))},E=function(e){var t=[],r=e.length,a=0,s=128,i=72,o=e.lastIndexOf("-");o<0&&(o=0);for(var n=0;n<o;++n)e.charCodeAt(n)>=128&&g("not-basic"),t.push(e.charCodeAt(n));for(var l=o>0?o+1:0;l<r;){for(var d=a,h=1,p=u;;p+=u){l>=r&&g("invalid-input");var m=b(e.charCodeAt(l++));(m>=u||m>f((c-a)/h))&&g("overflow"),a+=m*h;var v=p<=i?1:p>=i+26?26:p-i;if(m<v)break;var y=u-v;h>f(c/y)&&g("overflow"),h*=y}var _=t.length+1;i=w(a-d,_,0==d),f(a/_)>c-s&&g("overflow"),s+=f(a/_),a%=_,t.splice(a++,0,s)}return String.fromCodePoint.apply(String,t)},x=function(e){var t=[],r=(e=_(e)).length,a=128,s=0,i=72,o=!0,n=!1,l=void 0;try{for(var d,h=e[Symbol.iterator]();!(o=(d=h.next()).done);o=!0){var p=d.value;p<128&&t.push(v(p))}}catch(e){n=!0,l=e}finally{try{!o&&h.return&&h.return()}finally{if(n)throw l}}var m=t.length,y=m;for(m&&t.push("-");y<r;){var b=c,E=!0,x=!1,S=void 0;try{for(var k,j=e[Symbol.iterator]();!(E=(k=j.next()).done);E=!0){var O=k.value;O>=a&&O<b&&(b=O)}}catch(e){x=!0,S=e}finally{try{!E&&j.return&&j.return()}finally{if(x)throw S}}var R=y+1;b-a>f((c-s)/R)&&g("overflow"),s+=(b-a)*R,a=b;var $=!0,I=!1,T=void 0;try{for(var C,F=e[Symbol.iterator]();!($=(C=F.next()).done);$=!0){var D=C.value;if(D<a&&++s>c&&g("overflow"),D==a){for(var A=s,N=u;;N+=u){var Z=N<=i?1:N>=i+26?26:N-i;if(A<Z)break;var q=A-Z,L=u-Z;t.push(v(P(Z+q%L,0))),A=f(q/L)}t.push(v(P(A,0))),i=w(s,R,y==m),s=0,++y}}}catch(e){I=!0,T=e}finally{try{!$&&F.return&&F.return()}finally{if(I)throw T}}++s,++a}return t.join("")},S=function(e){return y(e,function(e){return h.test(e)?"xn--"+x(e):e})},k=function(e){return y(e,function(e){return d.test(e)?E(e.slice(4).toLowerCase()):e})},j={};function O(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function R(e){for(var t="",r=0,a=e.length;r<a;){var s=parseInt(e.substr(r+1,2),16);if(s<128)t+=String.fromCharCode(s),r+=3;else if(s>=194&&s<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&s)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(s>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),n=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&n)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function $(e,t){function r(e){var r=R(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,O).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,O).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,O).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,O).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,O).replace(t.PCT_ENCODED,s)),e}function I(e){return e.replace(/^0*(.*)/,"$1")||"0"}function T(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(I).join("."):e}function C(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),s=a[1],i=a[2];if(s){for(var o=s.toLowerCase().split("::").reverse(),n=l(o,2),c=n[0],u=n[1],d=u?u.split(":").map(I):[],h=c.split(":").map(I),p=t.IPV4ADDRESS.test(h[h.length-1]),m=p?7:8,f=h.length-m,v=Array(m),g=0;g<m;++g)v[g]=d[g]||h[f+g]||"";p&&(v[m-1]=T(v[m-1],t));var y=v.reduce(function(e,t,r){if(!t||"0"===t){var a=e[e.length-1];a&&a.index+a.length===r?a.length++:e.push({index:r,length:1})}return e},[]).sort(function(e,t){return t.length-e.length})[0],_=void 0;if(y&&y.length>1){var b=v.slice(0,y.index),P=v.slice(y.index+y.length);_=b.join(":")+"::"+P.join(":")}else _=v.join(":");return i&&(_+="%"+i),_}return e}var F=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,D=void 0==="".match(/(){0}/)[1];function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?n:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(F);if(s){D?(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5])):(r.scheme=s[1]||void 0,r.userinfo=-1!==e.indexOf("@")?s[3]:void 0,r.host=-1!==e.indexOf("//")?s[4]:void 0,r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=-1!==e.indexOf("?")?s[7]:void 0,r.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),r.host&&(r.host=C(T(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=j[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)$(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=S(r.host.replace(a.PCT_ENCODED,R).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}$(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var N=/^\.\.?\//,Z=/^\/\.(\/|$)/,q=/^\/\.\.(\/|$)/,L=/^\/?(?:.|\n)*?(?=\/|$)/;function z(e){for(var t=[];e.length;)if(e.match(N))e=e.replace(N,"");else if(e.match(Z))e=e.replace(Z,"/");else if(e.match(q))e=e.replace(q,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(L);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?n:o,a=[],s=j[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?k(e.host):S(e.host.replace(r.PCT_ENCODED,R).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}$(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?n:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(C(T(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(a.push(":"),a.push(String(e.port))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||s&&s.absolutePath||(l=z(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function V(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=A(M(e,r),r),t=A(M(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=z(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=z(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=z(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=z(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function H(e,t){return e&&e.toString().replace(t&&t.iri?n.PCT_ENCODED:o.PCT_ENCODED,R)}var U={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},Q={scheme:"https",domainHost:U.domainHost,parse:U.parse,serialize:U.serialize};function K(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var B={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=K(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(K(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),a=l(r,2),s=a[0],i=a[1];e.path=s&&"/"!==s?s:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:B.domainHost,parse:B.parse,serialize:B.serialize},W={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",X=r(r("%[EFef]"+Y+"%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f]"+Y+"%"+Y+Y)+"|"+r("%"+Y+Y)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(G,"g"),re=new RegExp(X,"g"),ae=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),se=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=se;function oe(e){var t=R(e);return t.match(te)?t:e}var ne={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var s=!1,i={},o=r.query.split("&"),n=0,l=o.length;n<l;++n){var c=o[n].split("=");switch(c[0]){case"to":for(var u=c[1].split(","),d=0,h=u.length;d<h;++d)a.push(u[d]);break;case"subject":r.subject=H(c[1],t);break;case"body":r.body=H(c[1],t);break;default:s=!0,i[H(c[0],t)]=H(c[1],t)}}s&&(r.headers=i)}r.query=void 0;for(var p=0,m=a.length;p<m;++p){var f=a[p].split("@");if(f[0]=H(f[0]),t.unicodeSupport)f[1]=H(f[1],t).toLowerCase();else try{f[1]=S(H(f[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}a[p]=f.join("@")}return r},serialize:function(e,t){var r,a=e,i=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(i){for(var o=0,n=i.length;o<n;++o){var l=String(i[o]),c=l.lastIndexOf("@"),u=l.slice(0,c).replace(re,oe).replace(re,s).replace(ae,O),d=l.slice(c+1);try{d=t.iri?k(d):S(H(d,t).toLowerCase())}catch(e){a.error=a.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}i[o]=u+"@"+d}a.path=i.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var p=[];for(var m in h)h[m]!==W[m]&&p.push(m.replace(re,oe).replace(re,s).replace(se,O)+"="+h[m].replace(re,oe).replace(re,s).replace(ie,O));return p.length&&(a.query=p.join("&")),a}},le=/^([^\:]+)\:(.*)/,ce={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(le),a=e;if(r){var s=t.scheme||a.scheme||"urn",i=r[1].toLowerCase(),o=r[2],n=s+":"+(t.nid||i),l=j[n];a.nid=i,a.nss=o,a.path=void 0,l&&(a=l.parse(a,t))}else a.error=a.error||"URN can not be parsed.";return a},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",a=e.nid,s=r+":"+(t.nid||a),i=j[s];i&&(e=i.serialize(e,t));var o=e,n=e.nss;return o.path=(a||t.nid)+":"+n,o}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,de={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ue)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};j[U.scheme]=U,j[Q.scheme]=Q,j[B.scheme]=B,j[J.scheme]=J,j[ne.scheme]=ne,j[ce.scheme]=ce,j[de.scheme]=de,e.SCHEMES=j,e.pctEncChar=O,e.pctDecChars=R,e.parse=A,e.removeDotSegments=z,e.serialize=M,e.resolveComponents=V,e.resolve=function(e,t,r){var a=function(e,t){var r=e;if(t)for(var a in t)r[a]=t[a];return r}({scheme:"null"},r);return M(V(A(e,a),A(t,a),a,!0),a)},e.normalize=function(e,t){return"string"==typeof e?e=M(A(e,t),t):"object"===a(e)&&(e=A(M(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=M(A(e,r),r):"object"===a(e)&&(e=M(e,r)),"string"==typeof t?t=M(A(t,r),r):"object"===a(t)&&(t=M(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?n.ESCAPE:o.ESCAPE,O)},e.unescapeComponent=H,Object.defineProperty(e,"__esModule",{value:!0})}(t)},14547:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var f="valid"+p.level,v=o.every(function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)});if(v){var g=p.baseId;a+=" var "+h+" = errors; var "+d+" = false; ";var y=e.compositeRule;e.compositeRule=p.compositeRule=!0;var _=o;if(_)for(var b,P=-1,w=_.length-1;P<w;)b=_[P+=1],p.schema=b,p.schemaPath=n+"["+P+"]",p.errSchemaPath=l+"/"+P,a+=" "+e.validate(p)+" ",p.baseId=g,a+=" "+d+" = "+d+" || "+f+"; if (!"+d+") { ",m+="}";e.compositeRule=p.compositeRule=y,a+=" "+m+" if (!"+d+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else c&&(a+=" if (true) { ");return a}},20698:(e,t,r)=>{"use strict";var a=r(52004),s=r(9717).toHash;e.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"];return e.all=s(t),e.types=s(["number","integer","string","array","object","boolean","null"]),e.forEach(function(r){r.rules=r.rules.map(function(r){var s;if("object"==typeof r){var i=Object.keys(r)[0];s=r[i],r=i,s.forEach(function(r){t.push(r),e.all[r]=!0})}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:s}}),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)}),e.keywords=s(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},20812:(e,t,r)=>{"use strict";var a=r(9717);e.exports=function(e){a.copy(e,this)}},22853:(e,t,r)=>{"use strict";var a=r(40985),s=r(9717),i=r(72916),o=r(56039),n=r(25572),l=s.ucs2length,c=r(67371),u=i.Validation;function d(e,t,r){var a=p.call(this,e,t,r);return a>=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function h(e,t,r){var a=p.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function p(e,t,r){for(var a=0;a<this._compilations.length;a++){var s=this._compilations[a];if(s.schema==e&&s.root==t&&s.baseId==r)return a}return-1}function m(e,t){return"var pattern"+e+" = new RegExp("+s.toQuotedString(t[e])+");"}function f(e){return"var default"+e+" = defaults["+e+"];"}function v(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function g(e){return"var customRule"+e+" = customRules["+e+"];"}function y(e,t){if(!e.length)return"";for(var r="",a=0;a<e.length;a++)r+=t(a,e);return r}e.exports=function e(t,r,p,_){var b=this,P=this._opts,w=[void 0],E={},x=[],S={},k=[],j={},O=[];r=r||{schema:t,refVal:w,refs:E};var R=d.call(this,t,r,_),$=this._compilations[R.index];if(R.compiling)return $.callValidate=function e(){var t=$.validate,r=t.apply(this,arguments);return e.errors=t.errors,r};var I=this._formats,T=this.RULES;try{var C=D(t,r,p,_);$.validate=C;var F=$.callValidate;return F&&(F.schema=C.schema,F.errors=null,F.refs=C.refs,F.refVal=C.refVal,F.root=C.root,F.$async=C.$async,P.sourceCode&&(F.source=C.source)),C}finally{h.call(this,t,r,_)}function D(t,o,d,h){var p=!o||o&&o.schema==t;if(o.schema!=r.schema)return e.call(b,t,o,d,h);var _,S=!0===t.$async,j=n({isTop:!0,schema:t,isRoot:p,baseId:h,root:o,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:i.MissingRef,RULES:T,validate:n,util:s,resolve:a,resolveRef:A,usePattern:q,useDefault:L,useCustomRule:z,opts:P,formats:I,logger:b.logger,self:b});j=y(w,v)+y(x,m)+y(k,f)+y(O,g)+j,P.processCode&&(j=P.processCode(j,t));try{_=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",j)(b,T,I,r,w,k,O,c,l,u),w[0]=_}catch(e){throw b.logger.error("Error compiling schema, function code:",j),e}return _.schema=t,_.errors=null,_.refs=E,_.refVal=w,_.root=p?_:o,S&&(_.$async=!0),!0===P.sourceCode&&(_.source={code:j,patterns:x,defaults:k}),_}function A(t,s,i){s=a.url(t,s);var o,n,l=E[s];if(void 0!==l)return Z(o=w[l],n="refVal["+l+"]");if(!i&&r.refs){var c=r.refs[s];if(void 0!==c)return Z(o=r.refVal[c],n=N(s,o))}n=N(s);var u=a.call(b,D,r,s);if(void 0===u){var d=p&&p[s];d&&(u=a.inlineRef(d,P.inlineRefs)?d:e.call(b,d,r,p,t))}if(void 0!==u)return function(e,t){var r=E[e];w[r]=t}(s,u),Z(u,n);!function(e){delete E[e]}(s)}function N(e,t){var r=w.length;return w[r]=t,E[e]=r,"refVal"+r}function Z(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function q(e){var t=S[e];return void 0===t&&(t=S[e]=x.length,x[t]=e),"pattern"+t}function L(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return s.toQuotedString(e);case"object":if(null===e)return"null";var t=o(e),r=j[t];return void 0===r&&(r=j[t]=k.length,k[r]=e),"default"+r}}function z(e,t,r,a){if(!1!==b._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var i=e.definition.validateSchema;if(i&&!i(t)){var o="keyword schema is invalid: "+b.errorsText(i.errors);if("log"!=b._opts.validateSchema)throw new Error(o);b.logger.error(o)}}var n,l=e.definition.compile,c=e.definition.inline,u=e.definition.macro;if(l)n=l.call(b,t,r,a);else if(u)n=u.call(b,t,r,a),!1!==P.validateSchema&&b.validateSchema(n,!0);else if(c)n=c.call(b,a,e.keyword,t,r);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var d=O.length;return O[d]=n,{code:"customRule"+d,validate:n}}}},24235:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var m="valid"+p.level,f="i"+s,v=p.dataLevel=e.dataLevel+1,g="data"+v,y=e.baseId,_=e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+h+" = errors;var "+d+";",_){var b=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=o,p.schemaPath=n,p.errSchemaPath=l,a+=" var "+m+" = false; for (var "+f+" = 0; "+f+" < "+u+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);var P=u+"["+f+"]";p.dataPathArr[v]=f;var w=e.validate(p);p.baseId=y,e.util.varOccurences(w,g)<2?a+=" "+e.util.varReplace(w,g,P)+" ":a+=" var "+g+" = "+P+"; "+w+" ",a+=" if ("+m+") break; } ",e.compositeRule=p.compositeRule=b,a+=" if (!"+m+") {"}else a+=" if ("+u+".length == 0) {";var E=E||[];E.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var x=a;return a=E.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",_&&(a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a}},25572:e=>{"use strict";e.exports=function(e,t,r){var a="",s=!0===e.schema.$async,i=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var n=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(n){var l="unknown keyword: "+n;if("log"!==e.opts.strictKeywords)throw new Error(l);e.logger.warn(l)}}if(e.isTop&&(a+=" var validate = ",s&&(e.async=!0,a+="async "),a+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(a+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof e.schema||!i&&!e.schema.$ref){t="false schema";var c=e.level,u=e.dataLevel,d=e.schema[t],h=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,m=!e.opts.allErrors,f="data"+(u||""),v="valid"+c;if(!1===e.schema){e.isTop?m=!0:a+=" var "+v+" = false; ",(U=U||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'boolean schema is false' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ";var g=a;a=U.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?a+=s?" return data; ":" validate.errors = null; return true; ":a+=" var "+v+" = true; ";return e.isTop&&(a+=" }; return validate; "),a}if(e.isTop){var y=e.isTop;if(c=e.level=0,u=e.dataLevel=0,f="data",e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var _="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}a+=" var vErrors = null; ",a+=" var errors = 0; ",a+=" if (rootData === undefined) rootData = data; "}else{if(c=e.level,f="data"+((u=e.dataLevel)||""),o&&(e.baseId=e.resolve.url(e.baseId,o)),s&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+c+" = errors;"}v="valid"+c,m=!e.opts.allErrors;var b="",P="",w=e.schema.type,E=Array.isArray(w);if(w&&e.opts.nullable&&!0===e.schema.nullable&&(E?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],E=!0)),E&&1==w.length&&(w=w[0],E=!1),e.schema.$ref&&i){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(i=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(a+=" "+e.RULES.all.$comment.code(e,"$comment")),w){if(e.opts.coerceTypes)var x=e.util.coerceToTypes(e.opts.coerceTypes,w);var S=e.RULES.types[w];if(x||E||!0===S||S&&!G(S)){h=e.schemaPath+".type",p=e.errSchemaPath+"/type",h=e.schemaPath+".type",p=e.errSchemaPath+"/type";var k=E?"checkDataTypes":"checkDataType";if(a+=" if ("+e.util[k](w,f,e.opts.strictNumbers,!0)+") { ",x){var j="dataType"+c,O="coerced"+c;a+=" var "+j+" = typeof "+f+"; var "+O+" = undefined; ","array"==e.opts.coerceTypes&&(a+=" if ("+j+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+j+" = typeof "+f+"; if ("+e.util.checkDataType(e.schema.type,f,e.opts.strictNumbers)+") "+O+" = "+f+"; } "),a+=" if ("+O+" !== undefined) ; ";var R=x;if(R)for(var $,I=-1,T=R.length-1;I<T;)"string"==($=R[I+=1])?a+=" else if ("+j+" == 'number' || "+j+" == 'boolean') "+O+" = '' + "+f+"; else if ("+f+" === null) "+O+" = ''; ":"number"==$||"integer"==$?(a+=" else if ("+j+" == 'boolean' || "+f+" === null || ("+j+" == 'string' && "+f+" && "+f+" == +"+f+" ","integer"==$&&(a+=" && !("+f+" % 1)"),a+=")) "+O+" = +"+f+"; "):"boolean"==$?a+=" else if ("+f+" === 'false' || "+f+" === 0 || "+f+" === null) "+O+" = false; else if ("+f+" === 'true' || "+f+" === 1) "+O+" = true; ":"null"==$?a+=" else if ("+f+" === '' || "+f+" === 0 || "+f+" === false) "+O+" = null; ":"array"==e.opts.coerceTypes&&"array"==$&&(a+=" else if ("+j+" == 'string' || "+j+" == 'number' || "+j+" == 'boolean' || "+f+" == null) "+O+" = ["+f+"]; ");a+=" else { ",(U=U||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=E?""+w.join(","):""+w,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=E?""+w.join(","):""+w,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ",g=a,a=U.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } if ("+O+" !== undefined) { ";var C=u?"data"+(u-1||""):"parentData";a+=" "+f+" = "+O+"; ",u||(a+="if ("+C+" !== undefined)"),a+=" "+C+"["+(u?e.dataPathArr[u]:"parentDataProperty")+"] = "+O+"; } "}else(U=U||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=E?""+w.join(","):""+w,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=E?""+w.join(","):""+w,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ",g=a,a=U.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";a+=" } "}}if(e.schema.$ref&&!i)a+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",m&&(a+=" } if (errors === ",a+=y?"0":"errs_"+c,a+=") { ",P+="}");else{var F=e.RULES;if(F)for(var D=-1,A=F.length-1;D<A;)if(G(S=F[D+=1])){if(S.type&&(a+=" if ("+e.util.checkDataType(S.type,f,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==S.type&&e.schema.properties){d=e.schema.properties;var N=Object.keys(d);if(N)for(var Z,q=-1,L=N.length-1;q<L;)if(void 0!==(V=d[Z=N[q+=1]]).default){var z=f+e.util.getProperty(Z);if(e.compositeRule){if(e.opts.strictDefaults){if(_="default is ignored for: "+z,"log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}}else a+=" if ("+z+" === undefined ","empty"==e.opts.useDefaults&&(a+=" || "+z+" === null || "+z+" === '' "),a+=" ) "+z+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(V.default)+" ":a+=" "+JSON.stringify(V.default)+" ",a+="; "}}else if("array"==S.type&&Array.isArray(e.schema.items)){var M=e.schema.items;if(M){I=-1;for(var V,H=M.length-1;I<H;)if(void 0!==(V=M[I+=1]).default)if(z=f+"["+I+"]",e.compositeRule){if(e.opts.strictDefaults){if(_="default is ignored for: "+z,"log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}}else a+=" if ("+z+" === undefined ","empty"==e.opts.useDefaults&&(a+=" || "+z+" === null || "+z+" === '' "),a+=" ) "+z+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(V.default)+" ":a+=" "+JSON.stringify(V.default)+" ",a+="; "}}var U,Q=S.rules;if(Q)for(var K,B=-1,J=Q.length-1;B<J;)if(Y(K=Q[B+=1])){var W=K.code(e,K.keyword,S.type);W&&(a+=" "+W+" ",m&&(b+="}"))}if(m&&(a+=" "+b+" ",b=""),S.type&&(a+=" } ",w&&w===S.type&&!x))a+=" else { ",h=e.schemaPath+".type",p=e.errSchemaPath+"/type",(U=U||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=E?""+w.join(","):""+w,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=E?""+w.join(","):""+w,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),a+=" } "):a+=" {} ",g=a,a=U.pop(),!e.compositeRule&&m?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ";m&&(a+=" if (errors === ",a+=y?"0":"errs_"+c,a+=") { ",P+="}")}}function G(e){for(var t=e.rules,r=0;r<t.length;r++)if(Y(t[r]))return!0}function Y(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var r=t.implements,a=0;a<r.length;a++)if(void 0!==e.schema[r[a]])return!0}(t)}return m&&(a+=" "+P+" "),y?(s?(a+=" if (errors === 0) return data; ",a+=" else throw new ValidationError(vErrors); "):(a+=" validate.errors = vErrors; ",a+=" return errors === 0; "),a+=" }; return validate;"):a+=" var "+v+" = errors === errs_"+c+";",a}},27713:e=>{"use strict";var t=e.exports=function(e,t,a){"function"==typeof t&&(a=t,t={}),r(t,"function"==typeof(a=t.cb||a)?a:a.pre||function(){},a.post||function(){},e,"",e)};function r(e,s,i,o,n,l,c,u,d,h){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var p in s(o,n,l,c,u,d,h),o){var m=o[p];if(Array.isArray(m)){if(p in t.arrayKeywords)for(var f=0;f<m.length;f++)r(e,s,i,m[f],n+"/"+p+"/"+f,l,n,p,o,f)}else if(p in t.propsKeywords){if(m&&"object"==typeof m)for(var v in m)r(e,s,i,m[v],n+"/"+p+"/"+a(v),l,n,p,o,v)}else(p in t.keywords||e.allKeys&&!(p in t.skipKeywords))&&r(e,s,i,m,n+"/"+p,l,n,p,o)}i(o,n,l,c,u,d,h)}}function a(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},28565:e=>{"use strict";var t=e.exports=function(){this._cache={}};t.prototype.put=function(e,t){this._cache[e]=t},t.prototype.get=function(e){return this._cache[e]},t.prototype.del=function(e){delete this._cache[e]},t.prototype.clear=function(){this._cache={}}},33728:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var f="valid"+p.level,v="i"+s,g=p.dataLevel=e.dataLevel+1,y="data"+g,_=e.baseId;if(a+="var "+h+" = errors;var "+d+";",Array.isArray(o)){var b=e.schema.additionalItems;if(!1===b){a+=" "+d+" = "+u+".length <= "+o.length+"; ";var P=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+d+") { ";var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var E=a;a=w.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=P,c&&(m+="}",a+=" else { ")}var x=o;if(x)for(var S,k=-1,j=x.length-1;k<j;)if(S=x[k+=1],e.opts.strictKeywords?"object"==typeof S&&Object.keys(S).length>0||!1===S:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+f+" = true; if ("+u+".length > "+k+") { ";var O=u+"["+k+"]";p.schema=S,p.schemaPath=n+"["+k+"]",p.errSchemaPath=l+"/"+k,p.errorPath=e.util.getPathExpr(e.errorPath,k,e.opts.jsonPointers,!0),p.dataPathArr[g]=k;var R=e.validate(p);p.baseId=_,e.util.varOccurences(R,y)<2?a+=" "+e.util.varReplace(R,y,O)+" ":a+=" var "+y+" = "+O+"; "+R+" ",a+=" } ",c&&(a+=" if ("+f+") { ",m+="}")}"object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0||!1===b:e.util.schemaHasRules(b,e.RULES.all))&&(p.schema=b,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+f+" = true; if ("+u+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+u+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0),O=u+"["+v+"]",p.dataPathArr[g]=v,R=e.validate(p),p.baseId=_,e.util.varOccurences(R,y)<2?a+=" "+e.util.varReplace(R,y,O)+" ":a+=" var "+y+" = "+O+"; "+R+" ",c&&(a+=" if (!"+f+") break; "),a+=" } } ",c&&(a+=" if ("+f+") { ",m+="}"))}else(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all))&&(p.schema=o,p.schemaPath=n,p.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+u+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0),O=u+"["+v+"]",p.dataPathArr[g]=v,R=e.validate(p),p.baseId=_,e.util.varOccurences(R,y)<2?a+=" "+e.util.varReplace(R,y,O)+" ":a+=" var "+y+" = "+O+"; "+R+" ",c&&(a+=" if (!"+f+") break; "),a+=" }");return c&&(a+=" "+m+" if ("+h+" == errors) {"),a}},36885:(e,t,r)=>{"use strict";var a=r(9717),s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31],o=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,n=/^(?=.{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,l=/^(?:[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,c=/^(?:(?:[^\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,u=/^(?:(?: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,d=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,m=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function f(e){return e="full"==e?"full":"fast",a.copy(f[e])}function v(e){var t=e.match(s);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],s=r[2],i=r[3],n=r[5];return(a<=23&&s<=59&&i<=59||23==a&&59==s&&60==i)&&(!t||n)}e.exports=f,f.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":c,url:u,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:n,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:P,uuid:d,"json-pointer":h,"json-pointer-uri-fragment":p,"relative-json-pointer":m},f.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return _.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:u,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:n,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:P,uuid:d,"json-pointer":h,"json-pointer-uri-fragment":p,"relative-json-pointer":m};var y=/t|\s/i,_=/\/|:/,b=/[^\\]\\Z/;function P(e){if(b.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},40985:(e,t,r)=>{"use strict";var a=r(13749),s=r(67371),i=r(9717),o=r(20812),n=r(27713);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return m(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var s,i,n,u=c.call(this,t,r);return u&&(s=u.schema,t=u.root,n=u.baseId),s instanceof o?i=s.validate||e.call(this,s.schema,t,void 0,n):void 0!==s&&(i=m(s,this._opts.inlineRefs)?s:e.call(this,s,t,void 0,n)),i}function c(e,t){var r=a.parse(t),s=y(r),i=g(this._getId(e.schema));if(0===Object.keys(e.schema).length||s!==i){var n=b(s),l=this._refs[n];if("string"==typeof l)return u.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[n])instanceof o))return;if(l.validate||this._compile(l),n==b(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=g(this._getId(e.schema))}return h.call(this,r,i,e.schema,e)}function u(e,t,r){var a=c.call(this,e,t);if(a){var s=a.schema,i=a.baseId;e=a.root;var o=this._getId(s);return o&&(i=P(i,o)),h.call(this,r,i,s,e)}}e.exports=l,l.normalizeId=b,l.fullPath=g,l.url=P,l.ids=function(e){var t=b(this._getId(e)),r={"":t},o={"":g(t,!1)},l={},c=this;return n(e,{allKeys:!0},function(e,t,n,u,d,h,p){if(""!==t){var m=c._getId(e),f=r[u],v=o[u]+"/"+d;if(void 0!==p&&(v+="/"+("number"==typeof p?p:i.escapeFragment(p))),"string"==typeof m){m=f=b(f?a.resolve(f,m):m);var g=c._refs[m];if("string"==typeof g&&(g=c._refs[g]),g&&g.schema){if(!s(e,g.schema))throw new Error('id "'+m+'" resolves to more than one schema')}else if(m!=b(v))if("#"==m[0]){if(l[m]&&!s(e,l[m]))throw new Error('id "'+m+'" resolves to more than one schema');l[m]=e}else c._refs[m]=v}r[t]=f,o[t]=v}}),l},l.inlineRef=m,l.schema=c;var d=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var s=e.fragment.split("/"),o=1;o<s.length;o++){var n=s[o];if(n){if(void 0===(r=r[n=i.unescapeFragment(n)]))break;var l;if(!d[n]&&((l=this._getId(r))&&(t=P(t,l)),r.$ref)){var u=P(t,r.$ref),h=c.call(this,a,u);h&&(r=h.schema,a=h.root,t=h.baseId)}}}return void 0!==r&&r!==a.schema?{schema:r,root:a,baseId:t}:void 0}}var p=i.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function m(e,t){return!1!==t&&(void 0===t||!0===t?f(e):t?v(e)<=t:void 0)}function f(e){var t;if(Array.isArray(e)){for(var r=0;r<e.length;r++)if("object"==typeof(t=e[r])&&!f(t))return!1}else for(var a in e){if("$ref"==a)return!1;if("object"==typeof(t=e[a])&&!f(t))return!1}return!0}function v(e){var t,r=0;if(Array.isArray(e)){for(var a=0;a<e.length;a++)if("object"==typeof(t=e[a])&&(r+=v(t)),r==1/0)return 1/0}else for(var s in e){if("$ref"==s)return 1/0;if(p[s])r++;else if("object"==typeof(t=e[s])&&(r+=v(t)+1),r==1/0)return 1/0}return r}function g(e,t){return!1!==t&&(e=b(e)),y(a.parse(e))}function y(e){return a.serialize(e).split("#")[0]+"#"}var _=/#\/?$/;function b(e){return e?e.replace(_,""):""}function P(e,t){return t=b(t),a.resolve(e,t)}},41021:e=>{"use strict";e.exports=function(e,t,r){var a,s,i=" ",o=e.level,n=e.dataLevel,l=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,h="data"+(n||""),p="valid"+o,m="errs__"+o,f=e.opts.$data&&l&&l.$data;f?(i+=" var schema"+o+" = "+e.util.getData(l.$data,n,e.dataPathArr)+"; ",s="schema"+o):s=l;var v,g,y,_,b,P=this,w="definition"+o,E=P.definition,x="";if(f&&E.$data){b="keywordValidate"+o;var S=E.validateSchema;i+=" var "+w+" = RULES.custom['"+t+"'].definition; var "+b+" = "+w+".validate;"}else{if(!(_=e.useCustomRule(P,l,e.schema,e)))return;s="validate.schema"+c,b=_.code,v=E.compile,g=E.inline,y=E.macro}var k=b+".errors",j="i"+o,O="ruleErr"+o,R=E.async;if(R&&!e.async)throw new Error("async keyword in sync schema");if(g||y||(i+=k+" = null;"),i+="var "+m+" = errors;var "+p+";",f&&E.$data&&(x+="}",i+=" if ("+s+" === undefined) { "+p+" = true; } else { ",S&&(x+="}",i+=" "+p+" = "+w+".validateSchema("+s+"); if ("+p+") { ")),g)E.statements?i+=" "+_.validate+" ":i+=" "+p+" = "+_.validate+"; ";else if(y){var $=e.util.copy(e);x="",$.level++;var I="valid"+$.level;$.schema=_.validate,$.schemaPath="";var T=e.compositeRule;e.compositeRule=$.compositeRule=!0;var C=e.validate($).replace(/validate\.schema/g,b);e.compositeRule=$.compositeRule=T,i+=" "+C}else{(N=N||[]).push(i),i="",i+=" "+b+".call( ",e.opts.passContext?i+="this":i+="self",v||!1===E.schema?i+=" , "+h+" ":i+=" , "+s+" , "+h+" , validate.schema"+e.schemaPath+" ",i+=" , (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var F=n?"data"+(n-1||""):"parentData",D=n?e.dataPathArr[n]:"parentDataProperty",A=i+=" , "+F+" , "+D+" , rootData ) ";i=N.pop(),!1===E.errors?(i+=" "+p+" = ",R&&(i+="await "),i+=A+"; "):i+=R?" var "+(k="customErrors"+o)+" = null; try { "+p+" = await "+A+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+k+" = e.errors; else throw e; } ":" "+k+" = null; "+p+" = "+A+"; "}if(E.modifying&&(i+=" if ("+F+") "+h+" = "+F+"["+D+"];"),i+=""+x,E.valid)d&&(i+=" if (true) { ");else{var N;i+=" if ( ",void 0===E.valid?(i+=" !",i+=y?""+I:""+p):i+=" "+!E.valid+" ",i+=") { ",a=P.keyword,(N=N||[]).push(i),i="",(N=N||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(a||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+P.keyword+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should pass \""+P.keyword+"\" keyword validation' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var Z=i;i=N.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+Z+"]); ":i+=" validate.errors = ["+Z+"]; return false; ":i+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var q=i;i=N.pop(),g?E.errors?"full"!=E.errors&&(i+=" for (var "+j+"="+m+"; "+j+"<errors; "+j+"++) { var "+O+" = vErrors["+j+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+O+".schemaPath === undefined) { "+O+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+O+".schema = "+s+"; "+O+".data = "+h+"; "),i+=" } "):!1===E.errors?i+=" "+q+" ":(i+=" if ("+m+" == errors) { "+q+" } else { for (var "+j+"="+m+"; "+j+"<errors; "+j+"++) { var "+O+" = vErrors["+j+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+O+".schemaPath === undefined) { "+O+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+O+".schema = "+s+"; "+O+".data = "+h+"; "),i+=" } } "):y?(i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: '"+(a||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+P.keyword+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should pass \""+P.keyword+"\" keyword validation' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; ")):!1===E.errors?i+=" "+q+" ":(i+=" if (Array.isArray("+k+")) { if (vErrors === null) vErrors = "+k+"; else vErrors = vErrors.concat("+k+"); errors = vErrors.length; for (var "+j+"="+m+"; "+j+"<errors; "+j+"++) { var "+O+" = vErrors["+j+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; "+O+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(i+=" "+O+".schema = "+s+"; "+O+".data = "+h+"; "),i+=" } } else { "+q+" } "),i+=" } ",d&&(i+=" else { ")}return i}},43528:(e,t,r)=>{"use strict";var a=/^[a-z_$][a-z0-9_$-]*$/i,s=r(41021),i=r(96150);e.exports={add:function(e,t){var r=this.RULES;if(r.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!a.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var i=t.type;if(Array.isArray(i))for(var o=0;o<i.length;o++)l(e,i[o],t);else l(e,i,t);var n=t.metaSchema;n&&(t.$data&&this._opts.$data&&(n={anyOf:[n,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(n,!0))}function l(e,t,a){for(var i,o=0;o<r.length;o++){var n=r[o];if(n.type==t){i=n;break}}i||(i={type:t,rules:[]},r.push(i));var l={keyword:e,definition:a,custom:!0,code:s,implements:a.implements};i.rules.push(l),r.custom[e]=l}return r.keywords[e]=r.all[e]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var a=t[r].rules,s=0;s<a.length;s++)if(a[s].keyword==e){a.splice(s,1);break}return this},validate:function e(t,r){e.errors=null;var a=this._validateKeyword=this._validateKeyword||this.compile(i,!0);if(a(t))return!0;if(e.errors=a.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(a.errors));return!1}}},44413:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.schema[t],i=e.errSchemaPath+"/"+t,o=(e.opts.allErrors,e.util.toQuotedString(s));return!0===e.opts.$comment?a+=" console.log("+o+");":"function"==typeof e.opts.$comment&&(a+=" self._opts.$comment("+o+", "+e.util.toQuotedString(i)+", validate.root.schema);"),a}},46079:e=>{"use strict";var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,r){for(var a=0;a<r.length;a++){e=JSON.parse(JSON.stringify(e));var s,i=r[a].split("/"),o=e;for(s=1;s<i.length;s++)o=o[i[s]];for(s=0;s<t.length;s++){var n=t[s],l=o[n];l&&(o[n]={anyOf:[l,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},46137:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var f="valid"+p.level,v=p.baseId,g="prevValid"+s,y="passingSchemas"+s;a+="var "+h+" = errors , "+g+" = false , "+d+" = false , "+y+" = null; ";var _=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=o;if(b)for(var P,w=-1,E=b.length-1;w<E;)P=b[w+=1],(e.opts.strictKeywords?"object"==typeof P&&Object.keys(P).length>0||!1===P:e.util.schemaHasRules(P,e.RULES.all))?(p.schema=P,p.schemaPath=n+"["+w+"]",p.errSchemaPath=l+"/"+w,a+=" "+e.validate(p)+" ",p.baseId=v):a+=" var "+f+" = true; ",w&&(a+=" if ("+f+" && "+g+") { "+d+" = false; "+y+" = ["+y+", "+w+"]; } else { ",m+="}"),a+=" if ("+f+") { "+d+" = "+g+" = true; "+y+" = "+w+"; }";return e.compositeRule=p.compositeRule=_,a+=m+"if (!"+d+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},52004:(e,t,r)=>{"use strict";e.exports={$ref:r(12857),allOf:r(67578),anyOf:r(14547),$comment:r(44413),const:r(59087),contains:r(24235),dependencies:r(90083),enum:r(68307),format:r(95545),if:r(82917),items:r(33728),maximum:r(71346),minimum:r(71346),maxItems:r(80536),minItems:r(80536),maxLength:r(83010),minLength:r(83010),maxProperties:r(96111),minProperties:r(96111),multipleOf:r(58047),not:r(13441),oneOf:r(46137),pattern:r(96774),properties:r(86343),propertyNames:r(9931),required:r(91939),uniqueItems:r(57817),validate:r(25572)}},53084:(e,t,r)=>{"use strict";var a=r(22853),s=r(40985),i=r(28565),o=r(20812),n=r(56039),l=r(36885),c=r(20698),u=r(46079),d=r(9717);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var s=r(t);return!0!==r.$async&&(this.errors=r.errors),s},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i<e.length;i++)this.addSchema(e[i],void 0,r,a);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return E(this,t=s.normalizeId(t||o)),this._schemas[t]=this._addSchema(e,r,a,!0),this},g.prototype.addMetaSchema=function(e,t,r){return this.addSchema(e,t,r,!0),this},g.prototype.validateSchema=function(e,t){var r,a,s=e.$schema;if(void 0!==s&&"string"!=typeof s)throw new Error("$schema must be a string");if(!(s=s||this._opts.defaultMeta||(r=this,a=r._opts.meta,r._opts.defaultMeta="object"==typeof a?r._getId(a)||a:r.getSchema(m)?m:void 0,r._opts.defaultMeta)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var i=this.validate(s,e);if(!i&&t){var o="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(o);this.logger.error(o)}return i},g.prototype.getSchema=function(e){var t=y(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var r=s.schema.call(e,{schema:{}},t);if(r){var i=r.schema,n=r.root,l=r.baseId,c=a.call(e,i,n,void 0,l);return e._fragments[t]=new o({ref:t,fragment:!0,schema:i,root:n,baseId:l,validate:c}),c}}(this,e)}},g.prototype.removeSchema=function(e){if(e instanceof RegExp)return _(this,this._schemas,e),_(this,this._refs,e),this;switch(typeof e){case"undefined":return _(this,this._schemas),_(this,this._refs),this._cache.clear(),this;case"string":var t=y(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var r=this._opts.serialize,a=r?r(e):e;this._cache.del(a);var i=this._getId(e);i&&(i=s.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this},g.prototype.addFormat=function(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this},g.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var r=void 0===(t=t||{}).separator?", ":t.separator,a=void 0===t.dataVar?"data":t.dataVar,s="",i=0;i<e.length;i++){var o=e[i];o&&(s+=a+o.dataPath+" "+o.message+r)}return s.slice(0,-r.length)},g.prototype._addSchema=function(e,t,r,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var i=this._opts.serialize,n=i?i(e):e,l=this._cache.get(n);if(l)return l;a=a||!1!==this._opts.addUsedSchema;var c=s.normalizeId(this._getId(e));c&&a&&E(this,c);var u,d=!1!==this._opts.validateSchema&&!t;d&&!(u=c&&c==s.normalizeId(e.$schema))&&this.validateSchema(e,!0);var h=s.ids.call(this,e),p=new o({id:c,schema:e,localRefs:h,cacheKey:n,meta:r});return"#"!=c[0]&&a&&(this._refs[c]=p),this._cache.put(n,p),d&&u&&this.validateSchema(e,!0),p},g.prototype._compile=function(e,t){if(e.compiling)return e.validate=i,i.schema=e.schema,i.errors=null,i.root=t||i,!0===e.schema.$async&&(i.$async=!0),i;var r,s;e.compiling=!0,e.meta&&(r=this._opts,this._opts=this._metaOpts);try{s=a.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=r)}return e.validate=s,e.refs=s.refs,e.refVal=s.refVal,e.root=s.root,s;function i(){var t=e.validate,r=t.apply(this,arguments);return i.errors=t.errors,r}},g.prototype.compileAsync=r(6069);var h=r(43528);g.prototype.addKeyword=h.add,g.prototype.getKeyword=h.get,g.prototype.removeKeyword=h.remove,g.prototype.validateKeyword=h.validate;var p=r(72916);g.ValidationError=p.Validation,g.MissingRefError=p.MissingRef,g.$dataMetaSchema=u;var m="http://json-schema.org/draft-07/schema",f=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],v=["/properties"];function g(e){if(!(this instanceof g))return new g(e);e=this._opts=d.copy(e)||{},function(e){var t=e._opts.logger;if(!1===t)e.logger={log:x,warn:x,error:x};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=l(e.format),this._cache=e.cache||new i,this._loadingSchemas={},this._compilations=[],this.RULES=c(),this._getId=function(e){switch(e.schemaId){case"auto":return w;case"id":return b;default:return P}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=n),this._metaOpts=function(e){for(var t=d.copy(e._opts),r=0;r<f.length;r++)delete t[f[r]];return t}(this),e.formats&&function(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}(this),e.keywords&&function(e){for(var t in e._opts.keywords){var r=e._opts.keywords[t];e.addKeyword(t,r)}}(this),function(e){var t;if(e._opts.$data&&(t=r(13215),e.addMetaSchema(t,t.$id,!0)),!1!==e._opts.meta){var a=r(12269);e._opts.$data&&(a=u(a,v)),e.addMetaSchema(a,m,!0),e._refs["http://json-schema.org/schema"]=m}}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}(this)}function y(e,t){return t=s.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function _(e,t,r){for(var a in t){var s=t[a];s.meta||r&&!r.test(a)||(e._cache.del(s.cacheKey),delete t[a])}}function b(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function P(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function w(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function E(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function x(){}},56039:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,a="boolean"==typeof t.cycles&&t.cycles,s=t.cmp&&(r=t.cmp,function(e){return function(t,a){var s={key:t,value:e[t]},i={key:a,value:e[a]};return r(s,i)}}),i=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,o;if(Array.isArray(t)){for(o="[",r=0;r<t.length;r++)r&&(o+=","),o+=e(t[r])||"null";return o+"]"}if(null===t)return"null";if(-1!==i.indexOf(t)){if(a)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var n=i.push(t)-1,l=Object.keys(t).sort(s&&s(t));for(o="",r=0;r<l.length;r++){var c=l[r],u=e(t[c]);u&&(o&&(o+=","),o+=JSON.stringify(c)+":"+u)}return i.splice(n,1),"{"+o+"}"}}(e)}},57817:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(o||""),h="valid"+i,p=e.opts.$data&&n&&n.$data;if(p?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,(n||p)&&!1!==e.opts.uniqueItems){p&&(s+=" var "+h+"; if ("+a+" === false || "+a+" === undefined) "+h+" = true; else if (typeof "+a+" != 'boolean') "+h+" = false; else { "),s+=" var i = "+d+".length , "+h+" = true , j; if (i > 1) { ";var m=e.schema.items&&e.schema.items.type,f=Array.isArray(m);if(!m||"object"==m||"array"==m||f&&(m.indexOf("object")>=0||m.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+d+"[i], "+d+"[j])) { "+h+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+d+"[i]; ";var v="checkDataType"+(f?"s":"");s+=" if ("+e.util[v](m,"item",e.opts.strictNumbers,!0)+") continue; ",f&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",p&&(s+=" } "),s+=" if (!"+h+") { ";var g=g||[];g.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=p?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var y=s;s=g.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+y+"]); ":s+=" validate.errors = ["+y+"]; return false; ":s+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { ")}else u&&(s+=" if (true) { ");return s}},58047:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(o||""),h=e.opts.$data&&n&&n.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,!h&&"number"!=typeof n)throw new Error(t+" must be number");s+="var division"+i+";if (",h&&(s+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),s+=" (division"+i+" = "+d+" / "+a+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+i+" !== parseInt(division"+i+") ",s+=" ) ",h&&(s+=" ) "),s+=" ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=h?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},59087:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="valid"+s,h=e.opts.$data&&o&&o.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; "),h||(a+=" var schema"+s+" = validate.schema"+n+";"),a+="var "+d+" = equal("+u+", schema"+s+"); if (!"+d+") { ";var p=p||[];p.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValue: schema"+s+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to constant' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var m=a;return a=p.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",c&&(a+=" else { "),a}},61812:e=>{"use strict";e.exports=function(e){for(var t,r=0,a=e.length,s=0;s<a;)r++,(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<a&&56320==(64512&(t=e.charCodeAt(s)))&&s++;return r}},67371:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var a,s,i;if(Array.isArray(t)){if((a=t.length)!=r.length)return!1;for(s=a;0!==s--;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((a=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=a;0!==s--;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=a;0!==s--;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},67578:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,n=!e.opts.allErrors,l=e.util.copy(e),c="";l.level++;var u="valid"+l.level,d=l.baseId,h=!0,p=s;if(p)for(var m,f=-1,v=p.length-1;f<v;)m=p[f+=1],(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all))&&(h=!1,l.schema=m,l.schemaPath=i+"["+f+"]",l.errSchemaPath=o+"/"+f,a+=" "+e.validate(l)+" ",l.baseId=d,n&&(a+=" if ("+u+") { ",c+="}"));return n&&(a+=h?" if (true) { ":" "+c.slice(0,-1)+" "),a}},68307:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="valid"+s,h=e.opts.$data&&o&&o.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var p="i"+s,m="schema"+s;h||(a+=" var "+m+" = validate.schema"+n+";"),a+="var "+d+";",h&&(a+=" if (schema"+s+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+s+")) "+d+" = false; else {"),a+=d+" = false;for (var "+p+"=0; "+p+"<"+m+".length; "+p+"++) if (equal("+u+", "+m+"["+p+"])) { "+d+" = true; break; }",h&&(a+=" } "),a+=" if (!"+d+") { ";var f=f||[];f.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+s+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var v=a;return a=f.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",c&&(a+=" else { "),a}},71346:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(o||""),h=e.opts.$data&&n&&n.$data;h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n;var p="maximum"==t,m=p?"exclusiveMaximum":"exclusiveMinimum",f=e.schema[m],v=e.opts.$data&&f&&f.$data,g=p?"<":">",y=p?">":"<",_=void 0;if(!h&&"number"!=typeof n&&void 0!==n)throw new Error(t+" must be number");if(!v&&void 0!==f&&"number"!=typeof f&&"boolean"!=typeof f)throw new Error(m+" must be number or boolean");if(v){var b,P=e.util.getData(f.$data,o,e.dataPathArr),w="exclusive"+i,E="exclType"+i,x="exclIsNumber"+i,S="' + "+(j="op"+i)+" + '";s+=" var schemaExcl"+i+" = "+P+"; ",s+=" var "+w+"; var "+E+" = typeof "+(P="schemaExcl"+i)+"; if ("+E+" != 'boolean' && "+E+" != 'undefined' && "+E+" != 'number') { ",_=m,(b=b||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var k=s;s=b.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+k+"]); ":s+=" validate.errors = ["+k+"]; return false; ":s+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+E+" == 'number' ? ( ("+w+" = "+a+" === undefined || "+P+" "+g+"= "+a+") ? "+d+" "+y+"= "+P+" : "+d+" "+y+" "+a+" ) : ( ("+w+" = "+P+" === true) ? "+d+" "+y+"= "+a+" : "+d+" "+y+" "+a+" ) || "+d+" !== "+d+") { var op"+i+" = "+w+" ? '"+g+"' : '"+g+"='; ",void 0===n&&(_=m,c=e.errSchemaPath+"/"+m,a=P,h=v)}else if(S=g,(x="number"==typeof f)&&h){var j="'"+S+"'";s+=" if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ( "+a+" === undefined || "+f+" "+g+"= "+a+" ? "+d+" "+y+"= "+f+" : "+d+" "+y+" "+a+" ) || "+d+" !== "+d+") { "}else x&&void 0===n?(w=!0,_=m,c=e.errSchemaPath+"/"+m,a=f,y+="="):(x&&(a=Math[p?"min":"max"](f,n)),f===(!x||a)?(w=!0,_=m,c=e.errSchemaPath+"/"+m,y+="="):(w=!1,S+="=")),j="'"+S+"'",s+=" if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+d+" "+y+" "+a+" || "+d+" !== "+d+") { ";return _=_||t,(b=b||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+j+", limit: "+a+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+S+" ",s+=h?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ",k=s,s=b.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+k+"]); ":s+=" validate.errors = ["+k+"]; return false; ":s+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { "),s}},72916:(e,t,r)=>{"use strict";var a=r(40985);function s(e,t,r){this.message=r||s.message(e,t),this.missingRef=a.url(e,t),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function i(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}e.exports={Validation:i(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:i(s)},s.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},80536:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(o||""),h=e.opts.$data&&n&&n.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,!h&&"number"!=typeof n)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+d+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==t?"more":"fewer",s+=" than ",s+=h?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var f=s;return s=m.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},82917:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var m="valid"+p.level,f=e.schema.then,v=e.schema.else,g=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0||!1===f:e.util.schemaHasRules(f,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:e.util.schemaHasRules(v,e.RULES.all)),_=p.baseId;if(g||y){var b;p.createErrors=!1,p.schema=o,p.schemaPath=n,p.errSchemaPath=l,a+=" var "+h+" = errors; var "+d+" = true; ";var P=e.compositeRule;e.compositeRule=p.compositeRule=!0,a+=" "+e.validate(p)+" ",p.baseId=_,p.createErrors=!0,a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=P,g?(a+=" if ("+m+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(p)+" ",p.baseId=_,a+=" "+d+" = "+m+"; ",g&&y?a+=" var "+(b="ifClause"+s)+" = 'then'; ":b="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+m+") { ",y&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(p)+" ",p.baseId=_,a+=" "+d+" = "+m+"; ",g&&y?a+=" var "+(b="ifClause"+s)+" = 'else'; ":b="'else'",a+=" } "),a+=" if (!"+d+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+b+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+b+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",c&&(a+=" else { ")}else c&&(a+=" if (true) { ");return a}},83010:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(o||""),h=e.opts.$data&&n&&n.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,!h&&"number"!=typeof n)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?s+=" "+d+".length ":s+=" ucs2length("+d+") ",s+=" "+p+" "+a+") { ";var m=t,f=f||[];f.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(m||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==t?"longer":"shorter",s+=" than ",s+=h?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var v=s;return s=f.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},86343:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,f="key"+s,v="idx"+s,g=h.dataLevel=e.dataLevel+1,y="data"+g,_="dataProperties"+s,b=Object.keys(o||{}).filter(C),P=e.schema.patternProperties||{},w=Object.keys(P).filter(C),E=e.schema.additionalProperties,x=b.length||w.length,S=!1===E,k="object"==typeof E&&Object.keys(E).length,j=e.opts.removeAdditional,O=S||k||j,R=e.opts.ownProperties,$=e.baseId,I=e.schema.required;if(I&&(!e.opts.$data||!I.$data)&&I.length<e.opts.loopRequired)var T=e.util.toHash(I);function C(e){return"__proto__"!==e}if(a+="var "+d+" = errors;var "+m+" = true;",R&&(a+=" var "+_+" = undefined;"),O){if(a+=R?" "+_+" = "+_+" || Object.keys("+u+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+f+" = "+_+"["+v+"]; ":" for (var "+f+" in "+u+") { ",x){if(a+=" var isAdditional"+s+" = !(false ",b.length)if(b.length>8)a+=" || validate.schema"+n+".hasOwnProperty("+f+") ";else{var F=b;if(F)for(var D=-1,A=F.length-1;D<A;)J=F[D+=1],a+=" || "+f+" == "+e.util.toQuotedString(J)+" "}if(w.length){var N=w;if(N)for(var Z=-1,q=N.length-1;Z<q;)ie=N[Z+=1],a+=" || "+e.usePattern(ie)+".test("+f+") "}a+=" ); if (isAdditional"+s+") { "}if("all"==j)a+=" delete "+u+"["+f+"]; ";else{var L=e.errorPath,z="' + "+f+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers)),S)if(j)a+=" delete "+u+"["+f+"]; ";else{a+=" "+m+" = false; ";var M=l;l=e.errSchemaPath+"/additionalProperties",(re=re||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { additionalProperty: '"+z+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is an invalid additional property":a+="should NOT have additional properties",a+="' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var V=a;a=re.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+V+"]); ":a+=" validate.errors = ["+V+"]; return false; ":a+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=M,c&&(a+=" break; ")}else if(k)if("failing"==j){a+=" var "+d+" = errors; ";var H=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=E,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers);var U=u+"["+f+"]";h.dataPathArr[g]=f;var Q=e.validate(h);h.baseId=$,e.util.varOccurences(Q,y)<2?a+=" "+e.util.varReplace(Q,y,U)+" ":a+=" var "+y+" = "+U+"; "+Q+" ",a+=" if (!"+m+") { errors = "+d+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+u+"["+f+"]; } ",e.compositeRule=h.compositeRule=H}else h.schema=E,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers),U=u+"["+f+"]",h.dataPathArr[g]=f,Q=e.validate(h),h.baseId=$,e.util.varOccurences(Q,y)<2?a+=" "+e.util.varReplace(Q,y,U)+" ":a+=" var "+y+" = "+U+"; "+Q+" ",c&&(a+=" if (!"+m+") break; ");e.errorPath=L}x&&(a+=" } "),a+=" } ",c&&(a+=" if ("+m+") { ",p+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(b.length){var B=b;if(B)for(var J,W=-1,G=B.length-1;W<G;){var Y=o[J=B[W+=1]];if(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0||!1===Y:e.util.schemaHasRules(Y,e.RULES.all)){var X=e.util.getProperty(J),ee=(U=u+X,K&&void 0!==Y.default);if(h.schema=Y,h.schemaPath=n+X,h.errSchemaPath=l+"/"+e.util.escapeFragment(J),h.errorPath=e.util.getPath(e.errorPath,J,e.opts.jsonPointers),h.dataPathArr[g]=e.util.toQuotedString(J),Q=e.validate(h),h.baseId=$,e.util.varOccurences(Q,y)<2){Q=e.util.varReplace(Q,y,U);var te=U}else te=y,a+=" var "+y+" = "+U+"; ";if(ee)a+=" "+Q+" ";else{if(T&&T[J]){a+=" if ( "+te+" === undefined ",R&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(J)+"') "),a+=") { "+m+" = false; ",L=e.errorPath,M=l;var re,ae=e.util.escapeQuotes(J);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(L,J,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(re=re||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+ae+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+ae+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",V=a,a=re.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+V+"]); ":a+=" validate.errors = ["+V+"]; return false; ":a+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=M,e.errorPath=L,a+=" } else { "}else c?(a+=" if ( "+te+" === undefined ",R&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(J)+"') "),a+=") { "+m+" = true; } else { "):(a+=" if ("+te+" !== undefined ",R&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(J)+"') "),a+=" ) { ");a+=" "+Q+" } "}}c&&(a+=" if ("+m+") { ",p+="}")}}if(w.length){var se=w;if(se)for(var ie,oe=-1,ne=se.length-1;oe<ne;)Y=P[ie=se[oe+=1]],(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0||!1===Y:e.util.schemaHasRules(Y,e.RULES.all))&&(h.schema=Y,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ie),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ie),a+=R?" "+_+" = "+_+" || Object.keys("+u+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+f+" = "+_+"["+v+"]; ":" for (var "+f+" in "+u+") { ",a+=" if ("+e.usePattern(ie)+".test("+f+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers),U=u+"["+f+"]",h.dataPathArr[g]=f,Q=e.validate(h),h.baseId=$,e.util.varOccurences(Q,y)<2?a+=" "+e.util.varReplace(Q,y,U)+" ":a+=" var "+y+" = "+U+"; "+Q+" ",c&&(a+=" if (!"+m+") break; "),a+=" } ",c&&(a+=" else "+m+" = true; "),a+=" } ",c&&(a+=" if ("+m+") { ",p+="}"))}return c&&(a+=" "+p+" if ("+d+" == errors) {"),a}},90083:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,f={},v={},g=e.opts.ownProperties;for(P in o)if("__proto__"!=P){var y=o[P],_=Array.isArray(y)?v:f;_[P]=y}a+="var "+d+" = errors;";var b=e.errorPath;for(var P in a+="var missing"+s+";",v)if((_=v[P]).length){if(a+=" if ( "+u+e.util.getProperty(P)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(P)+"') "),c){a+=" && ( ";var w=_;if(w)for(var E=-1,x=w.length-1;E<x;)$=w[E+=1],E&&(a+=" || "),a+=" ( ( "+(F=u+(C=e.util.getProperty($)))+" === undefined ",g&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes($)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?$:C)+") ) ";a+=")) { ";var S="missing"+s,k="' + "+S+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,S,!0):b+" + "+S);var j=j||[];j.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { property: '"+e.util.escapeQuotes(P)+"', missingProperty: '"+k+"', depsCount: "+_.length+", deps: '"+e.util.escapeQuotes(1==_.length?_[0]:_.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",1==_.length?a+="property "+e.util.escapeQuotes(_[0]):a+="properties "+e.util.escapeQuotes(_.join(", ")),a+=" when property "+e.util.escapeQuotes(P)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var O=a;a=j.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+O+"]); ":a+=" validate.errors = ["+O+"]; return false; ":a+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{a+=" ) { ";var R=_;if(R)for(var $,I=-1,T=R.length-1;I<T;){$=R[I+=1];var C=e.util.getProperty($),F=(k=e.util.escapeQuotes($),u+C);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,$,e.opts.jsonPointers)),a+=" if ( "+F+" === undefined ",g&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes($)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { property: '"+e.util.escapeQuotes(P)+"', missingProperty: '"+k+"', depsCount: "+_.length+", deps: '"+e.util.escapeQuotes(1==_.length?_[0]:_.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",1==_.length?a+="property "+e.util.escapeQuotes(_[0]):a+="properties "+e.util.escapeQuotes(_.join(", ")),a+=" when property "+e.util.escapeQuotes(P)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}a+=" } ",c&&(p+="}",a+=" else { ")}e.errorPath=b;var D=h.baseId;for(var P in f)y=f[P],(e.opts.strictKeywords?"object"==typeof y&&Object.keys(y).length>0||!1===y:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+m+" = true; if ( "+u+e.util.getProperty(P)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(P)+"') "),a+=") { ",h.schema=y,h.schemaPath=n+e.util.getProperty(P),h.errSchemaPath=l+"/"+e.util.escapeFragment(P),a+=" "+e.validate(h)+" ",h.baseId=D,a+=" } ",c&&(a+=" if ("+m+") { ",p+="}"));return c&&(a+=" "+p+" if ("+d+" == errors) {"),a}},91939:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||""),d="valid"+s,h=e.opts.$data&&o&&o.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var p="schema"+s;if(!h)if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var m=[],f=o;if(f)for(var v,g=-1,y=f.length-1;g<y;){v=f[g+=1];var _=e.schema.properties[v];_&&(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:e.util.schemaHasRules(_,e.RULES.all))||(m[m.length]=v)}}else m=o;if(h||m.length){var b=e.errorPath,P=h||m.length>=e.opts.loopRequired,w=e.opts.ownProperties;if(c)if(a+=" var missing"+s+"; ",P){h||(a+=" var "+p+" = validate.schema"+n+"; ");var E="' + "+(R="schema"+s+"["+(j="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,R,e.opts.jsonPointers)),a+=" var "+d+" = true; ",h&&(a+=" if (schema"+s+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+s+")) "+d+" = false; else {"),a+=" for (var "+j+" = 0; "+j+" < "+p+".length; "+j+"++) { "+d+" = "+u+"["+p+"["+j+"]] !== undefined ",w&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", "+p+"["+j+"]) "),a+="; if (!"+d+") break; } ",h&&(a+=" } "),a+=" if (!"+d+") { ",(S=S||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+E+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var x=a;a=S.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S,k=m;if(k)for(var j=-1,O=k.length-1;j<O;)I=k[j+=1],j&&(a+=" || "),a+=" ( ( "+(D=u+(F=e.util.getProperty(I)))+" === undefined ",w&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(I)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?I:F)+") ) ";a+=") { ",E="' + "+(R="missing"+s)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,R,!0):b+" + "+R),(S=S||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+E+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",x=a,a=S.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else if(P){var R;h||(a+=" var "+p+" = validate.schema"+n+"; "),E="' + "+(R="schema"+s+"["+(j="i"+s)+"]")+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,R,e.opts.jsonPointers)),h&&(a+=" if ("+p+" && !Array.isArray("+p+")) { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+E+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),a+=" for (var "+j+" = 0; "+j+" < "+p+".length; "+j+"++) { if ("+u+"["+p+"["+j+"]] === undefined ",w&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", "+p+"["+j+"]) "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+E+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(a+=" } ")}else{var $=m;if($)for(var I,T=-1,C=$.length-1;T<C;){I=$[T+=1];var F=e.util.getProperty(I),D=(E=e.util.escapeQuotes(I),u+F);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,I,e.opts.jsonPointers)),a+=" if ( "+D+" === undefined ",w&&(a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(I)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+E+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=b}else c&&(a+=" if (true) {");return a}},95545:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(i||"");if(!1===e.opts.format)return c&&(a+=" if (true) { "),a;var d,h=e.opts.$data&&o&&o.$data;h?(a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",d="schema"+s):d=o;var p=e.opts.unknownFormats,m=Array.isArray(p);if(h)a+=" var "+(f="format"+s)+" = formats["+d+"]; var "+(v="isObject"+s)+" = typeof "+f+" == 'object' && !("+f+" instanceof RegExp) && "+f+".validate; var "+(g="formatType"+s)+" = "+v+" && "+f+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+s+" = "+f+".async; "),a+=" "+f+" = "+f+".validate; } if ( ",h&&(a+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),a+=" (","ignore"!=p&&(a+=" ("+d+" && !"+f+" ",m&&(a+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),a+=") || "),a+=" ("+f+" && "+g+" == '"+r+"' && !(typeof "+f+" == 'function' ? ",e.async?a+=" (async"+s+" ? await "+f+"("+u+") : "+f+"("+u+")) ":a+=" "+f+"("+u+") ",a+=" : "+f+".test("+u+"))))) {";else{var f;if(!(f=e.formats[o])){if("ignore"==p)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(a+=" if (true) { "),a;if(m&&p.indexOf(o)>=0)return c&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof f&&!(f instanceof RegExp)&&f.validate)&&f.type||"string";if(v){var y=!0===f.async;f=f.validate}if(g!=r)return c&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(_="formats"+e.util.getProperty(o)+".validate")+"("+u+"))) { "}else{a+=" if (! ";var _="formats"+e.util.getProperty(o);v&&(_+=".validate"),a+="function"==typeof f?" "+_+"("+u+") ":" "+_+".test("+u+") ",a+=") { "}}var b=b||[];b.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=h?""+d:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=h?"' + "+d+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var P=a;return a=b.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+P+"]); ":a+=" validate.errors = ["+P+"]; return false; ":a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { "),a}},96111:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(o||""),h=e.opts.$data&&n&&n.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,!h&&"number"!=typeof n)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" Object.keys("+d+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==t?"more":"fewer",s+=" than ",s+=h?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var f=s;return s=m.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},96150:(e,t,r)=>{"use strict";var a=r(12269);e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:a.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:a.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"}]}}}},96774:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(o||""),h=e.opts.$data&&n&&n.$data;h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),s+=" !"+(h?"(new RegExp("+a+"))":e.usePattern(n))+".test("+d+") ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",s+=h?""+a:""+e.util.toQuotedString(n),s+=" } ",!1!==e.opts.messages&&(s+=" , message: 'should match pattern \"",s+=h?"' + "+a+" + '":""+e.util.escapeQuotes(n),s+="\"' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+l:""+e.util.toQuotedString(n),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}}},t={};function r(a){var s=t[a];if(void 0!==s)return s.exports;var i=t[a]={exports:{}};return e[a].call(i.exports,i,i.exports,r),i.exports}return(()=>{"use strict";const e=require("node:process");var t,a;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),a={};for(const e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(t||(t={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(a||(a={}));const s=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=t.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class n extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){const r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,t.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}n.create=e=>new n(e);const l=(e,r)=>{let a;switch(e.code){case o.invalid_type:a=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,t.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:a=`Unrecognized key(s) in object: ${t.joinValues(e.keys,", ")}`;break;case o.invalid_union:a="Invalid input";break;case o.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${t.joinValues(e.options)}`;break;case o.invalid_enum_value:a=`Invalid enum value. Expected ${t.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:a="Invalid function arguments";break;case o.invalid_return_type:a="Invalid function return type";break;case o.invalid_date:a="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:t.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:a="Invalid input";break;case o.invalid_intersection_types:a="Intersection results could not be merged";break;case o.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:a="Number must be finite";break;default:a=r.defaultError,t.assertNever(e)}return{message:a}};let c=l;function u(){return c}const d=e=>{const{data:t,path:r,errorMaps:a,issueData:s}=e,i=[...r,...s.path||[]],o={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let n="";const l=a.filter(e=>!!e).slice().reverse();for(const e of l)n=e(o,{data:t,defaultError:n}).message;return{...s,path:i,message:n}};function h(e,t){const r=u(),a=d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===l?void 0:l].filter(e=>!!e)});e.common.issues.push(a)}class p{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if("aborted"===a.status)return m;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return p.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:t,value:s}=a;if("aborted"===t.status)return m;if("aborted"===s.status)return m;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!a.alwaysSet||(r[t.value]=s.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),f=e=>({status:"dirty",value:e}),v=e=>({status:"valid",value:e}),g=e=>"aborted"===e.status,y=e=>"dirty"===e.status,_=e=>"valid"===e.status,b=e=>"undefined"!=typeof Promise&&e instanceof Promise;function P(e,t,r,a){if("a"===r&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)}function w(e,t,r,a,s){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?s.call(e,r):s?s.value=r:t.set(e,r),r}var E,x,S;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(E||(E={}));class k{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const j=(e,t)=>{if(_(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new n(e.common.issues);return this._error=t,this._error}}};function O(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{var i,o;const{message:n}=e;return"invalid_enum_value"===t.code?{message:null!=n?n:s.defaultError}:void 0===s.data?{message:null!==(i=null!=n?n:a)&&void 0!==i?i:s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:null!==(o=null!=n?n:r)&&void 0!==o?o:s.defaultError}},description:s}}class R{get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new p,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(b(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},s=this._parseSync({data:e,path:a.path,parent:a});return j(a,s)}"~validate"(e){var t,r;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return _(t)?{value:t.value}:{issues:a.common.issues}}catch(e){(null===(r=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(e=>_(e)?{value:e.value}:{issues:a.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(b(a)?a:Promise.resolve(a));return j(r,s)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,a)=>{const s=e(t),i=()=>a.addIssue({code:o.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then(e=>!!e||(i(),!1)):!!s||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new Ie({schema:this,typeName:He.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:e=>this["~validate"](e)}}optional(){return Te.create(this,this._def)}nullable(){return Ce.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return he.create(this)}promise(){return $e.create(this,this._def)}or(e){return fe.create([this,e],this._def)}and(e){return _e.create(this,e,this._def)}transform(e){return new Ie({...O(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Fe({...O(this._def),innerType:this,defaultValue:t,typeName:He.ZodDefault})}brand(){return new Ze({typeName:He.ZodBranded,type:this,...O(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new De({...O(this._def),innerType:this,catchValue:t,typeName:He.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return qe.create(this,e)}readonly(){return Le.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $=/^c[^\s-]{8,}$/i,I=/^[0-9a-z]+$/,T=/^[0-9A-HJKMNP-TV-Z]{26}$/i,C=/^[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,F=/^[a-z0-9_-]{21}$/i,D=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,A=/^[-+]?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)?)??$/,N=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Z;const q=/^(?:(?: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])$/,L=/^(?:(?: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])$/,z=/^(([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]))$/,M=/^(([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])$/,V=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,H=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U="((\\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])))",Q=new RegExp(`^${U}$`);function K(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function B(e){return new RegExp(`^${K(e)}$`)}function J(e){let t=`${U}T${K(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function W(e,t){return!("v4"!==t&&t||!q.test(e))||!("v6"!==t&&t||!z.test(e))}function G(e,t){if(!D.test(e))return!1;try{const[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));return!("object"!=typeof s||null===s||!s.typ||!s.alg||t&&s.alg!==t)}catch(e){return!1}}function Y(e,t){return!("v4"!==t&&t||!L.test(e))||!("v6"!==t&&t||!M.test(e))}class X extends R{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),m}const r=new p;let a;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if("max"===s.kind)e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if("length"===s.kind){const t=e.data.length>s.value,i=e.data.length<s.value;(t||i)&&(a=this._getOrReturnCtx(e,a),t?h(a,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):i&&h(a,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if("email"===s.kind)N.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"email",code:o.invalid_string,message:s.message}),r.dirty());else if("emoji"===s.kind)Z||(Z=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Z.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"emoji",code:o.invalid_string,message:s.message}),r.dirty());else if("uuid"===s.kind)C.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"uuid",code:o.invalid_string,message:s.message}),r.dirty());else if("nanoid"===s.kind)F.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"nanoid",code:o.invalid_string,message:s.message}),r.dirty());else if("cuid"===s.kind)$.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid",code:o.invalid_string,message:s.message}),r.dirty());else if("cuid2"===s.kind)I.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid2",code:o.invalid_string,message:s.message}),r.dirty());else if("ulid"===s.kind)T.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ulid",code:o.invalid_string,message:s.message}),r.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(t){a=this._getOrReturnCtx(e,a),h(a,{validation:"url",code:o.invalid_string,message:s.message}),r.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"regex",code:o.invalid_string,message:s.message}),r.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):"datetime"===s.kind?J(s).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:"datetime",message:s.message}),r.dirty()):"date"===s.kind?Q.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:"date",message:s.message}),r.dirty()):"time"===s.kind?B(s).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:"time",message:s.message}),r.dirty()):"duration"===s.kind?A.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"duration",code:o.invalid_string,message:s.message}),r.dirty()):"ip"===s.kind?W(e.data,s.version)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ip",code:o.invalid_string,message:s.message}),r.dirty()):"jwt"===s.kind?G(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"jwt",code:o.invalid_string,message:s.message}),r.dirty()):"cidr"===s.kind?Y(e.data,s.version)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cidr",code:o.invalid_string,message:s.message}),r.dirty()):"base64"===s.kind?V.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"base64",code:o.invalid_string,message:s.message}),r.dirty()):"base64url"===s.kind?H.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"base64url",code:o.invalid_string,message:s.message}),r.dirty()):t.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:o.invalid_string,...E.errToObj(r)})}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...E.errToObj(e)})}url(e){return this._addCheck({kind:"url",...E.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...E.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...E.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...E.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...E.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...E.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...E.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...E.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...E.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...E.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...E.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...E.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...E.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...E.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...E.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...E.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...E.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...E.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...E.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...E.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...E.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...E.errToObj(t)})}nonempty(e){return this.min(1,E.errToObj(e))}trim(){return new X({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new X({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new X({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ee(e,t){const r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}X.create=e=>{var t;return new X({checks:[],typeName:He.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class te extends R{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)!==s.number){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),m}let r;const a=new p;for(const s of this._def.checks)"int"===s.kind?t.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):"multipleOf"===s.kind?0!==ee(e.data,s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.not_finite,message:s.message}),a.dirty()):t.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,E.toString(t))}gt(e,t){return this.setLimit("min",e,!1,E.toString(t))}lte(e,t){return this.setLimit("max",e,!0,E.toString(t))}lt(e,t){return this.setLimit("max",e,!1,E.toString(t))}setLimit(e,t,r,a){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:E.toString(a)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:E.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:E.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&t.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}te.create=e=>new te({checks:[],typeName:He.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class re extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==s.bigint)return this._getInvalidInput(e);let r;const a=new p;for(const s of this._def.checks)"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):t.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,E.toString(t))}gt(e,t){return this.setLimit("min",e,!1,E.toString(t))}lte(e,t){return this.setLimit("max",e,!0,E.toString(t))}lt(e,t){return this.setLimit("max",e,!1,E.toString(t))}setLimit(e,t,r,a){return new re({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:E.toString(a)}]})}_addCheck(e){return new re({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}re.create=e=>{var t;return new re({checks:[],typeName:He.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...O(e)})};class ae extends R{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),m}return v(e.data)}}ae.create=e=>new ae({typeName:He.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...O(e)});class se extends R{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),m}if(isNaN(e.data.getTime()))return h(this._getOrReturnCtx(e),{code:o.invalid_date}),m;const r=new p;let a;for(const s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):t.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:E.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:E.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}se.create=e=>new se({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:He.ZodDate,...O(e)});class ie extends R{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),m}return v(e.data)}}ie.create=e=>new ie({typeName:He.ZodSymbol,...O(e)});class oe extends R{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),m}return v(e.data)}}oe.create=e=>new oe({typeName:He.ZodUndefined,...O(e)});class ne extends R{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),m}return v(e.data)}}ne.create=e=>new ne({typeName:He.ZodNull,...O(e)});class le extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return v(e.data)}}le.create=e=>new le({typeName:He.ZodAny,...O(e)});class ce extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return v(e.data)}}ce.create=e=>new ce({typeName:He.ZodUnknown,...O(e)});class ue extends R{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),m}}ue.create=e=>new ue({typeName:He.ZodNever,...O(e)});class de extends R{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),m}return v(e.data)}}de.create=e=>new de({typeName:He.ZodVoid,...O(e)});class he extends R{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==s.array)return h(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),m;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&(h(t,{code:e?o.too_big:o.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(h(t,{code:o.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(h(t,{code:o.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new k(t,e,t.path,r)))).then(e=>p.mergeArray(r,e));const i=[...t.data].map((e,r)=>a.type._parseSync(new k(t,e,t.path,r)));return p.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new he({...this._def,minLength:{value:e,message:E.toString(t)}})}max(e,t){return new he({...this._def,maxLength:{value:e,message:E.toString(t)}})}length(e,t){return new he({...this._def,exactLength:{value:e,message:E.toString(t)}})}nonempty(e){return this.min(1,e)}}function pe(e){if(e instanceof me){const t={};for(const r in e.shape){const a=e.shape[r];t[r]=Te.create(pe(a))}return new me({...e._def,shape:()=>t})}return e instanceof he?new he({...e._def,type:pe(e.element)}):e instanceof Te?Te.create(pe(e.unwrap())):e instanceof Ce?Ce.create(pe(e.unwrap())):e instanceof be?be.create(e.items.map(e=>pe(e))):e}he.create=(e,t)=>new he({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...O(t)});class me extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),r=t.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),m}const{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),n=[];if(!(this._def.catchall instanceof ue&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||n.push(e);const l=[];for(const e of i){const t=a[e],s=r.data[e];l.push({key:{status:"valid",value:e},value:t._parse(new k(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ue){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of n)l.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)n.length>0&&(h(r,{code:o.unrecognized_keys,keys:n}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of n){const a=r.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new k(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of l){const r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>p.mergeObjectSync(t,e)):p.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return E.errToObj,new me({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var a,s,i,o;const n=null!==(i=null===(s=(a=this._def).errorMap)||void 0===s?void 0:s.call(a,t,r).message)&&void 0!==i?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=E.errToObj(e).message)&&void 0!==o?o:n}:{message:n}}}:{}})}strip(){return new me({...this._def,unknownKeys:"strip"})}passthrough(){return new me({...this._def,unknownKeys:"passthrough"})}extend(e){return new me({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:He.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new me({...this._def,catchall:e})}pick(e){const r={};return t.objectKeys(e).forEach(t=>{e[t]&&this.shape[t]&&(r[t]=this.shape[t])}),new me({...this._def,shape:()=>r})}omit(e){const r={};return t.objectKeys(this.shape).forEach(t=>{e[t]||(r[t]=this.shape[t])}),new me({...this._def,shape:()=>r})}deepPartial(){return pe(this)}partial(e){const r={};return t.objectKeys(this.shape).forEach(t=>{const a=this.shape[t];e&&!e[t]?r[t]=a:r[t]=a.optional()}),new me({...this._def,shape:()=>r})}required(e){const r={};return t.objectKeys(this.shape).forEach(t=>{if(e&&!e[t])r[t]=this.shape[t];else{let e=this.shape[t];for(;e instanceof Te;)e=e._def.innerType;r[t]=e}}),new me({...this._def,shape:()=>r})}keyof(){return je(t.objectKeys(this.shape))}}me.create=(e,t)=>new me({shape:()=>e,unknownKeys:"strip",catchall:ue.create(),typeName:He.ZodObject,...O(t)}),me.strictCreate=(e,t)=>new me({shape:()=>e,unknownKeys:"strict",catchall:ue.create(),typeName:He.ZodObject,...O(t)}),me.lazycreate=(e,t)=>new me({shape:e,unknownKeys:"strip",catchall:ue.create(),typeName:He.ZodObject,...O(t)});class fe extends R{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new n(e.ctx.common.issues));return h(t,{code:o.invalid_union,unionErrors:r}),m});{let e;const a=[];for(const s of r){const r={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=a.map(e=>new n(e));return h(t,{code:o.invalid_union,unionErrors:s}),m}}get options(){return this._def.options}}fe.create=(e,t)=>new fe({options:e,typeName:He.ZodUnion,...O(t)});const ve=e=>e instanceof Se?ve(e.schema):e instanceof Ie?ve(e.innerType()):e instanceof ke?[e.value]:e instanceof Oe?e.options:e instanceof Re?t.objectValues(e.enum):e instanceof Fe?ve(e._def.innerType):e instanceof oe?[void 0]:e instanceof ne?[null]:e instanceof Te?[void 0,...ve(e.unwrap())]:e instanceof Ce?[null,...ve(e.unwrap())]:e instanceof Ze||e instanceof Le?ve(e.unwrap()):e instanceof De?ve(e._def.innerType):[];class ge extends R{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),m;const r=this.discriminator,a=t.data[r],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const r of t){const t=ve(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,r)}}return new ge({typeName:He.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...O(r)})}}function ye(e,r){const a=i(e),o=i(r);if(e===r)return{valid:!0,data:e};if(a===s.object&&o===s.object){const a=t.objectKeys(r),s=t.objectKeys(e).filter(e=>-1!==a.indexOf(e)),i={...e,...r};for(const t of s){const a=ye(e[t],r[t]);if(!a.valid)return{valid:!1};i[t]=a.data}return{valid:!0,data:i}}if(a===s.array&&o===s.array){if(e.length!==r.length)return{valid:!1};const t=[];for(let a=0;a<e.length;a++){const s=ye(e[a],r[a]);if(!s.valid)return{valid:!1};t.push(s.data)}return{valid:!0,data:t}}return a===s.date&&o===s.date&&+e===+r?{valid:!0,data:e}:{valid:!1}}class _e extends R{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if(g(e)||g(a))return m;const s=ye(e.value,a.value);return s.valid?((y(e)||y(a))&&t.dirty(),{status:t.value,value:s.data}):(h(r,{code:o.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_e.create=(e,t,r)=>new _e({left:e,right:t,typeName:He.ZodIntersection,...O(r)});class be extends R{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.array)return h(r,{code:o.invalid_type,expected:s.array,received:r.parsedType}),m;if(r.data.length<this._def.items.length)return h(r,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&r.data.length>this._def.items.length&&(h(r,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new k(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>p.mergeArray(t,e)):p.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new be({...this._def,rest:e})}}be.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new be({items:e,typeName:He.ZodTuple,rest:null,...O(t)})};class Pe extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.object)return h(r,{code:o.invalid_type,expected:s.object,received:r.parsedType}),m;const a=[],i=this._def.keyType,n=this._def.valueType;for(const e in r.data)a.push({key:i._parse(new k(r,e,r.path,e)),value:n._parse(new k(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?p.mergeObjectAsync(t,a):p.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new Pe(t instanceof R?{keyType:e,valueType:t,typeName:He.ZodRecord,...O(r)}:{keyType:X.create(),valueType:e,typeName:He.ZodRecord,...O(t)})}}class we extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.map)return h(r,{code:o.invalid_type,expected:s.map,received:r.parsedType}),m;const a=this._def.keyType,i=this._def.valueType,n=[...r.data.entries()].map(([e,t],s)=>({key:a._parse(new k(r,e,r.path,[s,"key"])),value:i._parse(new k(r,t,r.path,[s,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of n){const a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return m;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of n){const a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return m;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}we.create=(e,t,r)=>new we({valueType:t,keyType:e,typeName:He.ZodMap,...O(r)});class Ee extends R{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.set)return h(r,{code:o.invalid_type,expected:s.set,received:r.parsedType}),m;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(h(r,{code:o.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(h(r,{code:o.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const i=this._def.valueType;function n(e){const r=new Set;for(const a of e){if("aborted"===a.status)return m;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}const l=[...r.data.values()].map((e,t)=>i._parse(new k(r,e,r.path,t)));return r.common.async?Promise.all(l).then(e=>n(e)):n(l)}min(e,t){return new Ee({...this._def,minSize:{value:e,message:E.toString(t)}})}max(e,t){return new Ee({...this._def,maxSize:{value:e,message:E.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ee.create=(e,t)=>new Ee({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...O(t)});class xe extends R{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return h(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),m;function r(e,r){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,u(),l].filter(e=>!!e),issueData:{code:o.invalid_arguments,argumentsError:r}})}function a(e,r){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,u(),l].filter(e=>!!e),issueData:{code:o.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},c=t.data;if(this._def.returns instanceof $e){const e=this;return v(async function(...t){const s=new n([]),o=await e._def.args.parseAsync(t,i).catch(e=>{throw s.addIssue(r(t,e)),s}),l=await Reflect.apply(c,this,o);return await e._def.returns._def.type.parseAsync(l,i).catch(e=>{throw s.addIssue(a(l,e)),s})})}{const e=this;return v(function(...t){const s=e._def.args.safeParse(t,i);if(!s.success)throw new n([r(t,s.error)]);const o=Reflect.apply(c,this,s.data),l=e._def.returns.safeParse(o,i);if(!l.success)throw new n([a(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new xe({...this._def,args:be.create(e).rest(ce.create())})}returns(e){return new xe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new xe({args:e||be.create([]).rest(ce.create()),returns:t||ce.create(),typeName:He.ZodFunction,...O(r)})}}class Se extends R{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Se.create=(e,t)=>new Se({getter:e,typeName:He.ZodLazy,...O(t)});class ke extends R{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}function je(e,t){return new Oe({values:e,typeName:He.ZodEnum,...O(t)})}ke.create=(e,t)=>new ke({value:e,typeName:He.ZodLiteral,...O(t)});class Oe extends R{constructor(){super(...arguments),x.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const r=this._getOrReturnCtx(e),a=this._def.values;return h(r,{expected:t.joinValues(a),received:r.parsedType,code:o.invalid_type}),m}if(P(this,x,"f")||w(this,x,new Set(this._def.values),"f"),!P(this,x,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return h(t,{received:t.data,code:o.invalid_enum_value,options:r}),m}return v(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Oe.create(e,{...this._def,...t})}exclude(e,t=this._def){return Oe.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}x=new WeakMap,Oe.create=je;class Re extends R{constructor(){super(...arguments),S.set(this,void 0)}_parse(e){const r=t.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==s.string&&a.parsedType!==s.number){const e=t.objectValues(r);return h(a,{expected:t.joinValues(e),received:a.parsedType,code:o.invalid_type}),m}if(P(this,S,"f")||w(this,S,new Set(t.getValidEnumValues(this._def.values)),"f"),!P(this,S,"f").has(e.data)){const e=t.objectValues(r);return h(a,{received:a.data,code:o.invalid_enum_value,options:e}),m}return v(e.data)}get enum(){return this._def.values}}S=new WeakMap,Re.create=(e,t)=>new Re({values:e,typeName:He.ZodNativeEnum,...O(t)});class $e extends R{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return h(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),m;const r=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return v(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}$e.create=(e,t)=>new $e({type:e,typeName:He.ZodPromise,...O(t)});class Ie extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:a}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:e=>{h(a,e),e.fatal?r.abort():r.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===s.type){const e=s.transform(a.data,i);if(a.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===r.value)return m;const t=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===t.status?m:"dirty"===t.status||"dirty"===r.value?f(t.value):t});{if("aborted"===r.value)return m;const t=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===t.status?m:"dirty"===t.status||"dirty"===r.value?f(t.value):t}}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,i);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const t=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===t.status?m:("dirty"===t.status&&r.dirty(),e(t.value),{status:r.value,value:t.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(t=>"aborted"===t.status?m:("dirty"===t.status&&r.dirty(),e(t.value).then(()=>({status:r.value,value:t.value}))))}if("transform"===s.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!_(e))return e;const t=s.transform(e.value,i);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:t}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(e=>_(e)?Promise.resolve(s.transform(e.value,i)).then(e=>({status:r.value,value:e})):e)}t.assertNever(s)}}Ie.create=(e,t,r)=>new Ie({schema:e,typeName:He.ZodEffects,effect:t,...O(r)}),Ie.createWithPreprocess=(e,t,r)=>new Ie({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...O(r)});class Te extends R{_parse(e){return this._getType(e)===s.undefined?v(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Te.create=(e,t)=>new Te({innerType:e,typeName:He.ZodOptional,...O(t)});class Ce extends R{_parse(e){return this._getType(e)===s.null?v(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:He.ZodNullable,...O(t)});class Fe extends R{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===s.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Fe.create=(e,t)=>new Fe({innerType:e,typeName:He.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...O(t)});class De extends R{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return b(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new n(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new n(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}De.create=(e,t)=>new De({innerType:e,typeName:He.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...O(t)});class Ae extends R{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),m}return{status:"valid",value:e.data}}}Ae.create=e=>new Ae({typeName:He.ZodNaN,...O(e)});const Ne=Symbol("zod_brand");class Ze extends R{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class qe extends R{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?m:"dirty"===e.status?(t.dirty(),f(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?m:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new qe({in:e,out:t,typeName:He.ZodPipeline})}}class Le extends R{_parse(e){const t=this._def.innerType._parse(e),r=e=>(_(e)&&(e.value=Object.freeze(e.value)),e);return b(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function ze(e,t){const r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function Me(e,t={},r){return e?le.create().superRefine((a,s)=>{var i,o;const n=e(a);if(n instanceof Promise)return n.then(e=>{var i,o;if(!e){const e=ze(t,a),n=null===(o=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===o||o;s.addIssue({code:"custom",...e,fatal:n})}});if(!n){const e=ze(t,a),n=null===(o=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===o||o;s.addIssue({code:"custom",...e,fatal:n})}}):le.create()}Le.create=(e,t)=>new Le({innerType:e,typeName:He.ZodReadonly,...O(t)});const Ve={object:me.lazycreate};var He;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(He||(He={}));const Ue=X.create,Qe=te.create,Ke=Ae.create,Be=re.create,Je=ae.create,We=se.create,Ge=ie.create,Ye=oe.create,Xe=ne.create,et=le.create,tt=ce.create,rt=ue.create,at=de.create,st=he.create,it=me.create,ot=me.strictCreate,nt=fe.create,lt=ge.create,ct=_e.create,ut=be.create,dt=Pe.create,ht=we.create,pt=Ee.create,mt=xe.create,ft=Se.create,vt=ke.create,gt=Oe.create,yt=Re.create,_t=$e.create,bt=Ie.create,Pt=Te.create,wt=Ce.create,Et=Ie.createWithPreprocess,xt=qe.create,St={string:e=>X.create({...e,coerce:!0}),number:e=>te.create({...e,coerce:!0}),boolean:e=>ae.create({...e,coerce:!0}),bigint:e=>re.create({...e,coerce:!0}),date:e=>se.create({...e,coerce:!0})},kt=m;var jt=Object.freeze({__proto__:null,defaultErrorMap:l,setErrorMap:function(e){c=e},getErrorMap:u,makeIssue:d,EMPTY_PATH:[],addIssueToContext:h,ParseStatus:p,INVALID:m,DIRTY:f,OK:v,isAborted:g,isDirty:y,isValid:_,isAsync:b,get util(){return t},get objectUtil(){return a},ZodParsedType:s,getParsedType:i,ZodType:R,datetimeRegex:J,ZodString:X,ZodNumber:te,ZodBigInt:re,ZodBoolean:ae,ZodDate:se,ZodSymbol:ie,ZodUndefined:oe,ZodNull:ne,ZodAny:le,ZodUnknown:ce,ZodNever:ue,ZodVoid:de,ZodArray:he,ZodObject:me,ZodUnion:fe,ZodDiscriminatedUnion:ge,ZodIntersection:_e,ZodTuple:be,ZodRecord:Pe,ZodMap:we,ZodSet:Ee,ZodFunction:xe,ZodLazy:Se,ZodLiteral:ke,ZodEnum:Oe,ZodNativeEnum:Re,ZodPromise:$e,ZodEffects:Ie,ZodTransformer:Ie,ZodOptional:Te,ZodNullable:Ce,ZodDefault:Fe,ZodCatch:De,ZodNaN:Ae,BRAND:Ne,ZodBranded:Ze,ZodPipeline:qe,ZodReadonly:Le,custom:Me,Schema:R,ZodSchema:R,late:Ve,get ZodFirstPartyTypeKind(){return He},coerce:St,any:et,array:st,bigint:Be,boolean:Je,date:We,discriminatedUnion:lt,effect:bt,enum:gt,function:mt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Me(t=>t instanceof e,t),intersection:ct,lazy:ft,literal:vt,map:ht,nan:Ke,nativeEnum:yt,never:rt,null:Xe,nullable:wt,number:Qe,object:it,oboolean:()=>Je().optional(),onumber:()=>Qe().optional(),optional:Pt,ostring:()=>Ue().optional(),pipeline:xt,preprocess:Et,promise:_t,record:dt,set:pt,strictObject:ot,string:Ue,symbol:Ge,transformer:bt,tuple:ut,undefined:Ye,union:nt,unknown:tt,void:at,NEVER:kt,ZodIssueCode:o,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:n});const Ot="2025-06-18",Rt=[Ot,"2025-03-26","2024-11-05","2024-10-07"],$t="2.0",It=jt.union([jt.string(),jt.number().int()]),Tt=jt.string(),Ct=jt.object({progressToken:jt.optional(It)}).passthrough(),Ft=jt.object({_meta:jt.optional(Ct)}).passthrough(),Dt=jt.object({method:jt.string(),params:jt.optional(Ft)}),At=jt.object({_meta:jt.optional(jt.object({}).passthrough())}).passthrough(),Nt=jt.object({method:jt.string(),params:jt.optional(At)}),Zt=jt.object({_meta:jt.optional(jt.object({}).passthrough())}).passthrough(),qt=jt.union([jt.string(),jt.number().int()]),Lt=jt.object({jsonrpc:jt.literal($t),id:qt}).merge(Dt).strict(),zt=jt.object({jsonrpc:jt.literal($t)}).merge(Nt).strict(),Mt=jt.object({jsonrpc:jt.literal($t),id:qt,result:Zt}).strict(),Vt=e=>Mt.safeParse(e).success;var Ht;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(Ht||(Ht={}));const Ut=jt.object({jsonrpc:jt.literal($t),id:qt,error:jt.object({code:jt.number().int(),message:jt.string(),data:jt.optional(jt.unknown())})}).strict(),Qt=jt.union([Lt,zt,Mt,Ut]),Kt=Zt.strict(),Bt=Nt.extend({method:jt.literal("notifications/cancelled"),params:At.extend({requestId:qt,reason:jt.string().optional()})}),Jt=jt.object({src:jt.string(),mimeType:jt.optional(jt.string()),sizes:jt.optional(jt.string())}).passthrough(),Wt=jt.object({name:jt.string(),title:jt.optional(jt.string())}).passthrough(),Gt=Wt.extend({version:jt.string(),websiteUrl:jt.optional(jt.string()),icons:jt.optional(jt.array(Jt))}),Yt=jt.object({experimental:jt.optional(jt.object({}).passthrough()),sampling:jt.optional(jt.object({}).passthrough()),elicitation:jt.optional(jt.object({}).passthrough()),roots:jt.optional(jt.object({listChanged:jt.optional(jt.boolean())}).passthrough())}).passthrough(),Xt=Dt.extend({method:jt.literal("initialize"),params:Ft.extend({protocolVersion:jt.string(),capabilities:Yt,clientInfo:Gt})}),er=jt.object({experimental:jt.optional(jt.object({}).passthrough()),logging:jt.optional(jt.object({}).passthrough()),completions:jt.optional(jt.object({}).passthrough()),prompts:jt.optional(jt.object({listChanged:jt.optional(jt.boolean())}).passthrough()),resources:jt.optional(jt.object({subscribe:jt.optional(jt.boolean()),listChanged:jt.optional(jt.boolean())}).passthrough()),tools:jt.optional(jt.object({listChanged:jt.optional(jt.boolean())}).passthrough())}).passthrough(),tr=Zt.extend({protocolVersion:jt.string(),capabilities:er,serverInfo:Gt,instructions:jt.optional(jt.string())}),rr=Nt.extend({method:jt.literal("notifications/initialized")}),ar=Dt.extend({method:jt.literal("ping")}),sr=jt.object({progress:jt.number(),total:jt.optional(jt.number()),message:jt.optional(jt.string())}).passthrough(),ir=Nt.extend({method:jt.literal("notifications/progress"),params:At.merge(sr).extend({progressToken:It})}),or=Dt.extend({params:Ft.extend({cursor:jt.optional(Tt)}).optional()}),nr=Zt.extend({nextCursor:jt.optional(Tt)}),lr=jt.object({uri:jt.string(),mimeType:jt.optional(jt.string()),_meta:jt.optional(jt.object({}).passthrough())}).passthrough(),cr=lr.extend({text:jt.string()}),ur=jt.string().refine(e=>{try{return atob(e),!0}catch(e){return!1}},{message:"Invalid Base64 string"}),dr=lr.extend({blob:ur}),hr=Wt.extend({uri:jt.string(),description:jt.optional(jt.string()),mimeType:jt.optional(jt.string()),icons:jt.optional(jt.array(Jt)),_meta:jt.optional(jt.object({}).passthrough())}),pr=Wt.extend({uriTemplate:jt.string(),description:jt.optional(jt.string()),mimeType:jt.optional(jt.string()),_meta:jt.optional(jt.object({}).passthrough())}),mr=or.extend({method:jt.literal("resources/list")}),fr=nr.extend({resources:jt.array(hr)}),vr=or.extend({method:jt.literal("resources/templates/list")}),gr=nr.extend({resourceTemplates:jt.array(pr)}),yr=Dt.extend({method:jt.literal("resources/read"),params:Ft.extend({uri:jt.string()})}),_r=Zt.extend({contents:jt.array(jt.union([cr,dr]))}),br=Nt.extend({method:jt.literal("notifications/resources/list_changed")}),Pr=Dt.extend({method:jt.literal("resources/subscribe"),params:Ft.extend({uri:jt.string()})}),wr=Dt.extend({method:jt.literal("resources/unsubscribe"),params:Ft.extend({uri:jt.string()})}),Er=Nt.extend({method:jt.literal("notifications/resources/updated"),params:At.extend({uri:jt.string()})}),xr=jt.object({name:jt.string(),description:jt.optional(jt.string()),required:jt.optional(jt.boolean())}).passthrough(),Sr=Wt.extend({description:jt.optional(jt.string()),arguments:jt.optional(jt.array(xr)),icons:jt.optional(jt.array(Jt)),_meta:jt.optional(jt.object({}).passthrough())}),kr=or.extend({method:jt.literal("prompts/list")}),jr=nr.extend({prompts:jt.array(Sr)}),Or=Dt.extend({method:jt.literal("prompts/get"),params:Ft.extend({name:jt.string(),arguments:jt.optional(jt.record(jt.string()))})}),Rr=jt.object({type:jt.literal("text"),text:jt.string(),_meta:jt.optional(jt.object({}).passthrough())}).passthrough(),$r=jt.object({type:jt.literal("image"),data:ur,mimeType:jt.string(),_meta:jt.optional(jt.object({}).passthrough())}).passthrough(),Ir=jt.object({type:jt.literal("audio"),data:ur,mimeType:jt.string(),_meta:jt.optional(jt.object({}).passthrough())}).passthrough(),Tr=jt.object({type:jt.literal("resource"),resource:jt.union([cr,dr]),_meta:jt.optional(jt.object({}).passthrough())}).passthrough(),Cr=hr.extend({type:jt.literal("resource_link")}),Fr=jt.union([Rr,$r,Ir,Cr,Tr]),Dr=jt.object({role:jt.enum(["user","assistant"]),content:Fr}).passthrough(),Ar=Zt.extend({description:jt.optional(jt.string()),messages:jt.array(Dr)}),Nr=Nt.extend({method:jt.literal("notifications/prompts/list_changed")}),Zr=jt.object({title:jt.optional(jt.string()),readOnlyHint:jt.optional(jt.boolean()),destructiveHint:jt.optional(jt.boolean()),idempotentHint:jt.optional(jt.boolean()),openWorldHint:jt.optional(jt.boolean())}).passthrough(),qr=Wt.extend({description:jt.optional(jt.string()),inputSchema:jt.object({type:jt.literal("object"),properties:jt.optional(jt.object({}).passthrough()),required:jt.optional(jt.array(jt.string()))}).passthrough(),outputSchema:jt.optional(jt.object({type:jt.literal("object"),properties:jt.optional(jt.object({}).passthrough()),required:jt.optional(jt.array(jt.string()))}).passthrough()),annotations:jt.optional(Zr),icons:jt.optional(jt.array(Jt)),_meta:jt.optional(jt.object({}).passthrough())}),Lr=or.extend({method:jt.literal("tools/list")}),zr=nr.extend({tools:jt.array(qr)}),Mr=Zt.extend({content:jt.array(Fr).default([]),structuredContent:jt.object({}).passthrough().optional(),isError:jt.optional(jt.boolean())}),Vr=(Mr.or(Zt.extend({toolResult:jt.unknown()})),Dt.extend({method:jt.literal("tools/call"),params:Ft.extend({name:jt.string(),arguments:jt.optional(jt.record(jt.unknown()))})})),Hr=Nt.extend({method:jt.literal("notifications/tools/list_changed")}),Ur=jt.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Qr=Dt.extend({method:jt.literal("logging/setLevel"),params:Ft.extend({level:Ur})}),Kr=Nt.extend({method:jt.literal("notifications/message"),params:At.extend({level:Ur,logger:jt.optional(jt.string()),data:jt.unknown()})}),Br=jt.object({name:jt.string().optional()}).passthrough(),Jr=jt.object({hints:jt.optional(jt.array(Br)),costPriority:jt.optional(jt.number().min(0).max(1)),speedPriority:jt.optional(jt.number().min(0).max(1)),intelligencePriority:jt.optional(jt.number().min(0).max(1))}).passthrough(),Wr=jt.object({role:jt.enum(["user","assistant"]),content:jt.union([Rr,$r,Ir])}).passthrough(),Gr=Dt.extend({method:jt.literal("sampling/createMessage"),params:Ft.extend({messages:jt.array(Wr),systemPrompt:jt.optional(jt.string()),includeContext:jt.optional(jt.enum(["none","thisServer","allServers"])),temperature:jt.optional(jt.number()),maxTokens:jt.number().int(),stopSequences:jt.optional(jt.array(jt.string())),metadata:jt.optional(jt.object({}).passthrough()),modelPreferences:jt.optional(Jr)})}),Yr=Zt.extend({model:jt.string(),stopReason:jt.optional(jt.enum(["endTurn","stopSequence","maxTokens"]).or(jt.string())),role:jt.enum(["user","assistant"]),content:jt.discriminatedUnion("type",[Rr,$r,Ir])}),Xr=jt.object({type:jt.literal("boolean"),title:jt.optional(jt.string()),description:jt.optional(jt.string()),default:jt.optional(jt.boolean())}).passthrough(),ea=jt.object({type:jt.literal("string"),title:jt.optional(jt.string()),description:jt.optional(jt.string()),minLength:jt.optional(jt.number()),maxLength:jt.optional(jt.number()),format:jt.optional(jt.enum(["email","uri","date","date-time"]))}).passthrough(),ta=jt.object({type:jt.enum(["number","integer"]),title:jt.optional(jt.string()),description:jt.optional(jt.string()),minimum:jt.optional(jt.number()),maximum:jt.optional(jt.number())}).passthrough(),ra=jt.object({type:jt.literal("string"),title:jt.optional(jt.string()),description:jt.optional(jt.string()),enum:jt.array(jt.string()),enumNames:jt.optional(jt.array(jt.string()))}).passthrough(),aa=jt.union([Xr,ea,ta,ra]),sa=Dt.extend({method:jt.literal("elicitation/create"),params:Ft.extend({message:jt.string(),requestedSchema:jt.object({type:jt.literal("object"),properties:jt.record(jt.string(),aa),required:jt.optional(jt.array(jt.string()))}).passthrough()})}),ia=Zt.extend({action:jt.enum(["accept","decline","cancel"]),content:jt.optional(jt.record(jt.string(),jt.unknown()))}),oa=jt.object({type:jt.literal("ref/resource"),uri:jt.string()}).passthrough(),na=jt.object({type:jt.literal("ref/prompt"),name:jt.string()}).passthrough(),la=Dt.extend({method:jt.literal("completion/complete"),params:Ft.extend({ref:jt.union([na,oa]),argument:jt.object({name:jt.string(),value:jt.string()}).passthrough(),context:jt.optional(jt.object({arguments:jt.optional(jt.record(jt.string(),jt.string()))}))})}),ca=Zt.extend({completion:jt.object({values:jt.array(jt.string()).max(100),total:jt.optional(jt.number().int()),hasMore:jt.optional(jt.boolean())}).passthrough()}),ua=jt.object({uri:jt.string().startsWith("file://"),name:jt.optional(jt.string()),_meta:jt.optional(jt.object({}).passthrough())}).passthrough(),da=Dt.extend({method:jt.literal("roots/list")}),ha=Zt.extend({roots:jt.array(ua)}),pa=Nt.extend({method:jt.literal("notifications/roots/list_changed")});jt.union([ar,Xt,la,Qr,Or,kr,mr,vr,yr,Pr,wr,Vr,Lr]),jt.union([Bt,ir,rr,pa]),jt.union([Kt,Yr,ia,ha]),jt.union([ar,Gr,sa,da]),jt.union([Bt,ir,Kr,Er,br,Hr,Nr]),jt.union([Kt,tr,ca,Ar,jr,fr,gr,_r,Mr,zr]);class ma extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`),this.code=e,this.data=r,this.name="McpError"}}class fa{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;const e=this._buffer.indexOf("\n");if(-1===e)return null;const t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),function(e){return Qt.parse(JSON.parse(e))}(t)}clear(){this._buffer=void 0}}class va{constructor(t=e.stdin,r=e.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new fa,this._started=!1,this._ondata=e=>{this._readBuffer.append(e),this.processReadBuffer()},this._onerror=e=>{var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var e,t;;)try{const t=this._readBuffer.readMessage();if(null===t)break;null===(e=this.onmessage)||void 0===e||e.call(this,t)}catch(e){null===(t=this.onerror)||void 0===t||t.call(this,e)}}async close(){var e;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),0===this._stdin.listenerCount("data")&&this._stdin.pause(),this._readBuffer.clear(),null===(e=this.onclose)||void 0===e||e.call(this)}send(e){return new Promise(t=>{const r=function(e){return JSON.stringify(e)+"\n"}(e);this._stdout.write(r)?t():this._stdout.once("drain",t)})}}class ga{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(Bt,e=>{const t=this._requestHandlerAbortControllers.get(e.params.requestId);null==t||t.abort(e.params.reason)}),this.setNotificationHandler(ir,e=>{this._onprogress(e)}),this.setRequestHandler(ar,e=>({}))}_setupTimeout(e,t,r,a,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:s,onTimeout:a})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ma(Ht.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,r,a;this._transport=e;const s=null===(t=this.transport)||void 0===t?void 0:t.onclose;this._transport.onclose=()=>{null==s||s(),this._onclose()};const i=null===(r=this.transport)||void 0===r?void 0:r.onerror;this._transport.onerror=e=>{null==i||i(e),this._onerror(e)};const o=null===(a=this._transport)||void 0===a?void 0:a.onmessage;this._transport.onmessage=(e,t)=>{var r;null==o||o(e,t),Vt(e)||(r=e,Ut.safeParse(r).success)?this._onresponse(e):(e=>Lt.safeParse(e).success)(e)?this._onrequest(e,t):(e=>zt.safeParse(e).success)(e)?this._onnotification(e):this._onerror(new Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){var e;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,null===(e=this.onclose)||void 0===e||e.call(this);const r=new ma(Ht.ConnectionClosed,"Connection closed");for(const e of t.values())e(r)}_onerror(e){var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}_onnotification(e){var t;const r=null!==(t=this._notificationHandlers.get(e.method))&&void 0!==t?t:this.fallbackNotificationHandler;void 0!==r&&Promise.resolve().then(()=>r(e)).catch(e=>this._onerror(new Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var r,a;const s=null!==(r=this._requestHandlers.get(e.method))&&void 0!==r?r:this.fallbackRequestHandler,i=this._transport;if(void 0===s)return void(null==i||i.send({jsonrpc:"2.0",id:e.id,error:{code:Ht.MethodNotFound,message:"Method not found"}}).catch(e=>this._onerror(new Error(`Failed to send an error response: ${e}`))));const o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);const n={signal:o.signal,sessionId:null==i?void 0:i.sessionId,_meta:null===(a=e.params)||void 0===a?void 0:a._meta,sendNotification:t=>this.notification(t,{relatedRequestId:e.id}),sendRequest:(t,r,a)=>this.request(t,r,{...a,relatedRequestId:e.id}),authInfo:null==t?void 0:t.authInfo,requestId:e.id,requestInfo:null==t?void 0:t.requestInfo};Promise.resolve().then(()=>s(e,n)).then(t=>{if(!o.signal.aborted)return null==i?void 0:i.send({result:t,jsonrpc:"2.0",id:e.id})},t=>{var r;if(!o.signal.aborted)return null==i?void 0:i.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:Ht.InternalError,message:null!==(r=t.message)&&void 0!==r?r:"Internal error"}})}).catch(e=>this._onerror(new Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...r}=e.params,a=Number(t),s=this._progressHandlers.get(a);if(!s)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));const i=this._responseHandlers.get(a),o=this._timeoutInfo.get(a);if(o&&i&&o.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(e){return void i(e)}s(r)}_onresponse(e){const t=Number(e.id),r=this._responseHandlers.get(t);void 0!==r?(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),Vt(e)?r(e):r(new ma(e.error.code,e.error.message,e.error.data))):this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`))}get transport(){return this._transport}async close(){var e;await(null===(e=this._transport)||void 0===e?void 0:e.close())}request(e,t,r){const{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}=null!=r?r:{};return new Promise((o,n)=>{var l,c,u,d,h,p;if(!this._transport)return void n(new Error("Not connected"));!0===(null===(l=this._options)||void 0===l?void 0:l.enforceStrictCapabilities)&&this.assertCapabilityForMethod(e.method),null===(c=null==r?void 0:r.signal)||void 0===c||c.throwIfAborted();const m=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:m};(null==r?void 0:r.onprogress)&&(this._progressHandlers.set(m,r.onprogress),f.params={...e.params,_meta:{...(null===(u=e.params)||void 0===u?void 0:u._meta)||{},progressToken:m}});const v=e=>{var t;this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),null===(t=this._transport)||void 0===t||t.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(e)}},{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>this._onerror(new Error(`Failed to send cancellation: ${e}`))),n(e)};this._responseHandlers.set(m,e=>{var a;if(!(null===(a=null==r?void 0:r.signal)||void 0===a?void 0:a.aborted)){if(e instanceof Error)return n(e);try{const r=t.parse(e.result);o(r)}catch(e){n(e)}}}),null===(d=null==r?void 0:r.signal)||void 0===d||d.addEventListener("abort",()=>{var e;v(null===(e=null==r?void 0:r.signal)||void 0===e?void 0:e.reason)});const g=null!==(h=null==r?void 0:r.timeout)&&void 0!==h?h:6e4;this._setupTimeout(m,g,null==r?void 0:r.maxTotalTimeout,()=>v(new ma(Ht.RequestTimeout,"Request timed out",{timeout:g})),null!==(p=null==r?void 0:r.resetTimeoutOnProgress)&&void 0!==p&&p),this._transport.send(f,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>{this._cleanupTimeout(m),n(e)})})}async notification(e,t){var r,a;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),(null!==(a=null===(r=this._options)||void 0===r?void 0:r.debouncedNotificationMethods)&&void 0!==a?a:[]).includes(e.method)&&!e.params&&!(null==t?void 0:t.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;return this._pendingDebouncedNotifications.add(e.method),void Promise.resolve().then(()=>{var r;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const a={...e,jsonrpc:"2.0"};null===(r=this._transport)||void 0===r||r.send(a,t).catch(e=>this._onerror(e))})}const s={...e,jsonrpc:"2.0"};await this._transport.send(s,t)}setRequestHandler(e,t){const r=e.shape.method.value;this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(r,a)=>Promise.resolve(t(e.parse(r),a)))}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,r=>Promise.resolve(t(e.parse(r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}var ya=r(53084);class _a extends ga{constructor(e,t){var r;super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ur.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{const r=this._loggingLevels.get(t);return!!r&&this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r)},this._capabilities=null!==(r=null==t?void 0:t.capabilities)&&void 0!==r?r:{},this._instructions=null==t?void 0:t.instructions,this.setRequestHandler(Xt,e=>this._oninitialize(e)),this.setNotificationHandler(rr,()=>{var e;return null===(e=this.oninitialized)||void 0===e?void 0:e.call(this)}),this._capabilities.logging&&this.setRequestHandler(Qr,async(e,t)=>{var r;const a=t.sessionId||(null===(r=t.requestInfo)||void 0===r?void 0:r.headers["mcp-session-id"])||void 0,{level:s}=e.params,i=Ur.safeParse(s);return i.success&&this._loggingLevels.set(a,i.data),{}})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");var t,r;this._capabilities=(t=this._capabilities,r=e,Object.entries(r).reduce((e,[t,r])=>(e[t]=r&&"object"==typeof r&&e[t]?{...e[t],...r}:r,e),{...t}))}assertCapabilityForMethod(e){var t,r,a;switch(e){case"sampling/createMessage":if(!(null===(t=this._clientCapabilities)||void 0===t?void 0:t.sampling))throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(null===(r=this._clientCapabilities)||void 0===r?void 0:r.elicitation))throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(null===(a=this._clientCapabilities)||void 0===a?void 0:a.roots))throw new Error(`Client does not support listing roots (required for ${e})`)}}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})`)}}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})`)}}async _oninitialize(e){const t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Rt.includes(t)?t:Ot,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"},Kt)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Yr,t)}async elicitInput(e,t){const r=await this.request({method:"elicitation/create",params:e},ia,t);if("accept"===r.action&&r.content)try{const t=new ya,a=t.compile(e.requestedSchema);if(!a(r.content))throw new ma(Ht.InvalidParams,`Elicitation response content does not match requested schema: ${t.errorsText(a.errors)}`)}catch(e){if(e instanceof ma)throw e;throw new ma(Ht.InternalError,`Error validating elicitation response: ${e}`)}return r}async listRoots(e,t){return this.request({method:"roots/list",params:e},ha,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}const ba=INJECTED_TOOLS,Pa={name:"MCP Server",version:"0.0.1",capabilities:{tools:{listChanged:!0}}};function wa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ea{start(){try{this.mcpServer.connect(this.transport),this.debug&&console.log("[STDIO] MCP Server running with STDIO transport"),this.setupShutdownHandlers()}catch(e){this.debug&&console.error("[STDIO] Error starting STDIO transport:",e),process.exit(1)}}setupShutdownHandlers(){const e=()=>{this.debug&&console.log("[STDIO] Shutting down STDIO transport"),process.exit(0)};process.on("SIGINT",e),process.on("SIGTERM",e)}shutdown(){this.debug&&console.log("[STDIO] Shutting down STDIO transport"),process.exit(0)}constructor(e,t=!1){wa(this,"mcpServer",void 0),wa(this,"transport",void 0),wa(this,"debug",void 0),this.mcpServer=e,this.transport=new va,this.debug=t}}const xa=STDIO_CONFIG.debug||!1;(async function(){const e=new _a(Pa),[t,r]=function(){const e=new Map;return[Object.keys(ba).map(t=>ba[t]().then(r=>{e.set(t,r)})),e]}();return await Promise.all(t),async function(e,t){return function(e,t){const r=[],a=new Map;t.forEach((e,t)=>{const s=function(e){return(e.split("/").pop()||e).replace(/\.[^/.]+$/,"")}(t),i={name:s,description:"No description provided"};let o={};const{default:n,metadata:l,schema:c}=e;"object"==typeof l&&null!==l&&Object.assign(i,l),function(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.entries(t).every(([e,t])=>"string"==typeof e&&"object"==typeof t&&null!==t&&"parse"in t&&"function"==typeof t.parse)}(c)?Object.assign(o,c):null!=c&&console.warn(`Invalid schema for tool "${i.name}" at ${t}. Expected Record<string, z.ZodType>`),void 0===i.annotations&&(i.annotations={}),void 0===i.annotations.title&&(i.annotations.title=i.name);const u={name:i.name,description:i.description,inputSchema:{type:"object",properties:Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{type:"string"}]))}};r.push(u),a.set(i.name,n)}),e.setRequestHandler(Lr,async e=>({tools:r})),e.setRequestHandler(Vr,async e=>{const{name:t,arguments:r}=e.params,s=a.get(t);if(!s)return{content:[{type:"text",text:`Tool "${t}" not found`}],isError:!0};try{const e=await s(r||{});return{content:[{type:"text",text:"string"==typeof e?e:JSON.stringify(e)}]}}catch(e){return{content:[{type:"text",text:`Error executing tool "${t}": ${e instanceof Error?e.message:String(e)}`}],isError:!0}}})}(e,t),e}(e,r)})().then(e=>{new Ea(e,xa).start()})})(),{}})());
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}}(this,()=>(()=>{var e={6069:(e,t,r)=>{"use strict";var a=r(72916).MissingRef;e.exports=function e(t,r,s){var i=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof r&&(s=r,r=void 0);var o=n(t).then(function(){var e=i._addSchema(t,void 0,r);return e.validate||c(e)});return s&&o.then(function(e){s(null,e)},s),o;function n(t){var r=t.$schema;return r&&!i.getSchema(r)?e.call(i,{$ref:r},!0):Promise.resolve()}function c(e){try{return i._compile(e)}catch(t){if(t instanceof a)return function(t){var a=t.missingSchema;if(l(a))throw new Error("Schema "+a+" is loaded but "+t.missingRef+" cannot be resolved");var s=i._loadingSchemas[a];return s||(s=i._loadingSchemas[a]=i._opts.loadSchema(a)).then(o,o),s.then(function(e){if(!l(a))return n(e).then(function(){l(a)||i.addSchema(e,a,void 0,r)})}).then(function(){return c(e)});function o(){delete i._loadingSchemas[a]}function l(e){return i._refs[e]||i._schemas[e]}}(t);throw t}}}},9717:(e,t,r)=>{"use strict";function a(e,t,r,a){var s=a?" !== ":" === ",i=a?" || ":" && ",o=a?"!":"",n=a?"":"!";switch(e){case"null":return t+s+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+i+"typeof "+t+s+'"object"'+i+n+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+s+'"number"'+i+n+"("+t+" % 1)"+i+t+s+t+(r?i+o+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+s+'"'+e+'"'+(r?i+o+"isFinite("+t+")":"")+")";default:return"typeof "+t+s+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t,r){if(1===e.length)return a(e[0],t,r,!0);var s="",o=i(e);for(var n in o.array&&o.object&&(s=o.null?"(":"(!"+t+" || ",s+="typeof "+t+' !== "object")',delete o.null,delete o.array,delete o.object),o.number&&delete o.integer,o)s+=(s?" && ":"")+a(n,t,r,!0);return s},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a<t.length;a++){var i=t[a];(s[i]||"array"===e&&"array"===i)&&(r[r.length]=i)}if(r.length)return r}else{if(s[t])return[t];if("array"===e&&"array"===t)return["array"]}},toHash:i,getProperty:c,escapeQuotes:l,equal:r(67371),ucs2length:r(61812),varOccurences:function(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0},varReplace:function(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0},schemaHasRulesExcept:function(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var a in e)if(a!=r&&t[a])return!0},schemaUnknownRules:function(e,t){if("boolean"!=typeof e)for(var r in e)if(!t[r])return r},toQuotedString:d,getPathExpr:function(e,t,r,a){return p(e,r?"'/' + "+t+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,r){return p(e,d(r?"/"+f(t):c(t)))},getData:function(e,t,r){var a,s,i,o;if(""===e)return"rootData";if("/"==e[0]){if(!u.test(e))throw new Error("Invalid JSON-pointer: "+e);s=e,i="rootData"}else{if(!(o=e.match(h)))throw new Error("Invalid JSON-pointer: "+e);if(a=+o[1],"#"==(s=o[2])){if(a>=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!s)return i}for(var n=i,l=s.split("/"),d=0;d<l.length;d++){var p=l[d];p&&(n+=" && "+(i+=c(m(p))))}return n},unescapeFragment:function(e){return m(decodeURIComponent(e))},unescapeJsonPointer:m,escapeFragment:function(e){return encodeURIComponent(f(e))},escapeJsonPointer:f};var s=i(["string","number","integer","boolean","null"]);function i(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}var o=/^[a-z$_][a-z$_0-9]*$/i,n=/'|\\/g;function c(e){return"number"==typeof e?"["+e+"]":o.test(e)?"."+e:"['"+l(e)+"']"}function l(e){return e.replace(n,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function d(e){return"'"+l(e)+"'"}var u=/^\/(?:[^~]|~0|~1)*$/,h=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function p(e,t){return'""'==e?t:(e+" + "+t).replace(/([^\\])' \+ '/g,"$1")}function f(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function m(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},9931:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(a+="var "+u+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=n,h.errSchemaPath=c;var f="key"+s,m="idx"+s,v="i"+s,y="' + "+f+" + '",g="data"+(h.dataLevel=e.dataLevel+1),_="dataProperties"+s,b=e.opts.ownProperties,w=e.baseId;b&&(a+=" var "+_+" = undefined; "),a+=b?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+m+"=0; "+m+"<"+_+".length; "+m+"++) { var "+f+" = "+_+"["+m+"]; ":" for (var "+f+" in "+d+") { ",a+=" var startErrs"+s+" = errors; ";var E=f,P=e.compositeRule;e.compositeRule=h.compositeRule=!0;var S=e.validate(h);h.baseId=w,e.util.varOccurences(S,g)<2?a+=" "+e.util.varReplace(S,g,E)+" ":a+=" var "+g+" = "+E+"; "+S+" ",e.compositeRule=h.compositeRule=P,a+=" if (!"+p+") { for (var "+v+"=startErrs"+s+"; "+v+"<errors; "+v+"++) { vErrors["+v+"].propertyName = "+f+"; } var err = ",!1!==e.createErrors?(a+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { propertyName: '"+y+"' } ",!1!==e.opts.messages&&(a+=" , message: 'property name \\'"+y+"\\' is invalid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),l&&(a+=" break; "),a+=" } }"}return l&&(a+=" if ("+u+" == errors) {"),a}},12269:e=>{"use strict";e.exports=JSON.parse('{"$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}')},12857:e=>{"use strict";e.exports=function(e,t,r){var a,s,i=" ",o=e.level,n=e.dataLevel,c=e.schema[t],l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h="valid"+o;if("#"==c||"#/"==c)e.isRoot?(a=e.async,s="validate"):(a=!0===e.root.schema.$async,s="root.refVal[0]");else{var p=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===p){var f=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs){e.logger.error(f),(g=g||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var m=i;i=g.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,f);e.logger.warn(f),d&&(i+=" if (true) { ")}}else if(p.inline){var v=e.util.copy(e);v.level++;var y="valid"+v.level;v.schema=p.schema,v.schemaPath="",v.errSchemaPath=c,i+=" "+e.validate(v).replace(/validate\.schema/g,p.code)+" ",d&&(i+=" if ("+y+") { ")}else a=!0===p.$async||e.async&&!1!==p.$async,s=p.code}if(s){var g;(g=g||[]).push(i),i="",e.opts.passContext?i+=" "+s+".call(this, ":i+=" "+s+"( ",i+=" "+u+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var _=i+=" , "+(n?"data"+(n-1||""):"parentData")+" , "+(n?e.dataPathArr[n]:"parentDataProperty")+", rootData) ";if(i=g.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");d&&(i+=" var "+h+"; "),i+=" try { await "+_+"; ",d&&(i+=" "+h+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",d&&(i+=" "+h+" = false; "),i+=" } ",d&&(i+=" if ("+h+") { ")}else i+=" if (!"+_+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",d&&(i+=" else { ")}return i}},13215:e=>{"use strict";e.exports=JSON.parse('{"$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}')},13441:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=n,h.errSchemaPath=c,a+=" var "+u+" = errors; ";var f,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(f=h.opts.allErrors,h.opts.allErrors=!1),a+=" "+e.validate(h)+" ",h.createErrors=!0,f&&(h.opts.allErrors=f),e.compositeRule=h.compositeRule=m,a+=" if ("+p+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var y=a;a=v.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+y+"]); ":a+=" validate.errors = ["+y+"]; return false; ":a+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(a+=" if (false) { ");return a}},13749:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,s=1;s<a;++s)t[s]=t[s].slice(1,-1);return t[a]=t[a].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function a(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function s(e){return e.toUpperCase()}function i(e){var a="[A-Za-z]",s="[0-9]",i=t(s,"[A-Fa-f]"),o=r(r("%[EFef]"+i+"%"+i+i+"%"+i+i)+"|"+r("%[89A-Fa-f]"+i+"%"+i+i)+"|"+r("%"+i+i)),n="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",n),l=e?"[\\uE000-\\uF8FF]":"[]",d=t(a,s,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),u=r(a+t(a,s,"[\\+\\-\\.]")+"*"),h=r(r(o+"|"+t(d,n,"[\\:]"))+"*"),p=(r(r("25[0-5]")+"|"+r("2[0-4]"+s)+"|"+r("1"+s+s)+"|"+r("[1-9]"+s)+"|"+s),r(r("25[0-5]")+"|"+r("2[0-4]"+s)+"|"+r("1"+s+s)+"|"+r("0?[1-9]"+s)+"|0?0?"+s)),f=r(p+"\\."+p+"\\."+p+"\\."+p),m=r(i+"{1,4}"),v=r(r(m+"\\:"+m)+"|"+f),y=r(r(m+"\\:")+"{6}"+v),g=r("\\:\\:"+r(m+"\\:")+"{5}"+v),_=r(r(m)+"?\\:\\:"+r(m+"\\:")+"{4}"+v),b=r(r(r(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+r(m+"\\:")+"{3}"+v),w=r(r(r(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+r(m+"\\:")+"{2}"+v),E=r(r(r(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+v),P=r(r(r(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+v),S=r(r(r(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),x=r(r(r(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),k=r([y,g,_,b,w,E,P,S,x].join("|")),I=r(r(d+"|"+o)+"+"),j=(r(k+"\\%25"+I),r(k+r("\\%25|\\%(?!"+i+"{2})")+I)),O=r("[vV]"+i+"+\\."+t(d,n,"[\\:]")+"+"),T=r("\\["+r(j+"|"+k+"|"+O)+"\\]"),R=r(r(o+"|"+t(d,n))+"*"),$=r(T+"|"+f+"(?!"+R+")|"+R),A=r(s+"*"),C=r(r(h+"@")+"?"+$+r("\\:"+A)+"?"),D=r(o+"|"+t(d,n,"[\\:\\@]")),F=r(D+"*"),N=r(D+"+"),H=r(r(o+"|"+t(d,n,"[\\@]"))+"+"),Z=r(r("\\/"+F)+"*"),q=r("\\/"+r(N+Z)+"?"),L=r(H+Z),M=r(N+Z),K="(?!"+D+")",z=(r(Z+"|"+q+"|"+L+"|"+M+"|"+K),r(r(D+"|"+t("[\\/\\?]",l))+"*")),V=r(r(D+"|[\\/\\?]")+"*"),U=r(r("\\/\\/"+C+Z)+"|"+q+"|"+M+"|"+K),Q=r(u+"\\:"+U+r("\\?"+z)+"?"+r("\\#"+V)+"?"),B=r(r("\\/\\/"+C+Z)+"|"+q+"|"+L+"|"+K),J=r(B+r("\\?"+z)+"?"+r("\\#"+V)+"?");return r(Q+"|"+J),r(u+"\\:"+U+r("\\?"+z)+"?"),r(r("\\/\\/("+r("("+h+")@")+"?("+$+")"+r("\\:("+A+")")+"?)")+"?("+Z+"|"+q+"|"+M+"|"+K+")"),r("\\?("+z+")"),r("\\#("+V+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+$+")"+r("\\:("+A+")")+"?)")+"?("+Z+"|"+q+"|"+L+"|"+K+")"),r("\\?("+z+")"),r("\\#("+V+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+$+")"+r("\\:("+A+")")+"?)")+"?("+Z+"|"+q+"|"+M+"|"+K+")"),r("\\?("+z+")"),r("\\#("+V+")"),r("("+h+")@"),r("\\:("+A+")"),{NOT_SCHEME:new RegExp(t("[^]",a,s,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",d,n),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",d,n),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",d,n),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",d,n),"g"),NOT_QUERY:new RegExp(t("[^\\%]",d,n,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",d,n,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",d,n),"g"),UNRESERVED:new RegExp(d,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",d,c),"g"),PCT_ENCODED:new RegExp(o,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+k+")"+r(r("\\%25|\\%(?!"+i+"{2})")+"("+I+")")+"?\\]?$")}}var o=i(!1),n=i(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],a=!0,s=!1,i=void 0;try{for(var o,n=e[Symbol.iterator]();!(a=(o=n.next()).done)&&(r.push(o.value),!t||r.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{!a&&n.return&&n.return()}finally{if(s)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},l=2147483647,d=36,u=/^xn--/,h=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,v=String.fromCharCode;function y(e){throw new RangeError(f[e])}function g(e,t){var r=e.split("@"),a="";return r.length>1&&(a=r[0]+"@",e=r[1]),a+function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(p,".")).split("."),t).join(".")}function _(e){for(var t=[],r=0,a=e.length;r<a;){var s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<a){var i=e.charCodeAt(r++);56320==(64512&i)?t.push(((1023&s)<<10)+(1023&i)+65536):(t.push(s),r--)}else t.push(s)}return t}var b=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},w=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},E=function(e,t,r){var a=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;a+=d)e=m(e/35);return m(a+36*e/(e+38))},P=function(e){var t=[],r=e.length,a=0,s=128,i=72,o=e.lastIndexOf("-");o<0&&(o=0);for(var n=0;n<o;++n)e.charCodeAt(n)>=128&&y("not-basic"),t.push(e.charCodeAt(n));for(var c=o>0?o+1:0;c<r;){for(var u=a,h=1,p=d;;p+=d){c>=r&&y("invalid-input");var f=b(e.charCodeAt(c++));(f>=d||f>m((l-a)/h))&&y("overflow"),a+=f*h;var v=p<=i?1:p>=i+26?26:p-i;if(f<v)break;var g=d-v;h>m(l/g)&&y("overflow"),h*=g}var _=t.length+1;i=E(a-u,_,0==u),m(a/_)>l-s&&y("overflow"),s+=m(a/_),a%=_,t.splice(a++,0,s)}return String.fromCodePoint.apply(String,t)},S=function(e){var t=[],r=(e=_(e)).length,a=128,s=0,i=72,o=!0,n=!1,c=void 0;try{for(var u,h=e[Symbol.iterator]();!(o=(u=h.next()).done);o=!0){var p=u.value;p<128&&t.push(v(p))}}catch(e){n=!0,c=e}finally{try{!o&&h.return&&h.return()}finally{if(n)throw c}}var f=t.length,g=f;for(f&&t.push("-");g<r;){var b=l,P=!0,S=!1,x=void 0;try{for(var k,I=e[Symbol.iterator]();!(P=(k=I.next()).done);P=!0){var j=k.value;j>=a&&j<b&&(b=j)}}catch(e){S=!0,x=e}finally{try{!P&&I.return&&I.return()}finally{if(S)throw x}}var O=g+1;b-a>m((l-s)/O)&&y("overflow"),s+=(b-a)*O,a=b;var T=!0,R=!1,$=void 0;try{for(var A,C=e[Symbol.iterator]();!(T=(A=C.next()).done);T=!0){var D=A.value;if(D<a&&++s>l&&y("overflow"),D==a){for(var F=s,N=d;;N+=d){var H=N<=i?1:N>=i+26?26:N-i;if(F<H)break;var Z=F-H,q=d-H;t.push(v(w(H+Z%q,0))),F=m(Z/q)}t.push(v(w(F,0))),i=E(s,O,g==f),s=0,++g}}}catch(e){R=!0,$=e}finally{try{!T&&C.return&&C.return()}finally{if(R)throw $}}++s,++a}return t.join("")},x=function(e){return g(e,function(e){return h.test(e)?"xn--"+S(e):e})},k=function(e){return g(e,function(e){return u.test(e)?P(e.slice(4).toLowerCase()):e})},I={};function j(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function O(e){for(var t="",r=0,a=e.length;r<a;){var s=parseInt(e.substr(r+1,2),16);if(s<128)t+=String.fromCharCode(s),r+=3;else if(s>=194&&s<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&s)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(s>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),n=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&n)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=O(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,j).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,j).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,j).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,j).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,j).replace(t.PCT_ENCODED,s)),e}function R(e){return e.replace(/^0*(.*)/,"$1")||"0"}function $(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=c(r,2)[1];return a?a.split(".").map(R).join("."):e}function A(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=c(r,3),s=a[1],i=a[2];if(s){for(var o=s.toLowerCase().split("::").reverse(),n=c(o,2),l=n[0],d=n[1],u=d?d.split(":").map(R):[],h=l.split(":").map(R),p=t.IPV4ADDRESS.test(h[h.length-1]),f=p?7:8,m=h.length-f,v=Array(f),y=0;y<f;++y)v[y]=u[y]||h[m+y]||"";p&&(v[f-1]=$(v[f-1],t));var g=v.reduce(function(e,t,r){if(!t||"0"===t){var a=e[e.length-1];a&&a.index+a.length===r?a.length++:e.push({index:r,length:1})}return e},[]).sort(function(e,t){return t.length-e.length})[0],_=void 0;if(g&&g.length>1){var b=v.slice(0,g.index),w=v.slice(g.index+g.length);_=b.join(":")+"::"+w.join(":")}else _=v.join(":");return i&&(_+="%"+i),_}return e}var C=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,D=void 0==="".match(/(){0}/)[1];function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?n:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(C);if(s){D?(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5])):(r.scheme=s[1]||void 0,r.userinfo=-1!==e.indexOf("@")?s[3]:void 0,r.host=-1!==e.indexOf("//")?s[4]:void 0,r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=-1!==e.indexOf("?")?s[7]:void 0,r.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),r.host&&(r.host=A($(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=I[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=x(r.host.replace(a.PCT_ENCODED,O).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var N=/^\.\.?\//,H=/^\/\.(\/|$)/,Z=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function L(e){for(var t=[];e.length;)if(e.match(N))e=e.replace(N,"");else if(e.match(H))e=e.replace(H,"/");else if(e.match(Z))e=e.replace(Z,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(q);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?n:o,a=[],s=I[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?k(e.host):x(e.host.replace(r.PCT_ENCODED,O).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?n:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(A($(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(a.push(":"),a.push(String(e.port))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||s&&s.absolutePath||(c=L(c)),void 0===i&&(c=c.replace(/^\/\//,"/%2F")),a.push(c)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function K(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=F(M(e,r),r),t=F(M(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=L(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=L(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=L(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=L(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function z(e,t){return e&&e.toString().replace(t&&t.iri?n.PCT_ENCODED:o.PCT_ENCODED,O)}var V={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},U={scheme:"https",domainHost:V.domainHost,parse:V.parse,serialize:V.serialize};function Q(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var B={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=Q(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(Q(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),a=c(r,2),s=a[0],i=a[1];e.path=s&&"/"!==s?s:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:B.domainHost,parse:B.parse,serialize:B.serialize},W={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",X=r(r("%[EFef]"+Y+"%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f]"+Y+"%"+Y+Y)+"|"+r("%"+Y+Y)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(G,"g"),re=new RegExp(X,"g"),ae=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),se=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=se;function oe(e){var t=O(e);return t.match(te)?t:e}var ne={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var s=!1,i={},o=r.query.split("&"),n=0,c=o.length;n<c;++n){var l=o[n].split("=");switch(l[0]){case"to":for(var d=l[1].split(","),u=0,h=d.length;u<h;++u)a.push(d[u]);break;case"subject":r.subject=z(l[1],t);break;case"body":r.body=z(l[1],t);break;default:s=!0,i[z(l[0],t)]=z(l[1],t)}}s&&(r.headers=i)}r.query=void 0;for(var p=0,f=a.length;p<f;++p){var m=a[p].split("@");if(m[0]=z(m[0]),t.unicodeSupport)m[1]=z(m[1],t).toLowerCase();else try{m[1]=x(z(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}a[p]=m.join("@")}return r},serialize:function(e,t){var r,a=e,i=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(i){for(var o=0,n=i.length;o<n;++o){var c=String(i[o]),l=c.lastIndexOf("@"),d=c.slice(0,l).replace(re,oe).replace(re,s).replace(ae,j),u=c.slice(l+1);try{u=t.iri?k(u):x(z(u,t).toLowerCase())}catch(e){a.error=a.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}i[o]=d+"@"+u}a.path=i.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var p=[];for(var f in h)h[f]!==W[f]&&p.push(f.replace(re,oe).replace(re,s).replace(se,j)+"="+h[f].replace(re,oe).replace(re,s).replace(ie,j));return p.length&&(a.query=p.join("&")),a}},ce=/^([^\:]+)\:(.*)/,le={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ce),a=e;if(r){var s=t.scheme||a.scheme||"urn",i=r[1].toLowerCase(),o=r[2],n=s+":"+(t.nid||i),c=I[n];a.nid=i,a.nss=o,a.path=void 0,c&&(a=c.parse(a,t))}else a.error=a.error||"URN can not be parsed.";return a},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",a=e.nid,s=r+":"+(t.nid||a),i=I[s];i&&(e=i.serialize(e,t));var o=e,n=e.nss;return o.path=(a||t.nid)+":"+n,o}},de=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ue={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(de)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};I[V.scheme]=V,I[U.scheme]=U,I[B.scheme]=B,I[J.scheme]=J,I[ne.scheme]=ne,I[le.scheme]=le,I[ue.scheme]=ue,e.SCHEMES=I,e.pctEncChar=j,e.pctDecChars=O,e.parse=F,e.removeDotSegments=L,e.serialize=M,e.resolveComponents=K,e.resolve=function(e,t,r){var a=function(e,t){var r=e;if(t)for(var a in t)r[a]=t[a];return r}({scheme:"null"},r);return M(K(F(e,a),F(t,a),a,!0),a)},e.normalize=function(e,t){return"string"==typeof e?e=M(F(e,t),t):"object"===a(e)&&(e=F(M(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=M(F(e,r),r):"object"===a(e)&&(e=M(e,r)),"string"==typeof t?t=M(F(t,r),r):"object"===a(t)&&(t=M(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?n.ESCAPE:o.ESCAPE,j)},e.unescapeComponent=z,Object.defineProperty(e,"__esModule",{value:!0})}(t)},14547:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),f="";p.level++;var m="valid"+p.level,v=o.every(function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)});if(v){var y=p.baseId;a+=" var "+h+" = errors; var "+u+" = false; ";var g=e.compositeRule;e.compositeRule=p.compositeRule=!0;var _=o;if(_)for(var b,w=-1,E=_.length-1;w<E;)b=_[w+=1],p.schema=b,p.schemaPath=n+"["+w+"]",p.errSchemaPath=c+"/"+w,a+=" "+e.validate(p)+" ",p.baseId=y,a+=" "+u+" = "+u+" || "+m+"; if (!"+u+") { ",f+="}";e.compositeRule=p.compositeRule=g,a+=" "+f+" if (!"+u+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else l&&(a+=" if (true) { ");return a}},20698:(e,t,r)=>{"use strict";var a=r(52004),s=r(9717).toHash;e.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"];return e.all=s(t),e.types=s(["number","integer","string","array","object","boolean","null"]),e.forEach(function(r){r.rules=r.rules.map(function(r){var s;if("object"==typeof r){var i=Object.keys(r)[0];s=r[i],r=i,s.forEach(function(r){t.push(r),e.all[r]=!0})}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:s}}),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)}),e.keywords=s(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},20812:(e,t,r)=>{"use strict";var a=r(9717);e.exports=function(e){a.copy(e,this)}},22853:(e,t,r)=>{"use strict";var a=r(40985),s=r(9717),i=r(72916),o=r(56039),n=r(25572),c=s.ucs2length,l=r(67371),d=i.Validation;function u(e,t,r){var a=p.call(this,e,t,r);return a>=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function h(e,t,r){var a=p.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function p(e,t,r){for(var a=0;a<this._compilations.length;a++){var s=this._compilations[a];if(s.schema==e&&s.root==t&&s.baseId==r)return a}return-1}function f(e,t){return"var pattern"+e+" = new RegExp("+s.toQuotedString(t[e])+");"}function m(e){return"var default"+e+" = defaults["+e+"];"}function v(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function y(e){return"var customRule"+e+" = customRules["+e+"];"}function g(e,t){if(!e.length)return"";for(var r="",a=0;a<e.length;a++)r+=t(a,e);return r}e.exports=function e(t,r,p,_){var b=this,w=this._opts,E=[void 0],P={},S=[],x={},k=[],I={},j=[];r=r||{schema:t,refVal:E,refs:P};var O=u.call(this,t,r,_),T=this._compilations[O.index];if(O.compiling)return T.callValidate=function e(){var t=T.validate,r=t.apply(this,arguments);return e.errors=t.errors,r};var R=this._formats,$=this.RULES;try{var A=D(t,r,p,_);T.validate=A;var C=T.callValidate;return C&&(C.schema=A.schema,C.errors=null,C.refs=A.refs,C.refVal=A.refVal,C.root=A.root,C.$async=A.$async,w.sourceCode&&(C.source=A.source)),A}finally{h.call(this,t,r,_)}function D(t,o,u,h){var p=!o||o&&o.schema==t;if(o.schema!=r.schema)return e.call(b,t,o,u,h);var _,x=!0===t.$async,I=n({isTop:!0,schema:t,isRoot:p,baseId:h,root:o,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:i.MissingRef,RULES:$,validate:n,util:s,resolve:a,resolveRef:F,usePattern:Z,useDefault:q,useCustomRule:L,opts:w,formats:R,logger:b.logger,self:b});I=g(E,v)+g(S,f)+g(k,m)+g(j,y)+I,w.processCode&&(I=w.processCode(I,t));try{_=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",I)(b,$,R,r,E,k,j,l,c,d),E[0]=_}catch(e){throw b.logger.error("Error compiling schema, function code:",I),e}return _.schema=t,_.errors=null,_.refs=P,_.refVal=E,_.root=p?_:o,x&&(_.$async=!0),!0===w.sourceCode&&(_.source={code:I,patterns:S,defaults:k}),_}function F(t,s,i){s=a.url(t,s);var o,n,c=P[s];if(void 0!==c)return H(o=E[c],n="refVal["+c+"]");if(!i&&r.refs){var l=r.refs[s];if(void 0!==l)return H(o=r.refVal[l],n=N(s,o))}n=N(s);var d=a.call(b,D,r,s);if(void 0===d){var u=p&&p[s];u&&(d=a.inlineRef(u,w.inlineRefs)?u:e.call(b,u,r,p,t))}if(void 0!==d)return function(e,t){var r=P[e];E[r]=t}(s,d),H(d,n);!function(e){delete P[e]}(s)}function N(e,t){var r=E.length;return E[r]=t,P[e]=r,"refVal"+r}function H(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function Z(e){var t=x[e];return void 0===t&&(t=x[e]=S.length,S[t]=e),"pattern"+t}function q(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return s.toQuotedString(e);case"object":if(null===e)return"null";var t=o(e),r=I[t];return void 0===r&&(r=I[t]=k.length,k[r]=e),"default"+r}}function L(e,t,r,a){if(!1!==b._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var i=e.definition.validateSchema;if(i&&!i(t)){var o="keyword schema is invalid: "+b.errorsText(i.errors);if("log"!=b._opts.validateSchema)throw new Error(o);b.logger.error(o)}}var n,c=e.definition.compile,l=e.definition.inline,d=e.definition.macro;if(c)n=c.call(b,t,r,a);else if(d)n=d.call(b,t,r,a),!1!==w.validateSchema&&b.validateSchema(n,!0);else if(l)n=l.call(b,a,e.keyword,t,r);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var u=j.length;return j[u]=n,{code:"customRule"+u,validate:n}}}},24235:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var f="valid"+p.level,m="i"+s,v=p.dataLevel=e.dataLevel+1,y="data"+v,g=e.baseId,_=e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+h+" = errors;var "+u+";",_){var b=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=o,p.schemaPath=n,p.errSchemaPath=c,a+=" var "+f+" = false; for (var "+m+" = 0; "+m+" < "+d+".length; "+m+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var w=d+"["+m+"]";p.dataPathArr[v]=m;var E=e.validate(p);p.baseId=g,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,w)+" ":a+=" var "+y+" = "+w+"; "+E+" ",a+=" if ("+f+") break; } ",e.compositeRule=p.compositeRule=b,a+=" if (!"+f+") {"}else a+=" if ("+d+".length == 0) {";var P=P||[];P.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var S=a;return a=P.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+S+"]); ":a+=" validate.errors = ["+S+"]; return false; ":a+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",_&&(a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a}},25572:e=>{"use strict";e.exports=function(e,t,r){var a="",s=!0===e.schema.$async,i=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),o=e.self._getId(e.schema);if(e.opts.strictKeywords){var n=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(n){var c="unknown keyword: "+n;if("log"!==e.opts.strictKeywords)throw new Error(c);e.logger.warn(c)}}if(e.isTop&&(a+=" var validate = ",s&&(e.async=!0,a+="async "),a+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(e.opts.sourceCode||e.opts.processCode)&&(a+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof e.schema||!i&&!e.schema.$ref){t="false schema";var l=e.level,d=e.dataLevel,u=e.schema[t],h=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,m="data"+(d||""),v="valid"+l;if(!1===e.schema){e.isTop?f=!0:a+=" var "+v+" = false; ",(V=V||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'boolean schema is false' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),a+=" } "):a+=" {} ";var y=a;a=V.pop(),!e.compositeRule&&f?e.async?a+=" throw new ValidationError(["+y+"]); ":a+=" validate.errors = ["+y+"]; return false; ":a+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?a+=s?" return data; ":" validate.errors = null; return true; ":a+=" var "+v+" = true; ";return e.isTop&&(a+=" }; return validate; "),a}if(e.isTop){var g=e.isTop;if(l=e.level=0,d=e.dataLevel=0,m="data",e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var _="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}a+=" var vErrors = null; ",a+=" var errors = 0; ",a+=" if (rootData === undefined) rootData = data; "}else{if(l=e.level,m="data"+((d=e.dataLevel)||""),o&&(e.baseId=e.resolve.url(e.baseId,o)),s&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+l+" = errors;"}v="valid"+l,f=!e.opts.allErrors;var b="",w="",E=e.schema.type,P=Array.isArray(E);if(E&&e.opts.nullable&&!0===e.schema.nullable&&(P?-1==E.indexOf("null")&&(E=E.concat("null")):"null"!=E&&(E=[E,"null"],P=!0)),P&&1==E.length&&(E=E[0],P=!1),e.schema.$ref&&i){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(i=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(a+=" "+e.RULES.all.$comment.code(e,"$comment")),E){if(e.opts.coerceTypes)var S=e.util.coerceToTypes(e.opts.coerceTypes,E);var x=e.RULES.types[E];if(S||P||!0===x||x&&!G(x)){h=e.schemaPath+".type",p=e.errSchemaPath+"/type",h=e.schemaPath+".type",p=e.errSchemaPath+"/type";var k=P?"checkDataTypes":"checkDataType";if(a+=" if ("+e.util[k](E,m,e.opts.strictNumbers,!0)+") { ",S){var I="dataType"+l,j="coerced"+l;a+=" var "+I+" = typeof "+m+"; var "+j+" = undefined; ","array"==e.opts.coerceTypes&&(a+=" if ("+I+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+I+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+j+" = "+m+"; } "),a+=" if ("+j+" !== undefined) ; ";var O=S;if(O)for(var T,R=-1,$=O.length-1;R<$;)"string"==(T=O[R+=1])?a+=" else if ("+I+" == 'number' || "+I+" == 'boolean') "+j+" = '' + "+m+"; else if ("+m+" === null) "+j+" = ''; ":"number"==T||"integer"==T?(a+=" else if ("+I+" == 'boolean' || "+m+" === null || ("+I+" == 'string' && "+m+" && "+m+" == +"+m+" ","integer"==T&&(a+=" && !("+m+" % 1)"),a+=")) "+j+" = +"+m+"; "):"boolean"==T?a+=" else if ("+m+" === 'false' || "+m+" === 0 || "+m+" === null) "+j+" = false; else if ("+m+" === 'true' || "+m+" === 1) "+j+" = true; ":"null"==T?a+=" else if ("+m+" === '' || "+m+" === 0 || "+m+" === false) "+j+" = null; ":"array"==e.opts.coerceTypes&&"array"==T&&(a+=" else if ("+I+" == 'string' || "+I+" == 'number' || "+I+" == 'boolean' || "+m+" == null) "+j+" = ["+m+"]; ");a+=" else { ",(V=V||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=P?""+E.join(","):""+E,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=P?""+E.join(","):""+E,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),a+=" } "):a+=" {} ",y=a,a=V.pop(),!e.compositeRule&&f?e.async?a+=" throw new ValidationError(["+y+"]); ":a+=" validate.errors = ["+y+"]; return false; ":a+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } if ("+j+" !== undefined) { ";var A=d?"data"+(d-1||""):"parentData";a+=" "+m+" = "+j+"; ",d||(a+="if ("+A+" !== undefined)"),a+=" "+A+"["+(d?e.dataPathArr[d]:"parentDataProperty")+"] = "+j+"; } "}else(V=V||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=P?""+E.join(","):""+E,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=P?""+E.join(","):""+E,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),a+=" } "):a+=" {} ",y=a,a=V.pop(),!e.compositeRule&&f?e.async?a+=" throw new ValidationError(["+y+"]); ":a+=" validate.errors = ["+y+"]; return false; ":a+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";a+=" } "}}if(e.schema.$ref&&!i)a+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",f&&(a+=" } if (errors === ",a+=g?"0":"errs_"+l,a+=") { ",w+="}");else{var C=e.RULES;if(C)for(var D=-1,F=C.length-1;D<F;)if(G(x=C[D+=1])){if(x.type&&(a+=" if ("+e.util.checkDataType(x.type,m,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==x.type&&e.schema.properties){u=e.schema.properties;var N=Object.keys(u);if(N)for(var H,Z=-1,q=N.length-1;Z<q;)if(void 0!==(K=u[H=N[Z+=1]]).default){var L=m+e.util.getProperty(H);if(e.compositeRule){if(e.opts.strictDefaults){if(_="default is ignored for: "+L,"log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}}else a+=" if ("+L+" === undefined ","empty"==e.opts.useDefaults&&(a+=" || "+L+" === null || "+L+" === '' "),a+=" ) "+L+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(K.default)+" ":a+=" "+JSON.stringify(K.default)+" ",a+="; "}}else if("array"==x.type&&Array.isArray(e.schema.items)){var M=e.schema.items;if(M){R=-1;for(var K,z=M.length-1;R<z;)if(void 0!==(K=M[R+=1]).default)if(L=m+"["+R+"]",e.compositeRule){if(e.opts.strictDefaults){if(_="default is ignored for: "+L,"log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}}else a+=" if ("+L+" === undefined ","empty"==e.opts.useDefaults&&(a+=" || "+L+" === null || "+L+" === '' "),a+=" ) "+L+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(K.default)+" ":a+=" "+JSON.stringify(K.default)+" ",a+="; "}}var V,U=x.rules;if(U)for(var Q,B=-1,J=U.length-1;B<J;)if(Y(Q=U[B+=1])){var W=Q.code(e,Q.keyword,x.type);W&&(a+=" "+W+" ",f&&(b+="}"))}if(f&&(a+=" "+b+" ",b=""),x.type&&(a+=" } ",E&&E===x.type&&!S))a+=" else { ",h=e.schemaPath+".type",p=e.errSchemaPath+"/type",(V=V||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",a+=P?""+E.join(","):""+E,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=P?""+E.join(","):""+E,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),a+=" } "):a+=" {} ",y=a,a=V.pop(),!e.compositeRule&&f?e.async?a+=" throw new ValidationError(["+y+"]); ":a+=" validate.errors = ["+y+"]; return false; ":a+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ";f&&(a+=" if (errors === ",a+=g?"0":"errs_"+l,a+=") { ",w+="}")}}function G(e){for(var t=e.rules,r=0;r<t.length;r++)if(Y(t[r]))return!0}function Y(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var r=t.implements,a=0;a<r.length;a++)if(void 0!==e.schema[r[a]])return!0}(t)}return f&&(a+=" "+w+" "),g?(s?(a+=" if (errors === 0) return data; ",a+=" else throw new ValidationError(vErrors); "):(a+=" validate.errors = vErrors; ",a+=" return errors === 0; "),a+=" }; return validate;"):a+=" var "+v+" = errors === errs_"+l+";",a}},27713:e=>{"use strict";var t=e.exports=function(e,t,a){"function"==typeof t&&(a=t,t={}),r(t,"function"==typeof(a=t.cb||a)?a:a.pre||function(){},a.post||function(){},e,"",e)};function r(e,s,i,o,n,c,l,d,u,h){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var p in s(o,n,c,l,d,u,h),o){var f=o[p];if(Array.isArray(f)){if(p in t.arrayKeywords)for(var m=0;m<f.length;m++)r(e,s,i,f[m],n+"/"+p+"/"+m,c,n,p,o,m)}else if(p in t.propsKeywords){if(f&&"object"==typeof f)for(var v in f)r(e,s,i,f[v],n+"/"+p+"/"+a(v),c,n,p,o,v)}else(p in t.keywords||e.allKeys&&!(p in t.skipKeywords))&&r(e,s,i,f,n+"/"+p,c,n,p,o)}i(o,n,c,l,d,u,h)}}function a(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},28565:e=>{"use strict";var t=e.exports=function(){this._cache={}};t.prototype.put=function(e,t){this._cache[e]=t},t.prototype.get=function(e){return this._cache[e]},t.prototype.del=function(e){delete this._cache[e]},t.prototype.clear=function(){this._cache={}}},33728:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),f="";p.level++;var m="valid"+p.level,v="i"+s,y=p.dataLevel=e.dataLevel+1,g="data"+y,_=e.baseId;if(a+="var "+h+" = errors;var "+u+";",Array.isArray(o)){var b=e.schema.additionalItems;if(!1===b){a+=" "+u+" = "+d+".length <= "+o.length+"; ";var w=c;c=e.errSchemaPath+"/additionalItems",a+=" if (!"+u+") { ";var E=E||[];E.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var P=a;a=E.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+P+"]); ":a+=" validate.errors = ["+P+"]; return false; ":a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c=w,l&&(f+="}",a+=" else { ")}var S=o;if(S)for(var x,k=-1,I=S.length-1;k<I;)if(x=S[k+=1],e.opts.strictKeywords?"object"==typeof x&&Object.keys(x).length>0||!1===x:e.util.schemaHasRules(x,e.RULES.all)){a+=" "+m+" = true; if ("+d+".length > "+k+") { ";var j=d+"["+k+"]";p.schema=x,p.schemaPath=n+"["+k+"]",p.errSchemaPath=c+"/"+k,p.errorPath=e.util.getPathExpr(e.errorPath,k,e.opts.jsonPointers,!0),p.dataPathArr[y]=k;var O=e.validate(p);p.baseId=_,e.util.varOccurences(O,g)<2?a+=" "+e.util.varReplace(O,g,j)+" ":a+=" var "+g+" = "+j+"; "+O+" ",a+=" } ",l&&(a+=" if ("+m+") { ",f+="}")}"object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0||!1===b:e.util.schemaHasRules(b,e.RULES.all))&&(p.schema=b,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+d+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+d+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0),j=d+"["+v+"]",p.dataPathArr[y]=v,O=e.validate(p),p.baseId=_,e.util.varOccurences(O,g)<2?a+=" "+e.util.varReplace(O,g,j)+" ":a+=" var "+g+" = "+j+"; "+O+" ",l&&(a+=" if (!"+m+") break; "),a+=" } } ",l&&(a+=" if ("+m+") { ",f+="}"))}else(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0||!1===o:e.util.schemaHasRules(o,e.RULES.all))&&(p.schema=o,p.schemaPath=n,p.errSchemaPath=c,a+=" for (var "+v+" = 0; "+v+" < "+d+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0),j=d+"["+v+"]",p.dataPathArr[y]=v,O=e.validate(p),p.baseId=_,e.util.varOccurences(O,g)<2?a+=" "+e.util.varReplace(O,g,j)+" ":a+=" var "+g+" = "+j+"; "+O+" ",l&&(a+=" if (!"+m+") break; "),a+=" }");return l&&(a+=" "+f+" if ("+h+" == errors) {"),a}},36885:(e,t,r)=>{"use strict";var a=r(9717),s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31],o=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,n=/^(?=.{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,c=/^(?:[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,l=/^(?:(?:[^\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,d=/^(?:(?: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,u=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,f=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(s);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function y(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],s=r[2],i=r[3],n=r[5];return(a<=23&&s<=59&&i<=59||23==a&&59==s&&60==i)&&(!t||n)}e.exports=m,m.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":l,url:d,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:n,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:w,uuid:u,"json-pointer":h,"json-pointer-uri-fragment":p,"relative-json-pointer":f},m.full={date:v,time:y,"date-time":function(e){var t=e.split(g);return 2==t.length&&v(t[0])&&y(t[1],!0)},uri:function(e){return _.test(e)&&c.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":l,url:d,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:n,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:w,uuid:u,"json-pointer":h,"json-pointer-uri-fragment":p,"relative-json-pointer":f};var g=/t|\s/i,_=/\/|:/,b=/[^\\]\\Z/;function w(e){if(b.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},40985:(e,t,r)=>{"use strict";var a=r(13749),s=r(67371),i=r(9717),o=r(20812),n=r(27713);function c(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return c.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return f(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var s,i,n,d=l.call(this,t,r);return d&&(s=d.schema,t=d.root,n=d.baseId),s instanceof o?i=s.validate||e.call(this,s.schema,t,void 0,n):void 0!==s&&(i=f(s,this._opts.inlineRefs)?s:e.call(this,s,t,void 0,n)),i}function l(e,t){var r=a.parse(t),s=g(r),i=y(this._getId(e.schema));if(0===Object.keys(e.schema).length||s!==i){var n=b(s),c=this._refs[n];if("string"==typeof c)return d.call(this,e,c,r);if(c instanceof o)c.validate||this._compile(c),e=c;else{if(!((c=this._schemas[n])instanceof o))return;if(c.validate||this._compile(c),n==b(t))return{schema:c,root:e,baseId:i};e=c}if(!e.schema)return;i=y(this._getId(e.schema))}return h.call(this,r,i,e.schema,e)}function d(e,t,r){var a=l.call(this,e,t);if(a){var s=a.schema,i=a.baseId;e=a.root;var o=this._getId(s);return o&&(i=w(i,o)),h.call(this,r,i,s,e)}}e.exports=c,c.normalizeId=b,c.fullPath=y,c.url=w,c.ids=function(e){var t=b(this._getId(e)),r={"":t},o={"":y(t,!1)},c={},l=this;return n(e,{allKeys:!0},function(e,t,n,d,u,h,p){if(""!==t){var f=l._getId(e),m=r[d],v=o[d]+"/"+u;if(void 0!==p&&(v+="/"+("number"==typeof p?p:i.escapeFragment(p))),"string"==typeof f){f=m=b(m?a.resolve(m,f):f);var y=l._refs[f];if("string"==typeof y&&(y=l._refs[y]),y&&y.schema){if(!s(e,y.schema))throw new Error('id "'+f+'" resolves to more than one schema')}else if(f!=b(v))if("#"==f[0]){if(c[f]&&!s(e,c[f]))throw new Error('id "'+f+'" resolves to more than one schema');c[f]=e}else l._refs[f]=v}r[t]=m,o[t]=v}}),c},c.inlineRef=f,c.schema=l;var u=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var s=e.fragment.split("/"),o=1;o<s.length;o++){var n=s[o];if(n){if(void 0===(r=r[n=i.unescapeFragment(n)]))break;var c;if(!u[n]&&((c=this._getId(r))&&(t=w(t,c)),r.$ref)){var d=w(t,r.$ref),h=l.call(this,a,d);h&&(r=h.schema,a=h.root,t=h.baseId)}}}return void 0!==r&&r!==a.schema?{schema:r,root:a,baseId:t}:void 0}}var p=i.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function f(e,t){return!1!==t&&(void 0===t||!0===t?m(e):t?v(e)<=t:void 0)}function m(e){var t;if(Array.isArray(e)){for(var r=0;r<e.length;r++)if("object"==typeof(t=e[r])&&!m(t))return!1}else for(var a in e){if("$ref"==a)return!1;if("object"==typeof(t=e[a])&&!m(t))return!1}return!0}function v(e){var t,r=0;if(Array.isArray(e)){for(var a=0;a<e.length;a++)if("object"==typeof(t=e[a])&&(r+=v(t)),r==1/0)return 1/0}else for(var s in e){if("$ref"==s)return 1/0;if(p[s])r++;else if("object"==typeof(t=e[s])&&(r+=v(t)+1),r==1/0)return 1/0}return r}function y(e,t){return!1!==t&&(e=b(e)),g(a.parse(e))}function g(e){return a.serialize(e).split("#")[0]+"#"}var _=/#\/?$/;function b(e){return e?e.replace(_,""):""}function w(e,t){return t=b(t),a.resolve(e,t)}},41021:e=>{"use strict";e.exports=function(e,t,r){var a,s,i=" ",o=e.level,n=e.dataLevel,c=e.schema[t],l=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,h="data"+(n||""),p="valid"+o,f="errs__"+o,m=e.opts.$data&&c&&c.$data;m?(i+=" var schema"+o+" = "+e.util.getData(c.$data,n,e.dataPathArr)+"; ",s="schema"+o):s=c;var v,y,g,_,b,w=this,E="definition"+o,P=w.definition,S="";if(m&&P.$data){b="keywordValidate"+o;var x=P.validateSchema;i+=" var "+E+" = RULES.custom['"+t+"'].definition; var "+b+" = "+E+".validate;"}else{if(!(_=e.useCustomRule(w,c,e.schema,e)))return;s="validate.schema"+l,b=_.code,v=P.compile,y=P.inline,g=P.macro}var k=b+".errors",I="i"+o,j="ruleErr"+o,O=P.async;if(O&&!e.async)throw new Error("async keyword in sync schema");if(y||g||(i+=k+" = null;"),i+="var "+f+" = errors;var "+p+";",m&&P.$data&&(S+="}",i+=" if ("+s+" === undefined) { "+p+" = true; } else { ",x&&(S+="}",i+=" "+p+" = "+E+".validateSchema("+s+"); if ("+p+") { ")),y)P.statements?i+=" "+_.validate+" ":i+=" "+p+" = "+_.validate+"; ";else if(g){var T=e.util.copy(e);S="",T.level++;var R="valid"+T.level;T.schema=_.validate,T.schemaPath="";var $=e.compositeRule;e.compositeRule=T.compositeRule=!0;var A=e.validate(T).replace(/validate\.schema/g,b);e.compositeRule=T.compositeRule=$,i+=" "+A}else{(N=N||[]).push(i),i="",i+=" "+b+".call( ",e.opts.passContext?i+="this":i+="self",v||!1===P.schema?i+=" , "+h+" ":i+=" , "+s+" , "+h+" , validate.schema"+e.schemaPath+" ",i+=" , (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var C=n?"data"+(n-1||""):"parentData",D=n?e.dataPathArr[n]:"parentDataProperty",F=i+=" , "+C+" , "+D+" , rootData ) ";i=N.pop(),!1===P.errors?(i+=" "+p+" = ",O&&(i+="await "),i+=F+"; "):i+=O?" var "+(k="customErrors"+o)+" = null; try { "+p+" = await "+F+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+k+" = e.errors; else throw e; } ":" "+k+" = null; "+p+" = "+F+"; "}if(P.modifying&&(i+=" if ("+C+") "+h+" = "+C+"["+D+"];"),i+=""+S,P.valid)u&&(i+=" if (true) { ");else{var N;i+=" if ( ",void 0===P.valid?(i+=" !",i+=g?""+R:""+p):i+=" "+!P.valid+" ",i+=") { ",a=w.keyword,(N=N||[]).push(i),i="",(N=N||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(a||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+w.keyword+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should pass \""+w.keyword+"\" keyword validation' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var H=i;i=N.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+H+"]); ":i+=" validate.errors = ["+H+"]; return false; ":i+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var Z=i;i=N.pop(),y?P.errors?"full"!=P.errors&&(i+=" for (var "+I+"="+f+"; "+I+"<errors; "+I+"++) { var "+j+" = vErrors["+I+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(i+=" "+j+".schema = "+s+"; "+j+".data = "+h+"; "),i+=" } "):!1===P.errors?i+=" "+Z+" ":(i+=" if ("+f+" == errors) { "+Z+" } else { for (var "+I+"="+f+"; "+I+"<errors; "+I+"++) { var "+j+" = vErrors["+I+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(i+=" "+j+".schema = "+s+"; "+j+".data = "+h+"; "),i+=" } } "):g?(i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: '"+(a||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+w.keyword+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should pass \""+w.keyword+"\" keyword validation' "),e.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; ")):!1===P.errors?i+=" "+Z+" ":(i+=" if (Array.isArray("+k+")) { if (vErrors === null) vErrors = "+k+"; else vErrors = vErrors.concat("+k+"); errors = vErrors.length; for (var "+I+"="+f+"; "+I+"<errors; "+I+"++) { var "+j+" = vErrors["+I+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; "+j+'.schemaPath = "'+d+'"; ',e.opts.verbose&&(i+=" "+j+".schema = "+s+"; "+j+".data = "+h+"; "),i+=" } } else { "+Z+" } "),i+=" } ",u&&(i+=" else { ")}return i}},43528:(e,t,r)=>{"use strict";var a=/^[a-z_$][a-z0-9_$-]*$/i,s=r(41021),i=r(96150);e.exports={add:function(e,t){var r=this.RULES;if(r.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!a.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var i=t.type;if(Array.isArray(i))for(var o=0;o<i.length;o++)c(e,i[o],t);else c(e,i,t);var n=t.metaSchema;n&&(t.$data&&this._opts.$data&&(n={anyOf:[n,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(n,!0))}function c(e,t,a){for(var i,o=0;o<r.length;o++){var n=r[o];if(n.type==t){i=n;break}}i||(i={type:t,rules:[]},r.push(i));var c={keyword:e,definition:a,custom:!0,code:s,implements:a.implements};i.rules.push(c),r.custom[e]=c}return r.keywords[e]=r.all[e]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var a=t[r].rules,s=0;s<a.length;s++)if(a[s].keyword==e){a.splice(s,1);break}return this},validate:function e(t,r){e.errors=null;var a=this._validateKeyword=this._validateKeyword||this.compile(i,!0);if(a(t))return!0;if(e.errors=a.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(a.errors));return!1}}},44413:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.schema[t],i=e.errSchemaPath+"/"+t,o=(e.opts.allErrors,e.util.toQuotedString(s));return!0===e.opts.$comment?a+=" console.log("+o+");":"function"==typeof e.opts.$comment&&(a+=" self._opts.$comment("+o+", "+e.util.toQuotedString(i)+", validate.root.schema);"),a}},46079:e=>{"use strict";var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,r){for(var a=0;a<r.length;a++){e=JSON.parse(JSON.stringify(e));var s,i=r[a].split("/"),o=e;for(s=1;s<i.length;s++)o=o[i[s]];for(s=0;s<t.length;s++){var n=t[s],c=o[n];c&&(o[n]={anyOf:[c,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},46137:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),f="";p.level++;var m="valid"+p.level,v=p.baseId,y="prevValid"+s,g="passingSchemas"+s;a+="var "+h+" = errors , "+y+" = false , "+u+" = false , "+g+" = null; ";var _=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=o;if(b)for(var w,E=-1,P=b.length-1;E<P;)w=b[E+=1],(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0||!1===w:e.util.schemaHasRules(w,e.RULES.all))?(p.schema=w,p.schemaPath=n+"["+E+"]",p.errSchemaPath=c+"/"+E,a+=" "+e.validate(p)+" ",p.baseId=v):a+=" var "+m+" = true; ",E&&(a+=" if ("+m+" && "+y+") { "+u+" = false; "+g+" = ["+g+", "+E+"]; } else { ",f+="}"),a+=" if ("+m+") { "+u+" = "+y+" = true; "+g+" = "+E+"; }";return e.compositeRule=p.compositeRule=_,a+=f+"if (!"+u+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+g+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},52004:(e,t,r)=>{"use strict";e.exports={$ref:r(12857),allOf:r(67578),anyOf:r(14547),$comment:r(44413),const:r(59087),contains:r(24235),dependencies:r(90083),enum:r(68307),format:r(95545),if:r(82917),items:r(33728),maximum:r(71346),minimum:r(71346),maxItems:r(80536),minItems:r(80536),maxLength:r(83010),minLength:r(83010),maxProperties:r(96111),minProperties:r(96111),multipleOf:r(58047),not:r(13441),oneOf:r(46137),pattern:r(96774),properties:r(86343),propertyNames:r(9931),required:r(91939),uniqueItems:r(57817),validate:r(25572)}},53084:(e,t,r)=>{"use strict";var a=r(22853),s=r(40985),i=r(28565),o=r(20812),n=r(56039),c=r(36885),l=r(20698),d=r(46079),u=r(9717);e.exports=y,y.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var s=r(t);return!0!==r.$async&&(this.errors=r.errors),s},y.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},y.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i<e.length;i++)this.addSchema(e[i],void 0,r,a);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return P(this,t=s.normalizeId(t||o)),this._schemas[t]=this._addSchema(e,r,a,!0),this},y.prototype.addMetaSchema=function(e,t,r){return this.addSchema(e,t,r,!0),this},y.prototype.validateSchema=function(e,t){var r,a,s=e.$schema;if(void 0!==s&&"string"!=typeof s)throw new Error("$schema must be a string");if(!(s=s||this._opts.defaultMeta||(r=this,a=r._opts.meta,r._opts.defaultMeta="object"==typeof a?r._getId(a)||a:r.getSchema(f)?f:void 0,r._opts.defaultMeta)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var i=this.validate(s,e);if(!i&&t){var o="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(o);this.logger.error(o)}return i},y.prototype.getSchema=function(e){var t=g(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var r=s.schema.call(e,{schema:{}},t);if(r){var i=r.schema,n=r.root,c=r.baseId,l=a.call(e,i,n,void 0,c);return e._fragments[t]=new o({ref:t,fragment:!0,schema:i,root:n,baseId:c,validate:l}),l}}(this,e)}},y.prototype.removeSchema=function(e){if(e instanceof RegExp)return _(this,this._schemas,e),_(this,this._refs,e),this;switch(typeof e){case"undefined":return _(this,this._schemas),_(this,this._refs),this._cache.clear(),this;case"string":var t=g(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var r=this._opts.serialize,a=r?r(e):e;this._cache.del(a);var i=this._getId(e);i&&(i=s.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this},y.prototype.addFormat=function(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this},y.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var r=void 0===(t=t||{}).separator?", ":t.separator,a=void 0===t.dataVar?"data":t.dataVar,s="",i=0;i<e.length;i++){var o=e[i];o&&(s+=a+o.dataPath+" "+o.message+r)}return s.slice(0,-r.length)},y.prototype._addSchema=function(e,t,r,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var i=this._opts.serialize,n=i?i(e):e,c=this._cache.get(n);if(c)return c;a=a||!1!==this._opts.addUsedSchema;var l=s.normalizeId(this._getId(e));l&&a&&P(this,l);var d,u=!1!==this._opts.validateSchema&&!t;u&&!(d=l&&l==s.normalizeId(e.$schema))&&this.validateSchema(e,!0);var h=s.ids.call(this,e),p=new o({id:l,schema:e,localRefs:h,cacheKey:n,meta:r});return"#"!=l[0]&&a&&(this._refs[l]=p),this._cache.put(n,p),u&&d&&this.validateSchema(e,!0),p},y.prototype._compile=function(e,t){if(e.compiling)return e.validate=i,i.schema=e.schema,i.errors=null,i.root=t||i,!0===e.schema.$async&&(i.$async=!0),i;var r,s;e.compiling=!0,e.meta&&(r=this._opts,this._opts=this._metaOpts);try{s=a.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=r)}return e.validate=s,e.refs=s.refs,e.refVal=s.refVal,e.root=s.root,s;function i(){var t=e.validate,r=t.apply(this,arguments);return i.errors=t.errors,r}},y.prototype.compileAsync=r(6069);var h=r(43528);y.prototype.addKeyword=h.add,y.prototype.getKeyword=h.get,y.prototype.removeKeyword=h.remove,y.prototype.validateKeyword=h.validate;var p=r(72916);y.ValidationError=p.Validation,y.MissingRefError=p.MissingRef,y.$dataMetaSchema=d;var f="http://json-schema.org/draft-07/schema",m=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],v=["/properties"];function y(e){if(!(this instanceof y))return new y(e);e=this._opts=u.copy(e)||{},function(e){var t=e._opts.logger;if(!1===t)e.logger={log:S,warn:S,error:S};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=c(e.format),this._cache=e.cache||new i,this._loadingSchemas={},this._compilations=[],this.RULES=l(),this._getId=function(e){switch(e.schemaId){case"auto":return E;case"id":return b;default:return w}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=n),this._metaOpts=function(e){for(var t=u.copy(e._opts),r=0;r<m.length;r++)delete t[m[r]];return t}(this),e.formats&&function(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}(this),e.keywords&&function(e){for(var t in e._opts.keywords){var r=e._opts.keywords[t];e.addKeyword(t,r)}}(this),function(e){var t;if(e._opts.$data&&(t=r(13215),e.addMetaSchema(t,t.$id,!0)),!1!==e._opts.meta){var a=r(12269);e._opts.$data&&(a=d(a,v)),e.addMetaSchema(a,f,!0),e._refs["http://json-schema.org/schema"]=f}}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}(this)}function g(e,t){return t=s.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function _(e,t,r){for(var a in t){var s=t[a];s.meta||r&&!r.test(a)||(e._cache.del(s.cacheKey),delete t[a])}}function b(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function w(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function E(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function P(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function S(){}},56039:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,a="boolean"==typeof t.cycles&&t.cycles,s=t.cmp&&(r=t.cmp,function(e){return function(t,a){var s={key:t,value:e[t]},i={key:a,value:e[a]};return r(s,i)}}),i=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,o;if(Array.isArray(t)){for(o="[",r=0;r<t.length;r++)r&&(o+=","),o+=e(t[r])||"null";return o+"]"}if(null===t)return"null";if(-1!==i.indexOf(t)){if(a)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var n=i.push(t)-1,c=Object.keys(t).sort(s&&s(t));for(o="",r=0;r<c.length;r++){var l=c[r],d=e(t[l]);d&&(o&&(o+=","),o+=JSON.stringify(l)+":"+d)}return i.splice(n,1),"{"+o+"}"}}(e)}},57817:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h="valid"+i,p=e.opts.$data&&n&&n.$data;if(p?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,(n||p)&&!1!==e.opts.uniqueItems){p&&(s+=" var "+h+"; if ("+a+" === false || "+a+" === undefined) "+h+" = true; else if (typeof "+a+" != 'boolean') "+h+" = false; else { "),s+=" var i = "+u+".length , "+h+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,m=Array.isArray(f);if(!f||"object"==f||"array"==f||m&&(f.indexOf("object")>=0||f.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+h+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ";var v="checkDataType"+(m?"s":"");s+=" if ("+e.util[v](f,"item",e.opts.strictNumbers,!0)+") continue; ",m&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",p&&(s+=" } "),s+=" if (!"+h+") { ";var y=y||[];y.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=p?"validate.schema"+c:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var g=s;s=y.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+g+"]); ":s+=" validate.errors = ["+g+"]; return false; ":s+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { ")}else d&&(s+=" if (true) { ");return s}},58047:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&n&&n.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,!h&&"number"!=typeof n)throw new Error(t+" must be number");s+="var division"+i+";if (",h&&(s+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),s+=" (division"+i+" = "+u+" / "+a+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+i+" !== parseInt(division"+i+") ",s+=" ) ",h&&(s+=" ) "),s+=" ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=h?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var f=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s}},59087:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="valid"+s,h=e.opts.$data&&o&&o.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; "),h||(a+=" var schema"+s+" = validate.schema"+n+";"),a+="var "+u+" = equal("+d+", schema"+s+"); if (!"+u+") { ";var p=p||[];p.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValue: schema"+s+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to constant' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var f=a;return a=p.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+f+"]); ":a+=" validate.errors = ["+f+"]; return false; ":a+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",l&&(a+=" else { "),a}},61812:e=>{"use strict";e.exports=function(e){for(var t,r=0,a=e.length,s=0;s<a;)r++,(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<a&&56320==(64512&(t=e.charCodeAt(s)))&&s++;return r}},67371:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var a,s,i;if(Array.isArray(t)){if((a=t.length)!=r.length)return!1;for(s=a;0!==s--;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((a=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=a;0!==s--;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=a;0!==s--;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},67578:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,n=!e.opts.allErrors,c=e.util.copy(e),l="";c.level++;var d="valid"+c.level,u=c.baseId,h=!0,p=s;if(p)for(var f,m=-1,v=p.length-1;m<v;)f=p[m+=1],(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0||!1===f:e.util.schemaHasRules(f,e.RULES.all))&&(h=!1,c.schema=f,c.schemaPath=i+"["+m+"]",c.errSchemaPath=o+"/"+m,a+=" "+e.validate(c)+" ",c.baseId=u,n&&(a+=" if ("+d+") { ",l+="}"));return n&&(a+=h?" if (true) { ":" "+l.slice(0,-1)+" "),a}},68307:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="valid"+s,h=e.opts.$data&&o&&o.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var p="i"+s,f="schema"+s;h||(a+=" var "+f+" = validate.schema"+n+";"),a+="var "+u+";",h&&(a+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),a+=u+" = false;for (var "+p+"=0; "+p+"<"+f+".length; "+p+"++) if (equal("+d+", "+f+"["+p+"])) { "+u+" = true; break; }",h&&(a+=" } "),a+=" if (!"+u+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+s+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",l&&(a+=" else { "),a}},71346:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&n&&n.$data;h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n;var p="maximum"==t,f=p?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[f],v=e.opts.$data&&m&&m.$data,y=p?"<":">",g=p?">":"<",_=void 0;if(!h&&"number"!=typeof n&&void 0!==n)throw new Error(t+" must be number");if(!v&&void 0!==m&&"number"!=typeof m&&"boolean"!=typeof m)throw new Error(f+" must be number or boolean");if(v){var b,w=e.util.getData(m.$data,o,e.dataPathArr),E="exclusive"+i,P="exclType"+i,S="exclIsNumber"+i,x="' + "+(I="op"+i)+" + '";s+=" var schemaExcl"+i+" = "+w+"; ",s+=" var "+E+"; var "+P+" = typeof "+(w="schemaExcl"+i)+"; if ("+P+" != 'boolean' && "+P+" != 'undefined' && "+P+" != 'number') { ",_=f,(b=b||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var k=s;s=b.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+k+"]); ":s+=" validate.errors = ["+k+"]; return false; ":s+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+P+" == 'number' ? ( ("+E+" = "+a+" === undefined || "+w+" "+y+"= "+a+") ? "+u+" "+g+"= "+w+" : "+u+" "+g+" "+a+" ) : ( ("+E+" = "+w+" === true) ? "+u+" "+g+"= "+a+" : "+u+" "+g+" "+a+" ) || "+u+" !== "+u+") { var op"+i+" = "+E+" ? '"+y+"' : '"+y+"='; ",void 0===n&&(_=f,l=e.errSchemaPath+"/"+f,a=w,h=v)}else if(x=y,(S="number"==typeof m)&&h){var I="'"+x+"'";s+=" if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ( "+a+" === undefined || "+m+" "+y+"= "+a+" ? "+u+" "+g+"= "+m+" : "+u+" "+g+" "+a+" ) || "+u+" !== "+u+") { "}else S&&void 0===n?(E=!0,_=f,l=e.errSchemaPath+"/"+f,a=m,g+="="):(S&&(a=Math[p?"min":"max"](m,n)),m===(!S||a)?(E=!0,_=f,l=e.errSchemaPath+"/"+f,g+="="):(E=!1,x+="=")),I="'"+x+"'",s+=" if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+u+" "+g+" "+a+" || "+u+" !== "+u+") { ";return _=_||t,(b=b||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+I+", limit: "+a+", exclusive: "+E+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+x+" ",s+=h?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ",k=s,s=b.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+k+"]); ":s+=" validate.errors = ["+k+"]; return false; ":s+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { "),s}},72916:(e,t,r)=>{"use strict";var a=r(40985);function s(e,t,r){this.message=r||s.message(e,t),this.missingRef=a.url(e,t),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function i(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}e.exports={Validation:i(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:i(s)},s.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},80536:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&n&&n.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,!h&&"number"!=typeof n)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+u+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var p=t,f=f||[];f.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==t?"more":"fewer",s+=" than ",s+=h?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=f.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s}},82917:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var f="valid"+p.level,m=e.schema.then,v=e.schema.else,y=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),g=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:e.util.schemaHasRules(v,e.RULES.all)),_=p.baseId;if(y||g){var b;p.createErrors=!1,p.schema=o,p.schemaPath=n,p.errSchemaPath=c,a+=" var "+h+" = errors; var "+u+" = true; ";var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,a+=" "+e.validate(p)+" ",p.baseId=_,p.createErrors=!0,a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=w,y?(a+=" if ("+f+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(p)+" ",p.baseId=_,a+=" "+u+" = "+f+"; ",y&&g?a+=" var "+(b="ifClause"+s)+" = 'then'; ":b="'then'",a+=" } ",g&&(a+=" else { ")):a+=" if (!"+f+") { ",g&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(p)+" ",p.baseId=_,a+=" "+u+" = "+f+"; ",y&&g?a+=" var "+(b="ifClause"+s)+" = 'else'; ":b="'else'",a+=" } "),a+=" if (!"+u+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+b+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+b+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",l&&(a+=" else { ")}else l&&(a+=" if (true) { ");return a}},83010:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&n&&n.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,!h&&"number"!=typeof n)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?s+=" "+u+".length ":s+=" ucs2length("+u+") ",s+=" "+p+" "+a+") { ";var f=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==t?"longer":"shorter",s+=" than ",s+=h?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s}},86343:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var f="valid"+h.level,m="key"+s,v="idx"+s,y=h.dataLevel=e.dataLevel+1,g="data"+y,_="dataProperties"+s,b=Object.keys(o||{}).filter(A),w=e.schema.patternProperties||{},E=Object.keys(w).filter(A),P=e.schema.additionalProperties,S=b.length||E.length,x=!1===P,k="object"==typeof P&&Object.keys(P).length,I=e.opts.removeAdditional,j=x||k||I,O=e.opts.ownProperties,T=e.baseId,R=e.schema.required;if(R&&(!e.opts.$data||!R.$data)&&R.length<e.opts.loopRequired)var $=e.util.toHash(R);function A(e){return"__proto__"!==e}if(a+="var "+u+" = errors;var "+f+" = true;",O&&(a+=" var "+_+" = undefined;"),j){if(a+=O?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+d+") { ",S){if(a+=" var isAdditional"+s+" = !(false ",b.length)if(b.length>8)a+=" || validate.schema"+n+".hasOwnProperty("+m+") ";else{var C=b;if(C)for(var D=-1,F=C.length-1;D<F;)J=C[D+=1],a+=" || "+m+" == "+e.util.toQuotedString(J)+" "}if(E.length){var N=E;if(N)for(var H=-1,Z=N.length-1;H<Z;)ie=N[H+=1],a+=" || "+e.usePattern(ie)+".test("+m+") "}a+=" ); if (isAdditional"+s+") { "}if("all"==I)a+=" delete "+d+"["+m+"]; ";else{var q=e.errorPath,L="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),x)if(I)a+=" delete "+d+"["+m+"]; ";else{a+=" "+f+" = false; ";var M=c;c=e.errSchemaPath+"/additionalProperties",(re=re||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+L+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is an invalid additional property":a+="should NOT have additional properties",a+="' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var K=a;a=re.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+K+"]); ":a+=" validate.errors = ["+K+"]; return false; ":a+=" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=M,l&&(a+=" break; ")}else if(k)if("failing"==I){a+=" var "+u+" = errors; ";var z=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=P,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var V=d+"["+m+"]";h.dataPathArr[y]=m;var U=e.validate(h);h.baseId=T,e.util.varOccurences(U,g)<2?a+=" "+e.util.varReplace(U,g,V)+" ":a+=" var "+g+" = "+V+"; "+U+" ",a+=" if (!"+f+") { errors = "+u+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+d+"["+m+"]; } ",e.compositeRule=h.compositeRule=z}else h.schema=P,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),V=d+"["+m+"]",h.dataPathArr[y]=m,U=e.validate(h),h.baseId=T,e.util.varOccurences(U,g)<2?a+=" "+e.util.varReplace(U,g,V)+" ":a+=" var "+g+" = "+V+"; "+U+" ",l&&(a+=" if (!"+f+") break; ");e.errorPath=q}S&&(a+=" } "),a+=" } ",l&&(a+=" if ("+f+") { ",p+="}")}var Q=e.opts.useDefaults&&!e.compositeRule;if(b.length){var B=b;if(B)for(var J,W=-1,G=B.length-1;W<G;){var Y=o[J=B[W+=1]];if(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0||!1===Y:e.util.schemaHasRules(Y,e.RULES.all)){var X=e.util.getProperty(J),ee=(V=d+X,Q&&void 0!==Y.default);if(h.schema=Y,h.schemaPath=n+X,h.errSchemaPath=c+"/"+e.util.escapeFragment(J),h.errorPath=e.util.getPath(e.errorPath,J,e.opts.jsonPointers),h.dataPathArr[y]=e.util.toQuotedString(J),U=e.validate(h),h.baseId=T,e.util.varOccurences(U,g)<2){U=e.util.varReplace(U,g,V);var te=V}else te=g,a+=" var "+g+" = "+V+"; ";if(ee)a+=" "+U+" ";else{if($&&$[J]){a+=" if ( "+te+" === undefined ",O&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(J)+"') "),a+=") { "+f+" = false; ",q=e.errorPath,M=c;var re,ae=e.util.escapeQuotes(J);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(q,J,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(re=re||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+ae+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+ae+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",K=a,a=re.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+K+"]); ":a+=" validate.errors = ["+K+"]; return false; ":a+=" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=M,e.errorPath=q,a+=" } else { "}else l?(a+=" if ( "+te+" === undefined ",O&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(J)+"') "),a+=") { "+f+" = true; } else { "):(a+=" if ("+te+" !== undefined ",O&&(a+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(J)+"') "),a+=" ) { ");a+=" "+U+" } "}}l&&(a+=" if ("+f+") { ",p+="}")}}if(E.length){var se=E;if(se)for(var ie,oe=-1,ne=se.length-1;oe<ne;)Y=w[ie=se[oe+=1]],(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0||!1===Y:e.util.schemaHasRules(Y,e.RULES.all))&&(h.schema=Y,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ie),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ie),a+=O?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+d+") { ",a+=" if ("+e.usePattern(ie)+".test("+m+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),V=d+"["+m+"]",h.dataPathArr[y]=m,U=e.validate(h),h.baseId=T,e.util.varOccurences(U,g)<2?a+=" "+e.util.varReplace(U,g,V)+" ":a+=" var "+g+" = "+V+"; "+U+" ",l&&(a+=" if (!"+f+") break; "),a+=" } ",l&&(a+=" else "+f+" = true; "),a+=" } ",l&&(a+=" if ("+f+") { ",p+="}"))}return l&&(a+=" "+p+" if ("+u+" == errors) {"),a}},90083:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var f="valid"+h.level,m={},v={},y=e.opts.ownProperties;for(w in o)if("__proto__"!=w){var g=o[w],_=Array.isArray(g)?v:m;_[w]=g}a+="var "+u+" = errors;";var b=e.errorPath;for(var w in a+="var missing"+s+";",v)if((_=v[w]).length){if(a+=" if ( "+d+e.util.getProperty(w)+" !== undefined ",y&&(a+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),l){a+=" && ( ";var E=_;if(E)for(var P=-1,S=E.length-1;P<S;)T=E[P+=1],P&&(a+=" || "),a+=" ( ( "+(C=d+(A=e.util.getProperty(T)))+" === undefined ",y&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(T)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?T:A)+") ) ";a+=")) { ";var x="missing"+s,k="' + "+x+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,x,!0):b+" + "+x);var I=I||[];I.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(w)+"', missingProperty: '"+k+"', depsCount: "+_.length+", deps: '"+e.util.escapeQuotes(1==_.length?_[0]:_.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",1==_.length?a+="property "+e.util.escapeQuotes(_[0]):a+="properties "+e.util.escapeQuotes(_.join(", ")),a+=" when property "+e.util.escapeQuotes(w)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var j=a;a=I.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+j+"]); ":a+=" validate.errors = ["+j+"]; return false; ":a+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{a+=" ) { ";var O=_;if(O)for(var T,R=-1,$=O.length-1;R<$;){T=O[R+=1];var A=e.util.getProperty(T),C=(k=e.util.escapeQuotes(T),d+A);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,T,e.opts.jsonPointers)),a+=" if ( "+C+" === undefined ",y&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(T)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(w)+"', missingProperty: '"+k+"', depsCount: "+_.length+", deps: '"+e.util.escapeQuotes(1==_.length?_[0]:_.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",1==_.length?a+="property "+e.util.escapeQuotes(_[0]):a+="properties "+e.util.escapeQuotes(_.join(", ")),a+=" when property "+e.util.escapeQuotes(w)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}a+=" } ",l&&(p+="}",a+=" else { ")}e.errorPath=b;var D=h.baseId;for(var w in m)g=m[w],(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0||!1===g:e.util.schemaHasRules(g,e.RULES.all))&&(a+=" "+f+" = true; if ( "+d+e.util.getProperty(w)+" !== undefined ",y&&(a+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),a+=") { ",h.schema=g,h.schemaPath=n+e.util.getProperty(w),h.errSchemaPath=c+"/"+e.util.escapeFragment(w),a+=" "+e.validate(h)+" ",h.baseId=D,a+=" } ",l&&(a+=" if ("+f+") { ",p+="}"));return l&&(a+=" "+p+" if ("+u+" == errors) {"),a}},91939:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),u="valid"+s,h=e.opts.$data&&o&&o.$data;h&&(a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var p="schema"+s;if(!h)if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var f=[],m=o;if(m)for(var v,y=-1,g=m.length-1;y<g;){v=m[y+=1];var _=e.schema.properties[v];_&&(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:e.util.schemaHasRules(_,e.RULES.all))||(f[f.length]=v)}}else f=o;if(h||f.length){var b=e.errorPath,w=h||f.length>=e.opts.loopRequired,E=e.opts.ownProperties;if(l)if(a+=" var missing"+s+"; ",w){h||(a+=" var "+p+" = validate.schema"+n+"; ");var P="' + "+(O="schema"+s+"["+(I="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,O,e.opts.jsonPointers)),a+=" var "+u+" = true; ",h&&(a+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),a+=" for (var "+I+" = 0; "+I+" < "+p+".length; "+I+"++) { "+u+" = "+d+"["+p+"["+I+"]] !== undefined ",E&&(a+=" && Object.prototype.hasOwnProperty.call("+d+", "+p+"["+I+"]) "),a+="; if (!"+u+") break; } ",h&&(a+=" } "),a+=" if (!"+u+") { ",(x=x||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var S=a;a=x.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+S+"]); ":a+=" validate.errors = ["+S+"]; return false; ":a+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var x,k=f;if(k)for(var I=-1,j=k.length-1;I<j;)R=k[I+=1],I&&(a+=" || "),a+=" ( ( "+(D=d+(C=e.util.getProperty(R)))+" === undefined ",E&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(R)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?R:C)+") ) ";a+=") { ",P="' + "+(O="missing"+s)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,O,!0):b+" + "+O),(x=x||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",S=a,a=x.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+S+"]); ":a+=" validate.errors = ["+S+"]; return false; ":a+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else if(w){var O;h||(a+=" var "+p+" = validate.schema"+n+"; "),P="' + "+(O="schema"+s+"["+(I="i"+s)+"]")+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,O,e.opts.jsonPointers)),h&&(a+=" if ("+p+" && !Array.isArray("+p+")) { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),a+=" for (var "+I+" = 0; "+I+" < "+p+".length; "+I+"++) { if ("+d+"["+p+"["+I+"]] === undefined ",E&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", "+p+"["+I+"]) "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(a+=" } ")}else{var T=f;if(T)for(var R,$=-1,A=T.length-1;$<A;){R=T[$+=1];var C=e.util.getProperty(R),D=(P=e.util.escapeQuotes(R),d+C);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,R,e.opts.jsonPointers)),a+=" if ( "+D+" === undefined ",E&&(a+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(R)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+P+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=b}else l&&(a+=" if (true) {");return a}},95545:e=>{"use strict";e.exports=function(e,t,r){var a=" ",s=e.level,i=e.dataLevel,o=e.schema[t],n=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||"");if(!1===e.opts.format)return l&&(a+=" if (true) { "),a;var u,h=e.opts.$data&&o&&o.$data;h?(a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",u="schema"+s):u=o;var p=e.opts.unknownFormats,f=Array.isArray(p);if(h)a+=" var "+(m="format"+s)+" = formats["+u+"]; var "+(v="isObject"+s)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+s)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+s+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",h&&(a+=" ("+u+" !== undefined && typeof "+u+" != 'string') || "),a+=" (","ignore"!=p&&(a+=" ("+u+" && !"+m+" ",f&&(a+=" && self._opts.unknownFormats.indexOf("+u+") == -1 "),a+=") || "),a+=" ("+m+" && "+y+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+s+" ? await "+m+"("+d+") : "+m+"("+d+")) ":a+=" "+m+"("+d+") ",a+=" : "+m+".test("+d+"))))) {";else{var m;if(!(m=e.formats[o])){if("ignore"==p)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(a+=" if (true) { "),a;if(f&&p.indexOf(o)>=0)return l&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var g=!0===m.async;m=m.validate}if(y!=r)return l&&(a+=" if (true) { "),a;if(g){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(_="formats"+e.util.getProperty(o)+".validate")+"("+d+"))) { "}else{a+=" if (! ";var _="formats"+e.util.getProperty(o);v&&(_+=".validate"),a+="function"==typeof m?" "+_+"("+d+") ":" "+_+".test("+d+") ",a+=") { "}}var b=b||[];b.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",a+=h?""+u:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=h?"' + "+u+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+n:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var w=a;return a=b.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+w+"]); ":a+=" validate.errors = ["+w+"]; return false; ":a+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l&&(a+=" else { "),a}},96111:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&n&&n.$data;if(h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,!h&&"number"!=typeof n)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" Object.keys("+u+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var p=t,f=f||[];f.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==t?"more":"fewer",s+=" than ",s+=h?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=f.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s}},96150:(e,t,r)=>{"use strict";var a=r(12269);e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:a.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:a.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"}]}}}},96774:e=>{"use strict";e.exports=function(e,t,r){var a,s=" ",i=e.level,o=e.dataLevel,n=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&n&&n.$data;h?(s+=" var schema"+i+" = "+e.util.getData(n.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=n,s+="if ( ",h&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),s+=" !"+(h?"(new RegExp("+a+"))":e.usePattern(n))+".test("+u+") ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ",s+=h?""+a:""+e.util.toQuotedString(n),s+=" } ",!1!==e.opts.messages&&(s+=" , message: 'should match pattern \"",s+=h?"' + "+a+" + '":""+e.util.escapeQuotes(n),s+="\"' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+e.util.toQuotedString(n),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var f=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s}}},t={};function r(a){var s=t[a];if(void 0!==s)return s.exports;var i=t[a]={exports:{}};return e[a].call(i.exports,i,i.exports,r),i.exports}return(()=>{"use strict";const e=require("node:process");var t,a;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),a={};for(const e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(t||(t={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(a||(a={}));const s=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=t.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class n extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){const r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,t.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}n.create=e=>new n(e);const c=(e,r)=>{let a;switch(e.code){case o.invalid_type:a=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,t.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:a=`Unrecognized key(s) in object: ${t.joinValues(e.keys,", ")}`;break;case o.invalid_union:a="Invalid input";break;case o.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${t.joinValues(e.options)}`;break;case o.invalid_enum_value:a=`Invalid enum value. Expected ${t.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:a="Invalid function arguments";break;case o.invalid_return_type:a="Invalid function return type";break;case o.invalid_date:a="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:t.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:a="Invalid input";break;case o.invalid_intersection_types:a="Intersection results could not be merged";break;case o.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:a="Number must be finite";break;default:a=r.defaultError,t.assertNever(e)}return{message:a}};let l=c;function d(){return l}const u=e=>{const{data:t,path:r,errorMaps:a,issueData:s}=e,i=[...r,...s.path||[]],o={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let n="";const c=a.filter(e=>!!e).slice().reverse();for(const e of c)n=e(o,{data:t,defaultError:n}).message;return{...s,path:i,message:n}};function h(e,t){const r=d(),a=u({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===c?void 0:c].filter(e=>!!e)});e.common.issues.push(a)}class p{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if("aborted"===a.status)return f;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,a=await e.value;r.push({key:t,value:a})}return p.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:t,value:s}=a;if("aborted"===t.status)return f;if("aborted"===s.status)return f;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!a.alwaysSet||(r[t.value]=s.value)}return{status:e.value,value:r}}}const f=Object.freeze({status:"aborted"}),m=e=>({status:"dirty",value:e}),v=e=>({status:"valid",value:e}),y=e=>"aborted"===e.status,g=e=>"dirty"===e.status,_=e=>"valid"===e.status,b=e=>"undefined"!=typeof Promise&&e instanceof Promise;function w(e,t,r,a){if("a"===r&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)}function E(e,t,r,a,s){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?s.call(e,r):s?s.value=r:t.set(e,r),r}var P,S,x;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(P||(P={}));class k{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const I=(e,t)=>{if(_(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new n(e.common.issues);return this._error=t,this._error}}};function j(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{var i,o;const{message:n}=e;return"invalid_enum_value"===t.code?{message:null!=n?n:s.defaultError}:void 0===s.data?{message:null!==(i=null!=n?n:a)&&void 0!==i?i:s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:null!==(o=null!=n?n:r)&&void 0!==o?o:s.defaultError}},description:s}}class O{get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new p,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(b(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},s=this._parseSync({data:e,path:a.path,parent:a});return I(a,s)}"~validate"(e){var t,r;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return _(t)?{value:t.value}:{issues:a.common.issues}}catch(e){(null===(r=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(e=>_(e)?{value:e.value}:{issues:a.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(b(a)?a:Promise.resolve(a));return I(r,s)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,a)=>{const s=e(t),i=()=>a.addIssue({code:o.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then(e=>!!e||(i(),!1)):!!s||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new Re({schema:this,typeName:ze.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:e=>this["~validate"](e)}}optional(){return $e.create(this,this._def)}nullable(){return Ae.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return he.create(this)}promise(){return Te.create(this,this._def)}or(e){return me.create([this,e],this._def)}and(e){return _e.create(this,e,this._def)}transform(e){return new Re({...j(this._def),schema:this,typeName:ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ce({...j(this._def),innerType:this,defaultValue:t,typeName:ze.ZodDefault})}brand(){return new He({typeName:ze.ZodBranded,type:this,...j(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new De({...j(this._def),innerType:this,catchValue:t,typeName:ze.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ze.create(this,e)}readonly(){return qe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const T=/^c[^\s-]{8,}$/i,R=/^[0-9a-z]+$/,$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,A=/^[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,C=/^[a-z0-9_-]{21}$/i,D=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,F=/^[-+]?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)?)??$/,N=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let H;const Z=/^(?:(?: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])$/,q=/^(?:(?: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])$/,L=/^(([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]))$/,M=/^(([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])$/,K=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,V="((\\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])))",U=new RegExp(`^${V}$`);function Q(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function B(e){return new RegExp(`^${Q(e)}$`)}function J(e){let t=`${V}T${Q(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function W(e,t){return!("v4"!==t&&t||!Z.test(e))||!("v6"!==t&&t||!L.test(e))}function G(e,t){if(!D.test(e))return!1;try{const[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));return!("object"!=typeof s||null===s||!s.typ||!s.alg||t&&s.alg!==t)}catch(e){return!1}}function Y(e,t){return!("v4"!==t&&t||!q.test(e))||!("v6"!==t&&t||!M.test(e))}class X extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),f}const r=new p;let a;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if("max"===s.kind)e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if("length"===s.kind){const t=e.data.length>s.value,i=e.data.length<s.value;(t||i)&&(a=this._getOrReturnCtx(e,a),t?h(a,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):i&&h(a,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if("email"===s.kind)N.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"email",code:o.invalid_string,message:s.message}),r.dirty());else if("emoji"===s.kind)H||(H=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),H.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"emoji",code:o.invalid_string,message:s.message}),r.dirty());else if("uuid"===s.kind)A.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"uuid",code:o.invalid_string,message:s.message}),r.dirty());else if("nanoid"===s.kind)C.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"nanoid",code:o.invalid_string,message:s.message}),r.dirty());else if("cuid"===s.kind)T.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid",code:o.invalid_string,message:s.message}),r.dirty());else if("cuid2"===s.kind)R.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid2",code:o.invalid_string,message:s.message}),r.dirty());else if("ulid"===s.kind)$.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ulid",code:o.invalid_string,message:s.message}),r.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(t){a=this._getOrReturnCtx(e,a),h(a,{validation:"url",code:o.invalid_string,message:s.message}),r.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"regex",code:o.invalid_string,message:s.message}),r.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):"datetime"===s.kind?J(s).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:"datetime",message:s.message}),r.dirty()):"date"===s.kind?U.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:"date",message:s.message}),r.dirty()):"time"===s.kind?B(s).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:o.invalid_string,validation:"time",message:s.message}),r.dirty()):"duration"===s.kind?F.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"duration",code:o.invalid_string,message:s.message}),r.dirty()):"ip"===s.kind?W(e.data,s.version)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ip",code:o.invalid_string,message:s.message}),r.dirty()):"jwt"===s.kind?G(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"jwt",code:o.invalid_string,message:s.message}),r.dirty()):"cidr"===s.kind?Y(e.data,s.version)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cidr",code:o.invalid_string,message:s.message}),r.dirty()):"base64"===s.kind?K.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"base64",code:o.invalid_string,message:s.message}),r.dirty()):"base64url"===s.kind?z.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"base64url",code:o.invalid_string,message:s.message}),r.dirty()):t.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:o.invalid_string,...P.errToObj(r)})}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...P.errToObj(e)})}url(e){return this._addCheck({kind:"url",...P.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...P.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...P.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...P.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...P.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...P.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...P.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...P.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...P.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...P.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...P.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...P.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...P.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...P.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...P.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...P.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...P.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...P.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...P.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...P.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...P.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...P.errToObj(t)})}nonempty(e){return this.min(1,P.errToObj(e))}trim(){return new X({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new X({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new X({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ee(e,t){const r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}X.create=e=>{var t;return new X({checks:[],typeName:ze.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...j(e)})};class te extends O{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)!==s.number){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),f}let r;const a=new p;for(const s of this._def.checks)"int"===s.kind?t.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):"multipleOf"===s.kind?0!==ee(e.data,s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.not_finite,message:s.message}),a.dirty()):t.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,P.toString(t))}gt(e,t){return this.setLimit("min",e,!1,P.toString(t))}lte(e,t){return this.setLimit("max",e,!0,P.toString(t))}lt(e,t){return this.setLimit("max",e,!1,P.toString(t))}setLimit(e,t,r,a){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:P.toString(a)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:P.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:P.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:P.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:P.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:P.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&t.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}te.create=e=>new te({checks:[],typeName:ze.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});class re extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==s.bigint)return this._getInvalidInput(e);let r;const a=new p;for(const s of this._def.checks)"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):t.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),f}gte(e,t){return this.setLimit("min",e,!0,P.toString(t))}gt(e,t){return this.setLimit("min",e,!1,P.toString(t))}lte(e,t){return this.setLimit("max",e,!0,P.toString(t))}lt(e,t){return this.setLimit("max",e,!1,P.toString(t))}setLimit(e,t,r,a){return new re({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:P.toString(a)}]})}_addCheck(e){return new re({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:P.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:P.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:P.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:P.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:P.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}re.create=e=>{var t;return new re({checks:[],typeName:ze.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...j(e)})};class ae extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),f}return v(e.data)}}ae.create=e=>new ae({typeName:ze.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});class se extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),f}if(isNaN(e.data.getTime()))return h(this._getOrReturnCtx(e),{code:o.invalid_date}),f;const r=new p;let a;for(const s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:o.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):t.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:P.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:P.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}se.create=e=>new se({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ze.ZodDate,...j(e)});class ie extends O{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),f}return v(e.data)}}ie.create=e=>new ie({typeName:ze.ZodSymbol,...j(e)});class oe extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),f}return v(e.data)}}oe.create=e=>new oe({typeName:ze.ZodUndefined,...j(e)});class ne extends O{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),f}return v(e.data)}}ne.create=e=>new ne({typeName:ze.ZodNull,...j(e)});class ce extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return v(e.data)}}ce.create=e=>new ce({typeName:ze.ZodAny,...j(e)});class le extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return v(e.data)}}le.create=e=>new le({typeName:ze.ZodUnknown,...j(e)});class de extends O{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),f}}de.create=e=>new de({typeName:ze.ZodNever,...j(e)});class ue extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),f}return v(e.data)}}ue.create=e=>new ue({typeName:ze.ZodVoid,...j(e)});class he extends O{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==s.array)return h(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),f;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&(h(t,{code:e?o.too_big:o.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(h(t,{code:o.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(h(t,{code:o.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new k(t,e,t.path,r)))).then(e=>p.mergeArray(r,e));const i=[...t.data].map((e,r)=>a.type._parseSync(new k(t,e,t.path,r)));return p.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new he({...this._def,minLength:{value:e,message:P.toString(t)}})}max(e,t){return new he({...this._def,maxLength:{value:e,message:P.toString(t)}})}length(e,t){return new he({...this._def,exactLength:{value:e,message:P.toString(t)}})}nonempty(e){return this.min(1,e)}}function pe(e){if(e instanceof fe){const t={};for(const r in e.shape){const a=e.shape[r];t[r]=$e.create(pe(a))}return new fe({...e._def,shape:()=>t})}return e instanceof he?new he({...e._def,type:pe(e.element)}):e instanceof $e?$e.create(pe(e.unwrap())):e instanceof Ae?Ae.create(pe(e.unwrap())):e instanceof be?be.create(e.items.map(e=>pe(e))):e}he.create=(e,t)=>new he({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ze.ZodArray,...j(t)});class fe extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),r=t.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f}const{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),n=[];if(!(this._def.catchall instanceof de&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||n.push(e);const c=[];for(const e of i){const t=a[e],s=r.data[e];c.push({key:{status:"valid",value:e},value:t._parse(new k(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof de){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of n)c.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)n.length>0&&(h(r,{code:o.unrecognized_keys,keys:n}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of n){const a=r.data[t];c.push({key:{status:"valid",value:t},value:e._parse(new k(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of c){const r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>p.mergeObjectSync(t,e)):p.mergeObjectSync(t,c)}get shape(){return this._def.shape()}strict(e){return P.errToObj,new fe({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var a,s,i,o;const n=null!==(i=null===(s=(a=this._def).errorMap)||void 0===s?void 0:s.call(a,t,r).message)&&void 0!==i?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=P.errToObj(e).message)&&void 0!==o?o:n}:{message:n}}}:{}})}strip(){return new fe({...this._def,unknownKeys:"strip"})}passthrough(){return new fe({...this._def,unknownKeys:"passthrough"})}extend(e){return new fe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new fe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ze.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new fe({...this._def,catchall:e})}pick(e){const r={};return t.objectKeys(e).forEach(t=>{e[t]&&this.shape[t]&&(r[t]=this.shape[t])}),new fe({...this._def,shape:()=>r})}omit(e){const r={};return t.objectKeys(this.shape).forEach(t=>{e[t]||(r[t]=this.shape[t])}),new fe({...this._def,shape:()=>r})}deepPartial(){return pe(this)}partial(e){const r={};return t.objectKeys(this.shape).forEach(t=>{const a=this.shape[t];e&&!e[t]?r[t]=a:r[t]=a.optional()}),new fe({...this._def,shape:()=>r})}required(e){const r={};return t.objectKeys(this.shape).forEach(t=>{if(e&&!e[t])r[t]=this.shape[t];else{let e=this.shape[t];for(;e instanceof $e;)e=e._def.innerType;r[t]=e}}),new fe({...this._def,shape:()=>r})}keyof(){return Ie(t.objectKeys(this.shape))}}fe.create=(e,t)=>new fe({shape:()=>e,unknownKeys:"strip",catchall:de.create(),typeName:ze.ZodObject,...j(t)}),fe.strictCreate=(e,t)=>new fe({shape:()=>e,unknownKeys:"strict",catchall:de.create(),typeName:ze.ZodObject,...j(t)}),fe.lazycreate=(e,t)=>new fe({shape:e,unknownKeys:"strip",catchall:de.create(),typeName:ze.ZodObject,...j(t)});class me extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new n(e.ctx.common.issues));return h(t,{code:o.invalid_union,unionErrors:r}),f});{let e;const a=[];for(const s of r){const r={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=a.map(e=>new n(e));return h(t,{code:o.invalid_union,unionErrors:s}),f}}get options(){return this._def.options}}me.create=(e,t)=>new me({options:e,typeName:ze.ZodUnion,...j(t)});const ve=e=>e instanceof xe?ve(e.schema):e instanceof Re?ve(e.innerType()):e instanceof ke?[e.value]:e instanceof je?e.options:e instanceof Oe?t.objectValues(e.enum):e instanceof Ce?ve(e._def.innerType):e instanceof oe?[void 0]:e instanceof ne?[null]:e instanceof $e?[void 0,...ve(e.unwrap())]:e instanceof Ae?[null,...ve(e.unwrap())]:e instanceof He||e instanceof qe?ve(e.unwrap()):e instanceof De?ve(e._def.innerType):[];class ye extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f;const r=this.discriminator,a=t.data[r],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const r of t){const t=ve(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,r)}}return new ye({typeName:ze.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...j(r)})}}function ge(e,r){const a=i(e),o=i(r);if(e===r)return{valid:!0,data:e};if(a===s.object&&o===s.object){const a=t.objectKeys(r),s=t.objectKeys(e).filter(e=>-1!==a.indexOf(e)),i={...e,...r};for(const t of s){const a=ge(e[t],r[t]);if(!a.valid)return{valid:!1};i[t]=a.data}return{valid:!0,data:i}}if(a===s.array&&o===s.array){if(e.length!==r.length)return{valid:!1};const t=[];for(let a=0;a<e.length;a++){const s=ge(e[a],r[a]);if(!s.valid)return{valid:!1};t.push(s.data)}return{valid:!0,data:t}}return a===s.date&&o===s.date&&+e===+r?{valid:!0,data:e}:{valid:!1}}class _e extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if(y(e)||y(a))return f;const s=ge(e.value,a.value);return s.valid?((g(e)||g(a))&&t.dirty(),{status:t.value,value:s.data}):(h(r,{code:o.invalid_intersection_types}),f)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_e.create=(e,t,r)=>new _e({left:e,right:t,typeName:ze.ZodIntersection,...j(r)});class be extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.array)return h(r,{code:o.invalid_type,expected:s.array,received:r.parsedType}),f;if(r.data.length<this._def.items.length)return h(r,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;!this._def.rest&&r.data.length>this._def.items.length&&(h(r,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new k(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>p.mergeArray(t,e)):p.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new be({...this._def,rest:e})}}be.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new be({items:e,typeName:ze.ZodTuple,rest:null,...j(t)})};class we extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.object)return h(r,{code:o.invalid_type,expected:s.object,received:r.parsedType}),f;const a=[],i=this._def.keyType,n=this._def.valueType;for(const e in r.data)a.push({key:i._parse(new k(r,e,r.path,e)),value:n._parse(new k(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?p.mergeObjectAsync(t,a):p.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new we(t instanceof O?{keyType:e,valueType:t,typeName:ze.ZodRecord,...j(r)}:{keyType:X.create(),valueType:e,typeName:ze.ZodRecord,...j(t)})}}class Ee extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.map)return h(r,{code:o.invalid_type,expected:s.map,received:r.parsedType}),f;const a=this._def.keyType,i=this._def.valueType,n=[...r.data.entries()].map(([e,t],s)=>({key:a._parse(new k(r,e,r.path,[s,"key"])),value:i._parse(new k(r,t,r.path,[s,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of n){const a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return f;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of n){const a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return f;"dirty"!==a.status&&"dirty"!==s.status||t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}Ee.create=(e,t,r)=>new Ee({valueType:t,keyType:e,typeName:ze.ZodMap,...j(r)});class Pe extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.set)return h(r,{code:o.invalid_type,expected:s.set,received:r.parsedType}),f;const a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(h(r,{code:o.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(h(r,{code:o.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const i=this._def.valueType;function n(e){const r=new Set;for(const a of e){if("aborted"===a.status)return f;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}const c=[...r.data.values()].map((e,t)=>i._parse(new k(r,e,r.path,t)));return r.common.async?Promise.all(c).then(e=>n(e)):n(c)}min(e,t){return new Pe({...this._def,minSize:{value:e,message:P.toString(t)}})}max(e,t){return new Pe({...this._def,maxSize:{value:e,message:P.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Pe.create=(e,t)=>new Pe({valueType:e,minSize:null,maxSize:null,typeName:ze.ZodSet,...j(t)});class Se extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return h(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),f;function r(e,r){return u({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),c].filter(e=>!!e),issueData:{code:o.invalid_arguments,argumentsError:r}})}function a(e,r){return u({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),c].filter(e=>!!e),issueData:{code:o.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof Te){const e=this;return v(async function(...t){const s=new n([]),o=await e._def.args.parseAsync(t,i).catch(e=>{throw s.addIssue(r(t,e)),s}),c=await Reflect.apply(l,this,o);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw s.addIssue(a(c,e)),s})})}{const e=this;return v(function(...t){const s=e._def.args.safeParse(t,i);if(!s.success)throw new n([r(t,s.error)]);const o=Reflect.apply(l,this,s.data),c=e._def.returns.safeParse(o,i);if(!c.success)throw new n([a(o,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Se({...this._def,args:be.create(e).rest(le.create())})}returns(e){return new Se({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Se({args:e||be.create([]).rest(le.create()),returns:t||le.create(),typeName:ze.ZodFunction,...j(r)})}}class xe extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}xe.create=(e,t)=>new xe({getter:e,typeName:ze.ZodLazy,...j(t)});class ke extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ie(e,t){return new je({values:e,typeName:ze.ZodEnum,...j(t)})}ke.create=(e,t)=>new ke({value:e,typeName:ze.ZodLiteral,...j(t)});class je extends O{constructor(){super(...arguments),S.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const r=this._getOrReturnCtx(e),a=this._def.values;return h(r,{expected:t.joinValues(a),received:r.parsedType,code:o.invalid_type}),f}if(w(this,S,"f")||E(this,S,new Set(this._def.values),"f"),!w(this,S,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return h(t,{received:t.data,code:o.invalid_enum_value,options:r}),f}return v(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return je.create(e,{...this._def,...t})}exclude(e,t=this._def){return je.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}S=new WeakMap,je.create=Ie;class Oe extends O{constructor(){super(...arguments),x.set(this,void 0)}_parse(e){const r=t.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==s.string&&a.parsedType!==s.number){const e=t.objectValues(r);return h(a,{expected:t.joinValues(e),received:a.parsedType,code:o.invalid_type}),f}if(w(this,x,"f")||E(this,x,new Set(t.getValidEnumValues(this._def.values)),"f"),!w(this,x,"f").has(e.data)){const e=t.objectValues(r);return h(a,{received:a.data,code:o.invalid_enum_value,options:e}),f}return v(e.data)}get enum(){return this._def.values}}x=new WeakMap,Oe.create=(e,t)=>new Oe({values:e,typeName:ze.ZodNativeEnum,...j(t)});class Te extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return h(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),f;const r=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return v(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Te.create=(e,t)=>new Te({type:e,typeName:ze.ZodPromise,...j(t)});class Re extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:a}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:e=>{h(a,e),e.fatal?r.abort():r.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===s.type){const e=s.transform(a.data,i);if(a.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===r.value)return f;const t=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===t.status?f:"dirty"===t.status||"dirty"===r.value?m(t.value):t});{if("aborted"===r.value)return f;const t=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===t.status?f:"dirty"===t.status||"dirty"===r.value?m(t.value):t}}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,i);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const t=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===t.status?f:("dirty"===t.status&&r.dirty(),e(t.value),{status:r.value,value:t.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(t=>"aborted"===t.status?f:("dirty"===t.status&&r.dirty(),e(t.value).then(()=>({status:r.value,value:t.value}))))}if("transform"===s.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!_(e))return e;const t=s.transform(e.value,i);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:t}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(e=>_(e)?Promise.resolve(s.transform(e.value,i)).then(e=>({status:r.value,value:e})):e)}t.assertNever(s)}}Re.create=(e,t,r)=>new Re({schema:e,typeName:ze.ZodEffects,effect:t,...j(r)}),Re.createWithPreprocess=(e,t,r)=>new Re({schema:t,effect:{type:"preprocess",transform:e},typeName:ze.ZodEffects,...j(r)});class $e extends O{_parse(e){return this._getType(e)===s.undefined?v(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$e.create=(e,t)=>new $e({innerType:e,typeName:ze.ZodOptional,...j(t)});class Ae extends O{_parse(e){return this._getType(e)===s.null?v(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ae.create=(e,t)=>new Ae({innerType:e,typeName:ze.ZodNullable,...j(t)});class Ce extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===s.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:ze.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...j(t)});class De extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return b(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new n(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new n(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}De.create=(e,t)=>new De({innerType:e,typeName:ze.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...j(t)});class Fe extends O{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),f}return{status:"valid",value:e.data}}}Fe.create=e=>new Fe({typeName:ze.ZodNaN,...j(e)});const Ne=Symbol("zod_brand");class He extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ze extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),m(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Ze({in:e,out:t,typeName:ze.ZodPipeline})}}class qe extends O{_parse(e){const t=this._def.innerType._parse(e),r=e=>(_(e)&&(e.value=Object.freeze(e.value)),e);return b(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function Le(e,t){const r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function Me(e,t={},r){return e?ce.create().superRefine((a,s)=>{var i,o;const n=e(a);if(n instanceof Promise)return n.then(e=>{var i,o;if(!e){const e=Le(t,a),n=null===(o=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===o||o;s.addIssue({code:"custom",...e,fatal:n})}});if(!n){const e=Le(t,a),n=null===(o=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===o||o;s.addIssue({code:"custom",...e,fatal:n})}}):ce.create()}qe.create=(e,t)=>new qe({innerType:e,typeName:ze.ZodReadonly,...j(t)});const Ke={object:fe.lazycreate};var ze;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ze||(ze={}));const Ve=X.create,Ue=te.create,Qe=Fe.create,Be=re.create,Je=ae.create,We=se.create,Ge=ie.create,Ye=oe.create,Xe=ne.create,et=ce.create,tt=le.create,rt=de.create,at=ue.create,st=he.create,it=fe.create,ot=fe.strictCreate,nt=me.create,ct=ye.create,lt=_e.create,dt=be.create,ut=we.create,ht=Ee.create,pt=Pe.create,ft=Se.create,mt=xe.create,vt=ke.create,yt=je.create,gt=Oe.create,_t=Te.create,bt=Re.create,wt=$e.create,Et=Ae.create,Pt=Re.createWithPreprocess,St=Ze.create,xt={string:e=>X.create({...e,coerce:!0}),number:e=>te.create({...e,coerce:!0}),boolean:e=>ae.create({...e,coerce:!0}),bigint:e=>re.create({...e,coerce:!0}),date:e=>se.create({...e,coerce:!0})},kt=f;var It=Object.freeze({__proto__:null,defaultErrorMap:c,setErrorMap:function(e){l=e},getErrorMap:d,makeIssue:u,EMPTY_PATH:[],addIssueToContext:h,ParseStatus:p,INVALID:f,DIRTY:m,OK:v,isAborted:y,isDirty:g,isValid:_,isAsync:b,get util(){return t},get objectUtil(){return a},ZodParsedType:s,getParsedType:i,ZodType:O,datetimeRegex:J,ZodString:X,ZodNumber:te,ZodBigInt:re,ZodBoolean:ae,ZodDate:se,ZodSymbol:ie,ZodUndefined:oe,ZodNull:ne,ZodAny:ce,ZodUnknown:le,ZodNever:de,ZodVoid:ue,ZodArray:he,ZodObject:fe,ZodUnion:me,ZodDiscriminatedUnion:ye,ZodIntersection:_e,ZodTuple:be,ZodRecord:we,ZodMap:Ee,ZodSet:Pe,ZodFunction:Se,ZodLazy:xe,ZodLiteral:ke,ZodEnum:je,ZodNativeEnum:Oe,ZodPromise:Te,ZodEffects:Re,ZodTransformer:Re,ZodOptional:$e,ZodNullable:Ae,ZodDefault:Ce,ZodCatch:De,ZodNaN:Fe,BRAND:Ne,ZodBranded:He,ZodPipeline:Ze,ZodReadonly:qe,custom:Me,Schema:O,ZodSchema:O,late:Ke,get ZodFirstPartyTypeKind(){return ze},coerce:xt,any:et,array:st,bigint:Be,boolean:Je,date:We,discriminatedUnion:ct,effect:bt,enum:yt,function:ft,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Me(t=>t instanceof e,t),intersection:lt,lazy:mt,literal:vt,map:ht,nan:Qe,nativeEnum:gt,never:rt,null:Xe,nullable:Et,number:Ue,object:it,oboolean:()=>Je().optional(),onumber:()=>Ue().optional(),optional:wt,ostring:()=>Ve().optional(),pipeline:St,preprocess:Pt,promise:_t,record:ut,set:pt,strictObject:ot,string:Ve,symbol:Ge,transformer:bt,tuple:dt,undefined:Ye,union:nt,unknown:tt,void:at,NEVER:kt,ZodIssueCode:o,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:n});const jt="2025-06-18",Ot=[jt,"2025-03-26","2024-11-05","2024-10-07"],Tt="2.0",Rt=It.union([It.string(),It.number().int()]),$t=It.string(),At=It.object({progressToken:It.optional(Rt)}).passthrough(),Ct=It.object({_meta:It.optional(At)}).passthrough(),Dt=It.object({method:It.string(),params:It.optional(Ct)}),Ft=It.object({_meta:It.optional(It.object({}).passthrough())}).passthrough(),Nt=It.object({method:It.string(),params:It.optional(Ft)}),Ht=It.object({_meta:It.optional(It.object({}).passthrough())}).passthrough(),Zt=It.union([It.string(),It.number().int()]),qt=It.object({jsonrpc:It.literal(Tt),id:Zt}).merge(Dt).strict(),Lt=It.object({jsonrpc:It.literal(Tt)}).merge(Nt).strict(),Mt=It.object({jsonrpc:It.literal(Tt),id:Zt,result:Ht}).strict(),Kt=e=>Mt.safeParse(e).success;var zt;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(zt||(zt={}));const Vt=It.object({jsonrpc:It.literal(Tt),id:Zt,error:It.object({code:It.number().int(),message:It.string(),data:It.optional(It.unknown())})}).strict(),Ut=It.union([qt,Lt,Mt,Vt]),Qt=Ht.strict(),Bt=Nt.extend({method:It.literal("notifications/cancelled"),params:Ft.extend({requestId:Zt,reason:It.string().optional()})}),Jt=It.object({src:It.string(),mimeType:It.optional(It.string()),sizes:It.optional(It.string())}).passthrough(),Wt=It.object({name:It.string(),title:It.optional(It.string())}).passthrough(),Gt=Wt.extend({version:It.string(),websiteUrl:It.optional(It.string()),icons:It.optional(It.array(Jt))}),Yt=It.object({experimental:It.optional(It.object({}).passthrough()),sampling:It.optional(It.object({}).passthrough()),elicitation:It.optional(It.object({}).passthrough()),roots:It.optional(It.object({listChanged:It.optional(It.boolean())}).passthrough())}).passthrough(),Xt=Dt.extend({method:It.literal("initialize"),params:Ct.extend({protocolVersion:It.string(),capabilities:Yt,clientInfo:Gt})}),er=It.object({experimental:It.optional(It.object({}).passthrough()),logging:It.optional(It.object({}).passthrough()),completions:It.optional(It.object({}).passthrough()),prompts:It.optional(It.object({listChanged:It.optional(It.boolean())}).passthrough()),resources:It.optional(It.object({subscribe:It.optional(It.boolean()),listChanged:It.optional(It.boolean())}).passthrough()),tools:It.optional(It.object({listChanged:It.optional(It.boolean())}).passthrough())}).passthrough(),tr=Ht.extend({protocolVersion:It.string(),capabilities:er,serverInfo:Gt,instructions:It.optional(It.string())}),rr=Nt.extend({method:It.literal("notifications/initialized")}),ar=Dt.extend({method:It.literal("ping")}),sr=It.object({progress:It.number(),total:It.optional(It.number()),message:It.optional(It.string())}).passthrough(),ir=Nt.extend({method:It.literal("notifications/progress"),params:Ft.merge(sr).extend({progressToken:Rt})}),or=Dt.extend({params:Ct.extend({cursor:It.optional($t)}).optional()}),nr=Ht.extend({nextCursor:It.optional($t)}),cr=It.object({uri:It.string(),mimeType:It.optional(It.string()),_meta:It.optional(It.object({}).passthrough())}).passthrough(),lr=cr.extend({text:It.string()}),dr=It.string().refine(e=>{try{return atob(e),!0}catch(e){return!1}},{message:"Invalid Base64 string"}),ur=cr.extend({blob:dr}),hr=Wt.extend({uri:It.string(),description:It.optional(It.string()),mimeType:It.optional(It.string()),icons:It.optional(It.array(Jt)),_meta:It.optional(It.object({}).passthrough())}),pr=Wt.extend({uriTemplate:It.string(),description:It.optional(It.string()),mimeType:It.optional(It.string()),_meta:It.optional(It.object({}).passthrough())}),fr=or.extend({method:It.literal("resources/list")}),mr=nr.extend({resources:It.array(hr)}),vr=or.extend({method:It.literal("resources/templates/list")}),yr=nr.extend({resourceTemplates:It.array(pr)}),gr=Dt.extend({method:It.literal("resources/read"),params:Ct.extend({uri:It.string()})}),_r=Ht.extend({contents:It.array(It.union([lr,ur]))}),br=Nt.extend({method:It.literal("notifications/resources/list_changed")}),wr=Dt.extend({method:It.literal("resources/subscribe"),params:Ct.extend({uri:It.string()})}),Er=Dt.extend({method:It.literal("resources/unsubscribe"),params:Ct.extend({uri:It.string()})}),Pr=Nt.extend({method:It.literal("notifications/resources/updated"),params:Ft.extend({uri:It.string()})}),Sr=It.object({name:It.string(),description:It.optional(It.string()),required:It.optional(It.boolean())}).passthrough(),xr=Wt.extend({description:It.optional(It.string()),arguments:It.optional(It.array(Sr)),icons:It.optional(It.array(Jt)),_meta:It.optional(It.object({}).passthrough())}),kr=or.extend({method:It.literal("prompts/list")}),Ir=nr.extend({prompts:It.array(xr)}),jr=Dt.extend({method:It.literal("prompts/get"),params:Ct.extend({name:It.string(),arguments:It.optional(It.record(It.string()))})}),Or=It.object({type:It.literal("text"),text:It.string(),_meta:It.optional(It.object({}).passthrough())}).passthrough(),Tr=It.object({type:It.literal("image"),data:dr,mimeType:It.string(),_meta:It.optional(It.object({}).passthrough())}).passthrough(),Rr=It.object({type:It.literal("audio"),data:dr,mimeType:It.string(),_meta:It.optional(It.object({}).passthrough())}).passthrough(),$r=It.object({type:It.literal("resource"),resource:It.union([lr,ur]),_meta:It.optional(It.object({}).passthrough())}).passthrough(),Ar=hr.extend({type:It.literal("resource_link")}),Cr=It.union([Or,Tr,Rr,Ar,$r]),Dr=It.object({role:It.enum(["user","assistant"]),content:Cr}).passthrough(),Fr=Ht.extend({description:It.optional(It.string()),messages:It.array(Dr)}),Nr=Nt.extend({method:It.literal("notifications/prompts/list_changed")}),Hr=It.object({title:It.optional(It.string()),readOnlyHint:It.optional(It.boolean()),destructiveHint:It.optional(It.boolean()),idempotentHint:It.optional(It.boolean()),openWorldHint:It.optional(It.boolean())}).passthrough(),Zr=Wt.extend({description:It.optional(It.string()),inputSchema:It.object({type:It.literal("object"),properties:It.optional(It.object({}).passthrough()),required:It.optional(It.array(It.string()))}).passthrough(),outputSchema:It.optional(It.object({type:It.literal("object"),properties:It.optional(It.object({}).passthrough()),required:It.optional(It.array(It.string()))}).passthrough()),annotations:It.optional(Hr),icons:It.optional(It.array(Jt)),_meta:It.optional(It.object({}).passthrough())}),qr=or.extend({method:It.literal("tools/list")}),Lr=nr.extend({tools:It.array(Zr)}),Mr=Ht.extend({content:It.array(Cr).default([]),structuredContent:It.object({}).passthrough().optional(),isError:It.optional(It.boolean())}),Kr=(Mr.or(Ht.extend({toolResult:It.unknown()})),Dt.extend({method:It.literal("tools/call"),params:Ct.extend({name:It.string(),arguments:It.optional(It.record(It.unknown()))})})),zr=Nt.extend({method:It.literal("notifications/tools/list_changed")}),Vr=It.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Ur=Dt.extend({method:It.literal("logging/setLevel"),params:Ct.extend({level:Vr})}),Qr=Nt.extend({method:It.literal("notifications/message"),params:Ft.extend({level:Vr,logger:It.optional(It.string()),data:It.unknown()})}),Br=It.object({name:It.string().optional()}).passthrough(),Jr=It.object({hints:It.optional(It.array(Br)),costPriority:It.optional(It.number().min(0).max(1)),speedPriority:It.optional(It.number().min(0).max(1)),intelligencePriority:It.optional(It.number().min(0).max(1))}).passthrough(),Wr=It.object({role:It.enum(["user","assistant"]),content:It.union([Or,Tr,Rr])}).passthrough(),Gr=Dt.extend({method:It.literal("sampling/createMessage"),params:Ct.extend({messages:It.array(Wr),systemPrompt:It.optional(It.string()),includeContext:It.optional(It.enum(["none","thisServer","allServers"])),temperature:It.optional(It.number()),maxTokens:It.number().int(),stopSequences:It.optional(It.array(It.string())),metadata:It.optional(It.object({}).passthrough()),modelPreferences:It.optional(Jr)})}),Yr=Ht.extend({model:It.string(),stopReason:It.optional(It.enum(["endTurn","stopSequence","maxTokens"]).or(It.string())),role:It.enum(["user","assistant"]),content:It.discriminatedUnion("type",[Or,Tr,Rr])}),Xr=It.object({type:It.literal("boolean"),title:It.optional(It.string()),description:It.optional(It.string()),default:It.optional(It.boolean())}).passthrough(),ea=It.object({type:It.literal("string"),title:It.optional(It.string()),description:It.optional(It.string()),minLength:It.optional(It.number()),maxLength:It.optional(It.number()),format:It.optional(It.enum(["email","uri","date","date-time"]))}).passthrough(),ta=It.object({type:It.enum(["number","integer"]),title:It.optional(It.string()),description:It.optional(It.string()),minimum:It.optional(It.number()),maximum:It.optional(It.number())}).passthrough(),ra=It.object({type:It.literal("string"),title:It.optional(It.string()),description:It.optional(It.string()),enum:It.array(It.string()),enumNames:It.optional(It.array(It.string()))}).passthrough(),aa=It.union([Xr,ea,ta,ra]),sa=Dt.extend({method:It.literal("elicitation/create"),params:Ct.extend({message:It.string(),requestedSchema:It.object({type:It.literal("object"),properties:It.record(It.string(),aa),required:It.optional(It.array(It.string()))}).passthrough()})}),ia=Ht.extend({action:It.enum(["accept","decline","cancel"]),content:It.optional(It.record(It.string(),It.unknown()))}),oa=It.object({type:It.literal("ref/resource"),uri:It.string()}).passthrough(),na=It.object({type:It.literal("ref/prompt"),name:It.string()}).passthrough(),ca=Dt.extend({method:It.literal("completion/complete"),params:Ct.extend({ref:It.union([na,oa]),argument:It.object({name:It.string(),value:It.string()}).passthrough(),context:It.optional(It.object({arguments:It.optional(It.record(It.string(),It.string()))}))})}),la=Ht.extend({completion:It.object({values:It.array(It.string()).max(100),total:It.optional(It.number().int()),hasMore:It.optional(It.boolean())}).passthrough()}),da=It.object({uri:It.string().startsWith("file://"),name:It.optional(It.string()),_meta:It.optional(It.object({}).passthrough())}).passthrough(),ua=Dt.extend({method:It.literal("roots/list")}),ha=Ht.extend({roots:It.array(da)}),pa=Nt.extend({method:It.literal("notifications/roots/list_changed")});It.union([ar,Xt,ca,Ur,jr,kr,fr,vr,gr,wr,Er,Kr,qr]),It.union([Bt,ir,rr,pa]),It.union([Qt,Yr,ia,ha]),It.union([ar,Gr,sa,ua]),It.union([Bt,ir,Qr,Pr,br,zr,Nr]),It.union([Qt,tr,la,Fr,Ir,mr,yr,_r,Mr,Lr]);class fa extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`),this.code=e,this.data=r,this.name="McpError"}}class ma{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;const e=this._buffer.indexOf("\n");if(-1===e)return null;const t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),function(e){return Ut.parse(JSON.parse(e))}(t)}clear(){this._buffer=void 0}}class va{constructor(t=e.stdin,r=e.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new ma,this._started=!1,this._ondata=e=>{this._readBuffer.append(e),this.processReadBuffer()},this._onerror=e=>{var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var e,t;;)try{const t=this._readBuffer.readMessage();if(null===t)break;null===(e=this.onmessage)||void 0===e||e.call(this,t)}catch(e){null===(t=this.onerror)||void 0===t||t.call(this,e)}}async close(){var e;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),0===this._stdin.listenerCount("data")&&this._stdin.pause(),this._readBuffer.clear(),null===(e=this.onclose)||void 0===e||e.call(this)}send(e){return new Promise(t=>{const r=function(e){return JSON.stringify(e)+"\n"}(e);this._stdout.write(r)?t():this._stdout.once("drain",t)})}}class ya{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(Bt,e=>{const t=this._requestHandlerAbortControllers.get(e.params.requestId);null==t||t.abort(e.params.reason)}),this.setNotificationHandler(ir,e=>{this._onprogress(e)}),this.setRequestHandler(ar,e=>({}))}_setupTimeout(e,t,r,a,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:s,onTimeout:a})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new fa(zt.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,r,a;this._transport=e;const s=null===(t=this.transport)||void 0===t?void 0:t.onclose;this._transport.onclose=()=>{null==s||s(),this._onclose()};const i=null===(r=this.transport)||void 0===r?void 0:r.onerror;this._transport.onerror=e=>{null==i||i(e),this._onerror(e)};const o=null===(a=this._transport)||void 0===a?void 0:a.onmessage;this._transport.onmessage=(e,t)=>{var r;null==o||o(e,t),Kt(e)||(r=e,Vt.safeParse(r).success)?this._onresponse(e):(e=>qt.safeParse(e).success)(e)?this._onrequest(e,t):(e=>Lt.safeParse(e).success)(e)?this._onnotification(e):this._onerror(new Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){var e;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,null===(e=this.onclose)||void 0===e||e.call(this);const r=new fa(zt.ConnectionClosed,"Connection closed");for(const e of t.values())e(r)}_onerror(e){var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}_onnotification(e){var t;const r=null!==(t=this._notificationHandlers.get(e.method))&&void 0!==t?t:this.fallbackNotificationHandler;void 0!==r&&Promise.resolve().then(()=>r(e)).catch(e=>this._onerror(new Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var r,a;const s=null!==(r=this._requestHandlers.get(e.method))&&void 0!==r?r:this.fallbackRequestHandler,i=this._transport;if(void 0===s)return void(null==i||i.send({jsonrpc:"2.0",id:e.id,error:{code:zt.MethodNotFound,message:"Method not found"}}).catch(e=>this._onerror(new Error(`Failed to send an error response: ${e}`))));const o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);const n={signal:o.signal,sessionId:null==i?void 0:i.sessionId,_meta:null===(a=e.params)||void 0===a?void 0:a._meta,sendNotification:t=>this.notification(t,{relatedRequestId:e.id}),sendRequest:(t,r,a)=>this.request(t,r,{...a,relatedRequestId:e.id}),authInfo:null==t?void 0:t.authInfo,requestId:e.id,requestInfo:null==t?void 0:t.requestInfo};Promise.resolve().then(()=>s(e,n)).then(t=>{if(!o.signal.aborted)return null==i?void 0:i.send({result:t,jsonrpc:"2.0",id:e.id})},t=>{var r;if(!o.signal.aborted)return null==i?void 0:i.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:zt.InternalError,message:null!==(r=t.message)&&void 0!==r?r:"Internal error"}})}).catch(e=>this._onerror(new Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...r}=e.params,a=Number(t),s=this._progressHandlers.get(a);if(!s)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));const i=this._responseHandlers.get(a),o=this._timeoutInfo.get(a);if(o&&i&&o.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(e){return void i(e)}s(r)}_onresponse(e){const t=Number(e.id),r=this._responseHandlers.get(t);void 0!==r?(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),Kt(e)?r(e):r(new fa(e.error.code,e.error.message,e.error.data))):this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`))}get transport(){return this._transport}async close(){var e;await(null===(e=this._transport)||void 0===e?void 0:e.close())}request(e,t,r){const{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}=null!=r?r:{};return new Promise((o,n)=>{var c,l,d,u,h,p;if(!this._transport)return void n(new Error("Not connected"));!0===(null===(c=this._options)||void 0===c?void 0:c.enforceStrictCapabilities)&&this.assertCapabilityForMethod(e.method),null===(l=null==r?void 0:r.signal)||void 0===l||l.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};(null==r?void 0:r.onprogress)&&(this._progressHandlers.set(f,r.onprogress),m.params={...e.params,_meta:{...(null===(d=e.params)||void 0===d?void 0:d._meta)||{},progressToken:f}});const v=e=>{var t;this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),null===(t=this._transport)||void 0===t||t.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(e)}},{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>this._onerror(new Error(`Failed to send cancellation: ${e}`))),n(e)};this._responseHandlers.set(f,e=>{var a;if(!(null===(a=null==r?void 0:r.signal)||void 0===a?void 0:a.aborted)){if(e instanceof Error)return n(e);try{const r=t.parse(e.result);o(r)}catch(e){n(e)}}}),null===(u=null==r?void 0:r.signal)||void 0===u||u.addEventListener("abort",()=>{var e;v(null===(e=null==r?void 0:r.signal)||void 0===e?void 0:e.reason)});const y=null!==(h=null==r?void 0:r.timeout)&&void 0!==h?h:6e4;this._setupTimeout(f,y,null==r?void 0:r.maxTotalTimeout,()=>v(new fa(zt.RequestTimeout,"Request timed out",{timeout:y})),null!==(p=null==r?void 0:r.resetTimeoutOnProgress)&&void 0!==p&&p),this._transport.send(m,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>{this._cleanupTimeout(f),n(e)})})}async notification(e,t){var r,a;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),(null!==(a=null===(r=this._options)||void 0===r?void 0:r.debouncedNotificationMethods)&&void 0!==a?a:[]).includes(e.method)&&!e.params&&!(null==t?void 0:t.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;return this._pendingDebouncedNotifications.add(e.method),void Promise.resolve().then(()=>{var r;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const a={...e,jsonrpc:"2.0"};null===(r=this._transport)||void 0===r||r.send(a,t).catch(e=>this._onerror(e))})}const s={...e,jsonrpc:"2.0"};await this._transport.send(s,t)}setRequestHandler(e,t){const r=e.shape.method.value;this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(r,a)=>Promise.resolve(t(e.parse(r),a)))}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,r=>Promise.resolve(t(e.parse(r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}var ga=r(53084);class _a extends ya{constructor(e,t){var r;super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Vr.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{const r=this._loggingLevels.get(t);return!!r&&this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r)},this._capabilities=null!==(r=null==t?void 0:t.capabilities)&&void 0!==r?r:{},this._instructions=null==t?void 0:t.instructions,this.setRequestHandler(Xt,e=>this._oninitialize(e)),this.setNotificationHandler(rr,()=>{var e;return null===(e=this.oninitialized)||void 0===e?void 0:e.call(this)}),this._capabilities.logging&&this.setRequestHandler(Ur,async(e,t)=>{var r;const a=t.sessionId||(null===(r=t.requestInfo)||void 0===r?void 0:r.headers["mcp-session-id"])||void 0,{level:s}=e.params,i=Vr.safeParse(s);return i.success&&this._loggingLevels.set(a,i.data),{}})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");var t,r;this._capabilities=(t=this._capabilities,r=e,Object.entries(r).reduce((e,[t,r])=>(e[t]=r&&"object"==typeof r&&e[t]?{...e[t],...r}:r,e),{...t}))}assertCapabilityForMethod(e){var t,r,a;switch(e){case"sampling/createMessage":if(!(null===(t=this._clientCapabilities)||void 0===t?void 0:t.sampling))throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(null===(r=this._clientCapabilities)||void 0===r?void 0:r.elicitation))throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(null===(a=this._clientCapabilities)||void 0===a?void 0:a.roots))throw new Error(`Client does not support listing roots (required for ${e})`)}}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})`)}}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})`)}}async _oninitialize(e){const t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Ot.includes(t)?t:jt,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"},Qt)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Yr,t)}async elicitInput(e,t){const r=await this.request({method:"elicitation/create",params:e},ia,t);if("accept"===r.action&&r.content)try{const t=new ga,a=t.compile(e.requestedSchema);if(!a(r.content))throw new fa(zt.InvalidParams,`Elicitation response content does not match requested schema: ${t.errorsText(a.errors)}`)}catch(e){if(e instanceof fa)throw e;throw new fa(zt.InternalError,`Error validating elicitation response: ${e}`)}return r}async listRoots(e,t){return this.request({method:"roots/list",params:e},ha,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}const ba=require("crypto"),wa=require("node:crypto"),Ea=require("node:buffer");const Pa=e=>Ea.Buffer.from(e).toString("base64url"),Sa=require("node:util");class xa extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class ka extends xa{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class Ia extends xa{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class ja extends xa{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}Symbol.asyncIterator;const Oa=wa.webcrypto,Ta=e=>Sa.types.isCryptoKey(e),Ra=e=>Sa.types.isKeyObject(e);function $a(e,t,...r){if((r=r.filter(Boolean)).length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const Aa=(e,...t)=>$a("Key must be ",e,...t);function Ca(e,t,...r){return $a(`Key for the ${e} algorithm must be `,t,...r)}const Da=e=>Ra(e)||Ta(e),Fa=["KeyObject"];function Na(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ha(e){return Na(e)&&"string"==typeof e.kty}(globalThis.CryptoKey||Oa?.CryptoKey)&&Fa.push("CryptoKey"),new WeakMap;const Za=(e,t)=>{let r;if(Ta(e))r=wa.KeyObject.from(e);else{if(!Ra(e)){if(Ha(e))return e.crv;throw new TypeError(Aa(e,...Fa))}r=e}if("secret"===r.type)throw new TypeError('only "private" or "public" type keys can be used for this operation');switch(r.asymmetricKeyType){case"ed25519":case"ed448":return`Ed${r.asymmetricKeyType.slice(2)}`;case"x25519":case"x448":return`X${r.asymmetricKeyType.slice(1)}`;case"ec":{const e=r.asymmetricKeyDetails.namedCurve;return t?e:(e=>{switch(e){case"prime256v1":return"P-256";case"secp384r1":return"P-384";case"secp521r1":return"P-521";case"secp256k1":return"secp256k1";default:throw new ka("Unsupported key curve for this operation")}})(e)}default:throw new TypeError("Invalid asymmetric key type for this operation")}},qa=(e,t)=>{let r;try{r=e instanceof wa.KeyObject?e.asymmetricKeyDetails?.modulusLength:Buffer.from(e.n,"base64url").byteLength<<3}catch{}if("number"!=typeof r||r<2048)throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)},La=new Map([["ES256","P-256"],["ES256K","secp256k1"],["ES384","P-384"],["ES512","P-521"]]);function Ma(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Ka(e,t){return e.name===t}function za(e){return parseInt(e.name.slice(4),10)}function Va(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!Ka(e.algorithm,"HMAC"))throw Ma("HMAC");const r=parseInt(t.slice(2),10);if(za(e.algorithm.hash)!==r)throw Ma(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Ka(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Ma("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(za(e.algorithm.hash)!==r)throw Ma(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Ka(e.algorithm,"RSA-PSS"))throw Ma("RSA-PSS");const r=parseInt(t.slice(2),10);if(za(e.algorithm.hash)!==r)throw Ma(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw Ma("Ed25519 or Ed448");break;case"Ed25519":if(!Ka(e.algorithm,"Ed25519"))throw Ma("Ed25519");break;case"ES256":case"ES384":case"ES512":{if(!Ka(e.algorithm,"ECDSA"))throw Ma("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw Ma(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}!function(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}const Ua=(0,Sa.promisify)(wa.sign),Qa=new TextEncoder,Ba=new TextDecoder;const Ja=e=>e?.[Symbol.toStringTag],Wa=(e,t,r)=>{if(void 0!==t.use&&"sig"!==t.use)throw new TypeError("Invalid key for this operation, when present its use must be sig");if(void 0!==t.key_ops&&!0!==t.key_ops.includes?.(r))throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${r}`);if(void 0!==t.alg&&t.alg!==e)throw new TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0};function Ga(e,t,r,a){t.startsWith("HS")||"dir"===t||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?((e,t,r,a)=>{if(!(t instanceof Uint8Array)){if(a&&Ha(t)){if(function(e){return Ha(e)&&"oct"===e.kty&&"string"==typeof e.k}(t)&&Wa(e,t,r))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Da(t))throw new TypeError(Ca(e,t,...Fa,"Uint8Array",a?"JSON Web Key":null));if("secret"!==t.type)throw new TypeError(`${Ja(t)} instances for symmetric algorithms must be of type "secret"`)}})(t,r,a,e):((e,t,r,a)=>{if(a&&Ha(t))switch(r){case"sign":if(function(e){return"oct"!==e.kty&&"string"==typeof e.d}(t)&&Wa(e,t,r))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(function(e){return"oct"!==e.kty&&void 0===e.d}(t)&&Wa(e,t,r))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Da(t))throw new TypeError(Ca(e,t,...Fa,a?"JSON Web Key":null));if("secret"===t.type)throw new TypeError(`${Ja(t)} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Ja(t)} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Ja(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Ja(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Ja(t)} instances for asymmetric algorithm encryption must be of type "public"`)})(t,r,a,e)}Ga.bind(void 0,!1);const Ya=Ga.bind(void 0,!0);class Xa{_payload;_protectedHeader;_unprotectedHeader;constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new Ia("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!((...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0})(this._protectedHeader,this._unprotectedHeader))throw new Ia("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let a=!0;if(function(e,t,r,a,s){if(void 0!==s.crit&&void 0===a?.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!a||void 0===a.crit)return new Set;if(!Array.isArray(a.crit)||0===a.crit.length||a.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of a.crit){if(!i.has(t))throw new ka(`Extension Header Parameter "${t}" is not recognized`);if(void 0===s[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(i.get(t)&&void 0===a[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(a.crit)}(Ia,new Map([["b64",!0]]),t?.crit,this._protectedHeader,r).has("b64")&&(a=this._protectedHeader.b64,"boolean"!=typeof a))throw new Ia('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=r;if("string"!=typeof s||!s)throw new Ia('JWS "alg" (Algorithm) Header Parameter missing or invalid');Ya(s,e,"sign");let i,o=this._payload;a&&(o=Qa.encode(Pa(o))),i=this._protectedHeader?Qa.encode(Pa(JSON.stringify(this._protectedHeader))):Qa.encode("");const n=function(...e){const t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t);let a=0;for(const t of e)r.set(t,a),a+=t.length;return r}(i,Qa.encode("."),o),c=await(async(e,t,r)=>{const a=function(e,t){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Aa(t,...Fa));return(0,wa.createSecretKey)(t)}if(t instanceof wa.KeyObject)return t;if(Ta(t))return Va(t,e,"sign"),wa.KeyObject.from(t);if(Ha(t))return e.startsWith("HS")?(0,wa.createSecretKey)(Buffer.from(t.k,"base64url")):t;throw new TypeError(Aa(t,...Fa,"Uint8Array","JSON Web Key"))}(e,t);if(e.startsWith("HS")){const t=wa.createHmac(function(e){switch(e){case"HS256":return"sha256";case"HS384":return"sha384";case"HS512":return"sha512";default:throw new ka(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e),a);return t.update(r),t.digest()}return Ua(function(e){switch(e){case"PS256":case"RS256":case"ES256":case"ES256K":return"sha256";case"PS384":case"RS384":case"ES384":return"sha384";case"PS512":case"RS512":case"ES512":return"sha512";case"Ed25519":case"EdDSA":return;default:throw new ka(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e),r,function(e,t){let r,a,s,i;if(t instanceof wa.KeyObject)r=t.asymmetricKeyType,a=t.asymmetricKeyDetails;else switch(s=!0,t.kty){case"RSA":r="rsa";break;case"EC":r="ec";break;case"OKP":if("Ed25519"===t.crv){r="ed25519";break}if("Ed448"===t.crv){r="ed448";break}throw new TypeError("Invalid key for this operation, its crv must be Ed25519 or Ed448");default:throw new TypeError("Invalid key for this operation, its kty must be RSA, OKP, or EC")}switch(e){case"Ed25519":if("ed25519"!==r)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ed25519");break;case"EdDSA":if(!["ed25519","ed448"].includes(r))throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448");break;case"RS256":case"RS384":case"RS512":if("rsa"!==r)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");qa(t,e);break;case"PS256":case"PS384":case"PS512":if("rsa-pss"===r){const{hashAlgorithm:t,mgf1HashAlgorithm:r,saltLength:s}=a,i=parseInt(e.slice(-3),10);if(void 0!==t&&(t!==`sha${i}`||r!==t))throw new TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}`);if(void 0!==s&&s>i>>3)throw new TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}`)}else if("rsa"!==r)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss");qa(t,e),i={padding:wa.constants.RSA_PKCS1_PSS_PADDING,saltLength:wa.constants.RSA_PSS_SALTLEN_DIGEST};break;case"ES256":case"ES256K":case"ES384":case"ES512":{if("ec"!==r)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ec");const a=Za(t),s=La.get(e);if(a!==s)throw new TypeError(`Invalid key curve for the algorithm, its curve must be ${s}, got ${a}`);i={dsaEncoding:"ieee-p1363"};break}default:throw new ka(`alg ${e} is not supported either by JOSE or your javascript runtime`)}return s?{format:"jwk",key:t,...i}:i?{...i,key:t}:t}(e,a))})(s,e,n),l={signature:Pa(c),payload:""};return a&&(l.payload=Ba.decode(o)),this._unprotectedHeader&&(l.header=this._unprotectedHeader),this._protectedHeader&&(l.protected=Ba.decode(i)),l}}class es{_flattened;constructor(e){this._flattened=new Xa(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}const ts=e=>Math.floor(e.getTime()/1e3),rs=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,as=e=>{const t=rs.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const r=parseFloat(t[2]);let a;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":a=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":a=Math.round(60*r);break;case"hour":case"hours":case"hr":case"hrs":case"h":a=Math.round(3600*r);break;case"day":case"days":case"d":a=Math.round(86400*r);break;case"week":case"weeks":case"w":a=Math.round(604800*r);break;default:a=Math.round(31557600*r)}return"-"===t[1]||"ago"===t[4]?-a:a};function ss(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}class is{_payload;constructor(e={}){if(!Na(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return"number"==typeof e?this._payload={...this._payload,nbf:ss("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:ss("setNotBefore",ts(e))}:this._payload={...this._payload,nbf:ts(new Date)+as(e)},this}setExpirationTime(e){return"number"==typeof e?this._payload={...this._payload,exp:ss("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:ss("setExpirationTime",ts(e))}:this._payload={...this._payload,exp:ts(new Date)+as(e)},this}setIssuedAt(e){return void 0===e?this._payload={...this._payload,iat:ts(new Date)}:e instanceof Date?this._payload={...this._payload,iat:ss("setIssuedAt",ts(e))}:this._payload="string"==typeof e?{...this._payload,iat:ss("setIssuedAt",ts(new Date)+as(e))}:{...this._payload,iat:ss("setIssuedAt",e)},this}}class os extends is{_protectedHeader;setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){const r=new es(Qa.encode(JSON.stringify(this._payload)));if(r.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new ja("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}}class ns{async generateProof(e,t,r,a={}){const s=this.generateCanonicalHashes(e,t),i={did:this.identity.did,kid:this.identity.keyId,ts:Math.floor(Date.now()/1e3),nonce:r.nonce,audience:r.audience,sessionId:r.sessionId,requestHash:s.requestHash,responseHash:s.responseHash,...a};return{jws:await this.generateDetachedJWS(i),meta:i}}generateCanonicalHashes(e,t){const r={method:e.method,...e.params&&{params:e.params}},a=t.data;return{requestHash:this.generateSHA256Hash(r),responseHash:this.generateSHA256Hash(a)}}generateSHA256Hash(e){const t=this.canonicalizeJSON(e);return`sha256:${(0,ba.createHash)("sha256").update(t,"utf8").digest("hex")}`}canonicalizeJSON(e){return null===e?"null":"boolean"==typeof e?e.toString():"number"==typeof e?Number.isNaN(e)?"null":Number.isFinite(e)?e.toString():"null":"string"==typeof e?JSON.stringify(e):Array.isArray(e)?`[${e.map(e=>this.canonicalizeJSON(e)).join(",")}]`:"object"==typeof e?`{${Object.keys(e).sort().map(t=>{const r=this.canonicalizeJSON(e[t]);return`${JSON.stringify(t)}:${r}`}).join(",")}}`:JSON.stringify(e)}async generateDetachedJWS(e){try{const t=this.formatPrivateKeyAsPEM(this.identity.privateKey),r=await async function(e){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return t=e,(0,wa.createPrivateKey)({key:Ea.Buffer.from(t.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,""),"base64"),type:"pkcs8",format:"der"});var t}(t),a=await new os(e).setProtectedHeader({alg:"EdDSA",kid:this.identity.keyId}).sign(r),[s,,i]=a.split(".");return`${s}..${i}`}catch(e){throw new Error(`Failed to generate detached JWS: ${e instanceof Error?e.message:"Unknown error"}`)}}formatPrivateKeyAsPEM(e){const t=Buffer.from(e,"base64"),r=Buffer.from([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32]),a=Buffer.concat([r,t.subarray(0,32)]).toString("base64");return"-----BEGIN PRIVATE KEY-----\n"+(a.match(/.{1,64}/g)?.join("\n")||a)+"\n-----END PRIVATE KEY-----"}async verifyProof(e,t,r){try{const a=this.generateCanonicalHashes(t,r);if(e.meta.requestHash!==a.requestHash||e.meta.responseHash!==a.responseHash)return!1;const s=e.jws.split(".");return 3===s.length&&""===s[1]}catch{return!1}}constructor(e){var t,r;r=void 0,(t="identity")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.identity=e}}const cs=require("fs/promises"),ls=require("fs"),ds=require("path"),us=(0,Sa.promisify)(wa.generateKeyPair);function hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ps{async ensureIdentity(){return this.cachedIdentity||("development"===this.config.environment?this.cachedIdentity=await this.loadOrGenerateDevIdentity():this.cachedIdentity=await this.loadProdIdentity()),this.cachedIdentity}async loadOrGenerateDevIdentity(){const e=this.config.devIdentityPath;try{if((0,ls.existsSync)(e)){const t=await(0,cs.readFile)(e,"utf-8"),r=JSON.parse(t);return{did:r.did,keyId:r.keyId,privateKey:r.privateKey,publicKey:r.publicKey,createdAt:r.createdAt,lastRotated:r.lastRotated}}}catch{console.warn(`Warning: Could not load identity from ${e}, generating new one`)}return await this.generateDevIdentity()}async generateDevIdentity(){const e=await async function(e,t){return async function(e,t){switch(e){case"RS256":case"RS384":case"RS512":case"PS256":case"PS384":case"PS512":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":case"RSA1_5":{const e=t?.modulusLength??2048;if("number"!=typeof e||e<2048)throw new ka("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return await us("rsa",{modulusLength:e,publicExponent:65537})}case"ES256":return us("ec",{namedCurve:"P-256"});case"ES256K":return us("ec",{namedCurve:"secp256k1"});case"ES384":return us("ec",{namedCurve:"P-384"});case"ES512":return us("ec",{namedCurve:"P-521"});case"Ed25519":return us("ed25519");case"EdDSA":switch(t?.crv){case void 0:case"Ed25519":return us("ed25519");case"Ed448":return us("ed448");default:throw new ka("Invalid or unsupported crv option provided, supported values are Ed25519 and Ed448")}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=t?.crv??"P-256";switch(e){case void 0:case"P-256":case"P-384":case"P-521":return us("ec",{namedCurve:e});case"X25519":return us("x25519");case"X448":return us("x448");default:throw new ka("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}}default:throw new ka('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}}(e,t)}("EdDSA",{crv:"Ed25519"}),t=await async function(e){return(e=>{let t;if(Ta(e)){if(!e.extractable)throw new TypeError("CryptoKey is not extractable");t=wa.KeyObject.from(e)}else{if(!Ra(e)){if(e instanceof Uint8Array)return{kty:"oct",k:Pa(e)};throw new TypeError(Aa(e,...Fa,"Uint8Array"))}t=e}if("secret"!==t.type&&!["rsa","ec","ed25519","x25519","ed448","x448"].includes(t.asymmetricKeyType))throw new ka("Unsupported key asymmetricKeyType");return t.export({format:"jwk"})})(e)}(e.privateKey);if(!t.x||!t.d)throw new Error("Failed to generate Ed25519 keypair");const r=Buffer.from(t.d,"base64url").toString("base64"),a=Buffer.from(t.x,"base64url").toString("base64"),s=`key-${(0,ba.createHash)("sha256").update(a).digest("hex").substring(0,8)}`,i={did:`did:web:localhost:3000:agents:${s}`,keyId:s,privateKey:r,publicKey:a,createdAt:(new Date).toISOString()};return await this.saveDevIdentity(i),i}async saveDevIdentity(e){const t=this.config.devIdentityPath;await(0,cs.mkdir)((0,ds.dirname)(t),{recursive:!0});const r={version:"1.0",did:e.did,keyId:e.keyId,privateKey:e.privateKey,publicKey:e.publicKey,createdAt:e.createdAt,lastRotated:e.lastRotated};await(0,cs.writeFile)(t,JSON.stringify(r,null,2),{mode:384}),console.log(`✅ Identity saved to ${t}`),console.log(` DID: ${e.did}`),console.log(` Key ID: ${e.keyId}`)}async loadProdIdentity(){const e=["AGENT_PRIVATE_KEY","AGENT_KEY_ID","AGENT_DID","KYA_VOUCHED_API_KEY"],t=[],r={};for(const a of e){const e=process.env[a];e?r[a]=e:t.push(a)}if(t.length>0){const e=new Error(`Missing required environment variables for production identity: ${t.join(", ")}\nRequired variables:\n AGENT_PRIVATE_KEY - Base64-encoded Ed25519 private key\n AGENT_KEY_ID - Key identifier\n AGENT_DID - Agent DID\n KYA_VOUCHED_API_KEY - Know-That-AI API key`);throw e.code="XMCP_I_ENOIDENTITY",e}const a=Buffer.from(r.AGENT_PRIVATE_KEY,"base64"),s=(0,ba.createHash)("sha256").update(a).digest("base64");return{did:r.AGENT_DID,keyId:r.AGENT_KEY_ID,privateKey:r.AGENT_PRIVATE_KEY,publicKey:s,createdAt:(new Date).toISOString()}}async validateIdentity(e){try{return!!(e.did&&e.keyId&&e.privateKey&&e.publicKey)&&!!e.did.startsWith("did:")&&(Buffer.from(e.privateKey,"base64"),Buffer.from(e.publicKey,"base64"),!0)}catch{return!1}}clearCache(){this.cachedIdentity=void 0}getConfig(){return{...this.config}}constructor(e={environment:"development"}){hs(this,"config",void 0),hs(this,"cachedIdentity",void 0),this.config={privacyMode:!1,devIdentityPath:".mcpi/identity.json",...e}}}new ps;const fs=INJECTED_TOOLS,ms="undefined"!=typeof IDENTITY_CONFIG?IDENTITY_CONFIG:void 0,vs=ms?JSON.parse(ms):void 0,ys={name:"MCP Server",version:"0.0.1",capabilities:{tools:{listChanged:!0}}};function gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class _s{start(){try{this.mcpServer.connect(this.transport),this.debug&&console.log("[STDIO] MCP Server running with STDIO transport"),this.setupShutdownHandlers()}catch(e){this.debug&&console.error("[STDIO] Error starting STDIO transport:",e),process.exit(1)}}setupShutdownHandlers(){const e=()=>{this.debug&&console.log("[STDIO] Shutting down STDIO transport"),process.exit(0)};process.on("SIGINT",e),process.on("SIGTERM",e)}shutdown(){this.debug&&console.log("[STDIO] Shutting down STDIO transport"),process.exit(0)}constructor(e,t=!1){gs(this,"mcpServer",void 0),gs(this,"transport",void 0),gs(this,"debug",void 0),this.mcpServer=e,this.transport=new va,this.debug=t}}const bs=STDIO_CONFIG.debug||!1;(async function(){const e=new _a(ys),[t,r]=function(){const e=new Map;return[Object.keys(fs).map(t=>fs[t]().then(r=>{e.set(t,r)})),e]}();return await Promise.all(t),async function(e,t){return await async function(e,t,r){let a=null;if(r?.enabled)try{a=new ps({environment:r.environment||"development"});const e=await a.ensureIdentity();r.debug&&console.error(`[MCPI] Identity enabled - DID: ${e.did}`)}catch(e){console.error("[MCPI] Failed to initialize identity:",e)}const s=[],i=new Map;return t.forEach((e,t)=>{const r=function(e){return(e.split("/").pop()||e).replace(/\.[^/.]+$/,"")}(t),a={name:r,description:"No description provided"};let o={};const{default:n,metadata:c,schema:l}=e;"object"==typeof c&&null!==c&&Object.assign(a,c),function(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.entries(t).every(([e,t])=>"string"==typeof e&&"object"==typeof t&&null!==t&&"parse"in t&&"function"==typeof t.parse)}(l)?Object.assign(o,l):null!=l&&console.warn(`Invalid schema for tool "${a.name}" at ${t}. Expected Record<string, z.ZodType>`),void 0===a.annotations&&(a.annotations={}),void 0===a.annotations.title&&(a.annotations.title=a.name);const d={name:a.name,description:a.description,inputSchema:{type:"object",properties:Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{type:"string"}]))}};s.push(d),i.set(a.name,n)}),e.setRequestHandler(qr,async e=>({tools:s})),e.setRequestHandler(Kr,async e=>{const{name:t,arguments:s}=e.params,o=i.get(t);if(!o)return{content:[{type:"text",text:`Tool "${t}" not found`}],isError:!0};try{const e=await o(s||{}),i={content:[{type:"text",text:"string"==typeof e?e:JSON.stringify(e)}]};if(a)try{const o=await a.ensureIdentity(),n={method:t,params:s||{}},c={data:e},l=Math.floor(Date.now()/1e3),d={sessionId:`tool-${Date.now()}`,nonce:`${Date.now()}`,audience:"client",createdAt:l,timestamp:l,lastActivity:l,ttlMinutes:30},u=new ns(o),h=await u.generateProof(n,c,d);return r?.debug&&console.error(`[MCPI] Generated proof for tool "${t}" - DID: ${h.meta.did}`),{...i,_meta:{proof:h}}}catch(e){return r?.debug&&console.error(`[MCPI] Failed to generate proof for tool "${t}":`,e),i}return i}catch(e){return{content:[{type:"text",text:`Error executing tool "${t}": ${e instanceof Error?e.message:String(e)}`}],isError:!0}}}),e}(e,t,vs),e}(e,r)})().then(e=>{new _s(e,bs).start()})})(),{}})());