3 lines
215 KiB
JavaScript
3 lines
215 KiB
JavaScript
(()=>{var e={6474:(e,r,t)=>{"use strict";var a=t(9258),s=t(2603),i=t(7731),o=t(2961),n=t(6424),l=t(2015),c=t(9233),u=t(1966),d=t(8716);e.exports=Ajv;Ajv.prototype.validate=validate;Ajv.prototype.compile=compile;Ajv.prototype.addSchema=addSchema;Ajv.prototype.addMetaSchema=addMetaSchema;Ajv.prototype.validateSchema=validateSchema;Ajv.prototype.getSchema=getSchema;Ajv.prototype.removeSchema=removeSchema;Ajv.prototype.addFormat=addFormat;Ajv.prototype.errorsText=errorsText;Ajv.prototype._addSchema=_addSchema;Ajv.prototype._compile=_compile;Ajv.prototype.compileAsync=t(2694);var f=t(6765);Ajv.prototype.addKeyword=f.add;Ajv.prototype.getKeyword=f.get;Ajv.prototype.removeKeyword=f.remove;Ajv.prototype.validateKeyword=f.validate;var p=t(6343);Ajv.ValidationError=p.Validation;Ajv.MissingRefError=p.MissingRef;Ajv.$dataMetaSchema=u;var h="http://json-schema.org/draft-07/schema";var m=["removeAdditional","useDefaults","coerceTypes","strictDefaults"];var v=["/properties"];function Ajv(e){if(!(this instanceof Ajv))return new Ajv(e);e=this._opts=d.copy(e)||{};setLogger(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=chooseGetId(e);e.loopRequired=e.loopRequired||Infinity;if(e.errorDataPath=="property")e._errorDataPathProperty=true;if(e.serialize===undefined)e.serialize=n;this._metaOpts=getMetaSchemaOptions(this);if(e.formats)addInitialFormats(this);if(e.keywords)addInitialKeywords(this);addDefaultMetaSchema(this);if(typeof e.meta=="object")this.addMetaSchema(e.meta);if(e.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});addInitialSchemas(this)}function validate(e,r){var t;if(typeof e=="string"){t=this.getSchema(e);if(!t)throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);t=a.validate||this._compile(a)}var s=t(r);if(t.$async!==true)this.errors=t.errors;return s}function compile(e,r){var t=this._addSchema(e,undefined,r);return t.validate||this._compile(t)}function addSchema(e,r,t,a){if(Array.isArray(e)){for(var i=0;i<e.length;i++)this.addSchema(e[i],undefined,t,a);return this}var o=this._getId(e);if(o!==undefined&&typeof o!="string")throw new Error("schema id must be string");r=s.normalizeId(r||o);checkUnique(this,r);this._schemas[r]=this._addSchema(e,t,a,true);return this}function addMetaSchema(e,r,t){this.addSchema(e,r,t,true);return this}function validateSchema(e,r){var t=e.$schema;if(t!==undefined&&typeof t!="string")throw new Error("$schema must be a string");t=t||this._opts.defaultMeta||defaultMeta(this);if(!t){this.logger.warn("meta-schema not available");this.errors=null;return true}var a=this.validate(t,e);if(!a&&r){var s="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(s);else throw new Error(s)}return a}function defaultMeta(e){var r=e._opts.meta;e._opts.defaultMeta=typeof r=="object"?e._getId(r)||r:e.getSchema(h)?h:undefined;return e._opts.defaultMeta}function getSchema(e){var r=_getSchemaObj(this,e);switch(typeof r){case"object":return r.validate||this._compile(r);case"string":return this.getSchema(r);case"undefined":return _getSchemaFragment(this,e)}}function _getSchemaFragment(e,r){var t=s.schema.call(e,{schema:{}},r);if(t){var i=t.schema,n=t.root,l=t.baseId;var c=a.call(e,i,n,undefined,l);e._fragments[r]=new o({ref:r,fragment:true,schema:i,root:n,baseId:l,validate:c});return c}}function _getSchemaObj(e,r){r=s.normalizeId(r);return e._schemas[r]||e._refs[r]||e._fragments[r]}function removeSchema(e){if(e instanceof RegExp){_removeAllSchemas(this,this._schemas,e);_removeAllSchemas(this,this._refs,e);return this}switch(typeof e){case"undefined":_removeAllSchemas(this,this._schemas);_removeAllSchemas(this,this._refs);this._cache.clear();return this;case"string":var r=_getSchemaObj(this,e);if(r)this._cache.del(r.cacheKey);delete this._schemas[e];delete this._refs[e];return this;case"object":var t=this._opts.serialize;var a=t?t(e):e;this._cache.del(a);var i=this._getId(e);if(i){i=s.normalizeId(i);delete this._schemas[i];delete this._refs[i]}}return this}function _removeAllSchemas(e,r,t){for(var a in r){var s=r[a];if(!s.meta&&(!t||t.test(a))){e._cache.del(s.cacheKey);delete r[a]}}}function _addSchema(e,r,t,a){if(typeof e!="object"&&typeof e!="boolean")throw new Error("schema should be object or boolean");var i=this._opts.serialize;var n=i?i(e):e;var l=this._cache.get(n);if(l)return l;a=a||this._opts.addUsedSchema!==false;var c=s.normalizeId(this._getId(e));if(c&&a)checkUnique(this,c);var u=this._opts.validateSchema!==false&&!r;var d;if(u&&!(d=c&&c==s.normalizeId(e.$schema)))this.validateSchema(e,true);var f=s.ids.call(this,e);var p=new o({id:c,schema:e,localRefs:f,cacheKey:n,meta:t});if(c[0]!="#"&&a)this._refs[c]=p;this._cache.put(n,p);if(u&&d)this.validateSchema(e,true);return p}function _compile(e,r){if(e.compiling){e.validate=callValidate;callValidate.schema=e.schema;callValidate.errors=null;callValidate.root=r?r:callValidate;if(e.schema.$async===true)callValidate.$async=true;return callValidate}e.compiling=true;var t;if(e.meta){t=this._opts;this._opts=this._metaOpts}var s;try{s=a.call(this,e.schema,r,e.localRefs)}catch(r){delete e.validate;throw r}finally{e.compiling=false;if(e.meta)this._opts=t}e.validate=s;e.refs=s.refs;e.refVal=s.refVal;e.root=s.root;return s;function callValidate(){var r=e.validate;var t=r.apply(this,arguments);callValidate.errors=r.errors;return t}}function chooseGetId(e){switch(e.schemaId){case"auto":return _get$IdOrId;case"id":return _getId;default:return _get$Id}}function _getId(e){if(e.$id)this.logger.warn("schema $id ignored",e.$id);return e.id}function _get$Id(e){if(e.id)this.logger.warn("schema id ignored",e.id);return e.$id}function _get$IdOrId(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 errorsText(e,r){e=e||this.errors;if(!e)return"No errors";r=r||{};var t=r.separator===undefined?", ":r.separator;var a=r.dataVar===undefined?"data":r.dataVar;var s="";for(var i=0;i<e.length;i++){var o=e[i];if(o)s+=a+o.dataPath+" "+o.message+t}return s.slice(0,-t.length)}function addFormat(e,r){if(typeof r=="string")r=new RegExp(r);this._formats[e]=r;return this}function addDefaultMetaSchema(e){var r;if(e._opts.$data){r=t(7664);e.addMetaSchema(r,r.$id,true)}if(e._opts.meta===false)return;var a=t(7136);if(e._opts.$data)a=u(a,v);e.addMetaSchema(a,h,true);e._refs["http://json-schema.org/schema"]=h}function addInitialSchemas(e){var r=e._opts.schemas;if(!r)return;if(Array.isArray(r))e.addSchema(r);else for(var t in r)e.addSchema(r[t],t)}function addInitialFormats(e){for(var r in e._opts.formats){var t=e._opts.formats[r];e.addFormat(r,t)}}function addInitialKeywords(e){for(var r in e._opts.keywords){var t=e._opts.keywords[r];e.addKeyword(r,t)}}function checkUnique(e,r){if(e._schemas[r]||e._refs[r])throw new Error('schema with key or id "'+r+'" already exists')}function getMetaSchemaOptions(e){var r=d.copy(e._opts);for(var t=0;t<m.length;t++)delete r[m[t]];return r}function setLogger(e){var r=e._opts.logger;if(r===false){e.logger={log:noop,warn:noop,error:noop}}else{if(r===undefined)r=console;if(!(typeof r=="object"&&r.log&&r.warn&&r.error))throw new Error("logger must implement log, warn and error methods");e.logger=r}}function noop(){}},7731:e=>{"use strict";var r=e.exports=function Cache(){this._cache={}};r.prototype.put=function Cache_put(e,r){this._cache[e]=r};r.prototype.get=function Cache_get(e){return this._cache[e]};r.prototype.del=function Cache_del(e){delete this._cache[e]};r.prototype.clear=function Cache_clear(){this._cache={}}},2694:(e,r,t)=>{"use strict";var a=t(6343).MissingRef;e.exports=compileAsync;function compileAsync(e,r,t){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof r=="function"){t=r;r=undefined}var i=loadMetaSchemaOf(e).then((function(){var t=s._addSchema(e,undefined,r);return t.validate||_compileAsync(t)}));if(t){i.then((function(e){t(null,e)}),t)}return i;function loadMetaSchemaOf(e){var r=e.$schema;return r&&!s.getSchema(r)?compileAsync.call(s,{$ref:r},true):Promise.resolve()}function _compileAsync(e){try{return s._compile(e)}catch(e){if(e instanceof a)return loadMissingSchema(e);throw e}function loadMissingSchema(t){var a=t.missingSchema;if(added(a))throw new Error("Schema "+a+" is loaded but "+t.missingRef+" cannot be resolved");var i=s._loadingSchemas[a];if(!i){i=s._loadingSchemas[a]=s._opts.loadSchema(a);i.then(removePromise,removePromise)}return i.then((function(e){if(!added(a)){return loadMetaSchemaOf(e).then((function(){if(!added(a))s.addSchema(e,a,undefined,r)}))}})).then((function(){return _compileAsync(e)}));function removePromise(){delete s._loadingSchemas[a]}function added(e){return s._refs[e]||s._schemas[e]}}}}},6343:(e,r,t)=>{"use strict";var a=t(2603);e.exports={Validation:errorSubclass(ValidationError),MissingRef:errorSubclass(MissingRefError)};function ValidationError(e){this.message="validation failed";this.errors=e;this.ajv=this.validation=true}MissingRefError.message=function(e,r){return"can't resolve reference "+r+" from id "+e};function MissingRefError(e,r,t){this.message=t||MissingRefError.message(e,r);this.missingRef=a.url(e,r);this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function errorSubclass(e){e.prototype=Object.create(Error.prototype);e.prototype.constructor=e;return e}},2015:(e,r,t)=>{"use strict";var a=t(8716);var s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;var i=[0,31,28,31,30,31,30,31,31,30,31,30,31];var o=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;var 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;var 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;var 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;var u=/^(?:(?:[^\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;var 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;var f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;var p=/^(?:\/(?:[^~/]|~0|~1)*)*$/;var h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;var m=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;e.exports=formats;function formats(e){e=e=="full"?"full":"fast";return a.copy(formats[e])}formats.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":u,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:regex,uuid:f,"json-pointer":p,"json-pointer-uri-fragment":h,"relative-json-pointer":m};formats.full={date:date,time:time,"date-time":date_time,uri:uri,"uri-reference":c,"uri-template":u,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:regex,uuid:f,"json-pointer":p,"json-pointer-uri-fragment":h,"relative-json-pointer":m};function isLeapYear(e){return e%4===0&&(e%100!==0||e%400===0)}function date(e){var r=e.match(s);if(!r)return false;var t=+r[1];var a=+r[2];var o=+r[3];return a>=1&&a<=12&&o>=1&&o<=(a==2&&isLeapYear(t)?29:i[a])}function time(e,r){var t=e.match(o);if(!t)return false;var a=t[1];var s=t[2];var i=t[3];var n=t[5];return(a<=23&&s<=59&&i<=59||a==23&&s==59&&i==60)&&(!r||n)}var v=/t|\s/i;function date_time(e){var r=e.split(v);return r.length==2&&date(r[0])&&time(r[1],true)}var g=/\/|:/;function uri(e){return g.test(e)&&l.test(e)}var y=/[^\\]\\Z/;function regex(e){if(y.test(e))return false;try{new RegExp(e);return true}catch(e){return false}}},9258:(e,r,t)=>{"use strict";var a=t(2603),s=t(8716),i=t(6343),o=t(6424);var n=t(7003);var l=s.ucs2length;var c=t(1230);var u=i.Validation;e.exports=compile;function compile(e,r,t,d){var f=this,p=this._opts,h=[undefined],m={},v=[],g={},y=[],P={},b=[];r=r||{schema:e,refVal:h,refs:m};var S=checkCompiling.call(this,e,r,d);var _=this._compilations[S.index];if(S.compiling)return _.callValidate=callValidate;var R=this._formats;var E=this.RULES;try{var w=localCompile(e,r,t,d);_.validate=w;var z=_.callValidate;if(z){z.schema=w.schema;z.errors=null;z.refs=w.refs;z.refVal=w.refVal;z.root=w.root;z.$async=w.$async;if(p.sourceCode)z.source=w.source}return w}finally{endCompiling.call(this,e,r,d)}function callValidate(){var e=_.validate;var r=e.apply(this,arguments);callValidate.errors=e.errors;return r}function localCompile(e,t,o,d){var g=!t||t&&t.schema==e;if(t.schema!=r.schema)return compile.call(f,e,t,o,d);var P=e.$async===true;var S=n({isTop:true,schema:e,isRoot:g,baseId:d,root:t,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:i.MissingRef,RULES:E,validate:n,util:s,resolve:a,resolveRef:resolveRef,usePattern:usePattern,useDefault:useDefault,useCustomRule:useCustomRule,opts:p,formats:R,logger:f.logger,self:f});S=vars(h,refValCode)+vars(v,patternCode)+vars(y,defaultCode)+vars(b,customRuleCode)+S;if(p.processCode)S=p.processCode(S,e);var _;try{var w=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",S);_=w(f,E,R,r,h,y,b,c,l,u);h[0]=_}catch(e){f.logger.error("Error compiling schema, function code:",S);throw e}_.schema=e;_.errors=null;_.refs=m;_.refVal=h;_.root=g?_:t;if(P)_.$async=true;if(p.sourceCode===true){_.source={code:S,patterns:v,defaults:y}}return _}function resolveRef(e,s,i){s=a.url(e,s);var o=m[s];var n,l;if(o!==undefined){n=h[o];l="refVal["+o+"]";return resolvedRef(n,l)}if(!i&&r.refs){var c=r.refs[s];if(c!==undefined){n=r.refVal[c];l=addLocalRef(s,n);return resolvedRef(n,l)}}l=addLocalRef(s);var u=a.call(f,localCompile,r,s);if(u===undefined){var d=t&&t[s];if(d){u=a.inlineRef(d,p.inlineRefs)?d:compile.call(f,d,r,t,e)}}if(u===undefined){removeLocalRef(s)}else{replaceLocalRef(s,u);return resolvedRef(u,l)}}function addLocalRef(e,r){var t=h.length;h[t]=r;m[e]=t;return"refVal"+t}function removeLocalRef(e){delete m[e]}function replaceLocalRef(e,r){var t=m[e];h[t]=r}function resolvedRef(e,r){return typeof e=="object"||typeof e=="boolean"?{code:r,schema:e,inline:true}:{code:r,$async:e&&!!e.$async}}function usePattern(e){var r=g[e];if(r===undefined){r=g[e]=v.length;v[r]=e}return"pattern"+r}function useDefault(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return s.toQuotedString(e);case"object":if(e===null)return"null";var r=o(e);var t=P[r];if(t===undefined){t=P[r]=y.length;y[t]=e}return"default"+t}}function useCustomRule(e,r,t,a){if(f._opts.validateSchema!==false){var s=e.definition.dependencies;if(s&&!s.every((function(e){return Object.prototype.hasOwnProperty.call(t,e)})))throw new Error("parent schema must have all required keywords: "+s.join(","));var i=e.definition.validateSchema;if(i){var o=i(r);if(!o){var n="keyword schema is invalid: "+f.errorsText(i.errors);if(f._opts.validateSchema=="log")f.logger.error(n);else throw new Error(n)}}}var l=e.definition.compile,c=e.definition.inline,u=e.definition.macro;var d;if(l){d=l.call(f,r,t,a)}else if(u){d=u.call(f,r,t,a);if(p.validateSchema!==false)f.validateSchema(d,true)}else if(c){d=c.call(f,a,e.keyword,r,t)}else{d=e.definition.validate;if(!d)return}if(d===undefined)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=b.length;b[h]=d;return{code:"customRule"+h,validate:d}}}function checkCompiling(e,r,t){var a=compIndex.call(this,e,r,t);if(a>=0)return{index:a,compiling:true};a=this._compilations.length;this._compilations[a]={schema:e,root:r,baseId:t};return{index:a,compiling:false}}function endCompiling(e,r,t){var a=compIndex.call(this,e,r,t);if(a>=0)this._compilations.splice(a,1)}function compIndex(e,r,t){for(var a=0;a<this._compilations.length;a++){var s=this._compilations[a];if(s.schema==e&&s.root==r&&s.baseId==t)return a}return-1}function patternCode(e,r){return"var pattern"+e+" = new RegExp("+s.toQuotedString(r[e])+");"}function defaultCode(e){return"var default"+e+" = defaults["+e+"];"}function refValCode(e,r){return r[e]===undefined?"":"var refVal"+e+" = refVal["+e+"];"}function customRuleCode(e){return"var customRule"+e+" = customRules["+e+"];"}function vars(e,r){if(!e.length)return"";var t="";for(var a=0;a<e.length;a++)t+=r(a,e);return t}},2603:(e,r,t)=>{"use strict";var a=t(4856),s=t(1230),i=t(8716),o=t(2961),n=t(6042);e.exports=resolve;resolve.normalizeId=normalizeId;resolve.fullPath=getFullPath;resolve.url=resolveUrl;resolve.ids=resolveIds;resolve.inlineRef=inlineRef;resolve.schema=resolveSchema;function resolve(e,r,t){var a=this._refs[t];if(typeof a=="string"){if(this._refs[a])a=this._refs[a];else return resolve.call(this,e,r,a)}a=a||this._schemas[t];if(a instanceof o){return inlineRef(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a)}var s=resolveSchema.call(this,r,t);var i,n,l;if(s){i=s.schema;r=s.root;l=s.baseId}if(i instanceof o){n=i.validate||e.call(this,i.schema,r,undefined,l)}else if(i!==undefined){n=inlineRef(i,this._opts.inlineRefs)?i:e.call(this,i,r,undefined,l)}return n}function resolveSchema(e,r){var t=a.parse(r),s=_getFullPath(t),i=getFullPath(this._getId(e.schema));if(Object.keys(e.schema).length===0||s!==i){var n=normalizeId(s);var l=this._refs[n];if(typeof l=="string"){return resolveRecursive.call(this,e,l,t)}else if(l instanceof o){if(!l.validate)this._compile(l);e=l}else{l=this._schemas[n];if(l instanceof o){if(!l.validate)this._compile(l);if(n==normalizeId(r))return{schema:l,root:e,baseId:i};e=l}else{return}}if(!e.schema)return;i=getFullPath(this._getId(e.schema))}return getJsonPointer.call(this,t,i,e.schema,e)}function resolveRecursive(e,r,t){var a=resolveSchema.call(this,e,r);if(a){var s=a.schema;var i=a.baseId;e=a.root;var o=this._getId(s);if(o)i=resolveUrl(i,o);return getJsonPointer.call(this,t,i,s,e)}}var l=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(e,r,t,a){e.fragment=e.fragment||"";if(e.fragment.slice(0,1)!="/")return;var s=e.fragment.split("/");for(var o=1;o<s.length;o++){var n=s[o];if(n){n=i.unescapeFragment(n);t=t[n];if(t===undefined)break;var c;if(!l[n]){c=this._getId(t);if(c)r=resolveUrl(r,c);if(t.$ref){var u=resolveUrl(r,t.$ref);var d=resolveSchema.call(this,a,u);if(d){t=d.schema;a=d.root;r=d.baseId}}}}}if(t!==undefined&&t!==a.schema)return{schema:t,root:a,baseId:r}}var c=i.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function inlineRef(e,r){if(r===false)return false;if(r===undefined||r===true)return checkNoRef(e);else if(r)return countKeys(e)<=r}function checkNoRef(e){var r;if(Array.isArray(e)){for(var t=0;t<e.length;t++){r=e[t];if(typeof r=="object"&&!checkNoRef(r))return false}}else{for(var a in e){if(a=="$ref")return false;r=e[a];if(typeof r=="object"&&!checkNoRef(r))return false}}return true}function countKeys(e){var r=0,t;if(Array.isArray(e)){for(var a=0;a<e.length;a++){t=e[a];if(typeof t=="object")r+=countKeys(t);if(r==Infinity)return Infinity}}else{for(var s in e){if(s=="$ref")return Infinity;if(c[s]){r++}else{t=e[s];if(typeof t=="object")r+=countKeys(t)+1;if(r==Infinity)return Infinity}}}return r}function getFullPath(e,r){if(r!==false)e=normalizeId(e);var t=a.parse(e);return _getFullPath(t)}function _getFullPath(e){return a.serialize(e).split("#")[0]+"#"}var u=/#\/?$/;function normalizeId(e){return e?e.replace(u,""):""}function resolveUrl(e,r){r=normalizeId(r);return a.resolve(e,r)}function resolveIds(e){var r=normalizeId(this._getId(e));var t={"":r};var o={"":getFullPath(r,false)};var l={};var c=this;n(e,{allKeys:true},(function(e,r,n,u,d,f,p){if(r==="")return;var h=c._getId(e);var m=t[u];var v=o[u]+"/"+d;if(p!==undefined)v+="/"+(typeof p=="number"?p:i.escapeFragment(p));if(typeof h=="string"){h=m=normalizeId(m?a.resolve(m,h):h);var g=c._refs[h];if(typeof g=="string")g=c._refs[g];if(g&&g.schema){if(!s(e,g.schema))throw new Error('id "'+h+'" resolves to more than one schema')}else if(h!=normalizeId(v)){if(h[0]=="#"){if(l[h]&&!s(e,l[h]))throw new Error('id "'+h+'" resolves to more than one schema');l[h]=e}else{c._refs[h]=v}}}t[r]=m;o[r]=v}));return l}},9233:(e,r,t)=>{"use strict";var a=t(6964),s=t(8716).toHash;e.exports=function rules(){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"]}];var r=["type","$comment"];var t=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"];var i=["number","integer","string","array","object","boolean","null"];e.all=s(r);e.types=s(i);e.forEach((function(t){t.rules=t.rules.map((function(t){var s;if(typeof t=="object"){var i=Object.keys(t)[0];s=t[i];t=i;s.forEach((function(t){r.push(t);e.all[t]=true}))}r.push(t);var o=e.all[t]={keyword:t,code:a[t],implements:s};return o}));e.all.$comment={keyword:"$comment",code:a.$comment};if(t.type)e.types[t.type]=t}));e.keywords=s(r.concat(t));e.custom={};return e}},2961:(e,r,t)=>{"use strict";var a=t(8716);e.exports=SchemaObject;function SchemaObject(e){a.copy(e,this)}},2:e=>{"use strict";e.exports=function ucs2length(e){var r=0,t=e.length,a=0,s;while(a<t){r++;s=e.charCodeAt(a++);if(s>=55296&&s<=56319&&a<t){s=e.charCodeAt(a);if((s&64512)==56320)a++}}return r}},8716:(e,r,t)=>{"use strict";e.exports={copy:copy,checkDataType:checkDataType,checkDataTypes:checkDataTypes,coerceToTypes:coerceToTypes,toHash:toHash,getProperty:getProperty,escapeQuotes:escapeQuotes,equal:t(1230),ucs2length:t(2),varOccurences:varOccurences,varReplace:varReplace,schemaHasRules:schemaHasRules,schemaHasRulesExcept:schemaHasRulesExcept,schemaUnknownRules:schemaUnknownRules,toQuotedString:toQuotedString,getPathExpr:getPathExpr,getPath:getPath,getData:getData,unescapeFragment:unescapeFragment,unescapeJsonPointer:unescapeJsonPointer,escapeFragment:escapeFragment,escapeJsonPointer:escapeJsonPointer};function copy(e,r){r=r||{};for(var t in e)r[t]=e[t];return r}function checkDataType(e,r,t,a){var s=a?" !== ":" === ",i=a?" || ":" && ",o=a?"!":"",n=a?"":"!";switch(e){case"null":return r+s+"null";case"array":return o+"Array.isArray("+r+")";case"object":return"("+o+r+i+"typeof "+r+s+'"object"'+i+n+"Array.isArray("+r+"))";case"integer":return"(typeof "+r+s+'"number"'+i+n+"("+r+" % 1)"+i+r+s+r+(t?i+o+"isFinite("+r+")":"")+")";case"number":return"(typeof "+r+s+'"'+e+'"'+(t?i+o+"isFinite("+r+")":"")+")";default:return"typeof "+r+s+'"'+e+'"'}}function checkDataTypes(e,r,t){switch(e.length){case 1:return checkDataType(e[0],r,t,true);default:var a="";var s=toHash(e);if(s.array&&s.object){a=s.null?"(":"(!"+r+" || ";a+="typeof "+r+' !== "object")';delete s.null;delete s.array;delete s.object}if(s.number)delete s.integer;for(var i in s)a+=(a?" && ":"")+checkDataType(i,r,t,true);return a}}var a=toHash(["string","number","integer","boolean","null"]);function coerceToTypes(e,r){if(Array.isArray(r)){var t=[];for(var s=0;s<r.length;s++){var i=r[s];if(a[i])t[t.length]=i;else if(e==="array"&&i==="array")t[t.length]=i}if(t.length)return t}else if(a[r]){return[r]}else if(e==="array"&&r==="array"){return["array"]}}function toHash(e){var r={};for(var t=0;t<e.length;t++)r[e[t]]=true;return r}var s=/^[a-z$_][a-z$_0-9]*$/i;var i=/'|\\/g;function getProperty(e){return typeof e=="number"?"["+e+"]":s.test(e)?"."+e:"['"+escapeQuotes(e)+"']"}function escapeQuotes(e){return e.replace(i,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function varOccurences(e,r){r+="[^0-9]";var t=e.match(new RegExp(r,"g"));return t?t.length:0}function varReplace(e,r,t){r+="([^0-9])";t=t.replace(/\$/g,"$$$$");return e.replace(new RegExp(r,"g"),t+"$1")}function schemaHasRules(e,r){if(typeof e=="boolean")return!e;for(var t in e)if(r[t])return true}function schemaHasRulesExcept(e,r,t){if(typeof e=="boolean")return!e&&t!="not";for(var a in e)if(a!=t&&r[a])return true}function schemaUnknownRules(e,r){if(typeof e=="boolean")return;for(var t in e)if(!r[t])return t}function toQuotedString(e){return"'"+escapeQuotes(e)+"'"}function getPathExpr(e,r,t,a){var s=t?"'/' + "+r+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+r+" + ']'":"'[\\'' + "+r+" + '\\']'";return joinPaths(e,s)}function getPath(e,r,t){var a=t?toQuotedString("/"+escapeJsonPointer(r)):toQuotedString(getProperty(r));return joinPaths(e,a)}var o=/^\/(?:[^~]|~0|~1)*$/;var n=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(e,r,t){var a,s,i,l;if(e==="")return"rootData";if(e[0]=="/"){if(!o.test(e))throw new Error("Invalid JSON-pointer: "+e);s=e;i="rootData"}else{l=e.match(n);if(!l)throw new Error("Invalid JSON-pointer: "+e);a=+l[1];s=l[2];if(s=="#"){if(a>=r)throw new Error("Cannot access property/index "+a+" levels up, current level is "+r);return t[r-a]}if(a>r)throw new Error("Cannot access data "+a+" levels up, current level is "+r);i="data"+(r-a||"");if(!s)return i}var c=i;var u=s.split("/");for(var d=0;d<u.length;d++){var f=u[d];if(f){i+=getProperty(unescapeJsonPointer(f));c+=" && "+i}}return c}function joinPaths(e,r){if(e=='""')return r;return(e+" + "+r).replace(/([^\\])' \+ '/g,"$1")}function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}function escapeJsonPointer(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},1966:e=>{"use strict";var r=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var a=0;a<t.length;a++){e=JSON.parse(JSON.stringify(e));var s=t[a].split("/");var i=e;var o;for(o=1;o<s.length;o++)i=i[s[o]];for(o=0;o<r.length;o++){var n=r[o];var l=i[n];if(l){i[n]={anyOf:[l,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}}return e}},6686:(e,r,t)=>{"use strict";var a=t(7136);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"}]}}}},4130:e=>{"use strict";e.exports=function generate__limit(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u;var d="data"+(i||"");var f=e.opts.$data&&o&&o.$data,p;if(f){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";p="schema"+s}else{p=o}var h=r=="maximum",m=h?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[m],g=e.opts.$data&&v&&v.$data,y=h?"<":">",P=h?">":"<",u=undefined;if(!(f||typeof o=="number"||o===undefined)){throw new Error(r+" must be number")}if(!(g||v===undefined||typeof v=="number"||typeof v=="boolean")){throw new Error(m+" must be number or boolean")}if(g){var b=e.util.getData(v.$data,i,e.dataPathArr),S="exclusive"+s,_="exclType"+s,R="exclIsNumber"+s,E="op"+s,w="' + "+E+" + '";a+=" var schemaExcl"+s+" = "+b+"; ";b="schemaExcl"+s;a+=" var "+S+"; var "+_+" = typeof "+b+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var u=m;var z=z||[];z.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(u||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ";if(e.opts.messages!==false){a+=" , message: '"+m+" should be boolean' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "}a+=" } "}else{a+=" {} "}var x=a;a=z.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+x+"]); "}else{a+=" validate.errors = ["+x+"]; return false; "}}else{a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } else if ( ";if(f){a+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "}a+=" "+_+" == 'number' ? ( ("+S+" = "+p+" === undefined || "+b+" "+y+"= "+p+") ? "+d+" "+P+"= "+b+" : "+d+" "+P+" "+p+" ) : ( ("+S+" = "+b+" === true) ? "+d+" "+P+"= "+p+" : "+d+" "+P+" "+p+" ) || "+d+" !== "+d+") { var op"+s+" = "+S+" ? '"+y+"' : '"+y+"='; ";if(o===undefined){u=m;l=e.errSchemaPath+"/"+m;p=b;f=g}}else{var R=typeof v=="number",w=y;if(R&&f){var E="'"+w+"'";a+=" if ( ";if(f){a+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "}a+=" ( "+p+" === undefined || "+v+" "+y+"= "+p+" ? "+d+" "+P+"= "+v+" : "+d+" "+P+" "+p+" ) || "+d+" !== "+d+") { "}else{if(R&&o===undefined){S=true;u=m;l=e.errSchemaPath+"/"+m;p=v;P+="="}else{if(R)p=Math[h?"min":"max"](v,o);if(v===(R?p:true)){S=true;u=m;l=e.errSchemaPath+"/"+m;P+="="}else{S=false;w+="="}}var E="'"+w+"'";a+=" if ( ";if(f){a+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "}a+=" "+d+" "+P+" "+p+" || "+d+" !== "+d+") { "}}u=u||r;var z=z||[];z.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(u||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+E+", limit: "+p+", exclusive: "+S+" } ";if(e.opts.messages!==false){a+=" , message: 'should be "+w+" ";if(f){a+="' + "+p}else{a+=""+p+"'"}}if(e.opts.verbose){a+=" , schema: ";if(f){a+="validate.schema"+n}else{a+=""+o}a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "}a+=" } "}else{a+=" {} "}var x=a;a=z.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+x+"]); "}else{a+=" validate.errors = ["+x+"]; return false; "}}else{a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } ";if(c){a+=" else { "}return a}},3472:e=>{"use strict";e.exports=function generate__limitItems(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u;var d="data"+(i||"");var f=e.opts.$data&&o&&o.$data,p;if(f){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";p="schema"+s}else{p=o}if(!(f||typeof o=="number")){throw new Error(r+" must be number")}var h=r=="maxItems"?">":"<";a+="if ( ";if(f){a+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "}a+=" "+d+".length "+h+" "+p+") { ";var u=r;var m=m||[];m.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(u||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+p+" } ";if(e.opts.messages!==false){a+=" , message: 'should NOT have ";if(r=="maxItems"){a+="more"}else{a+="fewer"}a+=" than ";if(f){a+="' + "+p+" + '"}else{a+=""+o}a+=" items' "}if(e.opts.verbose){a+=" , schema: ";if(f){a+="validate.schema"+n}else{a+=""+o}a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "}a+=" } "}else{a+=" {} "}var v=a;a=m.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+v+"]); "}else{a+=" validate.errors = ["+v+"]; return false; "}}else{a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+="} ";if(c){a+=" else { "}return a}},9018:e=>{"use strict";e.exports=function generate__limitLength(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u;var d="data"+(i||"");var f=e.opts.$data&&o&&o.$data,p;if(f){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";p="schema"+s}else{p=o}if(!(f||typeof o=="number")){throw new Error(r+" must be number")}var h=r=="maxLength"?">":"<";a+="if ( ";if(f){a+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "}if(e.opts.unicode===false){a+=" "+d+".length "}else{a+=" ucs2length("+d+") "}a+=" "+h+" "+p+") { ";var u=r;var m=m||[];m.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(u||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+p+" } ";if(e.opts.messages!==false){a+=" , message: 'should NOT be ";if(r=="maxLength"){a+="longer"}else{a+="shorter"}a+=" than ";if(f){a+="' + "+p+" + '"}else{a+=""+o}a+=" characters' "}if(e.opts.verbose){a+=" , schema: ";if(f){a+="validate.schema"+n}else{a+=""+o}a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "}a+=" } "}else{a+=" {} "}var v=a;a=m.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+v+"]); "}else{a+=" validate.errors = ["+v+"]; return false; "}}else{a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+="} ";if(c){a+=" else { "}return a}},8740:e=>{"use strict";e.exports=function generate__limitProperties(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u;var d="data"+(i||"");var f=e.opts.$data&&o&&o.$data,p;if(f){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";p="schema"+s}else{p=o}if(!(f||typeof o=="number")){throw new Error(r+" must be number")}var h=r=="maxProperties"?">":"<";a+="if ( ";if(f){a+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "}a+=" Object.keys("+d+").length "+h+" "+p+") { ";var u=r;var m=m||[];m.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(u||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+p+" } ";if(e.opts.messages!==false){a+=" , message: 'should NOT have ";if(r=="maxProperties"){a+="more"}else{a+="fewer"}a+=" than ";if(f){a+="' + "+p+" + '"}else{a+=""+o}a+=" properties' "}if(e.opts.verbose){a+=" , schema: ";if(f){a+="validate.schema"+n}else{a+=""+o}a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "}a+=" } "}else{a+=" {} "}var v=a;a=m.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+v+"]); "}else{a+=" validate.errors = ["+v+"]; return false; "}}else{a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+="} ";if(c){a+=" else { "}return a}},4378:e=>{"use strict";e.exports=function generate_allOf(e,r,t){var a=" ";var s=e.schema[r];var i=e.schemaPath+e.util.getProperty(r);var o=e.errSchemaPath+"/"+r;var n=!e.opts.allErrors;var l=e.util.copy(e);var c="";l.level++;var u="valid"+l.level;var d=l.baseId,f=true;var p=s;if(p){var h,m=-1,v=p.length-1;while(m<v){h=p[m+=1];if(e.opts.strictKeywords?typeof h=="object"&&Object.keys(h).length>0||h===false:e.util.schemaHasRules(h,e.RULES.all)){f=false;l.schema=h;l.schemaPath=i+"["+m+"]";l.errSchemaPath=o+"/"+m;a+=" "+e.validate(l)+" ";l.baseId=d;if(n){a+=" if ("+u+") { ";c+="}"}}}}if(n){if(f){a+=" if (true) { "}else{a+=" "+c.slice(0,-1)+" "}}return a}},9278:e=>{"use strict";e.exports=function generate_anyOf(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f="errs__"+s;var p=e.util.copy(e);var h="";p.level++;var m="valid"+p.level;var v=o.every((function(r){return e.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===false:e.util.schemaHasRules(r,e.RULES.all)}));if(v){var g=p.baseId;a+=" var "+f+" = errors; var "+d+" = false; ";var y=e.compositeRule;e.compositeRule=p.compositeRule=true;var P=o;if(P){var b,S=-1,_=P.length-1;while(S<_){b=P[S+=1];p.schema=b;p.schemaPath=n+"["+S+"]";p.errSchemaPath=l+"/"+S;a+=" "+e.validate(p)+" ";p.baseId=g;a+=" "+d+" = "+d+" || "+m+"; if (!"+d+") { ";h+="}"}}e.compositeRule=p.compositeRule=y;a+=" "+h+" if (!"+d+") { var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"anyOf"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ";if(e.opts.messages!==false){a+=" , message: 'should match some schema in anyOf' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(vErrors); "}else{a+=" validate.errors = vErrors; return false; "}}a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ";if(e.opts.allErrors){a+=" } "}}else{if(c){a+=" if (true) { "}}return a}},9263:e=>{"use strict";e.exports=function generate_comment(e,r,t){var a=" ";var s=e.schema[r];var i=e.errSchemaPath+"/"+r;var o=!e.opts.allErrors;var n=e.util.toQuotedString(s);if(e.opts.$comment===true){a+=" console.log("+n+");"}else if(typeof e.opts.$comment=="function"){a+=" self._opts.$comment("+n+", "+e.util.toQuotedString(i)+", validate.root.schema);"}return a}},5326:e=>{"use strict";e.exports=function generate_const(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f=e.opts.$data&&o&&o.$data,p;if(f){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";p="schema"+s}else{p=o}if(!f){a+=" var schema"+s+" = validate.schema"+n+";"}a+="var "+d+" = equal("+u+", schema"+s+"); if (!"+d+") { ";var h=h||[];h.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"const"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValue: schema"+s+" } ";if(e.opts.messages!==false){a+=" , message: 'should be equal to constant' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var m=a;a=h.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+m+"]); "}else{a+=" validate.errors = ["+m+"]; return false; "}}else{a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" }";if(c){a+=" else { "}return a}},7922:e=>{"use strict";e.exports=function generate_contains(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f="errs__"+s;var p=e.util.copy(e);var h="";p.level++;var m="valid"+p.level;var v="i"+s,g=p.dataLevel=e.dataLevel+1,y="data"+g,P=e.baseId,b=e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===false:e.util.schemaHasRules(o,e.RULES.all);a+="var "+f+" = errors;var "+d+";";if(b){var S=e.compositeRule;e.compositeRule=p.compositeRule=true;p.schema=o;p.schemaPath=n;p.errSchemaPath=l;a+=" var "+m+" = false; for (var "+v+" = 0; "+v+" < "+u+".length; "+v+"++) { ";p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,true);var _=u+"["+v+"]";p.dataPathArr[g]=v;var R=e.validate(p);p.baseId=P;if(e.util.varOccurences(R,y)<2){a+=" "+e.util.varReplace(R,y,_)+" "}else{a+=" var "+y+" = "+_+"; "+R+" "}a+=" if ("+m+") break; } ";e.compositeRule=p.compositeRule=S;a+=" "+h+" if (!"+m+") {"}else{a+=" if ("+u+".length == 0) {"}var E=E||[];E.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"contains"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ";if(e.opts.messages!==false){a+=" , message: 'should contain a valid item' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var w=a;a=E.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+w+"]); "}else{a+=" validate.errors = ["+w+"]; return false; "}}else{a+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } else { ";if(b){a+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } "}if(e.opts.allErrors){a+=" } "}return a}},8029:e=>{"use strict";e.exports=function generate_custom(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u;var d="data"+(i||"");var f="valid"+s;var p="errs__"+s;var h=e.opts.$data&&o&&o.$data,m;if(h){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";m="schema"+s}else{m=o}var v=this,g="definition"+s,y=v.definition,P="";var b,S,_,R,E;if(h&&y.$data){E="keywordValidate"+s;var w=y.validateSchema;a+=" var "+g+" = RULES.custom['"+r+"'].definition; var "+E+" = "+g+".validate;"}else{R=e.useCustomRule(v,o,e.schema,e);if(!R)return;m="validate.schema"+n;E=R.code;b=y.compile;S=y.inline;_=y.macro}var z=E+".errors",x="i"+s,C="ruleErr"+s,D=y.async;if(D&&!e.async)throw new Error("async keyword in sync schema");if(!(S||_)){a+=""+z+" = null;"}a+="var "+p+" = errors;var "+f+";";if(h&&y.$data){P+="}";a+=" if ("+m+" === undefined) { "+f+" = true; } else { ";if(w){P+="}";a+=" "+f+" = "+g+".validateSchema("+m+"); if ("+f+") { "}}if(S){if(y.statements){a+=" "+R.validate+" "}else{a+=" "+f+" = "+R.validate+"; "}}else if(_){var O=e.util.copy(e);var P="";O.level++;var j="valid"+O.level;O.schema=R.validate;O.schemaPath="";var T=e.compositeRule;e.compositeRule=O.compositeRule=true;var I=e.validate(O).replace(/validate\.schema/g,E);e.compositeRule=O.compositeRule=T;a+=" "+I}else{var A=A||[];A.push(a);a="";a+=" "+E+".call( ";if(e.opts.passContext){a+="this"}else{a+="self"}if(b||y.schema===false){a+=" , "+d+" "}else{a+=" , "+m+" , "+d+" , validate.schema"+e.schemaPath+" "}a+=" , (dataPath || '')";if(e.errorPath!='""'){a+=" + "+e.errorPath}var $=i?"data"+(i-1||""):"parentData",F=i?e.dataPathArr[i]:"parentDataProperty";a+=" , "+$+" , "+F+" , rootData ) ";var k=a;a=A.pop();if(y.errors===false){a+=" "+f+" = ";if(D){a+="await "}a+=""+k+"; "}else{if(D){z="customErrors"+s;a+=" var "+z+" = null; try { "+f+" = await "+k+"; } catch (e) { "+f+" = false; if (e instanceof ValidationError) "+z+" = e.errors; else throw e; } "}else{a+=" "+z+" = null; "+f+" = "+k+"; "}}}if(y.modifying){a+=" if ("+$+") "+d+" = "+$+"["+F+"];"}a+=""+P;if(y.valid){if(c){a+=" if (true) { "}}else{a+=" if ( ";if(y.valid===undefined){a+=" !";if(_){a+=""+j}else{a+=""+f}}else{a+=" "+!y.valid+" "}a+=") { ";u=v.keyword;var A=A||[];A.push(a);a="";var A=A||[];A.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(u||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+v.keyword+"' } ";if(e.opts.messages!==false){a+=" , message: 'should pass \""+v.keyword+"\" keyword validation' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "}a+=" } "}else{a+=" {} "}var q=a;a=A.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+q+"]); "}else{a+=" validate.errors = ["+q+"]; return false; "}}else{a+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}var N=a;a=A.pop();if(S){if(y.errors){if(y.errors!="full"){a+=" for (var "+x+"="+p+"; "+x+"<errors; "+x+"++) { var "+C+" = vErrors["+x+"]; if ("+C+".dataPath === undefined) "+C+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+C+".schemaPath === undefined) { "+C+'.schemaPath = "'+l+'"; } ';if(e.opts.verbose){a+=" "+C+".schema = "+m+"; "+C+".data = "+d+"; "}a+=" } "}}else{if(y.errors===false){a+=" "+N+" "}else{a+=" if ("+p+" == errors) { "+N+" } else { for (var "+x+"="+p+"; "+x+"<errors; "+x+"++) { var "+C+" = vErrors["+x+"]; if ("+C+".dataPath === undefined) "+C+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+C+".schemaPath === undefined) { "+C+'.schemaPath = "'+l+'"; } ';if(e.opts.verbose){a+=" "+C+".schema = "+m+"; "+C+".data = "+d+"; "}a+=" } } "}}}else if(_){a+=" var err = ";if(e.createErrors!==false){a+=" { keyword: '"+(u||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+v.keyword+"' } ";if(e.opts.messages!==false){a+=" , message: 'should pass \""+v.keyword+"\" keyword validation' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(vErrors); "}else{a+=" validate.errors = vErrors; return false; "}}}else{if(y.errors===false){a+=" "+N+" "}else{a+=" if (Array.isArray("+z+")) { if (vErrors === null) vErrors = "+z+"; else vErrors = vErrors.concat("+z+"); errors = vErrors.length; for (var "+x+"="+p+"; "+x+"<errors; "+x+"++) { var "+C+" = vErrors["+x+"]; if ("+C+".dataPath === undefined) "+C+".dataPath = (dataPath || '') + "+e.errorPath+"; "+C+'.schemaPath = "'+l+'"; ';if(e.opts.verbose){a+=" "+C+".schema = "+m+"; "+C+".data = "+d+"; "}a+=" } } else { "+N+" } "}}a+=" } ";if(c){a+=" else { "}}return a}},2283:e=>{"use strict";e.exports=function generate_dependencies(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="errs__"+s;var f=e.util.copy(e);var p="";f.level++;var h="valid"+f.level;var m={},v={},g=e.opts.ownProperties;for(S in o){if(S=="__proto__")continue;var y=o[S];var P=Array.isArray(y)?v:m;P[S]=y}a+="var "+d+" = errors;";var b=e.errorPath;a+="var missing"+s+";";for(var S in v){P=v[S];if(P.length){a+=" if ( "+u+e.util.getProperty(S)+" !== undefined ";if(g){a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(S)+"') "}if(c){a+=" && ( ";var _=P;if(_){var R,E=-1,w=_.length-1;while(E<w){R=_[E+=1];if(E){a+=" || "}var z=e.util.getProperty(R),x=u+z;a+=" ( ( "+x+" === undefined ";if(g){a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(R)+"') "}a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?R:z)+") ) "}}a+=")) { ";var C="missing"+s,D="' + "+C+" + '";if(e.opts._errorDataPathProperty){e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,C,true):b+" + "+C}var O=O||[];O.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"dependencies"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { property: '"+e.util.escapeQuotes(S)+"', missingProperty: '"+D+"', depsCount: "+P.length+", deps: '"+e.util.escapeQuotes(P.length==1?P[0]:P.join(", "))+"' } ";if(e.opts.messages!==false){a+=" , message: 'should have ";if(P.length==1){a+="property "+e.util.escapeQuotes(P[0])}else{a+="properties "+e.util.escapeQuotes(P.join(", "))}a+=" when property "+e.util.escapeQuotes(S)+" is present' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var j=a;a=O.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+j+"]); "}else{a+=" validate.errors = ["+j+"]; return false; "}}else{a+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}}else{a+=" ) { ";var T=P;if(T){var R,I=-1,A=T.length-1;while(I<A){R=T[I+=1];var z=e.util.getProperty(R),D=e.util.escapeQuotes(R),x=u+z;if(e.opts._errorDataPathProperty){e.errorPath=e.util.getPath(b,R,e.opts.jsonPointers)}a+=" if ( "+x+" === undefined ";if(g){a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(R)+"') "}a+=") { var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"dependencies"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { property: '"+e.util.escapeQuotes(S)+"', missingProperty: '"+D+"', depsCount: "+P.length+", deps: '"+e.util.escapeQuotes(P.length==1?P[0]:P.join(", "))+"' } ";if(e.opts.messages!==false){a+=" , message: 'should have ";if(P.length==1){a+="property "+e.util.escapeQuotes(P[0])}else{a+="properties "+e.util.escapeQuotes(P.join(", "))}a+=" when property "+e.util.escapeQuotes(S)+" is present' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}a+=" } ";if(c){p+="}";a+=" else { "}}}e.errorPath=b;var $=f.baseId;for(var S in m){var y=m[S];if(e.opts.strictKeywords?typeof y=="object"&&Object.keys(y).length>0||y===false:e.util.schemaHasRules(y,e.RULES.all)){a+=" "+h+" = true; if ( "+u+e.util.getProperty(S)+" !== undefined ";if(g){a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(S)+"') "}a+=") { ";f.schema=y;f.schemaPath=n+e.util.getProperty(S);f.errSchemaPath=l+"/"+e.util.escapeFragment(S);a+=" "+e.validate(f)+" ";f.baseId=$;a+=" } ";if(c){a+=" if ("+h+") { ";p+="}"}}}if(c){a+=" "+p+" if ("+d+" == errors) {"}return a}},2783:e=>{"use strict";e.exports=function generate_enum(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f=e.opts.$data&&o&&o.$data,p;if(f){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";p="schema"+s}else{p=o}var h="i"+s,m="schema"+s;if(!f){a+=" var "+m+" = validate.schema"+n+";"}a+="var "+d+";";if(f){a+=" if (schema"+s+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+s+")) "+d+" = false; else {"}a+=""+d+" = false;for (var "+h+"=0; "+h+"<"+m+".length; "+h+"++) if (equal("+u+", "+m+"["+h+"])) { "+d+" = true; break; }";if(f){a+=" } "}a+=" if (!"+d+") { ";var v=v||[];v.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"enum"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+s+" } ";if(e.opts.messages!==false){a+=" , message: 'should be equal to one of the allowed values' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var g=a;a=v.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+g+"]); "}else{a+=" validate.errors = ["+g+"]; return false; "}}else{a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" }";if(c){a+=" else { "}return a}},9175:e=>{"use strict";e.exports=function generate_format(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");if(e.opts.format===false){if(c){a+=" if (true) { "}return a}var d=e.opts.$data&&o&&o.$data,f;if(d){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";f="schema"+s}else{f=o}var p=e.opts.unknownFormats,h=Array.isArray(p);if(d){var m="format"+s,v="isObject"+s,g="formatType"+s;a+=" var "+m+" = formats["+f+"]; var "+v+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+g+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ";if(e.async){a+=" var async"+s+" = "+m+".async; "}a+=" "+m+" = "+m+".validate; } if ( ";if(d){a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "}a+=" (";if(p!="ignore"){a+=" ("+f+" && !"+m+" ";if(h){a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "}a+=") || "}a+=" ("+m+" && "+g+" == '"+t+"' && !(typeof "+m+" == 'function' ? ";if(e.async){a+=" (async"+s+" ? await "+m+"("+u+") : "+m+"("+u+")) "}else{a+=" "+m+"("+u+") "}a+=" : "+m+".test("+u+"))))) {"}else{var m=e.formats[o];if(!m){if(p=="ignore"){e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"');if(c){a+=" if (true) { "}return a}else if(h&&p.indexOf(o)>=0){if(c){a+=" if (true) { "}return a}else{throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}}var v=typeof m=="object"&&!(m instanceof RegExp)&&m.validate;var g=v&&m.type||"string";if(v){var y=m.async===true;m=m.validate}if(g!=t){if(c){a+=" if (true) { "}return a}if(y){if(!e.async)throw new Error("async format in sync schema");var P="formats"+e.util.getProperty(o)+".validate";a+=" if (!(await "+P+"("+u+"))) { "}else{a+=" if (! ";var P="formats"+e.util.getProperty(o);if(v)P+=".validate";if(typeof m=="function"){a+=" "+P+"("+u+") "}else{a+=" "+P+".test("+u+") "}a+=") { "}}var b=b||[];b.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"format"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ";if(d){a+=""+f}else{a+=""+e.util.toQuotedString(o)}a+=" } ";if(e.opts.messages!==false){a+=" , message: 'should match format \"";if(d){a+="' + "+f+" + '"}else{a+=""+e.util.escapeQuotes(o)}a+="\"' "}if(e.opts.verbose){a+=" , schema: ";if(d){a+="validate.schema"+n}else{a+=""+e.util.toQuotedString(o)}a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var S=a;a=b.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+S+"]); "}else{a+=" validate.errors = ["+S+"]; return false; "}}else{a+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } ";if(c){a+=" else { "}return a}},5859:e=>{"use strict";e.exports=function generate_if(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f="errs__"+s;var p=e.util.copy(e);p.level++;var h="valid"+p.level;var m=e.schema["then"],v=e.schema["else"],g=m!==undefined&&(e.opts.strictKeywords?typeof m=="object"&&Object.keys(m).length>0||m===false:e.util.schemaHasRules(m,e.RULES.all)),y=v!==undefined&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===false:e.util.schemaHasRules(v,e.RULES.all)),P=p.baseId;if(g||y){var b;p.createErrors=false;p.schema=o;p.schemaPath=n;p.errSchemaPath=l;a+=" var "+f+" = errors; var "+d+" = true; ";var S=e.compositeRule;e.compositeRule=p.compositeRule=true;a+=" "+e.validate(p)+" ";p.baseId=P;p.createErrors=true;a+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ";e.compositeRule=p.compositeRule=S;if(g){a+=" if ("+h+") { ";p.schema=e.schema["then"];p.schemaPath=e.schemaPath+".then";p.errSchemaPath=e.errSchemaPath+"/then";a+=" "+e.validate(p)+" ";p.baseId=P;a+=" "+d+" = "+h+"; ";if(g&&y){b="ifClause"+s;a+=" var "+b+" = 'then'; "}else{b="'then'"}a+=" } ";if(y){a+=" else { "}}else{a+=" if (!"+h+") { "}if(y){p.schema=e.schema["else"];p.schemaPath=e.schemaPath+".else";p.errSchemaPath=e.errSchemaPath+"/else";a+=" "+e.validate(p)+" ";p.baseId=P;a+=" "+d+" = "+h+"; ";if(g&&y){b="ifClause"+s;a+=" var "+b+" = 'else'; "}else{b="'else'"}a+=" } "}a+=" if (!"+d+") { var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"if"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+b+" } ";if(e.opts.messages!==false){a+=" , message: 'should match \"' + "+b+" + '\" schema' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(vErrors); "}else{a+=" validate.errors = vErrors; return false; "}}a+=" } ";if(c){a+=" else { "}}else{if(c){a+=" if (true) { "}}return a}},6964:(e,r,t)=>{"use strict";e.exports={$ref:t(1473),allOf:t(4378),anyOf:t(9278),$comment:t(9263),const:t(5326),contains:t(7922),dependencies:t(2283),enum:t(2783),format:t(9175),if:t(5859),items:t(9187),maximum:t(4130),minimum:t(4130),maxItems:t(3472),minItems:t(3472),maxLength:t(9018),minLength:t(9018),maxProperties:t(8740),minProperties:t(8740),multipleOf:t(2644),not:t(4806),oneOf:t(1853),pattern:t(2944),properties:t(1615),propertyNames:t(6610),required:t(6172),uniqueItems:t(2370),validate:t(7003)}},9187:e=>{"use strict";e.exports=function generate_items(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f="errs__"+s;var p=e.util.copy(e);var h="";p.level++;var m="valid"+p.level;var v="i"+s,g=p.dataLevel=e.dataLevel+1,y="data"+g,P=e.baseId;a+="var "+f+" = errors;var "+d+";";if(Array.isArray(o)){var b=e.schema.additionalItems;if(b===false){a+=" "+d+" = "+u+".length <= "+o.length+"; ";var S=l;l=e.errSchemaPath+"/additionalItems";a+=" if (!"+d+") { ";var _=_||[];_.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"additionalItems"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ";if(e.opts.messages!==false){a+=" , message: 'should NOT have more than "+o.length+" items' "}if(e.opts.verbose){a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var R=a;a=_.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+R+"]); "}else{a+=" validate.errors = ["+R+"]; return false; "}}else{a+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } ";l=S;if(c){h+="}";a+=" else { "}}var E=o;if(E){var w,z=-1,x=E.length-1;while(z<x){w=E[z+=1];if(e.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===false:e.util.schemaHasRules(w,e.RULES.all)){a+=" "+m+" = true; if ("+u+".length > "+z+") { ";var C=u+"["+z+"]";p.schema=w;p.schemaPath=n+"["+z+"]";p.errSchemaPath=l+"/"+z;p.errorPath=e.util.getPathExpr(e.errorPath,z,e.opts.jsonPointers,true);p.dataPathArr[g]=z;var D=e.validate(p);p.baseId=P;if(e.util.varOccurences(D,y)<2){a+=" "+e.util.varReplace(D,y,C)+" "}else{a+=" var "+y+" = "+C+"; "+D+" "}a+=" } ";if(c){a+=" if ("+m+") { ";h+="}"}}}}if(typeof b=="object"&&(e.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===false:e.util.schemaHasRules(b,e.RULES.all))){p.schema=b;p.schemaPath=e.schemaPath+".additionalItems";p.errSchemaPath=e.errSchemaPath+"/additionalItems";a+=" "+m+" = 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,true);var C=u+"["+v+"]";p.dataPathArr[g]=v;var D=e.validate(p);p.baseId=P;if(e.util.varOccurences(D,y)<2){a+=" "+e.util.varReplace(D,y,C)+" "}else{a+=" var "+y+" = "+C+"; "+D+" "}if(c){a+=" if (!"+m+") break; "}a+=" } } ";if(c){a+=" if ("+m+") { ";h+="}"}}}else if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===false: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,true);var C=u+"["+v+"]";p.dataPathArr[g]=v;var D=e.validate(p);p.baseId=P;if(e.util.varOccurences(D,y)<2){a+=" "+e.util.varReplace(D,y,C)+" "}else{a+=" var "+y+" = "+C+"; "+D+" "}if(c){a+=" if (!"+m+") break; "}a+=" }"}if(c){a+=" "+h+" if ("+f+" == errors) {"}return a}},2644:e=>{"use strict";e.exports=function generate_multipleOf(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d=e.opts.$data&&o&&o.$data,f;if(d){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";f="schema"+s}else{f=o}if(!(d||typeof o=="number")){throw new Error(r+" must be number")}a+="var division"+s+";if (";if(d){a+=" "+f+" !== undefined && ( typeof "+f+" != 'number' || "}a+=" (division"+s+" = "+u+" / "+f+", ";if(e.opts.multipleOfPrecision){a+=" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" "}else{a+=" division"+s+" !== parseInt(division"+s+") "}a+=" ) ";if(d){a+=" ) "}a+=" ) { ";var p=p||[];p.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"multipleOf"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+f+" } ";if(e.opts.messages!==false){a+=" , message: 'should be multiple of ";if(d){a+="' + "+f}else{a+=""+f+"'"}}if(e.opts.verbose){a+=" , schema: ";if(d){a+="validate.schema"+n}else{a+=""+o}a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var h=a;a=p.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+h+"]); "}else{a+=" validate.errors = ["+h+"]; return false; "}}else{a+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+="} ";if(c){a+=" else { "}return a}},4806:e=>{"use strict";e.exports=function generate_not(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="errs__"+s;var f=e.util.copy(e);f.level++;var p="valid"+f.level;if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===false:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o;f.schemaPath=n;f.errSchemaPath=l;a+=" var "+d+" = errors; ";var h=e.compositeRule;e.compositeRule=f.compositeRule=true;f.createErrors=false;var m;if(f.opts.allErrors){m=f.opts.allErrors;f.opts.allErrors=false}a+=" "+e.validate(f)+" ";f.createErrors=true;if(m)f.opts.allErrors=m;e.compositeRule=f.compositeRule=h;a+=" if ("+p+") { ";var v=v||[];v.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"not"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ";if(e.opts.messages!==false){a+=" , message: 'should NOT be valid' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var g=a;a=v.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+g+"]); "}else{a+=" validate.errors = ["+g+"]; return false; "}}else{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; } ";if(e.opts.allErrors){a+=" } "}}else{a+=" var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"not"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ";if(e.opts.messages!==false){a+=" , message: 'should NOT be valid' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(c){a+=" if (false) { "}}return a}},1853:e=>{"use strict";e.exports=function generate_oneOf(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f="errs__"+s;var p=e.util.copy(e);var h="";p.level++;var m="valid"+p.level;var v=p.baseId,g="prevValid"+s,y="passingSchemas"+s;a+="var "+f+" = errors , "+g+" = false , "+d+" = false , "+y+" = null; ";var P=e.compositeRule;e.compositeRule=p.compositeRule=true;var b=o;if(b){var S,_=-1,R=b.length-1;while(_<R){S=b[_+=1];if(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===false:e.util.schemaHasRules(S,e.RULES.all)){p.schema=S;p.schemaPath=n+"["+_+"]";p.errSchemaPath=l+"/"+_;a+=" "+e.validate(p)+" ";p.baseId=v}else{a+=" var "+m+" = true; "}if(_){a+=" if ("+m+" && "+g+") { "+d+" = false; "+y+" = ["+y+", "+_+"]; } else { ";h+="}"}a+=" if ("+m+") { "+d+" = "+g+" = true; "+y+" = "+_+"; }"}}e.compositeRule=p.compositeRule=P;a+=""+h+"if (!"+d+") { var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"oneOf"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ";if(e.opts.messages!==false){a+=" , message: 'should match exactly one schema in oneOf' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(vErrors); "}else{a+=" validate.errors = vErrors; return false; "}}a+="} else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; }";if(e.opts.allErrors){a+=" } "}return a}},2944:e=>{"use strict";e.exports=function generate_pattern(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d=e.opts.$data&&o&&o.$data,f;if(d){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";f="schema"+s}else{f=o}var p=d?"(new RegExp("+f+"))":e.usePattern(o);a+="if ( ";if(d){a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "}a+=" !"+p+".test("+u+") ) { ";var h=h||[];h.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"pattern"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ";if(d){a+=""+f}else{a+=""+e.util.toQuotedString(o)}a+=" } ";if(e.opts.messages!==false){a+=" , message: 'should match pattern \"";if(d){a+="' + "+f+" + '"}else{a+=""+e.util.escapeQuotes(o)}a+="\"' "}if(e.opts.verbose){a+=" , schema: ";if(d){a+="validate.schema"+n}else{a+=""+e.util.toQuotedString(o)}a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var m=a;a=h.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+m+"]); "}else{a+=" validate.errors = ["+m+"]; return false; "}}else{a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+="} ";if(c){a+=" else { "}return a}},1615:e=>{"use strict";e.exports=function generate_properties(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="errs__"+s;var f=e.util.copy(e);var p="";f.level++;var h="valid"+f.level;var m="key"+s,v="idx"+s,g=f.dataLevel=e.dataLevel+1,y="data"+g,P="dataProperties"+s;var b=Object.keys(o||{}).filter(notProto),S=e.schema.patternProperties||{},_=Object.keys(S).filter(notProto),R=e.schema.additionalProperties,E=b.length||_.length,w=R===false,z=typeof R=="object"&&Object.keys(R).length,x=e.opts.removeAdditional,C=w||z||x,D=e.opts.ownProperties,O=e.baseId;var j=e.schema.required;if(j&&!(e.opts.$data&&j.$data)&&j.length<e.opts.loopRequired){var T=e.util.toHash(j)}function notProto(e){return e!=="__proto__"}a+="var "+d+" = errors;var "+h+" = true;";if(D){a+=" var "+P+" = undefined;"}if(C){if(D){a+=" "+P+" = "+P+" || Object.keys("+u+"); for (var "+v+"=0; "+v+"<"+P+".length; "+v+"++) { var "+m+" = "+P+"["+v+"]; "}else{a+=" for (var "+m+" in "+u+") { "}if(E){a+=" var isAdditional"+s+" = !(false ";if(b.length){if(b.length>8){a+=" || validate.schema"+n+".hasOwnProperty("+m+") "}else{var I=b;if(I){var A,$=-1,F=I.length-1;while($<F){A=I[$+=1];a+=" || "+m+" == "+e.util.toQuotedString(A)+" "}}}}if(_.length){var k=_;if(k){var q,N=-1,L=k.length-1;while(N<L){q=k[N+=1];a+=" || "+e.usePattern(q)+".test("+m+") "}}}a+=" ); if (isAdditional"+s+") { "}if(x=="all"){a+=" delete "+u+"["+m+"]; "}else{var M=e.errorPath;var U="' + "+m+" + '";if(e.opts._errorDataPathProperty){e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)}if(w){if(x){a+=" delete "+u+"["+m+"]; "}else{a+=" "+h+" = false; ";var V=l;l=e.errSchemaPath+"/additionalProperties";var H=H||[];H.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"additionalProperties"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { additionalProperty: '"+U+"' } ";if(e.opts.messages!==false){a+=" , message: '";if(e.opts._errorDataPathProperty){a+="is an invalid additional property"}else{a+="should NOT have additional properties"}a+="' "}if(e.opts.verbose){a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var Z=a;a=H.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+Z+"]); "}else{a+=" validate.errors = ["+Z+"]; return false; "}}else{a+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}l=V;if(c){a+=" break; "}}}else if(z){if(x=="failing"){a+=" var "+d+" = errors; ";var K=e.compositeRule;e.compositeRule=f.compositeRule=true;f.schema=R;f.schemaPath=e.schemaPath+".additionalProperties";f.errSchemaPath=e.errSchemaPath+"/additionalProperties";f.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var Q=u+"["+m+"]";f.dataPathArr[g]=m;var J=e.validate(f);f.baseId=O;if(e.util.varOccurences(J,y)<2){a+=" "+e.util.varReplace(J,y,Q)+" "}else{a+=" var "+y+" = "+Q+"; "+J+" "}a+=" if (!"+h+") { errors = "+d+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+u+"["+m+"]; } ";e.compositeRule=f.compositeRule=K}else{f.schema=R;f.schemaPath=e.schemaPath+".additionalProperties";f.errSchemaPath=e.errSchemaPath+"/additionalProperties";f.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var Q=u+"["+m+"]";f.dataPathArr[g]=m;var J=e.validate(f);f.baseId=O;if(e.util.varOccurences(J,y)<2){a+=" "+e.util.varReplace(J,y,Q)+" "}else{a+=" var "+y+" = "+Q+"; "+J+" "}if(c){a+=" if (!"+h+") break; "}}}e.errorPath=M}if(E){a+=" } "}a+=" } ";if(c){a+=" if ("+h+") { ";p+="}"}}var B=e.opts.useDefaults&&!e.compositeRule;if(b.length){var G=b;if(G){var A,W=-1,Y=G.length-1;while(W<Y){A=G[W+=1];var X=o[A];if(e.opts.strictKeywords?typeof X=="object"&&Object.keys(X).length>0||X===false:e.util.schemaHasRules(X,e.RULES.all)){var ee=e.util.getProperty(A),Q=u+ee,re=B&&X.default!==undefined;f.schema=X;f.schemaPath=n+ee;f.errSchemaPath=l+"/"+e.util.escapeFragment(A);f.errorPath=e.util.getPath(e.errorPath,A,e.opts.jsonPointers);f.dataPathArr[g]=e.util.toQuotedString(A);var J=e.validate(f);f.baseId=O;if(e.util.varOccurences(J,y)<2){J=e.util.varReplace(J,y,Q);var te=Q}else{var te=y;a+=" var "+y+" = "+Q+"; "}if(re){a+=" "+J+" "}else{if(T&&T[A]){a+=" if ( "+te+" === undefined ";if(D){a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(A)+"') "}a+=") { "+h+" = false; ";var M=e.errorPath,V=l,ae=e.util.escapeQuotes(A);if(e.opts._errorDataPathProperty){e.errorPath=e.util.getPath(M,A,e.opts.jsonPointers)}l=e.errSchemaPath+"/required";var H=H||[];H.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+ae+"' } ";if(e.opts.messages!==false){a+=" , message: '";if(e.opts._errorDataPathProperty){a+="is a required property"}else{a+="should have required property \\'"+ae+"\\'"}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var Z=a;a=H.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+Z+"]); "}else{a+=" validate.errors = ["+Z+"]; return false; "}}else{a+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}l=V;e.errorPath=M;a+=" } else { "}else{if(c){a+=" if ( "+te+" === undefined ";if(D){a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(A)+"') "}a+=") { "+h+" = true; } else { "}else{a+=" if ("+te+" !== undefined ";if(D){a+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(A)+"') "}a+=" ) { "}}a+=" "+J+" } "}}if(c){a+=" if ("+h+") { ";p+="}"}}}}if(_.length){var se=_;if(se){var q,ie=-1,oe=se.length-1;while(ie<oe){q=se[ie+=1];var X=S[q];if(e.opts.strictKeywords?typeof X=="object"&&Object.keys(X).length>0||X===false:e.util.schemaHasRules(X,e.RULES.all)){f.schema=X;f.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(q);f.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(q);if(D){a+=" "+P+" = "+P+" || Object.keys("+u+"); for (var "+v+"=0; "+v+"<"+P+".length; "+v+"++) { var "+m+" = "+P+"["+v+"]; "}else{a+=" for (var "+m+" in "+u+") { "}a+=" if ("+e.usePattern(q)+".test("+m+")) { ";f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var Q=u+"["+m+"]";f.dataPathArr[g]=m;var J=e.validate(f);f.baseId=O;if(e.util.varOccurences(J,y)<2){a+=" "+e.util.varReplace(J,y,Q)+" "}else{a+=" var "+y+" = "+Q+"; "+J+" "}if(c){a+=" if (!"+h+") break; "}a+=" } ";if(c){a+=" else "+h+" = true; "}a+=" } ";if(c){a+=" if ("+h+") { ";p+="}"}}}}}if(c){a+=" "+p+" if ("+d+" == errors) {"}return a}},6610:e=>{"use strict";e.exports=function generate_propertyNames(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="errs__"+s;var f=e.util.copy(e);var p="";f.level++;var h="valid"+f.level;a+="var "+d+" = errors;";if(e.opts.strictKeywords?typeof o=="object"&&Object.keys(o).length>0||o===false:e.util.schemaHasRules(o,e.RULES.all)){f.schema=o;f.schemaPath=n;f.errSchemaPath=l;var m="key"+s,v="idx"+s,g="i"+s,y="' + "+m+" + '",P=f.dataLevel=e.dataLevel+1,b="data"+P,S="dataProperties"+s,_=e.opts.ownProperties,R=e.baseId;if(_){a+=" var "+S+" = undefined; "}if(_){a+=" "+S+" = "+S+" || Object.keys("+u+"); for (var "+v+"=0; "+v+"<"+S+".length; "+v+"++) { var "+m+" = "+S+"["+v+"]; "}else{a+=" for (var "+m+" in "+u+") { "}a+=" var startErrs"+s+" = errors; ";var E=m;var w=e.compositeRule;e.compositeRule=f.compositeRule=true;var z=e.validate(f);f.baseId=R;if(e.util.varOccurences(z,b)<2){a+=" "+e.util.varReplace(z,b,E)+" "}else{a+=" var "+b+" = "+E+"; "+z+" "}e.compositeRule=f.compositeRule=w;a+=" if (!"+h+") { for (var "+g+"=startErrs"+s+"; "+g+"<errors; "+g+"++) { vErrors["+g+"].propertyName = "+m+"; } var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"propertyNames"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { propertyName: '"+y+"' } ";if(e.opts.messages!==false){a+=" , message: 'property name \\'"+y+"\\' is invalid' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(vErrors); "}else{a+=" validate.errors = vErrors; return false; "}}if(c){a+=" break; "}a+=" } }"}if(c){a+=" "+p+" if ("+d+" == errors) {"}return a}},1473:e=>{"use strict";e.exports=function generate_ref(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.errSchemaPath+"/"+r;var l=!e.opts.allErrors;var c="data"+(i||"");var u="valid"+s;var d,f;if(o=="#"||o=="#/"){if(e.isRoot){d=e.async;f="validate"}else{d=e.root.schema.$async===true;f="root.refVal[0]"}}else{var p=e.resolveRef(e.baseId,o,e.isRoot);if(p===undefined){var h=e.MissingRefError.message(e.baseId,o);if(e.opts.missingRefs=="fail"){e.logger.error(h);var m=m||[];m.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"$ref"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { ref: '"+e.util.escapeQuotes(o)+"' } ";if(e.opts.messages!==false){a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(o)+"' "}if(e.opts.verbose){a+=" , schema: "+e.util.toQuotedString(o)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "}a+=" } "}else{a+=" {} "}var v=a;a=m.pop();if(!e.compositeRule&&l){if(e.async){a+=" throw new ValidationError(["+v+"]); "}else{a+=" validate.errors = ["+v+"]; return false; "}}else{a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}if(l){a+=" if (false) { "}}else if(e.opts.missingRefs=="ignore"){e.logger.warn(h);if(l){a+=" if (true) { "}}else{throw new e.MissingRefError(e.baseId,o,h)}}else if(p.inline){var g=e.util.copy(e);g.level++;var y="valid"+g.level;g.schema=p.schema;g.schemaPath="";g.errSchemaPath=o;var P=e.validate(g).replace(/validate\.schema/g,p.code);a+=" "+P+" ";if(l){a+=" if ("+y+") { "}}else{d=p.$async===true||e.async&&p.$async!==false;f=p.code}}if(f){var m=m||[];m.push(a);a="";if(e.opts.passContext){a+=" "+f+".call(this, "}else{a+=" "+f+"( "}a+=" "+c+", (dataPath || '')";if(e.errorPath!='""'){a+=" + "+e.errorPath}var b=i?"data"+(i-1||""):"parentData",S=i?e.dataPathArr[i]:"parentDataProperty";a+=" , "+b+" , "+S+", rootData) ";var _=a;a=m.pop();if(d){if(!e.async)throw new Error("async schema referenced by sync schema");if(l){a+=" var "+u+"; "}a+=" try { await "+_+"; ";if(l){a+=" "+u+" = true; "}a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ";if(l){a+=" "+u+" = false; "}a+=" } ";if(l){a+=" if ("+u+") { "}}else{a+=" if (!"+_+") { if (vErrors === null) vErrors = "+f+".errors; else vErrors = vErrors.concat("+f+".errors); errors = vErrors.length; } ";if(l){a+=" else { "}}}return a}},6172:e=>{"use strict";e.exports=function generate_required(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f=e.opts.$data&&o&&o.$data,p;if(f){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";p="schema"+s}else{p=o}var h="schema"+s;if(!f){if(o.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var m=[];var v=o;if(v){var g,y=-1,P=v.length-1;while(y<P){g=v[y+=1];var b=e.schema.properties[g];if(!(b&&(e.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===false:e.util.schemaHasRules(b,e.RULES.all)))){m[m.length]=g}}}}else{var m=o}}if(f||m.length){var S=e.errorPath,_=f||m.length>=e.opts.loopRequired,R=e.opts.ownProperties;if(c){a+=" var missing"+s+"; ";if(_){if(!f){a+=" var "+h+" = validate.schema"+n+"; "}var E="i"+s,w="schema"+s+"["+E+"]",z="' + "+w+" + '";if(e.opts._errorDataPathProperty){e.errorPath=e.util.getPathExpr(S,w,e.opts.jsonPointers)}a+=" var "+d+" = true; ";if(f){a+=" if (schema"+s+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+s+")) "+d+" = false; else {"}a+=" for (var "+E+" = 0; "+E+" < "+h+".length; "+E+"++) { "+d+" = "+u+"["+h+"["+E+"]] !== undefined ";if(R){a+=" && Object.prototype.hasOwnProperty.call("+u+", "+h+"["+E+"]) "}a+="; if (!"+d+") break; } ";if(f){a+=" } "}a+=" if (!"+d+") { ";var x=x||[];x.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+z+"' } ";if(e.opts.messages!==false){a+=" , message: '";if(e.opts._errorDataPathProperty){a+="is a required property"}else{a+="should have required property \\'"+z+"\\'"}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var C=a;a=x.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+C+"]); "}else{a+=" validate.errors = ["+C+"]; return false; "}}else{a+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } else { "}else{a+=" if ( ";var D=m;if(D){var O,E=-1,j=D.length-1;while(E<j){O=D[E+=1];if(E){a+=" || "}var T=e.util.getProperty(O),I=u+T;a+=" ( ( "+I+" === undefined ";if(R){a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(O)+"') "}a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?O:T)+") ) "}}a+=") { ";var w="missing"+s,z="' + "+w+" + '";if(e.opts._errorDataPathProperty){e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(S,w,true):S+" + "+w}var x=x||[];x.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+z+"' } ";if(e.opts.messages!==false){a+=" , message: '";if(e.opts._errorDataPathProperty){a+="is a required property"}else{a+="should have required property \\'"+z+"\\'"}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var C=a;a=x.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+C+"]); "}else{a+=" validate.errors = ["+C+"]; return false; "}}else{a+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } else { "}}else{if(_){if(!f){a+=" var "+h+" = validate.schema"+n+"; "}var E="i"+s,w="schema"+s+"["+E+"]",z="' + "+w+" + '";if(e.opts._errorDataPathProperty){e.errorPath=e.util.getPathExpr(S,w,e.opts.jsonPointers)}if(f){a+=" if ("+h+" && !Array.isArray("+h+")) { var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+z+"' } ";if(e.opts.messages!==false){a+=" , message: '";if(e.opts._errorDataPathProperty){a+="is a required property"}else{a+="should have required property \\'"+z+"\\'"}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+h+" !== undefined) { "}a+=" for (var "+E+" = 0; "+E+" < "+h+".length; "+E+"++) { if ("+u+"["+h+"["+E+"]] === undefined ";if(R){a+=" || ! Object.prototype.hasOwnProperty.call("+u+", "+h+"["+E+"]) "}a+=") { var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+z+"' } ";if(e.opts.messages!==false){a+=" , message: '";if(e.opts._errorDataPathProperty){a+="is a required property"}else{a+="should have required property \\'"+z+"\\'"}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ";if(f){a+=" } "}}else{var A=m;if(A){var O,$=-1,F=A.length-1;while($<F){O=A[$+=1];var T=e.util.getProperty(O),z=e.util.escapeQuotes(O),I=u+T;if(e.opts._errorDataPathProperty){e.errorPath=e.util.getPath(S,O,e.opts.jsonPointers)}a+=" if ( "+I+" === undefined ";if(R){a+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(O)+"') "}a+=") { var err = ";if(e.createErrors!==false){a+=" { keyword: '"+"required"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+z+"' } ";if(e.opts.messages!==false){a+=" , message: '";if(e.opts._errorDataPathProperty){a+="is a required property"}else{a+="should have required property \\'"+z+"\\'"}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}}e.errorPath=S}else if(c){a+=" if (true) {"}return a}},2370:e=>{"use strict";e.exports=function generate_uniqueItems(e,r,t){var a=" ";var s=e.level;var i=e.dataLevel;var o=e.schema[r];var n=e.schemaPath+e.util.getProperty(r);var l=e.errSchemaPath+"/"+r;var c=!e.opts.allErrors;var u="data"+(i||"");var d="valid"+s;var f=e.opts.$data&&o&&o.$data,p;if(f){a+=" var schema"+s+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ";p="schema"+s}else{p=o}if((o||f)&&e.opts.uniqueItems!==false){if(f){a+=" var "+d+"; if ("+p+" === false || "+p+" === undefined) "+d+" = true; else if (typeof "+p+" != 'boolean') "+d+" = false; else { "}a+=" var i = "+u+".length , "+d+" = true , j; if (i > 1) { ";var h=e.schema.items&&e.schema.items.type,m=Array.isArray(h);if(!h||h=="object"||h=="array"||m&&(h.indexOf("object")>=0||h.indexOf("array")>=0)){a+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+d+" = false; break outer; } } } "}else{a+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ";var v="checkDataType"+(m?"s":"");a+=" if ("+e.util[v](h,"item",e.opts.strictNumbers,true)+") continue; ";if(m){a+=" if (typeof item == 'string') item = '\"' + item; "}a+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}a+=" } ";if(f){a+=" } "}a+=" if (!"+d+") { ";var g=g||[];g.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+"uniqueItems"+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ";if(e.opts.messages!==false){a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "}if(e.opts.verbose){a+=" , schema: ";if(f){a+="validate.schema"+n}else{a+=""+o}a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "}a+=" } "}else{a+=" {} "}var y=a;a=g.pop();if(!e.compositeRule&&c){if(e.async){a+=" throw new ValidationError(["+y+"]); "}else{a+=" validate.errors = ["+y+"]; return false; "}}else{a+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } ";if(c){a+=" else { "}}else{if(c){a+=" if (true) { "}}return a}},7003:e=>{"use strict";e.exports=function generate_validate(e,r,t){var a="";var s=e.schema.$async===true,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(e.opts.strictKeywords==="log")e.logger.warn(l);else throw new Error(l)}}if(e.isTop){a+=" var validate = ";if(s){e.async=true;a+="async "}a+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ";if(o&&(e.opts.sourceCode||e.opts.processCode)){a+=" "+("/*# sourceURL="+o+" */")+" "}}if(typeof e.schema=="boolean"||!(i||e.schema.$ref)){var r="false schema";var c=e.level;var u=e.dataLevel;var d=e.schema[r];var f=e.schemaPath+e.util.getProperty(r);var p=e.errSchemaPath+"/"+r;var h=!e.opts.allErrors;var m;var v="data"+(u||"");var g="valid"+c;if(e.schema===false){if(e.isTop){h=true}else{a+=" var "+g+" = false; "}var y=y||[];y.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(m||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ";if(e.opts.messages!==false){a+=" , message: 'boolean schema is false' "}if(e.opts.verbose){a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "}a+=" } "}else{a+=" {} "}var P=a;a=y.pop();if(!e.compositeRule&&h){if(e.async){a+=" throw new ValidationError(["+P+"]); "}else{a+=" validate.errors = ["+P+"]; return false; "}}else{a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}}else{if(e.isTop){if(s){a+=" return data; "}else{a+=" validate.errors = null; return true; "}}else{a+=" var "+g+" = true; "}}if(e.isTop){a+=" }; return validate; "}return a}if(e.isTop){var b=e.isTop,c=e.level=0,u=e.dataLevel=0,v="data";e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema));e.baseId=e.baseId||e.rootId;delete e.isTop;e.dataPathArr=[""];if(e.schema.default!==undefined&&e.opts.useDefaults&&e.opts.strictDefaults){var S="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}a+=" var vErrors = null; ";a+=" var errors = 0; ";a+=" if (rootData === undefined) rootData = data; "}else{var c=e.level,u=e.dataLevel,v="data"+(u||"");if(o)e.baseId=e.resolve.url(e.baseId,o);if(s&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+c+" = errors;"}var g="valid"+c,h=!e.opts.allErrors,_="",R="";var m;var E=e.schema.type,w=Array.isArray(E);if(E&&e.opts.nullable&&e.schema.nullable===true){if(w){if(E.indexOf("null")==-1)E=E.concat("null")}else if(E!="null"){E=[E,"null"];w=true}}if(w&&E.length==1){E=E[0];w=false}if(e.schema.$ref&&i){if(e.opts.extendRefs=="fail"){throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)')}else if(e.opts.extendRefs!==true){i=false;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")}if(E){if(e.opts.coerceTypes){var z=e.util.coerceToTypes(e.opts.coerceTypes,E)}var x=e.RULES.types[E];if(z||w||x===true||x&&!$shouldUseGroup(x)){var f=e.schemaPath+".type",p=e.errSchemaPath+"/type";var f=e.schemaPath+".type",p=e.errSchemaPath+"/type",C=w?"checkDataTypes":"checkDataType";a+=" if ("+e.util[C](E,v,e.opts.strictNumbers,true)+") { ";if(z){var D="dataType"+c,O="coerced"+c;a+=" var "+D+" = typeof "+v+"; var "+O+" = undefined; ";if(e.opts.coerceTypes=="array"){a+=" if ("+D+" == 'object' && Array.isArray("+v+") && "+v+".length == 1) { "+v+" = "+v+"[0]; "+D+" = typeof "+v+"; if ("+e.util.checkDataType(e.schema.type,v,e.opts.strictNumbers)+") "+O+" = "+v+"; } "}a+=" if ("+O+" !== undefined) ; ";var j=z;if(j){var T,I=-1,A=j.length-1;while(I<A){T=j[I+=1];if(T=="string"){a+=" else if ("+D+" == 'number' || "+D+" == 'boolean') "+O+" = '' + "+v+"; else if ("+v+" === null) "+O+" = ''; "}else if(T=="number"||T=="integer"){a+=" else if ("+D+" == 'boolean' || "+v+" === null || ("+D+" == 'string' && "+v+" && "+v+" == +"+v+" ";if(T=="integer"){a+=" && !("+v+" % 1)"}a+=")) "+O+" = +"+v+"; "}else if(T=="boolean"){a+=" else if ("+v+" === 'false' || "+v+" === 0 || "+v+" === null) "+O+" = false; else if ("+v+" === 'true' || "+v+" === 1) "+O+" = true; "}else if(T=="null"){a+=" else if ("+v+" === '' || "+v+" === 0 || "+v+" === false) "+O+" = null; "}else if(e.opts.coerceTypes=="array"&&T=="array"){a+=" else if ("+D+" == 'string' || "+D+" == 'number' || "+D+" == 'boolean' || "+v+" == null) "+O+" = ["+v+"]; "}}}a+=" else { ";var y=y||[];y.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(m||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '";if(w){a+=""+E.join(",")}else{a+=""+E}a+="' } ";if(e.opts.messages!==false){a+=" , message: 'should be ";if(w){a+=""+E.join(",")}else{a+=""+E}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "}a+=" } "}else{a+=" {} "}var P=a;a=y.pop();if(!e.compositeRule&&h){if(e.async){a+=" throw new ValidationError(["+P+"]); "}else{a+=" validate.errors = ["+P+"]; return false; "}}else{a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } if ("+O+" !== undefined) { ";var $=u?"data"+(u-1||""):"parentData",F=u?e.dataPathArr[u]:"parentDataProperty";a+=" "+v+" = "+O+"; ";if(!u){a+="if ("+$+" !== undefined)"}a+=" "+$+"["+F+"] = "+O+"; } "}else{var y=y||[];y.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(m||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '";if(w){a+=""+E.join(",")}else{a+=""+E}a+="' } ";if(e.opts.messages!==false){a+=" , message: 'should be ";if(w){a+=""+E.join(",")}else{a+=""+E}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "}a+=" } "}else{a+=" {} "}var P=a;a=y.pop();if(!e.compositeRule&&h){if(e.async){a+=" throw new ValidationError(["+P+"]); "}else{a+=" validate.errors = ["+P+"]; return false; "}}else{a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}}a+=" } "}}if(e.schema.$ref&&!i){a+=" "+e.RULES.all.$ref.code(e,"$ref")+" ";if(h){a+=" } if (errors === ";if(b){a+="0"}else{a+="errs_"+c}a+=") { ";R+="}"}}else{var k=e.RULES;if(k){var x,q=-1,N=k.length-1;while(q<N){x=k[q+=1];if($shouldUseGroup(x)){if(x.type){a+=" if ("+e.util.checkDataType(x.type,v,e.opts.strictNumbers)+") { "}if(e.opts.useDefaults){if(x.type=="object"&&e.schema.properties){var d=e.schema.properties,L=Object.keys(d);var M=L;if(M){var U,V=-1,H=M.length-1;while(V<H){U=M[V+=1];var Z=d[U];if(Z.default!==undefined){var K=v+e.util.getProperty(U);if(e.compositeRule){if(e.opts.strictDefaults){var S="default is ignored for: "+K;if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}}else{a+=" if ("+K+" === undefined ";if(e.opts.useDefaults=="empty"){a+=" || "+K+" === null || "+K+" === '' "}a+=" ) "+K+" = ";if(e.opts.useDefaults=="shared"){a+=" "+e.useDefault(Z.default)+" "}else{a+=" "+JSON.stringify(Z.default)+" "}a+="; "}}}}}else if(x.type=="array"&&Array.isArray(e.schema.items)){var Q=e.schema.items;if(Q){var Z,I=-1,J=Q.length-1;while(I<J){Z=Q[I+=1];if(Z.default!==undefined){var K=v+"["+I+"]";if(e.compositeRule){if(e.opts.strictDefaults){var S="default is ignored for: "+K;if(e.opts.strictDefaults==="log")e.logger.warn(S);else throw new Error(S)}}else{a+=" if ("+K+" === undefined ";if(e.opts.useDefaults=="empty"){a+=" || "+K+" === null || "+K+" === '' "}a+=" ) "+K+" = ";if(e.opts.useDefaults=="shared"){a+=" "+e.useDefault(Z.default)+" "}else{a+=" "+JSON.stringify(Z.default)+" "}a+="; "}}}}}}var B=x.rules;if(B){var G,W=-1,Y=B.length-1;while(W<Y){G=B[W+=1];if($shouldUseRule(G)){var X=G.code(e,G.keyword,x.type);if(X){a+=" "+X+" ";if(h){_+="}"}}}}}if(h){a+=" "+_+" ";_=""}if(x.type){a+=" } ";if(E&&E===x.type&&!z){a+=" else { ";var f=e.schemaPath+".type",p=e.errSchemaPath+"/type";var y=y||[];y.push(a);a="";if(e.createErrors!==false){a+=" { keyword: '"+(m||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '";if(w){a+=""+E.join(",")}else{a+=""+E}a+="' } ";if(e.opts.messages!==false){a+=" , message: 'should be ";if(w){a+=""+E.join(",")}else{a+=""+E}a+="' "}if(e.opts.verbose){a+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "}a+=" } "}else{a+=" {} "}var P=a;a=y.pop();if(!e.compositeRule&&h){if(e.async){a+=" throw new ValidationError(["+P+"]); "}else{a+=" validate.errors = ["+P+"]; return false; "}}else{a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } "}}if(h){a+=" if (errors === ";if(b){a+="0"}else{a+="errs_"+c}a+=") { ";R+="}"}}}}}if(h){a+=" "+R+" "}if(b){if(s){a+=" if (errors === 0) return data; ";a+=" else throw new ValidationError(vErrors); "}else{a+=" validate.errors = vErrors; ";a+=" return errors === 0; "}a+=" }; return validate;"}else{a+=" var "+g+" = errors === errs_"+c+";"}function $shouldUseGroup(e){var r=e.rules;for(var t=0;t<r.length;t++)if($shouldUseRule(r[t]))return true}function $shouldUseRule(r){return e.schema[r.keyword]!==undefined||r.implements&&$ruleImplementsSomeKeyword(r)}function $ruleImplementsSomeKeyword(r){var t=r.implements;for(var a=0;a<t.length;a++)if(e.schema[t[a]]!==undefined)return true}return a}},6765:(e,r,t)=>{"use strict";var a=/^[a-z_$][a-z0-9_$-]*$/i;var s=t(8029);var i=t(6686);e.exports={add:addKeyword,get:getKeyword,remove:removeKeyword,validate:validateKeyword};function addKeyword(e,r){var t=this.RULES;if(t.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(r){this.validateKeyword(r,true);var i=r.type;if(Array.isArray(i)){for(var o=0;o<i.length;o++)_addRule(e,i[o],r)}else{_addRule(e,i,r)}var n=r.metaSchema;if(n){if(r.$data&&this._opts.$data){n={anyOf:[n,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}r.validateSchema=this.compile(n,true)}}t.keywords[e]=t.all[e]=true;function _addRule(e,r,a){var i;for(var o=0;o<t.length;o++){var n=t[o];if(n.type==r){i=n;break}}if(!i){i={type:r,rules:[]};t.push(i)}var l={keyword:e,definition:a,custom:true,code:s,implements:a.implements};i.rules.push(l);t.custom[e]=l}return this}function getKeyword(e){var r=this.RULES.custom[e];return r?r.definition:this.RULES.keywords[e]||false}function removeKeyword(e){var r=this.RULES;delete r.keywords[e];delete r.all[e];delete r.custom[e];for(var t=0;t<r.length;t++){var a=r[t].rules;for(var s=0;s<a.length;s++){if(a[s].keyword==e){a.splice(s,1);break}}}return this}function validateKeyword(e,r){validateKeyword.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(i,true);if(t(e))return true;validateKeyword.errors=t.errors;if(r)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));else return false}},1230:e=>{"use strict";e.exports=function equal(e,r){if(e===r)return true;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return false;var t,a,s;if(Array.isArray(e)){t=e.length;if(t!=r.length)return false;for(a=t;a--!==0;)if(!equal(e[a],r[a]))return false;return true}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();s=Object.keys(e);t=s.length;if(t!==Object.keys(r).length)return false;for(a=t;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return false;for(a=t;a--!==0;){var i=s[a];if(!equal(e[i],r[i]))return false}return true}return e!==e&&r!==r}},6424:e=>{"use strict";e.exports=function(e,r){if(!r)r={};if(typeof r==="function")r={cmp:r};var t=typeof r.cycles==="boolean"?r.cycles:false;var a=r.cmp&&function(e){return function(r){return function(t,a){var s={key:t,value:r[t]};var i={key:a,value:r[a]};return e(s,i)}}}(r.cmp);var s=[];return function stringify(e){if(e&&e.toJSON&&typeof e.toJSON==="function"){e=e.toJSON()}if(e===undefined)return;if(typeof e=="number")return isFinite(e)?""+e:"null";if(typeof e!=="object")return JSON.stringify(e);var r,i;if(Array.isArray(e)){i="[";for(r=0;r<e.length;r++){if(r)i+=",";i+=stringify(e[r])||"null"}return i+"]"}if(e===null)return"null";if(s.indexOf(e)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var o=s.push(e)-1;var n=Object.keys(e).sort(a&&a(e));i="";for(r=0;r<n.length;r++){var l=n[r];var c=stringify(e[l]);if(!c)continue;if(i)i+=",";i+=JSON.stringify(l)+":"+c}s.splice(o,1);return"{"+i+"}"}(e)}},6042:e=>{"use strict";var r=e.exports=function(e,r,t){if(typeof r=="function"){t=r;r={}}t=r.cb||t;var a=typeof t=="function"?t:t.pre||function(){};var s=t.post||function(){};_traverse(r,a,s,e,"",e)};r.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true};r.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};r.propsKeywords={definitions:true,properties:true,patternProperties:true,dependencies:true};r.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function _traverse(e,t,a,s,i,o,n,l,c,u){if(s&&typeof s=="object"&&!Array.isArray(s)){t(s,i,o,n,l,c,u);for(var d in s){var f=s[d];if(Array.isArray(f)){if(d in r.arrayKeywords){for(var p=0;p<f.length;p++)_traverse(e,t,a,f[p],i+"/"+d+"/"+p,o,i,d,s,p)}}else if(d in r.propsKeywords){if(f&&typeof f=="object"){for(var h in f)_traverse(e,t,a,f[h],i+"/"+d+"/"+escapeJsonPtr(h),o,i,d,s,h)}}else if(d in r.keywords||e.allKeys&&!(d in r.skipKeywords)){_traverse(e,t,a,f,i+"/"+d,o,i,d,s)}}a(s,i,o,n,l,c,u)}}function escapeJsonPtr(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}},4856:function(e,r){
|
|
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
(function(e,t){true?t(r):0})(this,(function(e){"use strict";function merge(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++){r[t]=arguments[t]}if(r.length>1){r[0]=r[0].slice(0,-1);var a=r.length-1;for(var s=1;s<a;++s){r[s]=r[s].slice(1,-1)}r[a]=r[a].slice(1);return r.join("")}else{return r[0]}}function subexp(e){return"(?:"+e+")"}function typeOf(e){return e===undefined?"undefined":e===null?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function toUpperCase(e){return e.toUpperCase()}function toArray(e){return e!==undefined&&e!==null?e instanceof Array?e:typeof e.length!=="number"||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function assign(e,r){var t=e;if(r){for(var a in r){t[a]=r[a]}}return t}function buildExps(e){var r="[A-Za-z]",t="[\\x0D]",a="[0-9]",s="[\\x22]",i=merge(a,"[A-Fa-f]"),o="[\\x0A]",n="[\\x20]",l=subexp(subexp("%[EFef]"+i+"%"+i+i+"%"+i+i)+"|"+subexp("%[89A-Fa-f]"+i+"%"+i+i)+"|"+subexp("%"+i+i)),c="[\\:\\/\\?\\#\\[\\]\\@]",u="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",d=merge(c,u),f=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",p=e?"[\\uE000-\\uF8FF]":"[]",h=merge(r,a,"[\\-\\.\\_\\~]",f),m=subexp(r+merge(r,a,"[\\+\\-\\.]")+"*"),v=subexp(subexp(l+"|"+merge(h,u,"[\\:]"))+"*"),g=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+a)+"|"+subexp("1"+a+a)+"|"+subexp("[1-9]"+a)+"|"+a),y=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+a)+"|"+subexp("1"+a+a)+"|"+subexp("0?[1-9]"+a)+"|0?0?"+a),P=subexp(y+"\\."+y+"\\."+y+"\\."+y),b=subexp(i+"{1,4}"),S=subexp(subexp(b+"\\:"+b)+"|"+P),_=subexp(subexp(b+"\\:")+"{6}"+S),R=subexp("\\:\\:"+subexp(b+"\\:")+"{5}"+S),E=subexp(subexp(b)+"?\\:\\:"+subexp(b+"\\:")+"{4}"+S),w=subexp(subexp(subexp(b+"\\:")+"{0,1}"+b)+"?\\:\\:"+subexp(b+"\\:")+"{3}"+S),z=subexp(subexp(subexp(b+"\\:")+"{0,2}"+b)+"?\\:\\:"+subexp(b+"\\:")+"{2}"+S),x=subexp(subexp(subexp(b+"\\:")+"{0,3}"+b)+"?\\:\\:"+b+"\\:"+S),C=subexp(subexp(subexp(b+"\\:")+"{0,4}"+b)+"?\\:\\:"+S),D=subexp(subexp(subexp(b+"\\:")+"{0,5}"+b)+"?\\:\\:"+b),O=subexp(subexp(subexp(b+"\\:")+"{0,6}"+b)+"?\\:\\:"),j=subexp([_,R,E,w,z,x,C,D,O].join("|")),T=subexp(subexp(h+"|"+l)+"+"),I=subexp(j+"\\%25"+T),A=subexp(j+subexp("\\%25|\\%(?!"+i+"{2})")+T),$=subexp("[vV]"+i+"+\\."+merge(h,u,"[\\:]")+"+"),F=subexp("\\["+subexp(A+"|"+j+"|"+$)+"\\]"),k=subexp(subexp(l+"|"+merge(h,u))+"*"),q=subexp(F+"|"+P+"(?!"+k+")"+"|"+k),N=subexp(a+"*"),L=subexp(subexp(v+"@")+"?"+q+subexp("\\:"+N)+"?"),M=subexp(l+"|"+merge(h,u,"[\\:\\@]")),U=subexp(M+"*"),V=subexp(M+"+"),H=subexp(subexp(l+"|"+merge(h,u,"[\\@]"))+"+"),Z=subexp(subexp("\\/"+U)+"*"),K=subexp("\\/"+subexp(V+Z)+"?"),Q=subexp(H+Z),J=subexp(V+Z),B="(?!"+M+")",G=subexp(Z+"|"+K+"|"+Q+"|"+J+"|"+B),W=subexp(subexp(M+"|"+merge("[\\/\\?]",p))+"*"),Y=subexp(subexp(M+"|[\\/\\?]")+"*"),X=subexp(subexp("\\/\\/"+L+Z)+"|"+K+"|"+J+"|"+B),ee=subexp(m+"\\:"+X+subexp("\\?"+W)+"?"+subexp("\\#"+Y)+"?"),re=subexp(subexp("\\/\\/"+L+Z)+"|"+K+"|"+Q+"|"+B),te=subexp(re+subexp("\\?"+W)+"?"+subexp("\\#"+Y)+"?"),ae=subexp(ee+"|"+te),se=subexp(m+"\\:"+X+subexp("\\?"+W)+"?"),ie="^("+m+")\\:"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+q+")"+subexp("\\:("+N+")")+"?)")+"?("+Z+"|"+K+"|"+J+"|"+B+")")+subexp("\\?("+W+")")+"?"+subexp("\\#("+Y+")")+"?$",oe="^(){0}"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+q+")"+subexp("\\:("+N+")")+"?)")+"?("+Z+"|"+K+"|"+Q+"|"+B+")")+subexp("\\?("+W+")")+"?"+subexp("\\#("+Y+")")+"?$",ne="^("+m+")\\:"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+q+")"+subexp("\\:("+N+")")+"?)")+"?("+Z+"|"+K+"|"+J+"|"+B+")")+subexp("\\?("+W+")")+"?$",le="^"+subexp("\\#("+Y+")")+"?$",ce="^"+subexp("("+v+")@")+"?("+q+")"+subexp("\\:("+N+")")+"?$";return{NOT_SCHEME:new RegExp(merge("[^]",r,a,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(merge("[^\\%\\:]",h,u),"g"),NOT_HOST:new RegExp(merge("[^\\%\\[\\]\\:]",h,u),"g"),NOT_PATH:new RegExp(merge("[^\\%\\/\\:\\@]",h,u),"g"),NOT_PATH_NOSCHEME:new RegExp(merge("[^\\%\\/\\@]",h,u),"g"),NOT_QUERY:new RegExp(merge("[^\\%]",h,u,"[\\:\\@\\/\\?]",p),"g"),NOT_FRAGMENT:new RegExp(merge("[^\\%]",h,u,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(merge("[^]",h,u),"g"),UNRESERVED:new RegExp(h,"g"),OTHER_CHARS:new RegExp(merge("[^\\%]",h,d),"g"),PCT_ENCODED:new RegExp(l,"g"),IPV4ADDRESS:new RegExp("^("+P+")$"),IPV6ADDRESS:new RegExp("^\\[?("+j+")"+subexp(subexp("\\%25|\\%(?!"+i+"{2})")+"("+T+")")+"?\\]?$")}}var r=buildExps(false);var t=buildExps(true);var a=function(){function sliceIterator(e,r){var t=[];var a=true;var s=false;var i=undefined;try{for(var o=e[Symbol.iterator](),n;!(a=(n=o.next()).done);a=true){t.push(n.value);if(r&&t.length===r)break}}catch(e){s=true;i=e}finally{try{if(!a&&o["return"])o["return"]()}finally{if(s)throw i}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var toConsumableArray=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}else{return Array.from(e)}};var s=2147483647;var i=36;var o=1;var n=26;var l=38;var c=700;var u=72;var d=128;var f="-";var p=/^xn--/;var h=/[^\0-\x7E]/;var m=/[\x2E\u3002\uFF0E\uFF61]/g;var v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var g=i-o;var y=Math.floor;var P=String.fromCharCode;function error$1(e){throw new RangeError(v[e])}function map(e,r){var t=[];var a=e.length;while(a--){t[a]=r(e[a])}return t}function mapDomain(e,r){var t=e.split("@");var a="";if(t.length>1){a=t[0]+"@";e=t[1]}e=e.replace(m,".");var s=e.split(".");var i=map(s,r).join(".");return a+i}function ucs2decode(e){var r=[];var t=0;var a=e.length;while(t<a){var s=e.charCodeAt(t++);if(s>=55296&&s<=56319&&t<a){var i=e.charCodeAt(t++);if((i&64512)==56320){r.push(((s&1023)<<10)+(i&1023)+65536)}else{r.push(s);t--}}else{r.push(s)}}return r}var b=function ucs2encode(e){return String.fromCodePoint.apply(String,toConsumableArray(e))};var S=function basicToDigit(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return i};var _=function digitToBasic(e,r){return e+22+75*(e<26)-((r!=0)<<5)};var R=function adapt(e,r,t){var a=0;e=t?y(e/c):e>>1;e+=y(e/r);for(;e>g*n>>1;a+=i){e=y(e/g)}return y(a+(g+1)*e/(e+l))};var E=function decode(e){var r=[];var t=e.length;var a=0;var l=d;var c=u;var p=e.lastIndexOf(f);if(p<0){p=0}for(var h=0;h<p;++h){if(e.charCodeAt(h)>=128){error$1("not-basic")}r.push(e.charCodeAt(h))}for(var m=p>0?p+1:0;m<t;){var v=a;for(var g=1,P=i;;P+=i){if(m>=t){error$1("invalid-input")}var b=S(e.charCodeAt(m++));if(b>=i||b>y((s-a)/g)){error$1("overflow")}a+=b*g;var _=P<=c?o:P>=c+n?n:P-c;if(b<_){break}var E=i-_;if(g>y(s/E)){error$1("overflow")}g*=E}var w=r.length+1;c=R(a-v,w,v==0);if(y(a/w)>s-l){error$1("overflow")}l+=y(a/w);a%=w;r.splice(a++,0,l)}return String.fromCodePoint.apply(String,r)};var w=function encode(e){var r=[];e=ucs2decode(e);var t=e.length;var a=d;var l=0;var c=u;var p=true;var h=false;var m=undefined;try{for(var v=e[Symbol.iterator](),g;!(p=(g=v.next()).done);p=true){var b=g.value;if(b<128){r.push(P(b))}}}catch(e){h=true;m=e}finally{try{if(!p&&v.return){v.return()}}finally{if(h){throw m}}}var S=r.length;var E=S;if(S){r.push(f)}while(E<t){var w=s;var z=true;var x=false;var C=undefined;try{for(var D=e[Symbol.iterator](),O;!(z=(O=D.next()).done);z=true){var j=O.value;if(j>=a&&j<w){w=j}}}catch(e){x=true;C=e}finally{try{if(!z&&D.return){D.return()}}finally{if(x){throw C}}}var T=E+1;if(w-a>y((s-l)/T)){error$1("overflow")}l+=(w-a)*T;a=w;var I=true;var A=false;var $=undefined;try{for(var F=e[Symbol.iterator](),k;!(I=(k=F.next()).done);I=true){var q=k.value;if(q<a&&++l>s){error$1("overflow")}if(q==a){var N=l;for(var L=i;;L+=i){var M=L<=c?o:L>=c+n?n:L-c;if(N<M){break}var U=N-M;var V=i-M;r.push(P(_(M+U%V,0)));N=y(U/V)}r.push(P(_(N,0)));c=R(l,T,E==S);l=0;++E}}}catch(e){A=true;$=e}finally{try{if(!I&&F.return){F.return()}}finally{if(A){throw $}}}++l;++a}return r.join("")};var z=function toUnicode(e){return mapDomain(e,(function(e){return p.test(e)?E(e.slice(4).toLowerCase()):e}))};var x=function toASCII(e){return mapDomain(e,(function(e){return h.test(e)?"xn--"+w(e):e}))};var C={version:"2.1.0",ucs2:{decode:ucs2decode,encode:b},decode:E,encode:w,toASCII:x,toUnicode:z};var D={};function pctEncChar(e){var r=e.charCodeAt(0);var t=void 0;if(r<16)t="%0"+r.toString(16).toUpperCase();else if(r<128)t="%"+r.toString(16).toUpperCase();else if(r<2048)t="%"+(r>>6|192).toString(16).toUpperCase()+"%"+(r&63|128).toString(16).toUpperCase();else t="%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(r&63|128).toString(16).toUpperCase();return t}function pctDecChars(e){var r="";var t=0;var a=e.length;while(t<a){var s=parseInt(e.substr(t+1,2),16);if(s<128){r+=String.fromCharCode(s);t+=3}else if(s>=194&&s<224){if(a-t>=6){var i=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((s&31)<<6|i&63)}else{r+=e.substr(t,6)}t+=6}else if(s>=224){if(a-t>=9){var o=parseInt(e.substr(t+4,2),16);var n=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((s&15)<<12|(o&63)<<6|n&63)}else{r+=e.substr(t,9)}t+=9}else{r+=e.substr(t,3);t+=3}}return r}function _normalizeComponentEncoding(e,r){function decodeUnreserved(e){var t=pctDecChars(e);return!t.match(r.UNRESERVED)?e:t}if(e.scheme)e.scheme=String(e.scheme).replace(r.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(r.NOT_SCHEME,"");if(e.userinfo!==undefined)e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_USERINFO,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.host!==undefined)e.host=String(e.host).replace(r.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(r.NOT_HOST,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.path!==undefined)e.path=String(e.path).replace(r.PCT_ENCODED,decodeUnreserved).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.query!==undefined)e.query=String(e.query).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_QUERY,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.fragment!==undefined)e.fragment=String(e.fragment).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_FRAGMENT,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);return e}function _stripLeadingZeros(e){return e.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(e,r){var t=e.match(r.IPV4ADDRESS)||[];var s=a(t,2),i=s[1];if(i){return i.split(".").map(_stripLeadingZeros).join(".")}else{return e}}function _normalizeIPv6(e,r){var t=e.match(r.IPV6ADDRESS)||[];var s=a(t,3),i=s[1],o=s[2];if(i){var n=i.toLowerCase().split("::").reverse(),l=a(n,2),c=l[0],u=l[1];var d=u?u.split(":").map(_stripLeadingZeros):[];var f=c.split(":").map(_stripLeadingZeros);var p=r.IPV4ADDRESS.test(f[f.length-1]);var h=p?7:8;var m=f.length-h;var v=Array(h);for(var g=0;g<h;++g){v[g]=d[g]||f[m+g]||""}if(p){v[h-1]=_normalizeIPv4(v[h-1],r)}var y=v.reduce((function(e,r,t){if(!r||r==="0"){var a=e[e.length-1];if(a&&a.index+a.length===t){a.length++}else{e.push({index:t,length:1})}}return e}),[]);var P=y.sort((function(e,r){return r.length-e.length}))[0];var b=void 0;if(P&&P.length>1){var S=v.slice(0,P.index);var _=v.slice(P.index+P.length);b=S.join(":")+"::"+_.join(":")}else{b=v.join(":")}if(o){b+="%"+o}return b}else{return e}}var O=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var j="".match(/(){0}/)[1]===undefined;function parse(e){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s={};var i=a.iri!==false?t:r;if(a.reference==="suffix")e=(a.scheme?a.scheme+":":"")+"//"+e;var o=e.match(O);if(o){if(j){s.scheme=o[1];s.userinfo=o[3];s.host=o[4];s.port=parseInt(o[5],10);s.path=o[6]||"";s.query=o[7];s.fragment=o[8];if(isNaN(s.port)){s.port=o[5]}}else{s.scheme=o[1]||undefined;s.userinfo=e.indexOf("@")!==-1?o[3]:undefined;s.host=e.indexOf("//")!==-1?o[4]:undefined;s.port=parseInt(o[5],10);s.path=o[6]||"";s.query=e.indexOf("?")!==-1?o[7]:undefined;s.fragment=e.indexOf("#")!==-1?o[8]:undefined;if(isNaN(s.port)){s.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined}}if(s.host){s.host=_normalizeIPv6(_normalizeIPv4(s.host,i),i)}if(s.scheme===undefined&&s.userinfo===undefined&&s.host===undefined&&s.port===undefined&&!s.path&&s.query===undefined){s.reference="same-document"}else if(s.scheme===undefined){s.reference="relative"}else if(s.fragment===undefined){s.reference="absolute"}else{s.reference="uri"}if(a.reference&&a.reference!=="suffix"&&a.reference!==s.reference){s.error=s.error||"URI is not a "+a.reference+" reference."}var n=D[(a.scheme||s.scheme||"").toLowerCase()];if(!a.unicodeSupport&&(!n||!n.unicodeSupport)){if(s.host&&(a.domainHost||n&&n.domainHost)){try{s.host=C.toASCII(s.host.replace(i.PCT_ENCODED,pctDecChars).toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII via punycode: "+e}}_normalizeComponentEncoding(s,r)}else{_normalizeComponentEncoding(s,i)}if(n&&n.parse){n.parse(s,a)}}else{s.error=s.error||"URI can not be parsed."}return s}function _recomposeAuthority(e,a){var s=a.iri!==false?t:r;var i=[];if(e.userinfo!==undefined){i.push(e.userinfo);i.push("@")}if(e.host!==undefined){i.push(_normalizeIPv6(_normalizeIPv4(String(e.host),s),s).replace(s.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"})))}if(typeof e.port==="number"||typeof e.port==="string"){i.push(":");i.push(String(e.port))}return i.length?i.join(""):undefined}var T=/^\.\.?\//;var I=/^\/\.(\/|$)/;var A=/^\/\.\.(\/|$)/;var $=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(e){var r=[];while(e.length){if(e.match(T)){e=e.replace(T,"")}else if(e.match(I)){e=e.replace(I,"/")}else if(e.match(A)){e=e.replace(A,"/");r.pop()}else if(e==="."||e===".."){e=""}else{var t=e.match($);if(t){var a=t[0];e=e.slice(a.length);r.push(a)}else{throw new Error("Unexpected dot segment condition")}}}return r.join("")}function serialize(e){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=a.iri?t:r;var i=[];var o=D[(a.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize)o.serialize(e,a);if(e.host){if(s.IPV6ADDRESS.test(e.host)){}else if(a.domainHost||o&&o.domainHost){try{e.host=!a.iri?C.toASCII(e.host.replace(s.PCT_ENCODED,pctDecChars).toLowerCase()):C.toUnicode(e.host)}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(!a.iri?"ASCII":"Unicode")+" via punycode: "+r}}}_normalizeComponentEncoding(e,s);if(a.reference!=="suffix"&&e.scheme){i.push(e.scheme);i.push(":")}var n=_recomposeAuthority(e,a);if(n!==undefined){if(a.reference!=="suffix"){i.push("//")}i.push(n);if(e.path&&e.path.charAt(0)!=="/"){i.push("/")}}if(e.path!==undefined){var l=e.path;if(!a.absolutePath&&(!o||!o.absolutePath)){l=removeDotSegments(l)}if(n===undefined){l=l.replace(/^\/\//,"/%2F")}i.push(l)}if(e.query!==undefined){i.push("?");i.push(e.query)}if(e.fragment!==undefined){i.push("#");i.push(e.fragment)}return i.join("")}function resolveComponents(e,r){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var a=arguments[3];var s={};if(!a){e=parse(serialize(e,t),t);r=parse(serialize(r,t),t)}t=t||{};if(!t.tolerant&&r.scheme){s.scheme=r.scheme;s.userinfo=r.userinfo;s.host=r.host;s.port=r.port;s.path=removeDotSegments(r.path||"");s.query=r.query}else{if(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined){s.userinfo=r.userinfo;s.host=r.host;s.port=r.port;s.path=removeDotSegments(r.path||"");s.query=r.query}else{if(!r.path){s.path=e.path;if(r.query!==undefined){s.query=r.query}else{s.query=e.query}}else{if(r.path.charAt(0)==="/"){s.path=removeDotSegments(r.path)}else{if((e.userinfo!==undefined||e.host!==undefined||e.port!==undefined)&&!e.path){s.path="/"+r.path}else if(!e.path){s.path=r.path}else{s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path}s.path=removeDotSegments(s.path)}s.query=r.query}s.userinfo=e.userinfo;s.host=e.host;s.port=e.port}s.scheme=e.scheme}s.fragment=r.fragment;return s}function resolve(e,r,t){var a=assign({scheme:"null"},t);return serialize(resolveComponents(parse(e,a),parse(r,a),a,true),a)}function normalize(e,r){if(typeof e==="string"){e=serialize(parse(e,r),r)}else if(typeOf(e)==="object"){e=parse(serialize(e,r),r)}return e}function equal(e,r,t){if(typeof e==="string"){e=serialize(parse(e,t),t)}else if(typeOf(e)==="object"){e=serialize(e,t)}if(typeof r==="string"){r=serialize(parse(r,t),t)}else if(typeOf(r)==="object"){r=serialize(r,t)}return e===r}function escapeComponent(e,a){return e&&e.toString().replace(!a||!a.iri?r.ESCAPE:t.ESCAPE,pctEncChar)}function unescapeComponent(e,a){return e&&e.toString().replace(!a||!a.iri?r.PCT_ENCODED:t.PCT_ENCODED,pctDecChars)}var F={scheme:"http",domainHost:true,parse:function parse(e,r){if(!e.host){e.error=e.error||"HTTP URIs must have a host."}return e},serialize:function serialize(e,r){var t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port===""){e.port=undefined}if(!e.path){e.path="/"}return e}};var k={scheme:"https",domainHost:F.domainHost,parse:F.parse,serialize:F.serialize};function isSecure(e){return typeof e.secure==="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}var q={scheme:"ws",domainHost:true,parse:function parse(e,r){var t=e;t.secure=isSecure(t);t.resourceName=(t.path||"/")+(t.query?"?"+t.query:"");t.path=undefined;t.query=undefined;return t},serialize:function serialize(e,r){if(e.port===(isSecure(e)?443:80)||e.port===""){e.port=undefined}if(typeof e.secure==="boolean"){e.scheme=e.secure?"wss":"ws";e.secure=undefined}if(e.resourceName){var t=e.resourceName.split("?"),s=a(t,2),i=s[0],o=s[1];e.path=i&&i!=="/"?i:undefined;e.query=o;e.resourceName=undefined}e.fragment=undefined;return e}};var N={scheme:"wss",domainHost:q.domainHost,parse:q.parse,serialize:q.serialize};var L={};var M=true;var U="[A-Za-z0-9\\-\\.\\_\\~"+(M?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var V="[0-9A-Fa-f]";var H=subexp(subexp("%[EFef]"+V+"%"+V+V+"%"+V+V)+"|"+subexp("%[89A-Fa-f]"+V+"%"+V+V)+"|"+subexp("%"+V+V));var Z="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var K="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var Q=merge(K,'[\\"\\\\]');var J="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var B=new RegExp(U,"g");var G=new RegExp(H,"g");var W=new RegExp(merge("[^]",Z,"[\\.]",'[\\"]',Q),"g");var Y=new RegExp(merge("[^]",U,J),"g");var X=Y;function decodeUnreserved(e){var r=pctDecChars(e);return!r.match(B)?e:r}var ee={scheme:"mailto",parse:function parse$$1(e,r){var t=e;var a=t.to=t.path?t.path.split(","):[];t.path=undefined;if(t.query){var s=false;var i={};var o=t.query.split("&");for(var n=0,l=o.length;n<l;++n){var c=o[n].split("=");switch(c[0]){case"to":var u=c[1].split(",");for(var d=0,f=u.length;d<f;++d){a.push(u[d])}break;case"subject":t.subject=unescapeComponent(c[1],r);break;case"body":t.body=unescapeComponent(c[1],r);break;default:s=true;i[unescapeComponent(c[0],r)]=unescapeComponent(c[1],r);break}}if(s)t.headers=i}t.query=undefined;for(var p=0,h=a.length;p<h;++p){var m=a[p].split("@");m[0]=unescapeComponent(m[0]);if(!r.unicodeSupport){try{m[1]=C.toASCII(unescapeComponent(m[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}}else{m[1]=unescapeComponent(m[1],r).toLowerCase()}a[p]=m.join("@")}return t},serialize:function serialize$$1(e,r){var t=e;var a=toArray(e.to);if(a){for(var s=0,i=a.length;s<i;++s){var o=String(a[s]);var n=o.lastIndexOf("@");var l=o.slice(0,n).replace(G,decodeUnreserved).replace(G,toUpperCase).replace(W,pctEncChar);var c=o.slice(n+1);try{c=!r.iri?C.toASCII(unescapeComponent(c,r).toLowerCase()):C.toUnicode(c)}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(!r.iri?"ASCII":"Unicode")+" via punycode: "+e}a[s]=l+"@"+c}t.path=a.join(",")}var u=e.headers=e.headers||{};if(e.subject)u["subject"]=e.subject;if(e.body)u["body"]=e.body;var d=[];for(var f in u){if(u[f]!==L[f]){d.push(f.replace(G,decodeUnreserved).replace(G,toUpperCase).replace(Y,pctEncChar)+"="+u[f].replace(G,decodeUnreserved).replace(G,toUpperCase).replace(X,pctEncChar))}}if(d.length){t.query=d.join("&")}return t}};var re=/^([^\:]+)\:(.*)/;var te={scheme:"urn",parse:function parse$$1(e,r){var t=e.path&&e.path.match(re);var a=e;if(t){var s=r.scheme||a.scheme||"urn";var i=t[1].toLowerCase();var o=t[2];var n=s+":"+(r.nid||i);var l=D[n];a.nid=i;a.nss=o;a.path=undefined;if(l){a=l.parse(a,r)}}else{a.error=a.error||"URN can not be parsed."}return a},serialize:function serialize$$1(e,r){var t=r.scheme||e.scheme||"urn";var a=e.nid;var s=t+":"+(r.nid||a);var i=D[s];if(i){e=i.serialize(e,r)}var o=e;var n=e.nss;o.path=(a||r.nid)+":"+n;return o}};var ae=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;var se={scheme:"urn:uuid",parse:function parse(e,r){var t=e;t.uuid=t.nss;t.nss=undefined;if(!r.tolerant&&(!t.uuid||!t.uuid.match(ae))){t.error=t.error||"UUID is not valid."}return t},serialize:function serialize(e,r){var t=e;t.nss=(e.uuid||"").toLowerCase();return t}};D[F.scheme]=F;D[k.scheme]=k;D[q.scheme]=q;D[N.scheme]=N;D[ee.scheme]=ee;D[te.scheme]=te;D[se.scheme]=se;e.SCHEMES=D;e.pctEncChar=pctEncChar;e.pctDecChars=pctDecChars;e.parse=parse;e.removeDotSegments=removeDotSegments;e.serialize=serialize;e.resolveComponents=resolveComponents;e.resolve=resolve;e.normalize=normalize;e.equal=equal;e.escapeComponent=escapeComponent;e.unescapeComponent=unescapeComponent;Object.defineProperty(e,"__esModule",{value:true})}))},4788:e=>{"use strict";e.exports=require("next/dist/compiled/zod")},9279:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Completable=r.McpZodTypeKind=void 0;r.completable=completable;const a=t(4788);var s;(function(e){e["Completable"]="McpCompletable"})(s||(r.McpZodTypeKind=s={}));class Completable extends a.ZodType{_parse(e){const{ctx:r}=this._processInputParams(e);const t=r.data;return this._def.type._parse({data:t,path:r.path,parent:r})}unwrap(){return this._def.type}}r.Completable=Completable;Completable.create=(e,r)=>new Completable({type:e,typeName:s.Completable,complete:r.complete,...processCreateParams(r)});function completable(e,r){return Completable.create(e,{...e._def,complete:r})}function processCreateParams(e){if(!e)return{};const{errorMap:r,invalid_type_error:t,required_error:a,description:s}=e;if(r&&(t||a)){throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`)}if(r)return{errorMap:r,description:s};const customMap=(r,s)=>{var i,o;const{message:n}=e;if(r.code==="invalid_enum_value"){return{message:n!==null&&n!==void 0?n:s.defaultError}}if(typeof s.data==="undefined"){return{message:(i=n!==null&&n!==void 0?n:a)!==null&&i!==void 0?i:s.defaultError}}if(r.code!=="invalid_type")return{message:s.defaultError};return{message:(o=n!==null&&n!==void 0?n:t)!==null&&o!==void 0?o:s.defaultError}};return{errorMap:customMap,description:s}}},9938:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.Server=void 0;const s=t(5487);const i=t(8383);const o=a(t(6474));class Server extends s.Protocol{constructor(e,r){var t;super(r);this._serverInfo=e;this._loggingLevels=new Map;this.LOG_LEVEL_SEVERITY=new Map(i.LoggingLevelSchema.options.map(((e,r)=>[e,r])));this.isMessageIgnored=(e,r)=>{const t=this._loggingLevels.get(r);return t?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(t):false};this._capabilities=(t=r===null||r===void 0?void 0:r.capabilities)!==null&&t!==void 0?t:{};this._instructions=r===null||r===void 0?void 0:r.instructions;this.setRequestHandler(i.InitializeRequestSchema,(e=>this._oninitialize(e)));this.setNotificationHandler(i.InitializedNotificationSchema,(()=>{var e;return(e=this.oninitialized)===null||e===void 0?void 0:e.call(this)}));if(this._capabilities.logging){this.setRequestHandler(i.SetLevelRequestSchema,(async(e,r)=>{var t;const a=r.sessionId||((t=r.requestInfo)===null||t===void 0?void 0:t.headers["mcp-session-id"])||undefined;const{level:s}=e.params;const o=i.LoggingLevelSchema.safeParse(s);if(o.success){this._loggingLevels.set(a,o.data)}return{}}))}}registerCapabilities(e){if(this.transport){throw new Error("Cannot register capabilities after connecting to transport")}this._capabilities=(0,s.mergeCapabilities)(this._capabilities,e)}assertCapabilityForMethod(e){var r,t,a;switch(e){case"sampling/createMessage":if(!((r=this._clientCapabilities)===null||r===void 0?void 0:r.sampling)){throw new Error(`Client does not support sampling (required for ${e})`)}break;case"elicitation/create":if(!((t=this._clientCapabilities)===null||t===void 0?void 0:t.elicitation)){throw new Error(`Client does not support elicitation (required for ${e})`)}break;case"roots/list":if(!((a=this._clientCapabilities)===null||a===void 0?void 0:a.roots)){throw new Error(`Client does not support listing roots (required for ${e})`)}break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging){throw new Error(`Server does not support logging (required for ${e})`)}break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources){throw new Error(`Server does not support notifying about resources (required for ${e})`)}break;case"notifications/tools/list_changed":if(!this._capabilities.tools){throw new Error(`Server does not support notifying of tool list changes (required for ${e})`)}break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts){throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`)}break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling){throw new Error(`Server does not support sampling (required for ${e})`)}break;case"logging/setLevel":if(!this._capabilities.logging){throw new Error(`Server does not support logging (required for ${e})`)}break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts){throw new Error(`Server does not support prompts (required for ${e})`)}break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources){throw new Error(`Server does not support resources (required for ${e})`)}break;case"tools/call":case"tools/list":if(!this._capabilities.tools){throw new Error(`Server does not support tools (required for ${e})`)}break;case"ping":case"initialize":break}}async _oninitialize(e){const r=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities;this._clientVersion=e.params.clientInfo;const t=i.SUPPORTED_PROTOCOL_VERSIONS.includes(r)?r:i.LATEST_PROTOCOL_VERSION;return{protocolVersion:t,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"},i.EmptyResultSchema)}async createMessage(e,r){return this.request({method:"sampling/createMessage",params:e},i.CreateMessageResultSchema,r)}async elicitInput(e,r){const t=await this.request({method:"elicitation/create",params:e},i.ElicitResultSchema,r);if(t.action==="accept"&&t.content){try{const r=new o.default;const a=r.compile(e.requestedSchema);const s=a(t.content);if(!s){throw new i.McpError(i.ErrorCode.InvalidParams,`Elicitation response content does not match requested schema: ${r.errorsText(a.errors)}`)}}catch(e){if(e instanceof i.McpError){throw e}throw new i.McpError(i.ErrorCode.InternalError,`Error validating elicitation response: ${e}`)}}return t}async listRoots(e,r){return this.request({method:"roots/list",params:e},i.ListRootsResultSchema,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging){if(!this.isMessageIgnored(e.level,r)){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"})}}r.Server=Server},5487:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Protocol=r.DEFAULT_REQUEST_TIMEOUT_MSEC=void 0;r.mergeCapabilities=mergeCapabilities;const a=t(8383);r.DEFAULT_REQUEST_TIMEOUT_MSEC=6e4;class Protocol{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(a.CancelledNotificationSchema,(e=>{const r=this._requestHandlerAbortControllers.get(e.params.requestId);r===null||r===void 0?void 0:r.abort(e.params.reason)}));this.setNotificationHandler(a.ProgressNotificationSchema,(e=>{this._onprogress(e)}));this.setRequestHandler(a.PingRequestSchema,(e=>({})))}_setupTimeout(e,r,t,a,s=false){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,r),startTime:Date.now(),timeout:r,maxTotalTimeout:t,resetTimeoutOnProgress:s,onTimeout:a})}_resetTimeout(e){const r=this._timeoutInfo.get(e);if(!r)return false;const t=Date.now()-r.startTime;if(r.maxTotalTimeout&&t>=r.maxTotalTimeout){this._timeoutInfo.delete(e);throw new a.McpError(a.ErrorCode.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:t})}clearTimeout(r.timeoutId);r.timeoutId=setTimeout(r.onTimeout,r.timeout);return true}_cleanupTimeout(e){const r=this._timeoutInfo.get(e);if(r){clearTimeout(r.timeoutId);this._timeoutInfo.delete(e)}}async connect(e){var r,t,s;this._transport=e;const i=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{i===null||i===void 0?void 0:i();this._onclose()};const o=(t=this.transport)===null||t===void 0?void 0:t.onerror;this._transport.onerror=e=>{o===null||o===void 0?void 0:o(e);this._onerror(e)};const n=(s=this._transport)===null||s===void 0?void 0:s.onmessage;this._transport.onmessage=(e,r)=>{n===null||n===void 0?void 0:n(e,r);if((0,a.isJSONRPCResponse)(e)||(0,a.isJSONRPCError)(e)){this._onresponse(e)}else if((0,a.isJSONRPCRequest)(e)){this._onrequest(e,r)}else if((0,a.isJSONRPCNotification)(e)){this._onnotification(e)}else{this._onerror(new Error(`Unknown message type: ${JSON.stringify(e)}`))}};await this._transport.start()}_onclose(){var e;const r=this._responseHandlers;this._responseHandlers=new Map;this._progressHandlers.clear();this._pendingDebouncedNotifications.clear();this._transport=undefined;(e=this.onclose)===null||e===void 0?void 0:e.call(this);const t=new a.McpError(a.ErrorCode.ConnectionClosed,"Connection closed");for(const e of r.values()){e(t)}}_onerror(e){var r;(r=this.onerror)===null||r===void 0?void 0:r.call(this,e)}_onnotification(e){var r;const t=(r=this._notificationHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;if(t===undefined){return}Promise.resolve().then((()=>t(e))).catch((e=>this._onerror(new Error(`Uncaught error in notification handler: ${e}`))))}_onrequest(e,r){var t,s;const i=(t=this._requestHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackRequestHandler;const o=this._transport;if(i===undefined){o===null||o===void 0?void 0:o.send({jsonrpc:"2.0",id:e.id,error:{code:a.ErrorCode.MethodNotFound,message:"Method not found"}}).catch((e=>this._onerror(new Error(`Failed to send an error response: ${e}`))));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const l={signal:n.signal,sessionId:o===null||o===void 0?void 0:o.sessionId,_meta:(s=e.params)===null||s===void 0?void 0:s._meta,sendNotification:r=>this.notification(r,{relatedRequestId:e.id}),sendRequest:(r,t,a)=>this.request(r,t,{...a,relatedRequestId:e.id}),authInfo:r===null||r===void 0?void 0:r.authInfo,requestId:e.id,requestInfo:r===null||r===void 0?void 0:r.requestInfo};Promise.resolve().then((()=>i(e,l))).then((r=>{if(n.signal.aborted){return}return o===null||o===void 0?void 0:o.send({result:r,jsonrpc:"2.0",id:e.id})}),(r=>{var t;if(n.signal.aborted){return}return o===null||o===void 0?void 0:o.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(r["code"])?r["code"]:a.ErrorCode.InternalError,message:(t=r.message)!==null&&t!==void 0?t:"Internal error"}})})).catch((e=>this._onerror(new Error(`Failed to send response: ${e}`)))).finally((()=>{this._requestHandlerAbortControllers.delete(e.id)}))}_onprogress(e){const{progressToken:r,...t}=e.params;const a=Number(r);const s=this._progressHandlers.get(a);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const i=this._responseHandlers.get(a);const o=this._timeoutInfo.get(a);if(o&&i&&o.resetTimeoutOnProgress){try{this._resetTimeout(a)}catch(e){i(e);return}}s(t)}_onresponse(e){const r=Number(e.id);const t=this._responseHandlers.get(r);if(t===undefined){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r);this._progressHandlers.delete(r);this._cleanupTimeout(r);if((0,a.isJSONRPCResponse)(e)){t(e)}else{const r=new a.McpError(e.error.code,e.error.message,e.error.data);t(r)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,t,s){const{relatedRequestId:i,resumptionToken:o,onresumptiontoken:n}=s!==null&&s!==void 0?s:{};return new Promise(((l,c)=>{var u,d,f,p,h,m;if(!this._transport){c(new Error("Not connected"));return}if(((u=this._options)===null||u===void 0?void 0:u.enforceStrictCapabilities)===true){this.assertCapabilityForMethod(e.method)}(d=s===null||s===void 0?void 0:s.signal)===null||d===void 0?void 0:d.throwIfAborted();const v=this._requestMessageId++;const g={...e,jsonrpc:"2.0",id:v};if(s===null||s===void 0?void 0:s.onprogress){this._progressHandlers.set(v,s.onprogress);g.params={...e.params,_meta:{...((f=e.params)===null||f===void 0?void 0:f._meta)||{},progressToken:v}}}const cancel=e=>{var r;this._responseHandlers.delete(v);this._progressHandlers.delete(v);this._cleanupTimeout(v);(r=this._transport)===null||r===void 0?void 0:r.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(e)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:n}).catch((e=>this._onerror(new Error(`Failed to send cancellation: ${e}`))));c(e)};this._responseHandlers.set(v,(e=>{var r;if((r=s===null||s===void 0?void 0:s.signal)===null||r===void 0?void 0:r.aborted){return}if(e instanceof Error){return c(e)}try{const r=t.parse(e.result);l(r)}catch(e){c(e)}}));(p=s===null||s===void 0?void 0:s.signal)===null||p===void 0?void 0:p.addEventListener("abort",(()=>{var e;cancel((e=s===null||s===void 0?void 0:s.signal)===null||e===void 0?void 0:e.reason)}));const y=(h=s===null||s===void 0?void 0:s.timeout)!==null&&h!==void 0?h:r.DEFAULT_REQUEST_TIMEOUT_MSEC;const timeoutHandler=()=>cancel(new a.McpError(a.ErrorCode.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(v,y,s===null||s===void 0?void 0:s.maxTotalTimeout,timeoutHandler,(m=s===null||s===void 0?void 0:s.resetTimeoutOnProgress)!==null&&m!==void 0?m:false);this._transport.send(g,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:n}).catch((e=>{this._cleanupTimeout(v);c(e)}))}))}async notification(e,r){var t,a;if(!this._transport){throw new Error("Not connected")}this.assertNotificationCapability(e.method);const s=(a=(t=this._options)===null||t===void 0?void 0:t.debouncedNotificationMethods)!==null&&a!==void 0?a:[];const i=s.includes(e.method)&&!e.params&&!(r===null||r===void 0?void 0:r.relatedRequestId);if(i){if(this._pendingDebouncedNotifications.has(e.method)){return}this._pendingDebouncedNotifications.add(e.method);Promise.resolve().then((()=>{var t;this._pendingDebouncedNotifications.delete(e.method);if(!this._transport){return}const a={...e,jsonrpc:"2.0"};(t=this._transport)===null||t===void 0?void 0:t.send(a,r).catch((e=>this._onerror(e)))}));return}const o={...e,jsonrpc:"2.0"};await this._transport.send(o,r)}setRequestHandler(e,r){const t=e.shape.method.value;this.assertRequestHandlerCapability(t);this._requestHandlers.set(t,((t,a)=>Promise.resolve(r(e.parse(t),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,r){this._notificationHandlers.set(e.shape.method.value,(t=>Promise.resolve(r(e.parse(t)))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}r.Protocol=Protocol;function mergeCapabilities(e,r){return Object.entries(r).reduce(((e,[r,t])=>{if(t&&typeof t==="object"){e[r]=e[r]?{...e[r],...t}:t}else{e[r]=t}return e}),{...e})}},8311:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.UriTemplate=void 0;const t=1e6;const a=1e6;const s=1e4;const i=1e6;class UriTemplate{static isTemplate(e){return/\{[^}\s]+\}/.test(e)}static validateLength(e,r,t){if(e.length>r){throw new Error(`${t} exceeds maximum length of ${r} characters (got ${e.length})`)}}get variableNames(){return this.parts.flatMap((e=>typeof e==="string"?[]:e.names))}constructor(e){UriTemplate.validateLength(e,t,"Template");this.template=e;this.parts=this.parse(e)}toString(){return this.template}parse(e){const r=[];let t="";let i=0;let o=0;while(i<e.length){if(e[i]==="{"){if(t){r.push(t);t=""}const n=e.indexOf("}",i);if(n===-1)throw new Error("Unclosed template expression");o++;if(o>s){throw new Error(`Template contains too many expressions (max ${s})`)}const l=e.slice(i+1,n);const c=this.getOperator(l);const u=l.includes("*");const d=this.getNames(l);const f=d[0];for(const e of d){UriTemplate.validateLength(e,a,"Variable name")}r.push({name:f,operator:c,names:d,exploded:u});i=n+1}else{t+=e[i];i++}}if(t){r.push(t)}return r}getOperator(e){const r=["+","#",".","/","?","&"];return r.find((r=>e.startsWith(r)))||""}getNames(e){const r=this.getOperator(e);return e.slice(r.length).split(",").map((e=>e.replace("*","").trim())).filter((e=>e.length>0))}encodeValue(e,r){UriTemplate.validateLength(e,a,"Variable value");if(r==="+"||r==="#"){return encodeURI(e)}return encodeURIComponent(e)}expandPart(e,r){if(e.operator==="?"||e.operator==="&"){const t=e.names.map((t=>{const a=r[t];if(a===undefined)return"";const s=Array.isArray(a)?a.map((r=>this.encodeValue(r,e.operator))).join(","):this.encodeValue(a.toString(),e.operator);return`${t}=${s}`})).filter((e=>e.length>0));if(t.length===0)return"";const a=e.operator==="?"?"?":"&";return a+t.join("&")}if(e.names.length>1){const t=e.names.map((e=>r[e])).filter((e=>e!==undefined));if(t.length===0)return"";return t.map((e=>Array.isArray(e)?e[0]:e)).join(",")}const t=r[e.name];if(t===undefined)return"";const a=Array.isArray(t)?t:[t];const s=a.map((r=>this.encodeValue(r,e.operator)));switch(e.operator){case"":return s.join(",");case"+":return s.join(",");case"#":return"#"+s.join(",");case".":return"."+s.join(".");case"/":return"/"+s.join("/");default:return s.join(",")}}expand(e){let r="";let t=false;for(const a of this.parts){if(typeof a==="string"){r+=a;continue}const s=this.expandPart(a,e);if(!s)continue;if((a.operator==="?"||a.operator==="&")&&t){r+=s.replace("?","&")}else{r+=s}if(a.operator==="?"||a.operator==="&"){t=true}}return r}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(e){const r=[];for(const r of e.names){UriTemplate.validateLength(r,a,"Variable name")}if(e.operator==="?"||e.operator==="&"){for(let t=0;t<e.names.length;t++){const a=e.names[t];const s=t===0?"\\"+e.operator:"&";r.push({pattern:s+this.escapeRegExp(a)+"=([^&]+)",name:a})}return r}let t;const s=e.name;switch(e.operator){case"":t=e.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)";break;case"+":case"#":t="(.+)";break;case".":t="\\.([^/,]+)";break;case"/":t="/"+(e.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)");break;default:t="([^/]+)"}r.push({pattern:t,name:s});return r}match(e){UriTemplate.validateLength(e,t,"URI");let r="^";const a=[];for(const e of this.parts){if(typeof e==="string"){r+=this.escapeRegExp(e)}else{const t=this.partToRegExp(e);for(const{pattern:s,name:i}of t){r+=s;a.push({name:i,exploded:e.exploded})}}}r+="$";UriTemplate.validateLength(r,i,"Generated regex pattern");const s=new RegExp(r);const o=e.match(s);if(!o)return null;const n={};for(let e=0;e<a.length;e++){const{name:r,exploded:t}=a[e];const s=o[e+1];const i=r.replace("*","");if(t&&s.includes(",")){n[i]=s.split(",")}else{n[i]=s}}return n}}r.UriTemplate=UriTemplate},8383:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.SubscribeRequestSchema=r.ResourceListChangedNotificationSchema=r.ReadResourceResultSchema=r.ReadResourceRequestSchema=r.ListResourceTemplatesResultSchema=r.ListResourceTemplatesRequestSchema=r.ListResourcesResultSchema=r.ListResourcesRequestSchema=r.ResourceTemplateSchema=r.ResourceSchema=r.BlobResourceContentsSchema=r.TextResourceContentsSchema=r.ResourceContentsSchema=r.PaginatedResultSchema=r.PaginatedRequestSchema=r.ProgressNotificationSchema=r.ProgressSchema=r.PingRequestSchema=r.isInitializedNotification=r.InitializedNotificationSchema=r.InitializeResultSchema=r.ServerCapabilitiesSchema=r.isInitializeRequest=r.InitializeRequestSchema=r.ClientCapabilitiesSchema=r.ImplementationSchema=r.BaseMetadataSchema=r.IconSchema=r.CancelledNotificationSchema=r.EmptyResultSchema=r.JSONRPCMessageSchema=r.isJSONRPCError=r.JSONRPCErrorSchema=r.ErrorCode=r.isJSONRPCResponse=r.JSONRPCResponseSchema=r.isJSONRPCNotification=r.JSONRPCNotificationSchema=r.isJSONRPCRequest=r.JSONRPCRequestSchema=r.RequestIdSchema=r.ResultSchema=r.NotificationSchema=r.RequestSchema=r.CursorSchema=r.ProgressTokenSchema=r.JSONRPC_VERSION=r.SUPPORTED_PROTOCOL_VERSIONS=r.DEFAULT_NEGOTIATED_PROTOCOL_VERSION=r.LATEST_PROTOCOL_VERSION=void 0;r.ClientNotificationSchema=r.ClientRequestSchema=r.RootsListChangedNotificationSchema=r.ListRootsResultSchema=r.ListRootsRequestSchema=r.RootSchema=r.CompleteResultSchema=r.CompleteRequestSchema=r.PromptReferenceSchema=r.ResourceReferenceSchema=r.ResourceTemplateReferenceSchema=r.ElicitResultSchema=r.ElicitRequestSchema=r.PrimitiveSchemaDefinitionSchema=r.EnumSchemaSchema=r.NumberSchemaSchema=r.StringSchemaSchema=r.BooleanSchemaSchema=r.CreateMessageResultSchema=r.CreateMessageRequestSchema=r.SamplingMessageSchema=r.ModelPreferencesSchema=r.ModelHintSchema=r.LoggingMessageNotificationSchema=r.SetLevelRequestSchema=r.LoggingLevelSchema=r.ToolListChangedNotificationSchema=r.CallToolRequestSchema=r.CompatibilityCallToolResultSchema=r.CallToolResultSchema=r.ListToolsResultSchema=r.ListToolsRequestSchema=r.ToolSchema=r.ToolAnnotationsSchema=r.PromptListChangedNotificationSchema=r.GetPromptResultSchema=r.PromptMessageSchema=r.ContentBlockSchema=r.ResourceLinkSchema=r.EmbeddedResourceSchema=r.AudioContentSchema=r.ImageContentSchema=r.TextContentSchema=r.GetPromptRequestSchema=r.ListPromptsResultSchema=r.ListPromptsRequestSchema=r.PromptSchema=r.PromptArgumentSchema=r.ResourceUpdatedNotificationSchema=r.UnsubscribeRequestSchema=void 0;r.McpError=r.ServerResultSchema=r.ServerNotificationSchema=r.ServerRequestSchema=r.ClientResultSchema=void 0;const a=t(4788);r.LATEST_PROTOCOL_VERSION="2025-06-18";r.DEFAULT_NEGOTIATED_PROTOCOL_VERSION="2025-03-26";r.SUPPORTED_PROTOCOL_VERSIONS=[r.LATEST_PROTOCOL_VERSION,"2025-03-26","2024-11-05","2024-10-07"];r.JSONRPC_VERSION="2.0";r.ProgressTokenSchema=a.z.union([a.z.string(),a.z.number().int()]);r.CursorSchema=a.z.string();const s=a.z.object({progressToken:a.z.optional(r.ProgressTokenSchema)}).passthrough();const i=a.z.object({_meta:a.z.optional(s)}).passthrough();r.RequestSchema=a.z.object({method:a.z.string(),params:a.z.optional(i)});const o=a.z.object({_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();r.NotificationSchema=a.z.object({method:a.z.string(),params:a.z.optional(o)});r.ResultSchema=a.z.object({_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();r.RequestIdSchema=a.z.union([a.z.string(),a.z.number().int()]);r.JSONRPCRequestSchema=a.z.object({jsonrpc:a.z.literal(r.JSONRPC_VERSION),id:r.RequestIdSchema}).merge(r.RequestSchema).strict();const isJSONRPCRequest=e=>r.JSONRPCRequestSchema.safeParse(e).success;r.isJSONRPCRequest=isJSONRPCRequest;r.JSONRPCNotificationSchema=a.z.object({jsonrpc:a.z.literal(r.JSONRPC_VERSION)}).merge(r.NotificationSchema).strict();const isJSONRPCNotification=e=>r.JSONRPCNotificationSchema.safeParse(e).success;r.isJSONRPCNotification=isJSONRPCNotification;r.JSONRPCResponseSchema=a.z.object({jsonrpc:a.z.literal(r.JSONRPC_VERSION),id:r.RequestIdSchema,result:r.ResultSchema}).strict();const isJSONRPCResponse=e=>r.JSONRPCResponseSchema.safeParse(e).success;r.isJSONRPCResponse=isJSONRPCResponse;var n;(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"})(n||(r.ErrorCode=n={}));r.JSONRPCErrorSchema=a.z.object({jsonrpc:a.z.literal(r.JSONRPC_VERSION),id:r.RequestIdSchema,error:a.z.object({code:a.z.number().int(),message:a.z.string(),data:a.z.optional(a.z.unknown())})}).strict();const isJSONRPCError=e=>r.JSONRPCErrorSchema.safeParse(e).success;r.isJSONRPCError=isJSONRPCError;r.JSONRPCMessageSchema=a.z.union([r.JSONRPCRequestSchema,r.JSONRPCNotificationSchema,r.JSONRPCResponseSchema,r.JSONRPCErrorSchema]);r.EmptyResultSchema=r.ResultSchema.strict();r.CancelledNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/cancelled"),params:o.extend({requestId:r.RequestIdSchema,reason:a.z.string().optional()})});r.IconSchema=a.z.object({src:a.z.string(),mimeType:a.z.optional(a.z.string()),sizes:a.z.optional(a.z.string())}).passthrough();r.BaseMetadataSchema=a.z.object({name:a.z.string(),title:a.z.optional(a.z.string())}).passthrough();r.ImplementationSchema=r.BaseMetadataSchema.extend({version:a.z.string(),websiteUrl:a.z.optional(a.z.string()),icons:a.z.optional(a.z.array(r.IconSchema))});r.ClientCapabilitiesSchema=a.z.object({experimental:a.z.optional(a.z.object({}).passthrough()),sampling:a.z.optional(a.z.object({}).passthrough()),elicitation:a.z.optional(a.z.object({}).passthrough()),roots:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough())}).passthrough();r.InitializeRequestSchema=r.RequestSchema.extend({method:a.z.literal("initialize"),params:i.extend({protocolVersion:a.z.string(),capabilities:r.ClientCapabilitiesSchema,clientInfo:r.ImplementationSchema})});const isInitializeRequest=e=>r.InitializeRequestSchema.safeParse(e).success;r.isInitializeRequest=isInitializeRequest;r.ServerCapabilitiesSchema=a.z.object({experimental:a.z.optional(a.z.object({}).passthrough()),logging:a.z.optional(a.z.object({}).passthrough()),completions:a.z.optional(a.z.object({}).passthrough()),prompts:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough()),resources:a.z.optional(a.z.object({subscribe:a.z.optional(a.z.boolean()),listChanged:a.z.optional(a.z.boolean())}).passthrough()),tools:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough())}).passthrough();r.InitializeResultSchema=r.ResultSchema.extend({protocolVersion:a.z.string(),capabilities:r.ServerCapabilitiesSchema,serverInfo:r.ImplementationSchema,instructions:a.z.optional(a.z.string())});r.InitializedNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/initialized")});const isInitializedNotification=e=>r.InitializedNotificationSchema.safeParse(e).success;r.isInitializedNotification=isInitializedNotification;r.PingRequestSchema=r.RequestSchema.extend({method:a.z.literal("ping")});r.ProgressSchema=a.z.object({progress:a.z.number(),total:a.z.optional(a.z.number()),message:a.z.optional(a.z.string())}).passthrough();r.ProgressNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/progress"),params:o.merge(r.ProgressSchema).extend({progressToken:r.ProgressTokenSchema})});r.PaginatedRequestSchema=r.RequestSchema.extend({params:i.extend({cursor:a.z.optional(r.CursorSchema)}).optional()});r.PaginatedResultSchema=r.ResultSchema.extend({nextCursor:a.z.optional(r.CursorSchema)});r.ResourceContentsSchema=a.z.object({uri:a.z.string(),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();r.TextResourceContentsSchema=r.ResourceContentsSchema.extend({text:a.z.string()});const l=a.z.string().refine((e=>{try{atob(e);return true}catch(e){return false}}),{message:"Invalid Base64 string"});r.BlobResourceContentsSchema=r.ResourceContentsSchema.extend({blob:l});r.ResourceSchema=r.BaseMetadataSchema.extend({uri:a.z.string(),description:a.z.optional(a.z.string()),mimeType:a.z.optional(a.z.string()),icons:a.z.optional(a.z.array(r.IconSchema)),_meta:a.z.optional(a.z.object({}).passthrough())});r.ResourceTemplateSchema=r.BaseMetadataSchema.extend({uriTemplate:a.z.string(),description:a.z.optional(a.z.string()),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())});r.ListResourcesRequestSchema=r.PaginatedRequestSchema.extend({method:a.z.literal("resources/list")});r.ListResourcesResultSchema=r.PaginatedResultSchema.extend({resources:a.z.array(r.ResourceSchema)});r.ListResourceTemplatesRequestSchema=r.PaginatedRequestSchema.extend({method:a.z.literal("resources/templates/list")});r.ListResourceTemplatesResultSchema=r.PaginatedResultSchema.extend({resourceTemplates:a.z.array(r.ResourceTemplateSchema)});r.ReadResourceRequestSchema=r.RequestSchema.extend({method:a.z.literal("resources/read"),params:i.extend({uri:a.z.string()})});r.ReadResourceResultSchema=r.ResultSchema.extend({contents:a.z.array(a.z.union([r.TextResourceContentsSchema,r.BlobResourceContentsSchema]))});r.ResourceListChangedNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/resources/list_changed")});r.SubscribeRequestSchema=r.RequestSchema.extend({method:a.z.literal("resources/subscribe"),params:i.extend({uri:a.z.string()})});r.UnsubscribeRequestSchema=r.RequestSchema.extend({method:a.z.literal("resources/unsubscribe"),params:i.extend({uri:a.z.string()})});r.ResourceUpdatedNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/resources/updated"),params:o.extend({uri:a.z.string()})});r.PromptArgumentSchema=a.z.object({name:a.z.string(),description:a.z.optional(a.z.string()),required:a.z.optional(a.z.boolean())}).passthrough();r.PromptSchema=r.BaseMetadataSchema.extend({description:a.z.optional(a.z.string()),arguments:a.z.optional(a.z.array(r.PromptArgumentSchema)),icons:a.z.optional(a.z.array(r.IconSchema)),_meta:a.z.optional(a.z.object({}).passthrough())});r.ListPromptsRequestSchema=r.PaginatedRequestSchema.extend({method:a.z.literal("prompts/list")});r.ListPromptsResultSchema=r.PaginatedResultSchema.extend({prompts:a.z.array(r.PromptSchema)});r.GetPromptRequestSchema=r.RequestSchema.extend({method:a.z.literal("prompts/get"),params:i.extend({name:a.z.string(),arguments:a.z.optional(a.z.record(a.z.string()))})});r.TextContentSchema=a.z.object({type:a.z.literal("text"),text:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();r.ImageContentSchema=a.z.object({type:a.z.literal("image"),data:l,mimeType:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();r.AudioContentSchema=a.z.object({type:a.z.literal("audio"),data:l,mimeType:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();r.EmbeddedResourceSchema=a.z.object({type:a.z.literal("resource"),resource:a.z.union([r.TextResourceContentsSchema,r.BlobResourceContentsSchema]),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();r.ResourceLinkSchema=r.ResourceSchema.extend({type:a.z.literal("resource_link")});r.ContentBlockSchema=a.z.union([r.TextContentSchema,r.ImageContentSchema,r.AudioContentSchema,r.ResourceLinkSchema,r.EmbeddedResourceSchema]);r.PromptMessageSchema=a.z.object({role:a.z.enum(["user","assistant"]),content:r.ContentBlockSchema}).passthrough();r.GetPromptResultSchema=r.ResultSchema.extend({description:a.z.optional(a.z.string()),messages:a.z.array(r.PromptMessageSchema)});r.PromptListChangedNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/prompts/list_changed")});r.ToolAnnotationsSchema=a.z.object({title:a.z.optional(a.z.string()),readOnlyHint:a.z.optional(a.z.boolean()),destructiveHint:a.z.optional(a.z.boolean()),idempotentHint:a.z.optional(a.z.boolean()),openWorldHint:a.z.optional(a.z.boolean())}).passthrough();r.ToolSchema=r.BaseMetadataSchema.extend({description:a.z.optional(a.z.string()),inputSchema:a.z.object({type:a.z.literal("object"),properties:a.z.optional(a.z.object({}).passthrough()),required:a.z.optional(a.z.array(a.z.string()))}).passthrough(),outputSchema:a.z.optional(a.z.object({type:a.z.literal("object"),properties:a.z.optional(a.z.object({}).passthrough()),required:a.z.optional(a.z.array(a.z.string()))}).passthrough()),annotations:a.z.optional(r.ToolAnnotationsSchema),icons:a.z.optional(a.z.array(r.IconSchema)),_meta:a.z.optional(a.z.object({}).passthrough())});r.ListToolsRequestSchema=r.PaginatedRequestSchema.extend({method:a.z.literal("tools/list")});r.ListToolsResultSchema=r.PaginatedResultSchema.extend({tools:a.z.array(r.ToolSchema)});r.CallToolResultSchema=r.ResultSchema.extend({content:a.z.array(r.ContentBlockSchema).default([]),structuredContent:a.z.object({}).passthrough().optional(),isError:a.z.optional(a.z.boolean())});r.CompatibilityCallToolResultSchema=r.CallToolResultSchema.or(r.ResultSchema.extend({toolResult:a.z.unknown()}));r.CallToolRequestSchema=r.RequestSchema.extend({method:a.z.literal("tools/call"),params:i.extend({name:a.z.string(),arguments:a.z.optional(a.z.record(a.z.unknown()))})});r.ToolListChangedNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/tools/list_changed")});r.LoggingLevelSchema=a.z.enum(["debug","info","notice","warning","error","critical","alert","emergency"]);r.SetLevelRequestSchema=r.RequestSchema.extend({method:a.z.literal("logging/setLevel"),params:i.extend({level:r.LoggingLevelSchema})});r.LoggingMessageNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/message"),params:o.extend({level:r.LoggingLevelSchema,logger:a.z.optional(a.z.string()),data:a.z.unknown()})});r.ModelHintSchema=a.z.object({name:a.z.string().optional()}).passthrough();r.ModelPreferencesSchema=a.z.object({hints:a.z.optional(a.z.array(r.ModelHintSchema)),costPriority:a.z.optional(a.z.number().min(0).max(1)),speedPriority:a.z.optional(a.z.number().min(0).max(1)),intelligencePriority:a.z.optional(a.z.number().min(0).max(1))}).passthrough();r.SamplingMessageSchema=a.z.object({role:a.z.enum(["user","assistant"]),content:a.z.union([r.TextContentSchema,r.ImageContentSchema,r.AudioContentSchema])}).passthrough();r.CreateMessageRequestSchema=r.RequestSchema.extend({method:a.z.literal("sampling/createMessage"),params:i.extend({messages:a.z.array(r.SamplingMessageSchema),systemPrompt:a.z.optional(a.z.string()),includeContext:a.z.optional(a.z.enum(["none","thisServer","allServers"])),temperature:a.z.optional(a.z.number()),maxTokens:a.z.number().int(),stopSequences:a.z.optional(a.z.array(a.z.string())),metadata:a.z.optional(a.z.object({}).passthrough()),modelPreferences:a.z.optional(r.ModelPreferencesSchema)})});r.CreateMessageResultSchema=r.ResultSchema.extend({model:a.z.string(),stopReason:a.z.optional(a.z.enum(["endTurn","stopSequence","maxTokens"]).or(a.z.string())),role:a.z.enum(["user","assistant"]),content:a.z.discriminatedUnion("type",[r.TextContentSchema,r.ImageContentSchema,r.AudioContentSchema])});r.BooleanSchemaSchema=a.z.object({type:a.z.literal("boolean"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),default:a.z.optional(a.z.boolean())}).passthrough();r.StringSchemaSchema=a.z.object({type:a.z.literal("string"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),minLength:a.z.optional(a.z.number()),maxLength:a.z.optional(a.z.number()),format:a.z.optional(a.z.enum(["email","uri","date","date-time"]))}).passthrough();r.NumberSchemaSchema=a.z.object({type:a.z.enum(["number","integer"]),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),minimum:a.z.optional(a.z.number()),maximum:a.z.optional(a.z.number())}).passthrough();r.EnumSchemaSchema=a.z.object({type:a.z.literal("string"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),enum:a.z.array(a.z.string()),enumNames:a.z.optional(a.z.array(a.z.string()))}).passthrough();r.PrimitiveSchemaDefinitionSchema=a.z.union([r.BooleanSchemaSchema,r.StringSchemaSchema,r.NumberSchemaSchema,r.EnumSchemaSchema]);r.ElicitRequestSchema=r.RequestSchema.extend({method:a.z.literal("elicitation/create"),params:i.extend({message:a.z.string(),requestedSchema:a.z.object({type:a.z.literal("object"),properties:a.z.record(a.z.string(),r.PrimitiveSchemaDefinitionSchema),required:a.z.optional(a.z.array(a.z.string()))}).passthrough()})});r.ElicitResultSchema=r.ResultSchema.extend({action:a.z.enum(["accept","decline","cancel"]),content:a.z.optional(a.z.record(a.z.string(),a.z.unknown()))});r.ResourceTemplateReferenceSchema=a.z.object({type:a.z.literal("ref/resource"),uri:a.z.string()}).passthrough();r.ResourceReferenceSchema=r.ResourceTemplateReferenceSchema;r.PromptReferenceSchema=a.z.object({type:a.z.literal("ref/prompt"),name:a.z.string()}).passthrough();r.CompleteRequestSchema=r.RequestSchema.extend({method:a.z.literal("completion/complete"),params:i.extend({ref:a.z.union([r.PromptReferenceSchema,r.ResourceTemplateReferenceSchema]),argument:a.z.object({name:a.z.string(),value:a.z.string()}).passthrough(),context:a.z.optional(a.z.object({arguments:a.z.optional(a.z.record(a.z.string(),a.z.string()))}))})});r.CompleteResultSchema=r.ResultSchema.extend({completion:a.z.object({values:a.z.array(a.z.string()).max(100),total:a.z.optional(a.z.number().int()),hasMore:a.z.optional(a.z.boolean())}).passthrough()});r.RootSchema=a.z.object({uri:a.z.string().startsWith("file://"),name:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();r.ListRootsRequestSchema=r.RequestSchema.extend({method:a.z.literal("roots/list")});r.ListRootsResultSchema=r.ResultSchema.extend({roots:a.z.array(r.RootSchema)});r.RootsListChangedNotificationSchema=r.NotificationSchema.extend({method:a.z.literal("notifications/roots/list_changed")});r.ClientRequestSchema=a.z.union([r.PingRequestSchema,r.InitializeRequestSchema,r.CompleteRequestSchema,r.SetLevelRequestSchema,r.GetPromptRequestSchema,r.ListPromptsRequestSchema,r.ListResourcesRequestSchema,r.ListResourceTemplatesRequestSchema,r.ReadResourceRequestSchema,r.SubscribeRequestSchema,r.UnsubscribeRequestSchema,r.CallToolRequestSchema,r.ListToolsRequestSchema]);r.ClientNotificationSchema=a.z.union([r.CancelledNotificationSchema,r.ProgressNotificationSchema,r.InitializedNotificationSchema,r.RootsListChangedNotificationSchema]);r.ClientResultSchema=a.z.union([r.EmptyResultSchema,r.CreateMessageResultSchema,r.ElicitResultSchema,r.ListRootsResultSchema]);r.ServerRequestSchema=a.z.union([r.PingRequestSchema,r.CreateMessageRequestSchema,r.ElicitRequestSchema,r.ListRootsRequestSchema]);r.ServerNotificationSchema=a.z.union([r.CancelledNotificationSchema,r.ProgressNotificationSchema,r.LoggingMessageNotificationSchema,r.ResourceUpdatedNotificationSchema,r.ResourceListChangedNotificationSchema,r.ToolListChangedNotificationSchema,r.PromptListChangedNotificationSchema]);r.ServerResultSchema=a.z.union([r.EmptyResultSchema,r.InitializeResultSchema,r.CompleteResultSchema,r.GetPromptResultSchema,r.ListPromptsResultSchema,r.ListResourcesResultSchema,r.ListResourceTemplatesResultSchema,r.ReadResourceResultSchema,r.CallToolResultSchema,r.ListToolsResultSchema]);class McpError extends Error{constructor(e,r,t){super(`MCP error ${e}: ${r}`);this.code=e;this.data=t;this.name="McpError"}}r.McpError=McpError},9180:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getDefaultOptions=r.defaultOptions=r.jsonDescription=r.ignoreOverride=void 0;r.ignoreOverride=Symbol("Let zodToJsonSchema decide on which parser to use");const jsonDescription=(e,r)=>{if(r.description){try{return{...e,...JSON.parse(r.description)}}catch{}}return e};r.jsonDescription=jsonDescription;r.defaultOptions={name:undefined,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:true,rejectedAdditionalProperties:false,definitionPath:"definitions",target:"jsonSchema7",strictUnions:false,definitions:{},errorMessages:false,markdownDescription:false,patternStrategy:"escape",applyRegexFlags:false,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"};const getDefaultOptions=e=>typeof e==="string"?{...r.defaultOptions,name:e}:{...r.defaultOptions,...e};r.getDefaultOptions=getDefaultOptions},8847:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getRefs=void 0;const a=t(9180);const getRefs=e=>{const r=(0,a.getDefaultOptions)(e);const t=r.name!==undefined?[...r.basePath,r.definitionPath,r.name]:r.basePath;return{...r,flags:{hasReferencedOpenAiAnyType:false},currentPath:t,propertyPath:undefined,seen:new Map(Object.entries(r.definitions).map((([e,t])=>[t._def,{def:t._def,path:[...r.basePath,r.definitionPath,e],jsonSchema:undefined}])))}};r.getRefs=getRefs},7863:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.setResponseValueAndErrors=r.addErrorMessage=void 0;function addErrorMessage(e,r,t,a){if(!a?.errorMessages)return;if(t){e.errorMessage={...e.errorMessage,[r]:t}}}r.addErrorMessage=addErrorMessage;function setResponseValueAndErrors(e,r,t,a,s){e[r]=t;addErrorMessage(e,r,a,s)}r.setResponseValueAndErrors=setResponseValueAndErrors},5500:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getRelativePath=void 0;const getRelativePath=(e,r)=>{let t=0;for(;t<e.length&&t<r.length;t++){if(e[t]!==r[t])break}return[(e.length-t).toString(),...r.slice(t)].join("/")};r.getRelativePath=getRelativePath},7746:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,s)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var s=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});s(t(9180),r);s(t(8847),r);s(t(7863),r);s(t(5500),r);s(t(4266),r);s(t(9839),r);s(t(9392),r);s(t(8243),r);s(t(9955),r);s(t(1652),r);s(t(3103),r);s(t(2804),r);s(t(1970),r);s(t(9782),r);s(t(2085),r);s(t(7563),r);s(t(4877),r);s(t(1933),r);s(t(8110),r);s(t(7493),r);s(t(7098),r);s(t(3862),r);s(t(2048),r);s(t(8566),r);s(t(22),r);s(t(1286),r);s(t(3480),r);s(t(9460),r);s(t(9758),r);s(t(3721),r);s(t(9972),r);s(t(896),r);s(t(8700),r);s(t(4519),r);s(t(2977),r);s(t(4160),r);s(t(749),r);s(t(3878),r);const i=t(3878);r["default"]=i.zodToJsonSchema},4266:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseDef=void 0;const a=t(9180);const s=t(749);const i=t(5500);const o=t(9392);function parseDef(e,r,t=false){const i=r.seen.get(e);if(r.override){const s=r.override?.(e,r,i,t);if(s!==a.ignoreOverride){return s}}if(i&&!t){const e=get$ref(i,r);if(e!==undefined){return e}}const o={def:e,path:r.currentPath,jsonSchema:undefined};r.seen.set(e,o);const n=(0,s.selectParser)(e,e.typeName,r);const l=typeof n==="function"?parseDef(n(),r):n;if(l){addMeta(e,r,l)}if(r.postProcess){const t=r.postProcess(l,e,r);o.jsonSchema=l;return t}o.jsonSchema=l;return l}r.parseDef=parseDef;const get$ref=(e,r)=>{switch(r.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:(0,i.getRelativePath)(r.currentPath,e.path)};case"none":case"seen":{if(e.path.length<r.currentPath.length&&e.path.every(((e,t)=>r.currentPath[t]===e))){console.warn(`Recursive reference detected at ${r.currentPath.join("/")}! Defaulting to any`);return(0,o.parseAnyDef)(r)}return r.$refStrategy==="seen"?(0,o.parseAnyDef)(r):undefined}}};const addMeta=(e,r,t)=>{if(e.description){t.description=e.description;if(r.markdownDescription){t.markdownDescription=e.description}}return t}},9839:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true})},9392:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseAnyDef=void 0;const a=t(5500);function parseAnyDef(e){if(e.target!=="openAi"){return{}}const r=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];e.flags.hasReferencedOpenAiAnyType=true;return{$ref:e.$refStrategy==="relative"?(0,a.getRelativePath)(r,e.currentPath):r.join("/")}}r.parseAnyDef=parseAnyDef},8243:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseArrayDef=void 0;const a=t(4788);const s=t(7863);const i=t(4266);function parseArrayDef(e,r){const t={type:"array"};if(e.type?._def&&e.type?._def?.typeName!==a.ZodFirstPartyTypeKind.ZodAny){t.items=(0,i.parseDef)(e.type._def,{...r,currentPath:[...r.currentPath,"items"]})}if(e.minLength){(0,s.setResponseValueAndErrors)(t,"minItems",e.minLength.value,e.minLength.message,r)}if(e.maxLength){(0,s.setResponseValueAndErrors)(t,"maxItems",e.maxLength.value,e.maxLength.message,r)}if(e.exactLength){(0,s.setResponseValueAndErrors)(t,"minItems",e.exactLength.value,e.exactLength.message,r);(0,s.setResponseValueAndErrors)(t,"maxItems",e.exactLength.value,e.exactLength.message,r)}return t}r.parseArrayDef=parseArrayDef},9955:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseBigintDef=void 0;const a=t(7863);function parseBigintDef(e,r){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const s of e.checks){switch(s.kind){case"min":if(r.target==="jsonSchema7"){if(s.inclusive){(0,a.setResponseValueAndErrors)(t,"minimum",s.value,s.message,r)}else{(0,a.setResponseValueAndErrors)(t,"exclusiveMinimum",s.value,s.message,r)}}else{if(!s.inclusive){t.exclusiveMinimum=true}(0,a.setResponseValueAndErrors)(t,"minimum",s.value,s.message,r)}break;case"max":if(r.target==="jsonSchema7"){if(s.inclusive){(0,a.setResponseValueAndErrors)(t,"maximum",s.value,s.message,r)}else{(0,a.setResponseValueAndErrors)(t,"exclusiveMaximum",s.value,s.message,r)}}else{if(!s.inclusive){t.exclusiveMaximum=true}(0,a.setResponseValueAndErrors)(t,"maximum",s.value,s.message,r)}break;case"multipleOf":(0,a.setResponseValueAndErrors)(t,"multipleOf",s.value,s.message,r);break}}return t}r.parseBigintDef=parseBigintDef},1652:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseBooleanDef=void 0;function parseBooleanDef(){return{type:"boolean"}}r.parseBooleanDef=parseBooleanDef},3103:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseBrandedDef=void 0;const a=t(4266);function parseBrandedDef(e,r){return(0,a.parseDef)(e.type._def,r)}r.parseBrandedDef=parseBrandedDef},2804:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseCatchDef=void 0;const a=t(4266);const parseCatchDef=(e,r)=>(0,a.parseDef)(e.innerType._def,r);r.parseCatchDef=parseCatchDef},1970:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseDateDef=void 0;const a=t(7863);function parseDateDef(e,r,t){const a=t??r.dateStrategy;if(Array.isArray(a)){return{anyOf:a.map(((t,a)=>parseDateDef(e,r,t)))}}switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return integerDateParser(e,r)}}r.parseDateDef=parseDateDef;const integerDateParser=(e,r)=>{const t={type:"integer",format:"unix-time"};if(r.target==="openApi3"){return t}for(const s of e.checks){switch(s.kind){case"min":(0,a.setResponseValueAndErrors)(t,"minimum",s.value,s.message,r);break;case"max":(0,a.setResponseValueAndErrors)(t,"maximum",s.value,s.message,r);break}}return t}},9782:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseDefaultDef=void 0;const a=t(4266);function parseDefaultDef(e,r){return{...(0,a.parseDef)(e.innerType._def,r),default:e.defaultValue()}}r.parseDefaultDef=parseDefaultDef},2085:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseEffectsDef=void 0;const a=t(4266);const s=t(9392);function parseEffectsDef(e,r){return r.effectStrategy==="input"?(0,a.parseDef)(e.schema._def,r):(0,s.parseAnyDef)(r)}r.parseEffectsDef=parseEffectsDef},7563:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseEnumDef=void 0;function parseEnumDef(e){return{type:"string",enum:Array.from(e.values)}}r.parseEnumDef=parseEnumDef},4877:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseIntersectionDef=void 0;const a=t(4266);const isJsonSchema7AllOfType=e=>{if("type"in e&&e.type==="string")return false;return"allOf"in e};function parseIntersectionDef(e,r){const t=[(0,a.parseDef)(e.left._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),(0,a.parseDef)(e.right._def,{...r,currentPath:[...r.currentPath,"allOf","1"]})].filter((e=>!!e));let s=r.target==="jsonSchema2019-09"?{unevaluatedProperties:false}:undefined;const i=[];t.forEach((e=>{if(isJsonSchema7AllOfType(e)){i.push(...e.allOf);if(e.unevaluatedProperties===undefined){s=undefined}}else{let r=e;if("additionalProperties"in e&&e.additionalProperties===false){const{additionalProperties:t,...a}=e;r=a}else{s=undefined}i.push(r)}}));return i.length?{allOf:i,...s}:undefined}r.parseIntersectionDef=parseIntersectionDef},1933:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseLiteralDef=void 0;function parseLiteralDef(e,r){const t=typeof e.value;if(t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"){return{type:Array.isArray(e.value)?"array":"object"}}if(r.target==="openApi3"){return{type:t==="bigint"?"integer":t,enum:[e.value]}}return{type:t==="bigint"?"integer":t,const:e.value}}r.parseLiteralDef=parseLiteralDef},8110:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseMapDef=void 0;const a=t(4266);const s=t(3721);const i=t(9392);function parseMapDef(e,r){if(r.mapStrategy==="record"){return(0,s.parseRecordDef)(e,r)}const t=(0,a.parseDef)(e.keyType._def,{...r,currentPath:[...r.currentPath,"items","items","0"]})||(0,i.parseAnyDef)(r);const o=(0,a.parseDef)(e.valueType._def,{...r,currentPath:[...r.currentPath,"items","items","1"]})||(0,i.parseAnyDef)(r);return{type:"array",maxItems:125,items:{type:"array",items:[t,o],minItems:2,maxItems:2}}}r.parseMapDef=parseMapDef},7493:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseNativeEnumDef=void 0;function parseNativeEnumDef(e){const r=e.values;const t=Object.keys(e.values).filter((e=>typeof r[r[e]]!=="number"));const a=t.map((e=>r[e]));const s=Array.from(new Set(a.map((e=>typeof e))));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:a}}r.parseNativeEnumDef=parseNativeEnumDef},7098:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseNeverDef=void 0;const a=t(9392);function parseNeverDef(e){return e.target==="openAi"?undefined:{not:(0,a.parseAnyDef)({...e,currentPath:[...e.currentPath,"not"]})}}r.parseNeverDef=parseNeverDef},3862:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseNullDef=void 0;function parseNullDef(e){return e.target==="openApi3"?{enum:["null"],nullable:true}:{type:"null"}}r.parseNullDef=parseNullDef},2048:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseNullableDef=void 0;const a=t(4266);const s=t(2977);function parseNullableDef(e,r){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length)){if(r.target==="openApi3"){return{type:s.primitiveMappings[e.innerType._def.typeName],nullable:true}}return{type:[s.primitiveMappings[e.innerType._def.typeName],"null"]}}if(r.target==="openApi3"){const t=(0,a.parseDef)(e.innerType._def,{...r,currentPath:[...r.currentPath]});if(t&&"$ref"in t)return{allOf:[t],nullable:true};return t&&{...t,nullable:true}}const t=(0,a.parseDef)(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}r.parseNullableDef=parseNullableDef},8566:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseNumberDef=void 0;const a=t(7863);function parseNumberDef(e,r){const t={type:"number"};if(!e.checks)return t;for(const s of e.checks){switch(s.kind){case"int":t.type="integer";(0,a.addErrorMessage)(t,"type",s.message,r);break;case"min":if(r.target==="jsonSchema7"){if(s.inclusive){(0,a.setResponseValueAndErrors)(t,"minimum",s.value,s.message,r)}else{(0,a.setResponseValueAndErrors)(t,"exclusiveMinimum",s.value,s.message,r)}}else{if(!s.inclusive){t.exclusiveMinimum=true}(0,a.setResponseValueAndErrors)(t,"minimum",s.value,s.message,r)}break;case"max":if(r.target==="jsonSchema7"){if(s.inclusive){(0,a.setResponseValueAndErrors)(t,"maximum",s.value,s.message,r)}else{(0,a.setResponseValueAndErrors)(t,"exclusiveMaximum",s.value,s.message,r)}}else{if(!s.inclusive){t.exclusiveMaximum=true}(0,a.setResponseValueAndErrors)(t,"maximum",s.value,s.message,r)}break;case"multipleOf":(0,a.setResponseValueAndErrors)(t,"multipleOf",s.value,s.message,r);break}}return t}r.parseNumberDef=parseNumberDef},22:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseObjectDef=void 0;const a=t(4266);function parseObjectDef(e,r){const t=r.target==="openAi";const s={type:"object",properties:{}};const i=[];const o=e.shape();for(const e in o){let n=o[e];if(n===undefined||n._def===undefined){continue}let l=safeIsOptional(n);if(l&&t){if(n._def.typeName==="ZodOptional"){n=n._def.innerType}if(!n.isNullable()){n=n.nullable()}l=false}const c=(0,a.parseDef)(n._def,{...r,currentPath:[...r.currentPath,"properties",e],propertyPath:[...r.currentPath,"properties",e]});if(c===undefined){continue}s.properties[e]=c;if(!l){i.push(e)}}if(i.length){s.required=i}const n=decideAdditionalProperties(e,r);if(n!==undefined){s.additionalProperties=n}return s}r.parseObjectDef=parseObjectDef;function decideAdditionalProperties(e,r){if(e.catchall._def.typeName!=="ZodNever"){return(0,a.parseDef)(e.catchall._def,{...r,currentPath:[...r.currentPath,"additionalProperties"]})}switch(e.unknownKeys){case"passthrough":return r.allowedAdditionalProperties;case"strict":return r.rejectedAdditionalProperties;case"strip":return r.removeAdditionalStrategy==="strict"?r.allowedAdditionalProperties:r.rejectedAdditionalProperties}}function safeIsOptional(e){try{return e.isOptional()}catch{return true}}},1286:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseOptionalDef=void 0;const a=t(4266);const s=t(9392);const parseOptionalDef=(e,r)=>{if(r.currentPath.toString()===r.propertyPath?.toString()){return(0,a.parseDef)(e.innerType._def,r)}const t=(0,a.parseDef)(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","1"]});return t?{anyOf:[{not:(0,s.parseAnyDef)(r)},t]}:(0,s.parseAnyDef)(r)};r.parseOptionalDef=parseOptionalDef},3480:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parsePipelineDef=void 0;const a=t(4266);const parsePipelineDef=(e,r)=>{if(r.pipeStrategy==="input"){return(0,a.parseDef)(e.in._def,r)}else if(r.pipeStrategy==="output"){return(0,a.parseDef)(e.out._def,r)}const t=(0,a.parseDef)(e.in._def,{...r,currentPath:[...r.currentPath,"allOf","0"]});const s=(0,a.parseDef)(e.out._def,{...r,currentPath:[...r.currentPath,"allOf",t?"1":"0"]});return{allOf:[t,s].filter((e=>e!==undefined))}};r.parsePipelineDef=parsePipelineDef},9460:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parsePromiseDef=void 0;const a=t(4266);function parsePromiseDef(e,r){return(0,a.parseDef)(e.type._def,r)}r.parsePromiseDef=parsePromiseDef},9758:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseReadonlyDef=void 0;const a=t(4266);const parseReadonlyDef=(e,r)=>(0,a.parseDef)(e.innerType._def,r);r.parseReadonlyDef=parseReadonlyDef},3721:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseRecordDef=void 0;const a=t(4788);const s=t(4266);const i=t(896);const o=t(3103);const n=t(9392);function parseRecordDef(e,r){if(r.target==="openAi"){console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.")}if(r.target==="openApi3"&&e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodEnum){return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce(((t,a)=>({...t,[a]:(0,s.parseDef)(e.valueType._def,{...r,currentPath:[...r.currentPath,"properties",a]})??(0,n.parseAnyDef)(r)})),{}),additionalProperties:r.rejectedAdditionalProperties}}const t={type:"object",additionalProperties:(0,s.parseDef)(e.valueType._def,{...r,currentPath:[...r.currentPath,"additionalProperties"]})??r.allowedAdditionalProperties};if(r.target==="openApi3"){return t}if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.checks?.length){const{type:a,...s}=(0,i.parseStringDef)(e.keyType._def,r);return{...t,propertyNames:s}}else if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodEnum){return{...t,propertyNames:{enum:e.keyType._def.values}}}else if(e.keyType?._def.typeName===a.ZodFirstPartyTypeKind.ZodBranded&&e.keyType._def.type._def.typeName===a.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.type._def.checks?.length){const{type:a,...s}=(0,o.parseBrandedDef)(e.keyType._def,r);return{...t,propertyNames:s}}return t}r.parseRecordDef=parseRecordDef},9972:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseSetDef=void 0;const a=t(7863);const s=t(4266);function parseSetDef(e,r){const t=(0,s.parseDef)(e.valueType._def,{...r,currentPath:[...r.currentPath,"items"]});const i={type:"array",uniqueItems:true,items:t};if(e.minSize){(0,a.setResponseValueAndErrors)(i,"minItems",e.minSize.value,e.minSize.message,r)}if(e.maxSize){(0,a.setResponseValueAndErrors)(i,"maxItems",e.maxSize.value,e.maxSize.message,r)}return i}r.parseSetDef=parseSetDef},896:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseStringDef=r.zodPatterns=void 0;const a=t(7863);let s=undefined;r.zodPatterns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(s===undefined){s=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}return s},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function parseStringDef(e,t){const s={type:"string"};if(e.checks){for(const i of e.checks){switch(i.kind){case"min":(0,a.setResponseValueAndErrors)(s,"minLength",typeof s.minLength==="number"?Math.max(s.minLength,i.value):i.value,i.message,t);break;case"max":(0,a.setResponseValueAndErrors)(s,"maxLength",typeof s.maxLength==="number"?Math.min(s.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":addFormat(s,"email",i.message,t);break;case"format:idn-email":addFormat(s,"idn-email",i.message,t);break;case"pattern:zod":addPattern(s,r.zodPatterns.email,i.message,t);break}break;case"url":addFormat(s,"uri",i.message,t);break;case"uuid":addFormat(s,"uuid",i.message,t);break;case"regex":addPattern(s,i.regex,i.message,t);break;case"cuid":addPattern(s,r.zodPatterns.cuid,i.message,t);break;case"cuid2":addPattern(s,r.zodPatterns.cuid2,i.message,t);break;case"startsWith":addPattern(s,RegExp(`^${escapeLiteralCheckValue(i.value,t)}`),i.message,t);break;case"endsWith":addPattern(s,RegExp(`${escapeLiteralCheckValue(i.value,t)}$`),i.message,t);break;case"datetime":addFormat(s,"date-time",i.message,t);break;case"date":addFormat(s,"date",i.message,t);break;case"time":addFormat(s,"time",i.message,t);break;case"duration":addFormat(s,"duration",i.message,t);break;case"length":(0,a.setResponseValueAndErrors)(s,"minLength",typeof s.minLength==="number"?Math.max(s.minLength,i.value):i.value,i.message,t);(0,a.setResponseValueAndErrors)(s,"maxLength",typeof s.maxLength==="number"?Math.min(s.maxLength,i.value):i.value,i.message,t);break;case"includes":{addPattern(s,RegExp(escapeLiteralCheckValue(i.value,t)),i.message,t);break}case"ip":{if(i.version!=="v6"){addFormat(s,"ipv4",i.message,t)}if(i.version!=="v4"){addFormat(s,"ipv6",i.message,t)}break}case"base64url":addPattern(s,r.zodPatterns.base64url,i.message,t);break;case"jwt":addPattern(s,r.zodPatterns.jwt,i.message,t);break;case"cidr":{if(i.version!=="v6"){addPattern(s,r.zodPatterns.ipv4Cidr,i.message,t)}if(i.version!=="v4"){addPattern(s,r.zodPatterns.ipv6Cidr,i.message,t)}break}case"emoji":addPattern(s,r.zodPatterns.emoji(),i.message,t);break;case"ulid":{addPattern(s,r.zodPatterns.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{addFormat(s,"binary",i.message,t);break}case"contentEncoding:base64":{(0,a.setResponseValueAndErrors)(s,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{addPattern(s,r.zodPatterns.base64,i.message,t);break}}break}case"nanoid":{addPattern(s,r.zodPatterns.nanoid,i.message,t)}case"toLowerCase":case"toUpperCase":case"trim":break;default:(e=>{})(i)}}}return s}r.parseStringDef=parseStringDef;function escapeLiteralCheckValue(e,r){return r.patternStrategy==="escape"?escapeNonAlphaNumeric(e):e}const i=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function escapeNonAlphaNumeric(e){let r="";for(let t=0;t<e.length;t++){if(!i.has(e[t])){r+="\\"}r+=e[t]}return r}function addFormat(e,r,t,s){if(e.format||e.anyOf?.some((e=>e.format))){if(!e.anyOf){e.anyOf=[]}if(e.format){e.anyOf.push({format:e.format,...e.errorMessage&&s.errorMessages&&{errorMessage:{format:e.errorMessage.format}}});delete e.format;if(e.errorMessage){delete e.errorMessage.format;if(Object.keys(e.errorMessage).length===0){delete e.errorMessage}}}e.anyOf.push({format:r,...t&&s.errorMessages&&{errorMessage:{format:t}}})}else{(0,a.setResponseValueAndErrors)(e,"format",r,t,s)}}function addPattern(e,r,t,s){if(e.pattern||e.allOf?.some((e=>e.pattern))){if(!e.allOf){e.allOf=[]}if(e.pattern){e.allOf.push({pattern:e.pattern,...e.errorMessage&&s.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}});delete e.pattern;if(e.errorMessage){delete e.errorMessage.pattern;if(Object.keys(e.errorMessage).length===0){delete e.errorMessage}}}e.allOf.push({pattern:stringifyRegExpWithFlags(r,s),...t&&s.errorMessages&&{errorMessage:{pattern:t}}})}else{(0,a.setResponseValueAndErrors)(e,"pattern",stringifyRegExpWithFlags(r,s),t,s)}}function stringifyRegExpWithFlags(e,r){if(!r.applyRegexFlags||!e.flags){return e.source}const t={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")};const a=t.i?e.source.toLowerCase():e.source;let s="";let i=false;let o=false;let n=false;for(let e=0;e<a.length;e++){if(i){s+=a[e];i=false;continue}if(t.i){if(o){if(a[e].match(/[a-z]/)){if(n){s+=a[e];s+=`${a[e-2]}-${a[e]}`.toUpperCase();n=false}else if(a[e+1]==="-"&&a[e+2]?.match(/[a-z]/)){s+=a[e];n=true}else{s+=`${a[e]}${a[e].toUpperCase()}`}continue}}else if(a[e].match(/[a-z]/)){s+=`[${a[e]}${a[e].toUpperCase()}]`;continue}}if(t.m){if(a[e]==="^"){s+=`(^|(?<=[\r\n]))`;continue}else if(a[e]==="$"){s+=`($|(?=[\r\n]))`;continue}}if(t.s&&a[e]==="."){s+=o?`${a[e]}\r\n`:`[${a[e]}\r\n]`;continue}s+=a[e];if(a[e]==="\\"){i=true}else if(o&&a[e]==="]"){o=false}else if(!o&&a[e]==="["){o=true}}try{new RegExp(s)}catch{console.warn(`Could not convert regex pattern at ${r.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);return e.source}return s}},8700:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseTupleDef=void 0;const a=t(4266);function parseTupleDef(e,r){if(e.rest){return{type:"array",minItems:e.items.length,items:e.items.map(((e,t)=>(0,a.parseDef)(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]}))).reduce(((e,r)=>r===undefined?e:[...e,r]),[]),additionalItems:(0,a.parseDef)(e.rest._def,{...r,currentPath:[...r.currentPath,"additionalItems"]})}}else{return{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,t)=>(0,a.parseDef)(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]}))).reduce(((e,r)=>r===undefined?e:[...e,r]),[])}}}r.parseTupleDef=parseTupleDef},4519:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseUndefinedDef=void 0;const a=t(9392);function parseUndefinedDef(e){return{not:(0,a.parseAnyDef)(e)}}r.parseUndefinedDef=parseUndefinedDef},2977:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseUnionDef=r.primitiveMappings=void 0;const a=t(4266);r.primitiveMappings={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function parseUnionDef(e,t){if(t.target==="openApi3")return asAnyOf(e,t);const a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every((e=>e._def.typeName in r.primitiveMappings&&(!e._def.checks||!e._def.checks.length)))){const e=a.reduce(((e,t)=>{const a=r.primitiveMappings[t._def.typeName];return a&&!e.includes(a)?[...e,a]:e}),[]);return{type:e.length>1?e:e[0]}}else if(a.every((e=>e._def.typeName==="ZodLiteral"&&!e.description))){const e=a.reduce(((e,r)=>{const t=typeof r._def.value;switch(t){case"string":case"number":case"boolean":return[...e,t];case"bigint":return[...e,"integer"];case"object":if(r._def.value===null)return[...e,"null"];case"symbol":case"undefined":case"function":default:return e}}),[]);if(e.length===a.length){const r=e.filter(((e,r,t)=>t.indexOf(e)===r));return{type:r.length>1?r:r[0],enum:a.reduce(((e,r)=>e.includes(r._def.value)?e:[...e,r._def.value]),[])}}}else if(a.every((e=>e._def.typeName==="ZodEnum"))){return{type:"string",enum:a.reduce(((e,r)=>[...e,...r._def.values.filter((r=>!e.includes(r)))]),[])}}return asAnyOf(e,t)}r.parseUnionDef=parseUnionDef;const asAnyOf=(e,r)=>{const t=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,t)=>(0,a.parseDef)(e._def,{...r,currentPath:[...r.currentPath,"anyOf",`${t}`]}))).filter((e=>!!e&&(!r.strictUnions||typeof e==="object"&&Object.keys(e).length>0)));return t.length?{anyOf:t}:undefined}},4160:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parseUnknownDef=void 0;const a=t(9392);function parseUnknownDef(e){return(0,a.parseAnyDef)(e)}r.parseUnknownDef=parseUnknownDef},749:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.selectParser=void 0;const a=t(4788);const s=t(9392);const i=t(8243);const o=t(9955);const n=t(1652);const l=t(3103);const c=t(2804);const u=t(1970);const d=t(9782);const f=t(2085);const p=t(7563);const h=t(4877);const m=t(1933);const v=t(8110);const g=t(7493);const y=t(7098);const P=t(3862);const b=t(2048);const S=t(8566);const _=t(22);const R=t(1286);const E=t(3480);const w=t(9460);const z=t(3721);const x=t(9972);const C=t(896);const D=t(8700);const O=t(4519);const j=t(2977);const T=t(4160);const I=t(9758);const selectParser=(e,r,t)=>{switch(r){case a.ZodFirstPartyTypeKind.ZodString:return(0,C.parseStringDef)(e,t);case a.ZodFirstPartyTypeKind.ZodNumber:return(0,S.parseNumberDef)(e,t);case a.ZodFirstPartyTypeKind.ZodObject:return(0,_.parseObjectDef)(e,t);case a.ZodFirstPartyTypeKind.ZodBigInt:return(0,o.parseBigintDef)(e,t);case a.ZodFirstPartyTypeKind.ZodBoolean:return(0,n.parseBooleanDef)();case a.ZodFirstPartyTypeKind.ZodDate:return(0,u.parseDateDef)(e,t);case a.ZodFirstPartyTypeKind.ZodUndefined:return(0,O.parseUndefinedDef)(t);case a.ZodFirstPartyTypeKind.ZodNull:return(0,P.parseNullDef)(t);case a.ZodFirstPartyTypeKind.ZodArray:return(0,i.parseArrayDef)(e,t);case a.ZodFirstPartyTypeKind.ZodUnion:case a.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,j.parseUnionDef)(e,t);case a.ZodFirstPartyTypeKind.ZodIntersection:return(0,h.parseIntersectionDef)(e,t);case a.ZodFirstPartyTypeKind.ZodTuple:return(0,D.parseTupleDef)(e,t);case a.ZodFirstPartyTypeKind.ZodRecord:return(0,z.parseRecordDef)(e,t);case a.ZodFirstPartyTypeKind.ZodLiteral:return(0,m.parseLiteralDef)(e,t);case a.ZodFirstPartyTypeKind.ZodEnum:return(0,p.parseEnumDef)(e);case a.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,g.parseNativeEnumDef)(e);case a.ZodFirstPartyTypeKind.ZodNullable:return(0,b.parseNullableDef)(e,t);case a.ZodFirstPartyTypeKind.ZodOptional:return(0,R.parseOptionalDef)(e,t);case a.ZodFirstPartyTypeKind.ZodMap:return(0,v.parseMapDef)(e,t);case a.ZodFirstPartyTypeKind.ZodSet:return(0,x.parseSetDef)(e,t);case a.ZodFirstPartyTypeKind.ZodLazy:return()=>e.getter()._def;case a.ZodFirstPartyTypeKind.ZodPromise:return(0,w.parsePromiseDef)(e,t);case a.ZodFirstPartyTypeKind.ZodNaN:case a.ZodFirstPartyTypeKind.ZodNever:return(0,y.parseNeverDef)(t);case a.ZodFirstPartyTypeKind.ZodEffects:return(0,f.parseEffectsDef)(e,t);case a.ZodFirstPartyTypeKind.ZodAny:return(0,s.parseAnyDef)(t);case a.ZodFirstPartyTypeKind.ZodUnknown:return(0,T.parseUnknownDef)(t);case a.ZodFirstPartyTypeKind.ZodDefault:return(0,d.parseDefaultDef)(e,t);case a.ZodFirstPartyTypeKind.ZodBranded:return(0,l.parseBrandedDef)(e,t);case a.ZodFirstPartyTypeKind.ZodReadonly:return(0,I.parseReadonlyDef)(e,t);case a.ZodFirstPartyTypeKind.ZodCatch:return(0,c.parseCatchDef)(e,t);case a.ZodFirstPartyTypeKind.ZodPipeline:return(0,E.parsePipelineDef)(e,t);case a.ZodFirstPartyTypeKind.ZodFunction:case a.ZodFirstPartyTypeKind.ZodVoid:case a.ZodFirstPartyTypeKind.ZodSymbol:return undefined;default:return(e=>undefined)(r)}};r.selectParser=selectParser},3878:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.zodToJsonSchema=void 0;const a=t(4266);const s=t(8847);const i=t(9392);const zodToJsonSchema=(e,r)=>{const t=(0,s.getRefs)(r);let o=typeof r==="object"&&r.definitions?Object.entries(r.definitions).reduce(((e,[r,s])=>({...e,[r]:(0,a.parseDef)(s._def,{...t,currentPath:[...t.basePath,t.definitionPath,r]},true)??(0,i.parseAnyDef)(t)})),{}):undefined;const n=typeof r==="string"?r:r?.nameStrategy==="title"?undefined:r?.name;const l=(0,a.parseDef)(e._def,n===undefined?t:{...t,currentPath:[...t.basePath,t.definitionPath,n]},false)??(0,i.parseAnyDef)(t);const c=typeof r==="object"&&r.name!==undefined&&r.nameStrategy==="title"?r.name:undefined;if(c!==undefined){l.title=c}if(t.flags.hasReferencedOpenAiAnyType){if(!o){o={}}if(!o[t.openAiAnyTypeName]){o[t.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:t.$refStrategy==="relative"?"1":[...t.basePath,t.definitionPath,t.openAiAnyTypeName].join("/")}}}}const u=n===undefined?o?{...l,[t.definitionPath]:o}:l:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,n].join("/"),[t.definitionPath]:{...o,[n]:l}};if(t.target==="jsonSchema7"){u.$schema="http://json-schema.org/draft-07/schema#"}else if(t.target==="jsonSchema2019-09"||t.target==="openAi"){u.$schema="https://json-schema.org/draft/2019-09/schema#"}if(t.target==="openAi"&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))){console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.")}return u};r.zodToJsonSchema=zodToJsonSchema},7664: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}')},7136: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}')}};var r={};function __nccwpck_require__(t){var a=r[t];if(a!==undefined){return a.exports}var s=r[t]={exports:{}};var i=true;try{e[t].call(s.exports,s,s.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t={};(()=>{"use strict";var e=t;Object.defineProperty(e,"__esModule",{value:true});e.ResourceTemplate=e.McpServer=void 0;const r=__nccwpck_require__(9938);const a=__nccwpck_require__(7746);const s=__nccwpck_require__(4788);const i=__nccwpck_require__(8383);const o=__nccwpck_require__(9279);const n=__nccwpck_require__(8311);class McpServer{constructor(e,t){this._registeredResources={};this._registeredResourceTemplates={};this._registeredTools={};this._registeredPrompts={};this._toolHandlersInitialized=false;this._completionHandlerInitialized=false;this._resourceHandlersInitialized=false;this._promptHandlersInitialized=false;this.server=new r.Server(e,t)}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized){return}this.server.assertCanSetRequestHandler(i.ListToolsRequestSchema.shape.method.value);this.server.assertCanSetRequestHandler(i.CallToolRequestSchema.shape.method.value);this.server.registerCapabilities({tools:{listChanged:true}});this.server.setRequestHandler(i.ListToolsRequestSchema,(()=>({tools:Object.entries(this._registeredTools).filter((([,e])=>e.enabled)).map((([e,r])=>{const t={name:e,title:r.title,description:r.description,inputSchema:r.inputSchema?(0,a.zodToJsonSchema)(r.inputSchema,{strictUnions:true}):l,annotations:r.annotations,_meta:r._meta};if(r.outputSchema){t.outputSchema=(0,a.zodToJsonSchema)(r.outputSchema,{strictUnions:true})}return t}))})));this.server.setRequestHandler(i.CallToolRequestSchema,(async(e,r)=>{const t=this._registeredTools[e.params.name];if(!t){throw new i.McpError(i.ErrorCode.InvalidParams,`Tool ${e.params.name} not found`)}if(!t.enabled){throw new i.McpError(i.ErrorCode.InvalidParams,`Tool ${e.params.name} disabled`)}let a;if(t.inputSchema){const s=await t.inputSchema.safeParseAsync(e.params.arguments);if(!s.success){throw new i.McpError(i.ErrorCode.InvalidParams,`Invalid arguments for tool ${e.params.name}: ${s.error.message}`)}const o=s.data;const n=t.callback;try{a=await Promise.resolve(n(o,r))}catch(e){a={content:[{type:"text",text:e instanceof Error?e.message:String(e)}],isError:true}}}else{const e=t.callback;try{a=await Promise.resolve(e(r))}catch(e){a={content:[{type:"text",text:e instanceof Error?e.message:String(e)}],isError:true}}}if(t.outputSchema&&!a.isError){if(!a.structuredContent){throw new i.McpError(i.ErrorCode.InvalidParams,`Tool ${e.params.name} has an output schema but no structured content was provided`)}const r=await t.outputSchema.safeParseAsync(a.structuredContent);if(!r.success){throw new i.McpError(i.ErrorCode.InvalidParams,`Invalid structured content for tool ${e.params.name}: ${r.error.message}`)}}return a}));this._toolHandlersInitialized=true}setCompletionRequestHandler(){if(this._completionHandlerInitialized){return}this.server.assertCanSetRequestHandler(i.CompleteRequestSchema.shape.method.value);this.server.registerCapabilities({completions:{}});this.server.setRequestHandler(i.CompleteRequestSchema,(async e=>{switch(e.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return this.handleResourceCompletion(e,e.params.ref);default:throw new i.McpError(i.ErrorCode.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}));this._completionHandlerInitialized=true}async handlePromptCompletion(e,r){const t=this._registeredPrompts[r.name];if(!t){throw new i.McpError(i.ErrorCode.InvalidParams,`Prompt ${r.name} not found`)}if(!t.enabled){throw new i.McpError(i.ErrorCode.InvalidParams,`Prompt ${r.name} disabled`)}if(!t.argsSchema){return c}const a=t.argsSchema.shape[e.params.argument.name];if(!(a instanceof o.Completable)){return c}const s=a._def;const n=await s.complete(e.params.argument.value,e.params.context);return createCompletionResult(n)}async handleResourceCompletion(e,r){const t=Object.values(this._registeredResourceTemplates).find((e=>e.resourceTemplate.uriTemplate.toString()===r.uri));if(!t){if(this._registeredResources[r.uri]){return c}throw new i.McpError(i.ErrorCode.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}const a=t.resourceTemplate.completeCallback(e.params.argument.name);if(!a){return c}const s=await a(e.params.argument.value,e.params.context);return createCompletionResult(s)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized){return}this.server.assertCanSetRequestHandler(i.ListResourcesRequestSchema.shape.method.value);this.server.assertCanSetRequestHandler(i.ListResourceTemplatesRequestSchema.shape.method.value);this.server.assertCanSetRequestHandler(i.ReadResourceRequestSchema.shape.method.value);this.server.registerCapabilities({resources:{listChanged:true}});this.server.setRequestHandler(i.ListResourcesRequestSchema,(async(e,r)=>{const t=Object.entries(this._registeredResources).filter((([e,r])=>r.enabled)).map((([e,r])=>({uri:e,name:r.name,...r.metadata})));const a=[];for(const e of Object.values(this._registeredResourceTemplates)){if(!e.resourceTemplate.listCallback){continue}const t=await e.resourceTemplate.listCallback(r);for(const r of t.resources){a.push({...e.metadata,...r})}}return{resources:[...t,...a]}}));this.server.setRequestHandler(i.ListResourceTemplatesRequestSchema,(async()=>{const e=Object.entries(this._registeredResourceTemplates).map((([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata})));return{resourceTemplates:e}}));this.server.setRequestHandler(i.ReadResourceRequestSchema,(async(e,r)=>{const t=new URL(e.params.uri);const a=this._registeredResources[t.toString()];if(a){if(!a.enabled){throw new i.McpError(i.ErrorCode.InvalidParams,`Resource ${t} disabled`)}return a.readCallback(t,r)}for(const e of Object.values(this._registeredResourceTemplates)){const a=e.resourceTemplate.uriTemplate.match(t.toString());if(a){return e.readCallback(t,a,r)}}throw new i.McpError(i.ErrorCode.InvalidParams,`Resource ${t} not found`)}));this.setCompletionRequestHandler();this._resourceHandlersInitialized=true}setPromptRequestHandlers(){if(this._promptHandlersInitialized){return}this.server.assertCanSetRequestHandler(i.ListPromptsRequestSchema.shape.method.value);this.server.assertCanSetRequestHandler(i.GetPromptRequestSchema.shape.method.value);this.server.registerCapabilities({prompts:{listChanged:true}});this.server.setRequestHandler(i.ListPromptsRequestSchema,(()=>({prompts:Object.entries(this._registeredPrompts).filter((([,e])=>e.enabled)).map((([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?promptArgumentsFromSchema(r.argsSchema):undefined})))})));this.server.setRequestHandler(i.GetPromptRequestSchema,(async(e,r)=>{const t=this._registeredPrompts[e.params.name];if(!t){throw new i.McpError(i.ErrorCode.InvalidParams,`Prompt ${e.params.name} not found`)}if(!t.enabled){throw new i.McpError(i.ErrorCode.InvalidParams,`Prompt ${e.params.name} disabled`)}if(t.argsSchema){const a=await t.argsSchema.safeParseAsync(e.params.arguments);if(!a.success){throw new i.McpError(i.ErrorCode.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${a.error.message}`)}const s=a.data;const o=t.callback;return await Promise.resolve(o(s,r))}else{const e=t.callback;return await Promise.resolve(e(r))}}));this.setCompletionRequestHandler();this._promptHandlersInitialized=true}resource(e,r,...t){let a;if(typeof t[0]==="object"){a=t.shift()}const s=t[0];if(typeof r==="string"){if(this._registeredResources[r]){throw new Error(`Resource ${r} is already registered`)}const t=this._createRegisteredResource(e,undefined,r,a,s);this.setResourceRequestHandlers();this.sendResourceListChanged();return t}else{if(this._registeredResourceTemplates[e]){throw new Error(`Resource template ${e} is already registered`)}const t=this._createRegisteredResourceTemplate(e,undefined,r,a,s);this.setResourceRequestHandlers();this.sendResourceListChanged();return t}}registerResource(e,r,t,a){if(typeof r==="string"){if(this._registeredResources[r]){throw new Error(`Resource ${r} is already registered`)}const s=this._createRegisteredResource(e,t.title,r,t,a);this.setResourceRequestHandlers();this.sendResourceListChanged();return s}else{if(this._registeredResourceTemplates[e]){throw new Error(`Resource template ${e} is already registered`)}const s=this._createRegisteredResourceTemplate(e,t.title,r,t,a);this.setResourceRequestHandlers();this.sendResourceListChanged();return s}}_createRegisteredResource(e,r,t,a,s){const i={name:e,title:r,metadata:a,readCallback:s,enabled:true,disable:()=>i.update({enabled:false}),enable:()=>i.update({enabled:true}),remove:()=>i.update({uri:null}),update:e=>{if(typeof e.uri!=="undefined"&&e.uri!==t){delete this._registeredResources[t];if(e.uri)this._registeredResources[e.uri]=i}if(typeof e.name!=="undefined")i.name=e.name;if(typeof e.title!=="undefined")i.title=e.title;if(typeof e.metadata!=="undefined")i.metadata=e.metadata;if(typeof e.callback!=="undefined")i.readCallback=e.callback;if(typeof e.enabled!=="undefined")i.enabled=e.enabled;this.sendResourceListChanged()}};this._registeredResources[t]=i;return i}_createRegisteredResourceTemplate(e,r,t,a,s){const i={resourceTemplate:t,title:r,metadata:a,readCallback:s,enabled:true,disable:()=>i.update({enabled:false}),enable:()=>i.update({enabled:true}),remove:()=>i.update({name:null}),update:r=>{if(typeof r.name!=="undefined"&&r.name!==e){delete this._registeredResourceTemplates[e];if(r.name)this._registeredResourceTemplates[r.name]=i}if(typeof r.title!=="undefined")i.title=r.title;if(typeof r.template!=="undefined")i.resourceTemplate=r.template;if(typeof r.metadata!=="undefined")i.metadata=r.metadata;if(typeof r.callback!=="undefined")i.readCallback=r.callback;if(typeof r.enabled!=="undefined")i.enabled=r.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;return i}_createRegisteredPrompt(e,r,t,a,i){const o={title:r,description:t,argsSchema:a===undefined?undefined:s.z.object(a),callback:i,enabled:true,disable:()=>o.update({enabled:false}),enable:()=>o.update({enabled:true}),remove:()=>o.update({name:null}),update:r=>{if(typeof r.name!=="undefined"&&r.name!==e){delete this._registeredPrompts[e];if(r.name)this._registeredPrompts[r.name]=o}if(typeof r.title!=="undefined")o.title=r.title;if(typeof r.description!=="undefined")o.description=r.description;if(typeof r.argsSchema!=="undefined")o.argsSchema=s.z.object(r.argsSchema);if(typeof r.callback!=="undefined")o.callback=r.callback;if(typeof r.enabled!=="undefined")o.enabled=r.enabled;this.sendPromptListChanged()}};this._registeredPrompts[e]=o;return o}_createRegisteredTool(e,r,t,a,i,o,n,l){const c={title:r,description:t,inputSchema:a===undefined?undefined:s.z.object(a),outputSchema:i===undefined?undefined:s.z.object(i),annotations:o,_meta:n,callback:l,enabled:true,disable:()=>c.update({enabled:false}),enable:()=>c.update({enabled:true}),remove:()=>c.update({name:null}),update:r=>{if(typeof r.name!=="undefined"&&r.name!==e){delete this._registeredTools[e];if(r.name)this._registeredTools[r.name]=c}if(typeof r.title!=="undefined")c.title=r.title;if(typeof r.description!=="undefined")c.description=r.description;if(typeof r.paramsSchema!=="undefined")c.inputSchema=s.z.object(r.paramsSchema);if(typeof r.callback!=="undefined")c.callback=r.callback;if(typeof r.annotations!=="undefined")c.annotations=r.annotations;if(typeof r._meta!=="undefined")c._meta=r._meta;if(typeof r.enabled!=="undefined")c.enabled=r.enabled;this.sendToolListChanged()}};this._registeredTools[e]=c;this.setToolRequestHandlers();this.sendToolListChanged();return c}tool(e,...r){if(this._registeredTools[e]){throw new Error(`Tool ${e} is already registered`)}let t;let a;let s;let i;if(typeof r[0]==="string"){t=r.shift()}if(r.length>1){const e=r[0];if(isZodRawShape(e)){a=r.shift();if(r.length>1&&typeof r[0]==="object"&&r[0]!==null&&!isZodRawShape(r[0])){i=r.shift()}}else if(typeof e==="object"&&e!==null){i=r.shift()}}const o=r[0];return this._createRegisteredTool(e,undefined,t,a,s,i,undefined,o)}registerTool(e,r,t){if(this._registeredTools[e]){throw new Error(`Tool ${e} is already registered`)}const{title:a,description:s,inputSchema:i,outputSchema:o,annotations:n,_meta:l}=r;return this._createRegisteredTool(e,a,s,i,o,n,l,t)}prompt(e,...r){if(this._registeredPrompts[e]){throw new Error(`Prompt ${e} is already registered`)}let t;if(typeof r[0]==="string"){t=r.shift()}let a;if(r.length>1){a=r.shift()}const s=r[0];const i=this._createRegisteredPrompt(e,undefined,t,a,s);this.setPromptRequestHandlers();this.sendPromptListChanged();return i}registerPrompt(e,r,t){if(this._registeredPrompts[e]){throw new Error(`Prompt ${e} is already registered`)}const{title:a,description:s,argsSchema:i}=r;const o=this._createRegisteredPrompt(e,a,s,i,t);this.setPromptRequestHandlers();this.sendPromptListChanged();return o}isConnected(){return this.server.transport!==undefined}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){if(this.isConnected()){this.server.sendResourceListChanged()}}sendToolListChanged(){if(this.isConnected()){this.server.sendToolListChanged()}}sendPromptListChanged(){if(this.isConnected()){this.server.sendPromptListChanged()}}}e.McpServer=McpServer;class ResourceTemplate{constructor(e,r){this._callbacks=r;this._uriTemplate=typeof e==="string"?new n.UriTemplate(e):e}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(e){var r;return(r=this._callbacks.complete)===null||r===void 0?void 0:r[e]}}e.ResourceTemplate=ResourceTemplate;const l={type:"object",properties:{}};function isZodRawShape(e){if(typeof e!=="object"||e===null)return false;const r=Object.keys(e).length===0;return r||Object.values(e).some(isZodTypeLike)}function isZodTypeLike(e){return e!==null&&typeof e==="object"&&"parse"in e&&typeof e.parse==="function"&&"safeParse"in e&&typeof e.safeParse==="function"}function promptArgumentsFromSchema(e){return Object.entries(e.shape).map((([e,r])=>({name:e,description:r.description,required:!r.isOptional()})))}function createCompletionResult(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}const c={completion:{values:[],hasMore:false}}})();module.exports=t})(); |