@hookform/resolvers 2.9.7 → 2.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hookform/resolvers"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form"],t):t((e||self).hookformResolversAjv={},e.hookformResolvers,e.reactHookForm)}(this,function(e,t,r){function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e}).apply(this,arguments)}function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e){var t={exports:{}};return e(t,t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var n=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=s;class o extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof s&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function a(e,...t){const r=[e[0]];let s=0;for(;s<t.length;)c(r,t[s]),r.push(e[++s]);return new o(r)}t._Code=o,t.nil=new o(""),t._=a;const n=new o("+");function i(e,...t){const r=[d(e[0])];let s=0;for(;s<t.length;)r.push(n),c(r,t[s]),r.push(n,d(e[++s]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){const r=l(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new o(r)}function c(e,t){var r;t instanceof o?e.push(...t._items):e.push(t instanceof s?t:"number"==typeof(r=t)||"boolean"==typeof r||null===r?r:d(Array.isArray(r)?r.join(","):r))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof s||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof s?void 0:`"${e}${t.slice(1)}`}function d(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=i,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},t.stringify=function(e){return new o(d(e))},t.safeStringify=d,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):a`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}}),i=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var s;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(s=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=a;const i=n._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e),{prefix:o}=s,a=null!==(r=t.key)&&void 0!==r?r:t.ref;let n=this._values[o];if(n){const e=n.get(a);if(e)return e}else n=this._values[o]=new Map;n.set(a,s);const i=this._scope[o]||(this._scope[o]=[]),c=i.length;return i[c]=t.ref,s.setValue(t,{property:o,itemIndex:c}),s}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,o,a={},i){let c=n.nil;for(const l in e){const d=e[l];if(!d)continue;const u=a[l]=a[l]||new Map;d.forEach(e=>{if(u.has(e))return;u.set(e,s.Started);let a=o(e);if(a)c=n._`${c}${this.opts.es5?t.varKinds.var:t.varKinds.const} ${e} = ${a};${this.opts._n}`;else{if(!(a=null==i?void 0:i(e)))throw new r(e);c=n._`${c}${a}${this.opts._n}`}u.set(e,s.Completed)})}return c}}}),c=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var r=n;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var s=i;Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class a extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){return`${e?i.varKinds.var:this.varKind} ${this.name}${void 0===this.rhs?"":` = ${this.rhs}`};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=O(this.rhs,e,t),this}get names(){return C(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class l extends c{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class f extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=O(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class p extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let s=r.length;for(;s--;){const o=r[s];o.optimizeNames(e,t)||(x(e,o.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>j(e,t.names),{})}}class m extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends p{}class v extends m{}v.kind="else";class g extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof g?t:t.nodes:this.nodes.length?this:new g(T(e),t instanceof g?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=O(this.condition,e,t),this}get names(){const e=super.names;return C(e,this.condition),this.else&&j(e,this.else.names),e}}g.kind="if";class $ extends m{}$.kind="for";class _ extends ${constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=O(this.iteration,e,t),this}get names(){return j(super.names,this.iteration.names)}}class w extends ${constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:r,from:s,to:o}=this;return`for(${t} ${r}=${s}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=C(super.names,this.from);return C(e,this.to)}}class b extends ${constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=O(this.iterable,e,t),this}get names(){return j(super.names,this.iterable.names)}}class E extends m{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class P extends p{render(e){return"return "+super.render(e)}}P.kind="return";class S extends m{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&j(e,this.catch.names),this.finally&&j(e,this.finally.names),e}}class k extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class N extends m{render(e){return"finally"+super.render(e)}}function j(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function C(e,t){return t instanceof n._CodeOrName?j(e,t.names):e}function O(e,t,r){return e instanceof n.Name?o(e):(s=e)instanceof n._Code&&s._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])?new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=o(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[])):e;var s;function o(e){const s=r[e.str];return void 0===s||1!==t[e.str]?e:(delete t[e.str],s)}}function x(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function T(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${A(e)}`}N.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){const o=this._scope.toName(t);return void 0!==r&&s&&(this._constants[o.str]=r),this._leafNode(new a(e,o,r)),o}const(e,t,r){return this._def(i.varKinds.const,e,t,r)}let(e,t,r){return this._def(i.varKinds.let,e,t,r)}var(e,t,r){return this._def(i.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new c(e,t,r))}add(e,r){return this._leafNode(new l(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new h(e)),this}object(...e){const t=["{"];for(const[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,s));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(g,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,s,o=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const a=this._scope.toName(e);return this._for(new w(o,a,t,r),()=>s(a))}forOf(e,t,r,s=i.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,t=>{this.var(o,n._`${e}[${t}]`),r(o)})}return this._for(new b("of",s,o,t),()=>r(o))}forIn(e,t,r,s=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const o=this._scope.toName(e);return this._for(new b("in",s,o,t),()=>r(o))}endFor(){return this._endBlockNode($)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new u(e))}return(e){const t=new P;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new S;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new k(e),t(e)}return r&&(this._currNode=s.finally=new N,this.code(r)),this._endBlockNode(k,N)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,s){return this._blockNode(new E(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=T;const R=D(t.operators.AND);t.and=function(...e){return e.reduce(R)};const I=D(t.operators.OR);function D(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${A(t)} ${e} ${A(r)}`}function A(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(I)}}),l=a(function(e,t){function r(e,t=e.schema){const{opts:r,self:s}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=s.RULES.keywords;for(const r in t)o[r]||h(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function i({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:s}){return(o,a,n,i)=>{const l=void 0===n?a:n instanceof c.Name?(a instanceof c.Name?e(o,a,n):t(o,a,n),n):a instanceof c.Name?(t(o,n,a),a):r(a,n);return i!==c.Name||l instanceof c.Name?l:s(o,l)}}function l(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",c._`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach(r=>e.assign(c._`${t}${(0,c.getProperty)(r)}`,!0))}Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0,t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=r,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,s,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return c._`${r}`}return c._`${e}${t}${(0,c.getProperty)(s)}`},t.unescapeFragment=function(e){return a(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(o(e))},t.escapeJsonPointer=o,t.unescapeJsonPointer=a,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:i({mergeNames:(e,t,r)=>e.if(c._`${r} !== true && ${t} !== undefined`,()=>{e.if(c._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,c._`${r} || {}`).code(c._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(c._`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,c._`${r} || {}`),d(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:l}),items:i({mergeNames:(e,t,r)=>e.if(c._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,c._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(c._`${r} !== true`,()=>e.assign(r,!0===t||c._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=l,t.setEvaluated=d;const u={};var f;function h(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new n._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(f=t.Type||(t.Type={})),t.getErrorPath=function(e,t,r){if(e instanceof c.Name){const s=t===f.Num;return r?s?c._`"[" + ${e} + "]"`:c._`"['" + ${e} + "']"`:s?c._`"/" + ${e}`:c._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,c.getProperty)(e).toString():"/"+o(e)},t.checkStrictMode=h});const d={data:new c.Name("data"),valCxt:new c.Name("valCxt"),instancePath:new c.Name("instancePath"),parentData:new c.Name("parentData"),parentDataProperty:new c.Name("parentDataProperty"),rootData:new c.Name("rootData"),dynamicAnchors:new c.Name("dynamicAnchors"),vErrors:new c.Name("vErrors"),errors:new c.Name("errors"),this:new c.Name("this"),self:new c.Name("self"),scope:new c.Name("scope"),json:new c.Name("json"),jsonPos:new c.Name("jsonPos"),jsonLen:new c.Name("jsonLen"),jsonPart:new c.Name("jsonPart")};var u=/*#__PURE__*/Object.defineProperty({default:d},"__esModule",{value:!0}),f=a(function(e,t){function r(e,t){const r=e.const("err",t);e.if(c._`${u.default.vErrors} === null`,()=>e.assign(u.default.vErrors,c._`[${r}]`),c._`${u.default.vErrors}.push(${r})`),e.code(c._`${u.default.errors}++`)}function s(e,t){const{gen:r,validateName:s,schemaEnv:o}=e;o.$async?r.throw(c._`new ${e.ValidationError}(${t})`):(r.assign(c._`${s}.errors`,t),r.return(!1))}Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0,t.keywordError={message:({keyword:e})=>c.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?c.str`"${e}" keyword must be ${t} ($data)`:c.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,o=t.keywordError,n,i){const{it:l}=e,{gen:d,compositeRule:u,allErrors:f}=l,h=a(e,o,n);(null!=i?i:u||f)?r(d,h):s(l,c._`[${h}]`)},t.reportExtraError=function(e,o=t.keywordError,n){const{it:i}=e,{gen:c,compositeRule:l,allErrors:d}=i;r(c,a(e,o,n)),l||d||s(i,u.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(u.default.errors,t),e.if(c._`${u.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(c._`${u.default.vErrors}.length`,t),()=>e.assign(u.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:s,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const n=e.name("err");e.forRange("i",o,u.default.errors,o=>{e.const(n,c._`${u.default.vErrors}[${o}]`),e.if(c._`${n}.instancePath === undefined`,()=>e.assign(c._`${n}.instancePath`,(0,c.strConcat)(u.default.instancePath,a.errorPath))),e.assign(c._`${n}.schemaPath`,c.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(c._`${n}.schema`,r),e.assign(c._`${n}.data`,s))})};const o={keyword:new c.Name("keyword"),schemaPath:new c.Name("schemaPath"),params:new c.Name("params"),propertyName:new c.Name("propertyName"),message:new c.Name("message"),schema:new c.Name("schema"),parentSchema:new c.Name("parentSchema")};function a(e,t,r){const{createErrors:s}=e.it;return!1===s?c._`{}`:function(e,t,r={}){const{gen:s,it:a}=e,l=[n(a,r),i(e,r)];return function(e,{params:t,message:r},s){const{keyword:a,data:n,schemaValue:i,it:l}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:p}=l;s.push([o.keyword,a],[o.params,"function"==typeof t?t(e):t||c._`{}`]),d.messages&&s.push([o.message,"function"==typeof r?r(e):r]),d.verbose&&s.push([o.schema,i],[o.parentSchema,c._`${h}${p}`],[u.default.data,n]),f&&s.push([o.propertyName,f])}(e,t,l),s.object(...l)}(e,t,r)}function n({errorPath:e},{instancePath:t}){const r=t?c.str`${e}${(0,l.getErrorPath)(t,l.Type.Str)}`:e;return[u.default.instancePath,(0,c.strConcat)(u.default.instancePath,r)]}function i({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let a=s?t:c.str`${t}/${e}`;return r&&(a=c.str`${a}${(0,l.getErrorPath)(r,l.Type.Str)}`),[o.schemaPath,a]}}),h=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r={message:"boolean schema is false"};function s(e,t){const{gen:s,data:o}=e;(0,f.reportError)({gen:s,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},r,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:o}=e;!1===r?s(e,!1):"object"==typeof r&&!0===r.$async?t.return(u.default.data):(t.assign(c._`${o}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:o}=e;!1===o?(r.var(t,!1),s(e)):r.var(t,!0)}}),p=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}}),m=a(function(e,t){function r(e,t){return t.rules.some(t=>s(e,t))}function s(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},s){const o=t.RULES.types[s];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=s}),y=a(function(e,t){var r;function s(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(p.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0,function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(r=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=s,t.coerceAndCheckDataType=function(e,t){const{gen:s,data:a,opts:i}=e,l=function(e,t){return t?e.filter(e=>o.has(e)||"array"===t&&"array"===e):[]}(t,i.coerceTypes),u=t.length>0&&!(0===l.length&&1===t.length&&(0,m.schemaHasRulesForType)(e,t[0]));if(u){const u=n(t,a,i.strictNumbers,r.Wrong);s.if(u,()=>{l.length?function(e,t,r){const{gen:s,data:a,opts:i}=e,l=s.let("dataType",c._`typeof ${a}`),u=s.let("coerced",c._`undefined`);"array"===i.coerceTypes&&s.if(c._`${l} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>s.assign(a,c._`${a}[0]`).assign(l,c._`typeof ${a}`).if(n(t,a,i.strictNumbers),()=>s.assign(u,a))),s.if(c._`${u} !== undefined`);for(const e of r)(o.has(e)||"array"===e&&"array"===i.coerceTypes)&&f(e);function f(e){switch(e){case"string":return void s.elseIf(c._`${l} == "number" || ${l} == "boolean"`).assign(u,c._`"" + ${a}`).elseIf(c._`${a} === null`).assign(u,c._`""`);case"number":return void s.elseIf(c._`${l} == "boolean" || ${a} === null
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hookform/resolvers"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form"],t):t((e||self).hookformResolversAjv={},e.hookformResolvers,e.ReactHookForm)}(this,function(e,t,r){function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e}).apply(this,arguments)}function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e){var t={exports:{}};return e(t,t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var n=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class s extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=s;class o extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof s&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function a(e,...t){const r=[e[0]];let s=0;for(;s<t.length;)c(r,t[s]),r.push(e[++s]);return new o(r)}t._Code=o,t.nil=new o(""),t._=a;const n=new o("+");function i(e,...t){const r=[d(e[0])];let s=0;for(;s<t.length;)r.push(n),c(r,t[s]),r.push(n,d(e[++s]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){const r=l(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new o(r)}function c(e,t){var r;t instanceof o?e.push(...t._items):e.push(t instanceof s?t:"number"==typeof(r=t)||"boolean"==typeof r||null===r?r:d(Array.isArray(r)?r.join(","):r))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof s||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof s?void 0:`"${e}${t.slice(1)}`}function d(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=i,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},t.stringify=function(e){return new o(d(e))},t.safeStringify=d,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):a`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}}),i=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var s;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(s=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=a;const i=n._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e),{prefix:o}=s,a=null!==(r=t.key)&&void 0!==r?r:t.ref;let n=this._values[o];if(n){const e=n.get(a);if(e)return e}else n=this._values[o]=new Map;n.set(a,s);const i=this._scope[o]||(this._scope[o]=[]),c=i.length;return i[c]=t.ref,s.setValue(t,{property:o,itemIndex:c}),s}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,o,a={},i){let c=n.nil;for(const l in e){const d=e[l];if(!d)continue;const u=a[l]=a[l]||new Map;d.forEach(e=>{if(u.has(e))return;u.set(e,s.Started);let a=o(e);if(a)c=n._`${c}${this.opts.es5?t.varKinds.var:t.varKinds.const} ${e} = ${a};${this.opts._n}`;else{if(!(a=null==i?void 0:i(e)))throw new r(e);c=n._`${c}${a}${this.opts._n}`}u.set(e,s.Completed)})}return c}}}),c=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var r=n;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var s=i;Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class a extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){return`${e?i.varKinds.var:this.varKind} ${this.name}${void 0===this.rhs?"":` = ${this.rhs}`};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=O(this.rhs,e,t),this}get names(){return C(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class l extends c{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class f extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=O(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class p extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let s=r.length;for(;s--;){const o=r[s];o.optimizeNames(e,t)||(x(e,o.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>j(e,t.names),{})}}class m extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends p{}class v extends m{}v.kind="else";class g extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof g?t:t.nodes:this.nodes.length?this:new g(T(e),t instanceof g?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=O(this.condition,e,t),this}get names(){const e=super.names;return C(e,this.condition),this.else&&j(e,this.else.names),e}}g.kind="if";class $ extends m{}$.kind="for";class _ extends ${constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=O(this.iteration,e,t),this}get names(){return j(super.names,this.iteration.names)}}class w extends ${constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:r,from:s,to:o}=this;return`for(${t} ${r}=${s}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=C(super.names,this.from);return C(e,this.to)}}class b extends ${constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=O(this.iterable,e,t),this}get names(){return j(super.names,this.iterable.names)}}class E extends m{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class P extends p{render(e){return"return "+super.render(e)}}P.kind="return";class S extends m{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&j(e,this.catch.names),this.finally&&j(e,this.finally.names),e}}class k extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class N extends m{render(e){return"finally"+super.render(e)}}function j(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function C(e,t){return t instanceof n._CodeOrName?j(e,t.names):e}function O(e,t,r){return e instanceof n.Name?o(e):(s=e)instanceof n._Code&&s._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])?new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=o(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[])):e;var s;function o(e){const s=r[e.str];return void 0===s||1!==t[e.str]?e:(delete t[e.str],s)}}function x(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function T(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${A(e)}`}N.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){const o=this._scope.toName(t);return void 0!==r&&s&&(this._constants[o.str]=r),this._leafNode(new a(e,o,r)),o}const(e,t,r){return this._def(i.varKinds.const,e,t,r)}let(e,t,r){return this._def(i.varKinds.let,e,t,r)}var(e,t,r){return this._def(i.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new c(e,t,r))}add(e,r){return this._leafNode(new l(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new h(e)),this}object(...e){const t=["{"];for(const[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,s));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(g,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,s,o=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const a=this._scope.toName(e);return this._for(new w(o,a,t,r),()=>s(a))}forOf(e,t,r,s=i.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,t=>{this.var(o,n._`${e}[${t}]`),r(o)})}return this._for(new b("of",s,o,t),()=>r(o))}forIn(e,t,r,s=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const o=this._scope.toName(e);return this._for(new b("in",s,o,t),()=>r(o))}endFor(){return this._endBlockNode($)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new u(e))}return(e){const t=new P;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new S;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new k(e),t(e)}return r&&(this._currNode=s.finally=new N,this.code(r)),this._endBlockNode(k,N)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,s){return this._blockNode(new E(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=T;const R=D(t.operators.AND);t.and=function(...e){return e.reduce(R)};const I=D(t.operators.OR);function D(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${A(t)} ${e} ${A(r)}`}function A(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(I)}}),l=a(function(e,t){function r(e,t=e.schema){const{opts:r,self:s}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=s.RULES.keywords;for(const r in t)o[r]||h(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function i({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:s}){return(o,a,n,i)=>{const l=void 0===n?a:n instanceof c.Name?(a instanceof c.Name?e(o,a,n):t(o,a,n),n):a instanceof c.Name?(t(o,n,a),a):r(a,n);return i!==c.Name||l instanceof c.Name?l:s(o,l)}}function l(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",c._`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach(r=>e.assign(c._`${t}${(0,c.getProperty)(r)}`,!0))}Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0,t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=r,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,s,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return c._`${r}`}return c._`${e}${t}${(0,c.getProperty)(s)}`},t.unescapeFragment=function(e){return a(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(o(e))},t.escapeJsonPointer=o,t.unescapeJsonPointer=a,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:i({mergeNames:(e,t,r)=>e.if(c._`${r} !== true && ${t} !== undefined`,()=>{e.if(c._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,c._`${r} || {}`).code(c._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(c._`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,c._`${r} || {}`),d(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:l}),items:i({mergeNames:(e,t,r)=>e.if(c._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,c._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(c._`${r} !== true`,()=>e.assign(r,!0===t||c._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=l,t.setEvaluated=d;const u={};var f;function h(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new n._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(f=t.Type||(t.Type={})),t.getErrorPath=function(e,t,r){if(e instanceof c.Name){const s=t===f.Num;return r?s?c._`"[" + ${e} + "]"`:c._`"['" + ${e} + "']"`:s?c._`"/" + ${e}`:c._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,c.getProperty)(e).toString():"/"+o(e)},t.checkStrictMode=h});const d={data:new c.Name("data"),valCxt:new c.Name("valCxt"),instancePath:new c.Name("instancePath"),parentData:new c.Name("parentData"),parentDataProperty:new c.Name("parentDataProperty"),rootData:new c.Name("rootData"),dynamicAnchors:new c.Name("dynamicAnchors"),vErrors:new c.Name("vErrors"),errors:new c.Name("errors"),this:new c.Name("this"),self:new c.Name("self"),scope:new c.Name("scope"),json:new c.Name("json"),jsonPos:new c.Name("jsonPos"),jsonLen:new c.Name("jsonLen"),jsonPart:new c.Name("jsonPart")};var u=/*#__PURE__*/Object.defineProperty({default:d},"__esModule",{value:!0}),f=a(function(e,t){function r(e,t){const r=e.const("err",t);e.if(c._`${u.default.vErrors} === null`,()=>e.assign(u.default.vErrors,c._`[${r}]`),c._`${u.default.vErrors}.push(${r})`),e.code(c._`${u.default.errors}++`)}function s(e,t){const{gen:r,validateName:s,schemaEnv:o}=e;o.$async?r.throw(c._`new ${e.ValidationError}(${t})`):(r.assign(c._`${s}.errors`,t),r.return(!1))}Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0,t.keywordError={message:({keyword:e})=>c.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?c.str`"${e}" keyword must be ${t} ($data)`:c.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,o=t.keywordError,n,i){const{it:l}=e,{gen:d,compositeRule:u,allErrors:f}=l,h=a(e,o,n);(null!=i?i:u||f)?r(d,h):s(l,c._`[${h}]`)},t.reportExtraError=function(e,o=t.keywordError,n){const{it:i}=e,{gen:c,compositeRule:l,allErrors:d}=i;r(c,a(e,o,n)),l||d||s(i,u.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(u.default.errors,t),e.if(c._`${u.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(c._`${u.default.vErrors}.length`,t),()=>e.assign(u.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:s,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const n=e.name("err");e.forRange("i",o,u.default.errors,o=>{e.const(n,c._`${u.default.vErrors}[${o}]`),e.if(c._`${n}.instancePath === undefined`,()=>e.assign(c._`${n}.instancePath`,(0,c.strConcat)(u.default.instancePath,a.errorPath))),e.assign(c._`${n}.schemaPath`,c.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(c._`${n}.schema`,r),e.assign(c._`${n}.data`,s))})};const o={keyword:new c.Name("keyword"),schemaPath:new c.Name("schemaPath"),params:new c.Name("params"),propertyName:new c.Name("propertyName"),message:new c.Name("message"),schema:new c.Name("schema"),parentSchema:new c.Name("parentSchema")};function a(e,t,r){const{createErrors:s}=e.it;return!1===s?c._`{}`:function(e,t,r={}){const{gen:s,it:a}=e,l=[n(a,r),i(e,r)];return function(e,{params:t,message:r},s){const{keyword:a,data:n,schemaValue:i,it:l}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:p}=l;s.push([o.keyword,a],[o.params,"function"==typeof t?t(e):t||c._`{}`]),d.messages&&s.push([o.message,"function"==typeof r?r(e):r]),d.verbose&&s.push([o.schema,i],[o.parentSchema,c._`${h}${p}`],[u.default.data,n]),f&&s.push([o.propertyName,f])}(e,t,l),s.object(...l)}(e,t,r)}function n({errorPath:e},{instancePath:t}){const r=t?c.str`${e}${(0,l.getErrorPath)(t,l.Type.Str)}`:e;return[u.default.instancePath,(0,c.strConcat)(u.default.instancePath,r)]}function i({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let a=s?t:c.str`${t}/${e}`;return r&&(a=c.str`${a}${(0,l.getErrorPath)(r,l.Type.Str)}`),[o.schemaPath,a]}}),h=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r={message:"boolean schema is false"};function s(e,t){const{gen:s,data:o}=e;(0,f.reportError)({gen:s,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},r,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:o}=e;!1===r?s(e,!1):"object"==typeof r&&!0===r.$async?t.return(u.default.data):(t.assign(c._`${o}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:o}=e;!1===o?(r.var(t,!1),s(e)):r.var(t,!0)}}),p=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}}),m=a(function(e,t){function r(e,t){return t.rules.some(t=>s(e,t))}function s(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},s){const o=t.RULES.types[s];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=s}),y=a(function(e,t){var r;function s(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(p.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0,function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(r=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=s,t.coerceAndCheckDataType=function(e,t){const{gen:s,data:a,opts:i}=e,l=function(e,t){return t?e.filter(e=>o.has(e)||"array"===t&&"array"===e):[]}(t,i.coerceTypes),u=t.length>0&&!(0===l.length&&1===t.length&&(0,m.schemaHasRulesForType)(e,t[0]));if(u){const u=n(t,a,i.strictNumbers,r.Wrong);s.if(u,()=>{l.length?function(e,t,r){const{gen:s,data:a,opts:i}=e,l=s.let("dataType",c._`typeof ${a}`),u=s.let("coerced",c._`undefined`);"array"===i.coerceTypes&&s.if(c._`${l} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>s.assign(a,c._`${a}[0]`).assign(l,c._`typeof ${a}`).if(n(t,a,i.strictNumbers),()=>s.assign(u,a))),s.if(c._`${u} !== undefined`);for(const e of r)(o.has(e)||"array"===e&&"array"===i.coerceTypes)&&f(e);function f(e){switch(e){case"string":return void s.elseIf(c._`${l} == "number" || ${l} == "boolean"`).assign(u,c._`"" + ${a}`).elseIf(c._`${a} === null`).assign(u,c._`""`);case"number":return void s.elseIf(c._`${l} == "boolean" || ${a} === null
2
2
  || (${l} == "string" && ${a} && ${a} == +${a})`).assign(u,c._`+${a}`);case"integer":return void s.elseIf(c._`${l} === "boolean" || ${a} === null
3
3
  || (${l} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(u,c._`+${a}`);case"boolean":return void s.elseIf(c._`${a} === "false" || ${a} === 0 || ${a} === null`).assign(u,!1).elseIf(c._`${a} === "true" || ${a} === 1`).assign(u,!0);case"null":return s.elseIf(c._`${a} === "" || ${a} === 0 || ${a} === false`),void s.assign(u,null);case"array":s.elseIf(c._`${l} === "string" || ${l} === "number"
4
4
  || ${l} === "boolean" || ${a} === null`).assign(u,c._`[${a}]`)}}s.else(),d(e),s.endIf(),s.if(c._`${u} !== undefined`,()=>{s.assign(a,u),function({gen:e,parentData:t,parentDataProperty:r},s){e.if(c._`${t} !== undefined`,()=>e.assign(c._`${t}[${r}]`,s))}(e,u)})}(e,t,l):d(e)})}return u};const o=new Set(["string","number","integer","boolean","null"]);function a(e,t,s,o=r.Correct){const a=o===r.Correct?c.operators.EQ:c.operators.NEQ;let n;switch(e){case"null":return c._`${t} ${a} null`;case"array":n=c._`Array.isArray(${t})`;break;case"object":n=c._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":n=i(c._`!(${t} % 1) && !isNaN(${t})`);break;case"number":n=i();break;default:return c._`typeof ${t} ${a} ${e}`}return o===r.Correct?n:(0,c.not)(n);function i(e=c.nil){return(0,c.and)(c._`typeof ${t} == "number"`,e,s?c._`isFinite(${t})`:c.nil)}}function n(e,t,r,s){if(1===e.length)return a(e[0],t,r,s);let o;const n=(0,l.toHash)(e);if(n.array&&n.object){const e=c._`typeof ${t} != "object"`;o=n.null?e:c._`!${t} || ${e}`,delete n.null,delete n.array,delete n.object}else o=c.nil;n.number&&delete n.integer;for(const e in n)o=(0,c.and)(o,a(e,t,r,s));return o}t.checkDataType=a,t.checkDataTypes=n;const i={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?c._`{type: ${e}}`:c._`{type: ${t}}`};function d(e){const t=function(e){const{gen:t,data:r,schema:s}=e,o=(0,l.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:o,schemaValue:o,parentSchema:s,params:{},it:e}}(e);(0,f.reportError)(t,i)}t.reportTypeError=d}),v=a(function(e,t){function r(e,t,r){const{gen:s,compositeRule:o,data:a,opts:n}=e;if(void 0===r)return;const i=c._`${a}${(0,c.getProperty)(t)}`;if(o)return void(0,l.checkStrictMode)(e,`default is ignored for: ${i}`);let d=c._`${i} === undefined`;"empty"===n.useDefaults&&(d=c._`${d} || ${i} === null || ${i} === ""`),s.if(d,c._`${i} = ${(0,c.stringify)(r)}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0,t.assignDefaults=function(e,t){const{properties:s,items:o}=e.schema;if("object"===t&&s)for(const t in s)r(e,t,s[t].default);else"array"===t&&Array.isArray(o)&&o.forEach((t,s)=>r(e,s,t.default))}}),g=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=l;function s(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:c._`Object.prototype.hasOwnProperty`})}function o(e,t,r){return c._`${s(e)}.call(${t}, ${r})`}function a(e,t,r,s){const a=c._`${t}${(0,c.getProperty)(r)} === undefined`;return s?(0,c.or)(a,(0,c.not)(o(e,t,r))):a}function n(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:s,it:o}=e;r.if(a(r,s,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:c._`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},s,o){return(0,c.or)(...s.map(s=>(0,c.and)(a(e,t,s,r.ownProperties),c._`${o} = ${s}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=s,t.isOwnProperty=o,t.propertyInData=function(e,t,r,s){const a=c._`${t}${(0,c.getProperty)(r)} !== undefined`;return s?c._`${a} && ${o(e,t,r)}`:a},t.noPropertyInData=a,t.allSchemaProperties=n,t.schemaProperties=function(e,t){return n(t).filter(r=>!(0,l.alwaysValidSchema)(e,t[r]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:o,errorPath:a},it:n},i,l,d){const f=d?c._`${e}, ${t}, ${s}${o}`:t,h=[[u.default.instancePath,(0,c.strConcat)(u.default.instancePath,a)],[u.default.parentData,n.parentData],[u.default.parentDataProperty,n.parentDataProperty],[u.default.rootData,u.default.rootData]];n.opts.dynamicRef&&h.push([u.default.dynamicAnchors,u.default.dynamicAnchors]);const p=c._`${f}, ${r.object(...h)}`;return l!==c.nil?c._`${i}.call(${l}, ${p})`:c._`${i}(${p})`};const i=c._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},s){const o=t.unicodeRegExp?"u":"",{regExp:a}=t.code,n=a(s,o);return e.scopeValue("pattern",{key:n.toString(),ref:n,code:c._`${"new RegExp"===a.code?i:(0,r.useFunc)(e,a)}(${s}, ${o})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:s,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return n(()=>t.assign(e,!1)),e}return t.var(a,!0),n(()=>t.break()),a;function n(o){const n=t.const("len",c._`${r}.length`);t.forRange("i",0,n,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:l.Type.Num},a),t.if((0,c.not)(a),o)})}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:s,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(e=>(0,l.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),n=t.name("_valid");t.block(()=>r.forEach((r,o)=>{const i=e.subschema({keyword:s,schemaProp:o,compositeRule:!0},n);t.assign(a,c._`${a} || ${n}`),e.mergeValidEvaluated(i,n)||t.if((0,c.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}}),$=a(function(e,t){function r(e){const{gen:t,data:r,it:s}=e;t.if(s.parentData,()=>t.assign(r,c._`${s.parentData}[${s.parentDataProperty}]`))}function s(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,c.stringify)(r)})}Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0,t.macroKeywordCode=function(e,t){const{gen:r,keyword:o,schema:a,parentSchema:n,it:i}=e,l=t.macro.call(i.self,a,n,i),d=s(r,o,l);!1!==i.opts.validateSchema&&i.self.validateSchema(l,!0);const u=r.name("valid");e.subschema({schema:l,schemaPath:c.nil,errSchemaPath:`${i.errSchemaPath}/${o}`,topSchemaRef:d,compositeRule:!0},u),e.pass(u,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var o;const{gen:a,keyword:n,schema:i,parentSchema:l,$data:d,it:h}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,t);const p=!d&&t.compile?t.compile.call(h.self,i,l,h):t.validate,m=s(a,n,p),y=a.let("valid");function v(r=(t.async?c._`await `:c.nil)){a.assign(y,c._`${r}${(0,g.callValidateCode)(e,m,h.opts.passContext?u.default.this:u.default.self,!("compile"in t&&!d||!1===t.schema))}`,t.modifying)}function $(e){var r;a.if((0,c.not)(null!==(r=t.valid)&&void 0!==r?r:y),e)}e.block$data(y,function(){if(!1===t.errors)v(),t.modifying&&r(e),$(()=>e.error());else{const s=t.async?function(){const e=a.let("ruleErrs",null);return a.try(()=>v(c._`await `),t=>a.assign(y,!1).if(c._`${t} instanceof ${h.ValidationError}`,()=>a.assign(e,c._`${t}.errors`),()=>a.throw(t))),e}():function(){const e=c._`${m}.errors`;return a.assign(e,null),v(c.nil),e}();t.modifying&&r(e),$(()=>function(e,t){const{gen:r}=e;r.if(c._`Array.isArray(${t})`,()=>{r.assign(u.default.vErrors,c._`${u.default.vErrors} === null ? ${t} : ${u.default.vErrors}.concat(${t})`).assign(u.default.errors,c._`${u.default.vErrors}.length`),(0,f.extendErrors)(e)},()=>e.error())}(e,s))}}),e.ok(null!==(o=t.valid)&&void 0!==o?o:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:s},o,a){if(Array.isArray(o.keyword)?!o.keyword.includes(a):o.keyword!==a)throw new Error("ajv implementation error");const n=o.dependencies;if(null==n?void 0:n.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${a}: ${n.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[a])){const e=`keyword "${a}" value is invalid at path "${s}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}}),_=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0,t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:s,schemaPath:o,errSchemaPath:a,topSchemaRef:n}){if(void 0!==t&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const s=e.schema[t];return void 0===r?{schema:s,schemaPath:c._`${e.schemaPath}${(0,c.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:c._`${e.schemaPath}${(0,c.getProperty)(t)}${(0,c.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,l.escapeFragment)(r)}`}}if(void 0!==s){if(void 0===o||void 0===a||void 0===n)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:o,topSchemaRef:n,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:s,data:o,dataTypes:a,propertyName:n}){if(void 0!==o&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:i}=t;if(void 0!==r){const{errorPath:o,dataPathArr:a,opts:n}=t;d(i.let("data",c._`${t.data}${(0,c.getProperty)(r)}`,!0)),e.errorPath=c.str`${o}${(0,l.getErrorPath)(r,s,n.jsPropertySyntax)}`,e.parentDataProperty=c._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function d(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==o&&(d(o instanceof c.Name?o:i.let("data",o,!0)),void 0!==n&&(e.propertyName=n)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:s,createErrors:o,allErrors:a}){void 0!==s&&(e.compositeRule=s),void 0!==o&&(e.createErrors=o),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}}),w=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var s,o,a;if(Array.isArray(t)){if((s=t.length)!=r.length)return!1;for(o=s;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((s=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=s;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=s;0!=o--;){var n=a[o];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r},b=a(function(e){var t=e.exports=function(e,t,s){"function"==typeof t&&(s=t,t={}),r(t,"function"==typeof(s=t.cb||s)?s:s.pre||function(){},s.post||function(){},e,"",e)};function r(e,s,o,a,n,i,c,l,d,u){if(a&&"object"==typeof a&&!Array.isArray(a)){for(var f in s(a,n,i,c,l,d,u),a){var h=a[f];if(Array.isArray(h)){if(f in t.arrayKeywords)for(var p=0;p<h.length;p++)r(e,s,o,h[p],n+"/"+f+"/"+p,i,n,f,a,p)}else if(f in t.propsKeywords){if(h&&"object"==typeof h)for(var m in h)r(e,s,o,h[m],n+"/"+f+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),i,n,f,a,m)}else(f in t.keywords||e.allKeys&&!(f in t.skipKeywords))&&r(e,s,o,h,n+"/"+f,i,n,f,a)}o(a,n,i,c,l,d,u)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}}),E=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!o(e):!!t&&a(e)<=t)};const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(e){for(const t in e){if(s.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(o))return!0;if("object"==typeof r&&o(r))return!0}return!1}function a(e){let t=0;for(const s in e){if("$ref"===s)return Infinity;if(t++,!r.has(s)&&("object"==typeof e[s]&&(0,l.eachItem)(e[s],e=>t+=a(e)),Infinity===t))return Infinity}return t}function n(e,t="",r){!1!==r&&(t=d(t));const s=e.parse(t);return i(e,s)}function i(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=n,t._getFullPath=i;const c=/#\/?$/;function d(e){return e?e.replace(c,""):""}t.normalizeId=d,t.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};const u=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:s}=this.opts,o=d(e[r]||t),a={"":o},i=n(s,o,!1),c={},l=new Set;return b(e,{allKeys:!0},(e,t,s,o)=>{if(void 0===o)return;const n=i+t;let p=a[o];function m(t){if(t=d(p?(0,this.opts.uriResolver.resolve)(p,t):t),l.has(t))throw h(t);l.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?f(e,r.schema,t):t!==d(n)&&("#"===t[0]?(f(e,c[t],t),c[t]=e):this.refs[t]=n),t}function y(e){if("string"==typeof e){if(!u.test(e))throw new Error(`invalid anchor "${e}"`);m.call(this,`#${e}`)}}"string"==typeof e[r]&&(p=m.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=p}),c;function f(e,t,r){if(void 0!==t&&!w(e,t))throw h(r)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}}}),P=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=y;function s({gen:e,validateName:t,schema:r,schemaEnv:s,opts:a},n){a.code.es5?e.func(t,c._`${u.default.data}, ${u.default.valCxt}`,s.$async,()=>{e.code(c._`"use strict"; ${o(r,a)}`),function(e,t){e.if(u.default.valCxt,()=>{e.var(u.default.instancePath,c._`${u.default.valCxt}.${u.default.instancePath}`),e.var(u.default.parentData,c._`${u.default.valCxt}.${u.default.parentData}`),e.var(u.default.parentDataProperty,c._`${u.default.valCxt}.${u.default.parentDataProperty}`),e.var(u.default.rootData,c._`${u.default.valCxt}.${u.default.rootData}`),t.dynamicRef&&e.var(u.default.dynamicAnchors,c._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{e.var(u.default.instancePath,c._`""`),e.var(u.default.parentData,c._`undefined`),e.var(u.default.parentDataProperty,c._`undefined`),e.var(u.default.rootData,u.default.data),t.dynamicRef&&e.var(u.default.dynamicAnchors,c._`{}`)})}(e,a),e.code(n)}):e.func(t,c._`${u.default.data}, ${function(e){return c._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${e.dynamicRef?c._`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}(a)}`,s.$async,()=>e.code(o(r,a)).code(n))}function o(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?c._`/*# sourceURL=${r} */`:c.nil}function a({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function n(e){return"boolean"!=typeof e.schema}function i(e){(0,l.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:s,self:o}=e;t.$ref&&s.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function d(e,t){if(e.opts.jtd)return g(e,[],!1,t);const r=(0,y.getSchemaTypes)(e.schema);g(e,r,!(0,y.coerceAndCheckDataType)(e,r),t)}function p({gen:e,schemaEnv:t,schema:r,errSchemaPath:s,opts:o}){const a=r.$comment;if(!0===o.$comment)e.code(c._`${u.default.self}.logger.log(${a})`);else if("function"==typeof o.$comment){const r=c.str`${s}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(c._`${u.default.self}.opts.$comment(${a}, ${r}, ${o}.schema)`)}}function g(e,t,s,o){const{gen:a,schema:n,data:i,allErrors:d,opts:f,self:h}=e,{RULES:p}=h;function y(l){(0,m.shouldUseGroup)(n,l)&&(l.type?(a.if((0,r.checkDataType)(l.type,i,f.strictNumbers)),w(e,l),1===t.length&&t[0]===l.type&&s&&(a.else(),(0,r.reportTypeError)(e)),a.endIf()):w(e,l),d||a.if(c._`${u.default.errors} === ${o||0}`))}!n.$ref||!f.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(n,p)?(f.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach(t=>{b(e.dataTypes,t)||P(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),e.dataTypes=e.dataTypes.filter(e=>b(t,e))):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&P(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const s in r){const o=r[s];if("object"==typeof o&&(0,m.shouldUseRule)(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some(e=>{return(r=t).includes(s=e)||"number"===s&&r.includes("integer");var r,s})&&P(e,`missing type "${r.join(",")}" for keyword "${s}"`)}}}(e,e.dataTypes))}(e,t),a.block(()=>{for(const e of p.rules)y(e);y(p.post)})):a.block(()=>k(e,"$ref",p.all.$ref.definition))}function w(e,t){const{gen:r,schema:s,opts:{useDefaults:o}}=e;o&&(0,v.assignDefaults)(e,t.type),r.block(()=>{for(const r of t.rules)(0,m.shouldUseRule)(s,r)&&k(e,r.keyword,r.definition,t.type)})}function b(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function P(e,t){(0,l.checkStrictMode)(e,t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,e.opts.strictTypes)}t.validateFunctionCode=function(e){n(e)&&(i(e),a(e))?function(e){const{schema:t,opts:r,gen:o}=e;s(e,()=>{r.$comment&&t.$comment&&p(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,l.checkStrictMode)(e,"default is ignored in the schema root")}(e),o.let(u.default.vErrors,null),o.let(u.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",c._`${r}.evaluated`),t.if(c._`${e.evaluated}.dynamicProps`,()=>t.assign(c._`${e.evaluated}.props`,c._`undefined`)),t.if(c._`${e.evaluated}.dynamicItems`,()=>t.assign(c._`${e.evaluated}.items`,c._`undefined`))}(e),d(e),function(e){const{gen:t,schemaEnv:r,validateName:s,ValidationError:o,opts:a}=e;r.$async?t.if(c._`${u.default.errors} === 0`,()=>t.return(u.default.data),()=>t.throw(c._`new ${o}(${u.default.vErrors})`)):(t.assign(c._`${s}.errors`,u.default.vErrors),a.unevaluated&&function({gen:e,evaluated:t,props:r,items:s}){r instanceof c.Name&&e.assign(c._`${t}.props`,r),s instanceof c.Name&&e.assign(c._`${t}.items`,s)}(e),t.return(c._`${u.default.errors} === 0`))}(e)})}(e):s(e,()=>(0,h.topBoolOrEmptySchema)(e))};class S{constructor(e,t,r){if((0,$.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",C(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,$.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",u.default.errors))}result(e,t,r){this.failResult((0,c.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(c._`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=c.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;const{gen:r,schemaCode:s,schemaType:o,def:a}=this;r.if((0,c.or)(c._`${s} === undefined`,t)),e!==c.nil&&r.assign(e,!0),(o.length||a.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:s,def:o,it:a}=this;return(0,c.or)(function(){if(s.length){if(!(t instanceof c.Name))throw new Error("ajv implementation error");const e=Array.isArray(s)?s:[s];return c._`${(0,r.checkDataTypes)(e,t,a.opts.strictNumbers,r.DataType.Wrong)}`}return c.nil}(),function(){if(o.validateSchema){const r=e.scopeValue("validate$data",{ref:o.validateSchema});return c._`!${r}(${t})`}return c.nil}())}subschema(e,t){const r=(0,_.getSubschema)(this.it,e);(0,_.extendSubschemaData)(r,this.it,e),(0,_.extendSubschemaMode)(r,e);const s={...this.it,...r,items:void 0,props:void 0};return function(e,t){n(e)&&(i(e),a(e))?function(e,t){const{schema:r,gen:s,opts:o}=e;o.$comment&&r.$comment&&p(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,E.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const a=s.const("_errs",u.default.errors);d(e,a),s.var(t,c._`${a} === ${u.default.errors}`)}(e,t):(0,h.boolOrEmptySchema)(e,t)}(s,t),s}mergeEvaluated(e,t){const{it:r,gen:s}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=l.mergeEvaluated.props(s,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=l.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:s}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return s.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}}function k(e,t,r,s){const o=new S(e,r,t);"code"in r?r.code(o,s):o.$data&&r.validate?(0,$.funcKeywordCode)(o,r):"macro"in r?(0,$.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,$.funcKeywordCode)(o,r)}t.KeywordCxt=S;const N=/^\/(?:[^~]|~0|~1)*$/,j=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function C(e,{dataLevel:t,dataNames:r,dataPathArr:s}){let o,a;if(""===e)return u.default.rootData;if("/"===e[0]){if(!N.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,a=u.default.rootData}else{const n=j.exec(e);if(!n)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+n[1];if(o=n[2],"#"===o){if(i>=t)throw new Error(d("property/index",i));return s[t-i]}if(i>t)throw new Error(d("data",i));if(a=r[t-i],!o)return a}let n=a;const i=o.split("/");for(const e of i)e&&(a=c._`${a}${(0,c.getProperty)((0,l.unescapeJsonPointer)(e))}`,n=c._`${n} && ${a}`);return n;function d(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=C});class S extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}var k=/*#__PURE__*/Object.defineProperty({default:S},"__esModule",{value:!0});class N extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,E.resolveUrl)(e,t,r),this.missingSchema=(0,E.normalizeId)((0,E.getFullPath)(e,this.missingRef))}}var j=/*#__PURE__*/Object.defineProperty({default:N},"__esModule",{value:!0}),C=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;class r{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,E.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function s(e){const t=a.call(this,e);if(t)return t;const r=(0,E.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:o}=this.opts.code,{ownProperties:n}=this.opts,i=new c.CodeGen(this.scope,{es5:s,lines:o,ownProperties:n});let l;e.$async&&(l=i.scopeValue("Error",{ref:k.default,code:c._`require("ajv/dist/runtime/validation_error").default`}));const d=i.scopeName("validate");e.validateName=d;const f={gen:i,allErrors:this.opts.allErrors,data:u.default.data,parentData:u.default.parentData,parentDataProperty:u.default.parentDataProperty,dataNames:[u.default.data],dataPathArr:[c.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,c.stringify)(e.schema)}:{ref:e.schema}),validateName:d,ValidationError:l,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:c.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:c._`""`,opts:this.opts,self:this};let h;try{this._compilations.add(e),(0,P.validateFunctionCode)(f),i.optimize(this.opts.code.optimize);const t=i.toString();h=`${i.scopeRefs(u.default.scope)}return ${t}`,this.opts.code.process&&(h=this.opts.code.process(h,e));const r=new Function(`${u.default.self}`,`${u.default.scope}`,h)(this,this.scope.get());if(this.scope.value(d,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:d,validateCode:t,scopeValues:i._values}),this.opts.unevaluated){const{props:e,items:t}=f;r.evaluated={props:e instanceof c.Name?void 0:e,items:t instanceof c.Name?void 0:t,dynamicProps:e instanceof c.Name,dynamicItems:t instanceof c.Name},r.source&&(r.source.evaluated=(0,c.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,h&&this.logger.error("Error compiling schema, function code:",h),t}finally{this._compilations.delete(e)}}function o(e){return(0,E.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:s.call(this,e)}function a(e){for(const s of this._compilations)if((t=s).schema===(r=e).schema&&t.root===r.root&&t.baseId===r.baseId)return s;var t,r}function n(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||i.call(this,e,t)}function i(e,t){const o=this.opts.uriResolver.parse(t),a=(0,E._getFullPath)(this.opts.uriResolver,o);let n=(0,E.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&a===n)return f.call(this,o,e);const c=(0,E.normalizeId)(a),l=this.refs[c]||this.schemas[c];if("string"==typeof l){const t=i.call(this,e,l);if("object"!=typeof(null==t?void 0:t.schema))return;return f.call(this,o,t)}if("object"==typeof(null==l?void 0:l.schema)){if(l.validate||s.call(this,l),c===(0,E.normalizeId)(t)){const{schema:t}=l,{schemaId:s}=this.opts,o=t[s];return o&&(n=(0,E.resolveUrl)(this.opts.uriResolver,n,o)),new r({schema:t,schemaId:s,root:e,baseId:n})}return f.call(this,o,l)}}t.SchemaEnv=r,t.compileSchema=s,t.resolveRef=function(e,t,s){var a;s=(0,E.resolveUrl)(this.opts.uriResolver,t,s);const i=e.refs[s];if(i)return i;let c=n.call(this,e,s);if(void 0===c){const o=null===(a=e.localRefs)||void 0===a?void 0:a[s],{schemaId:n}=this.opts;o&&(c=new r({schema:o,schemaId:n,root:e,baseId:t}))}return void 0!==c?e.refs[s]=o.call(this,c):void 0},t.getCompilingSchema=a,t.resolveSchema=i;const d=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,{baseId:t,schema:s,root:o}){var a;if("/"!==(null===(a=e.fragment)||void 0===a?void 0:a[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof s)return;const e=s[(0,l.unescapeFragment)(r)];if(void 0===e)return;const o="object"==typeof(s=e)&&s[this.opts.schemaId];!d.has(r)&&o&&(t=(0,E.resolveUrl)(this.opts.uriResolver,t,o))}let n;if("boolean"!=typeof s&&s.$ref&&!(0,l.schemaHasRulesButRef)(s,this.RULES)){const e=(0,E.resolveUrl)(this.opts.uriResolver,t,s.$ref);n=i.call(this,o,e)}const{schemaId:c}=this.opts;return n=n||new r({schema:s,schemaId:c,root:o,baseId:t}),n.schema!==n.root.schema?n:void 0}}),O={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1},x=a(function(e,t){!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var s=t.length-1,o=1;o<s;++o)t[o]=t[o].slice(1,-1);return t[s]=t[s].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function s(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){var s="[A-Za-z]",o="[0-9]",a=t(o,"[A-Fa-f]"),n=r(r("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+r("%[89A-Fa-f]"+a+"%"+a+a)+"|"+r("%"+a+a)),i="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",i),l=e?"[\\uE000-\\uF8FF]":"[]",d=t(s,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");r(s+t(s,o,"[\\+\\-\\.]")+"*"),r(r(n+"|"+t(d,i,"[\\:]"))+"*");var u=r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("0?[1-9][0-9]")+"|0?0?"+o),f=r(u+"\\."+u+"\\."+u+"\\."+u),h=r(a+"{1,4}"),p=r(r(h+"\\:"+h)+"|"+f),m=r(r(h+"\\:")+"{6}"+p),y=r("\\:\\:"+r(h+"\\:")+"{5}"+p),v=r(r(h)+"?\\:\\:"+r(h+"\\:")+"{4}"+p),g=r(r(r(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+r(h+"\\:")+"{3}"+p),$=r(r(r(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+r(h+"\\:")+"{2}"+p),_=r(r(r(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+p),w=r(r(r(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+p),b=r(r(r(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),E=r(r(r(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),P=r([m,y,v,g,$,_,w,b,E].join("|")),S=r(r(d+"|"+n)+"+");r("[vV]"+a+"+\\."+t(d,i,"[\\:]")+"+"),r(r(n+"|"+t(d,i))+"*");var k=r(n+"|"+t(d,i,"[\\:\\@]"));return r(r(n+"|"+t(d,i,"[\\@]"))+"+"),r(r(k+"|"+t("[\\/\\?]",l))+"*"),{NOT_SCHEME:new RegExp(t("[^]",s,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",d,i),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",d,i),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",d,i),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",d,i),"g"),NOT_QUERY:new RegExp(t("[^\\%]",d,i,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",d,i,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",d,i),"g"),UNRESERVED:new RegExp(d,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",d,c),"g"),PCT_ENCODED:new RegExp(n,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+P+")"+r(r("\\%25|\\%(?!"+a+"{2})")+"("+S+")")+"?\\]?$")}}var n=a(!1),i=a(!0),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],s=!0,o=!1,a=void 0;try{for(var n,i=e[Symbol.iterator]();!(s=(n=i.next()).done)&&(r.push(n.value),!t||r.length!==t);s=!0);}catch(e){o=!0,a=e}finally{try{!s&&i.return&&i.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},l=2147483647,d=36,u=/^xn--/,f=/[^\0-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,y=String.fromCharCode;function v(e){throw new RangeError(p[e])}function g(e,t){var r=e.split("@"),s="";return r.length>1&&(s=r[0]+"@",e=r[1]),s+function(e,t){for(var r=[],s=e.length;s--;)r[s]=t(e[s]);return r}((e=e.replace(h,".")).split("."),t).join(".")}var $=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},_=function(e,t,r){var s=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;s+=d)e=m(e/35);return m(s+36*e/(e+38))},w=function(e){return g(e,function(e){return f.test(e)?"xn--"+function(e){var t=[],r=(e=function(e){for(var t=[],r=0,s=e.length;r<s;){var o=e.charCodeAt(r++);if(o>=55296&&o<=56319&&r<s){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&o)<<10)+(1023&a)+65536):(t.push(o),r--)}else t.push(o)}return t}(e)).length,s=128,o=0,a=72,n=!0,i=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(n=(u=f.next()).done);n=!0){var h=u.value;h<128&&t.push(y(h))}}catch(e){i=!0,c=e}finally{try{!n&&f.return&&f.return()}finally{if(i)throw c}}var p=t.length,g=p;for(p&&t.push("-");g<r;){var w=l,b=!0,E=!1,P=void 0;try{for(var S,k=e[Symbol.iterator]();!(b=(S=k.next()).done);b=!0){var N=S.value;N>=s&&N<w&&(w=N)}}catch(e){E=!0,P=e}finally{try{!b&&k.return&&k.return()}finally{if(E)throw P}}var j=g+1;w-s>m((l-o)/j)&&v("overflow"),o+=(w-s)*j,s=w;var C=!0,O=!1,x=void 0;try{for(var T,R=e[Symbol.iterator]();!(C=(T=R.next()).done);C=!0){var I=T.value;if(I<s&&++o>l&&v("overflow"),I==s){for(var D=o,A=d;;A+=d){var M=A<=a?1:A>=a+26?26:A-a;if(D<M)break;var V=D-M,F=d-M;t.push(y($(M+V%F,0))),D=m(V/F)}t.push(y($(D,0))),a=_(o,j,g==p),o=0,++g}}}catch(e){O=!0,x=e}finally{try{!C&&R.return&&R.return()}finally{if(O)throw x}}++o,++s}return t.join("")}(e):e})},b=function(e){return g(e,function(e){return u.test(e)?function(e){var t,r=[],s=e.length,o=0,a=128,n=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var c=0;c<i;++c)e.charCodeAt(c)>=128&&v("not-basic"),r.push(e.charCodeAt(c));for(var u=i>0?i+1:0;u<s;){for(var f=o,h=1,p=d;;p+=d){u>=s&&v("invalid-input");var y=(t=e.charCodeAt(u++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:d;(y>=d||y>m((l-o)/h))&&v("overflow"),o+=y*h;var g=p<=n?1:p>=n+26?26:p-n;if(y<g)break;var $=d-g;h>m(l/$)&&v("overflow"),h*=$}var w=r.length+1;n=_(o-f,w,0==f),m(o/w)>l-a&&v("overflow"),a+=m(o/w),o%=w,r.splice(o++,0,a)}return String.fromCodePoint.apply(String,r)}(e.slice(4).toLowerCase()):e})},E={};function P(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function S(e){for(var t="",r=0,s=e.length;r<s;){var o=parseInt(e.substr(r+1,2),16);if(o<128)t+=String.fromCharCode(o),r+=3;else if(o>=194&&o<224){if(s-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&o)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(o>=224){if(s-r>=9){var n=parseInt(e.substr(r+4,2),16),i=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&n)<<6|63&i)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function k(e,t){function r(e){var r=S(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,P).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,P).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,P).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,P).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,P).replace(t.PCT_ENCODED,o)),e}function N(e){return e.replace(/^0*(.*)/,"$1")||"0"}function j(e,t){var r=e.match(t.IPV4ADDRESS)||[],s=c(r,2)[1];return s?s.split(".").map(N).join("."):e}function C(e,t){var r=e.match(t.IPV6ADDRESS)||[],s=c(r,3),o=s[1],a=s[2];if(o){for(var n=o.toLowerCase().split("::").reverse(),i=c(n,2),l=i[0],d=i[1],u=d?d.split(":").map(N):[],f=l.split(":").map(N),h=t.IPV4ADDRESS.test(f[f.length-1]),p=h?7:8,m=f.length-p,y=Array(p),v=0;v<p;++v)y[v]=u[v]||f[m+v]||"";h&&(y[p-1]=j(y[p-1],t));var g=y.reduce(function(e,t,r){if(!t||"0"===t){var s=e[e.length-1];s&&s.index+s.length===r?s.length++:e.push({index:r,length:1})}return e},[]).sort(function(e,t){return t.length-e.length})[0],$=void 0;if(g&&g.length>1){var _=y.slice(0,g.index),w=y.slice(g.index+g.length);$=_.join(":")+"::"+w.join(":")}else $=y.join(":");return a&&($+="%"+a),$}return e}var O=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,x=void 0==="".match(/(){0}/)[1];function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},s=!1!==t.iri?i:n;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(O);if(o){x?(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5])):(r.scheme=o[1]||void 0,r.userinfo=-1!==e.indexOf("@")?o[3]:void 0,r.host=-1!==e.indexOf("//")?o[4]:void 0,r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=-1!==e.indexOf("?")?o[7]:void 0,r.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),r.host&&(r.host=C(j(r.host,s),s)),r.reference=void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?"relative":void 0===r.fragment?"absolute":"uri":"same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)k(r,s);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=w(r.host.replace(s.PCT_ENCODED,S).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}k(r,n)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function R(e,t){var r=!1!==t.iri?i:n,s=[];return void 0!==e.userinfo&&(s.push(e.userinfo),s.push("@")),void 0!==e.host&&s.push(C(j(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(s.push(":"),s.push(String(e.port))),s.length?s.join(""):void 0}var I=/^\.\.?\//,D=/^\/\.(\/|$)/,A=/^\/\.\.(\/|$)/,M=/^\/?(?:.|\n)*?(?=\/|$)/;function V(e){for(var t=[];e.length;)if(e.match(I))e=e.replace(I,"");else if(e.match(D))e=e.replace(D,"/");else if(e.match(A))e=e.replace(A,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(M);if(!r)throw new Error("Unexpected dot segment condition");var s=r[0];e=e.slice(s.length),t.push(s)}return t.join("")}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?i:n,s=[],o=E[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?b(e.host):w(e.host.replace(r.PCT_ENCODED,S).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}k(e,r),"suffix"!==t.reference&&e.scheme&&(s.push(e.scheme),s.push(":"));var a=R(e,t);if(void 0!==a&&("suffix"!==t.reference&&s.push("//"),s.push(a),e.path&&"/"!==e.path.charAt(0)&&s.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||o&&o.absolutePath||(c=V(c)),void 0===a&&(c=c.replace(/^\/\//,"/%2F")),s.push(c)}return void 0!==e.query&&(s.push("?"),s.push(e.query)),void 0!==e.fragment&&(s.push("#"),s.push(e.fragment)),s.join("")}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={};return arguments[3]||(e=T(F(e,r),r),t=T(F(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=V(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=V(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=V(t.path):(s.path=void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:t.path:"/"+t.path,s.path=V(s.path)),s.query=t.query):(s.path=e.path,s.query=void 0!==t.query?t.query:e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function q(e,t){return e&&e.toString().replace(t&&t.iri?i.PCT_ENCODED:n.PCT_ENCODED,S)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},K={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};function L(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var H={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=L(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(L(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),s=c(r,2),o=s[0],a=s[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},G={scheme:"wss",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize},J={},B="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",W="[0-9A-Fa-f]",Q=r(r("%[EFef][0-9A-Fa-f]%"+W+W+"%"+W+W)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+W+W)+"|"+r("%"+W+W)),Z=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Y=new RegExp(B,"g"),X=new RegExp(Q,"g"),ee=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Z),"g"),te=new RegExp(t("[^]",B,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),re=te;function se(e){var t=S(e);return t.match(Y)?t:e}var oe={scheme:"mailto",parse:function(e,t){var r=e,s=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var o=!1,a={},n=r.query.split("&"),i=0,c=n.length;i<c;++i){var l=n[i].split("=");switch(l[0]){case"to":for(var d=l[1].split(","),u=0,f=d.length;u<f;++u)s.push(d[u]);break;case"subject":r.subject=q(l[1],t);break;case"body":r.body=q(l[1],t);break;default:o=!0,a[q(l[0],t)]=q(l[1],t)}}o&&(r.headers=a)}r.query=void 0;for(var h=0,p=s.length;h<p;++h){var m=s[h].split("@");if(m[0]=q(m[0]),t.unicodeSupport)m[1]=q(m[1],t).toLowerCase();else try{m[1]=w(q(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}s[h]=m.join("@")}return r},serialize:function(e,t){var r,s=e,a=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(a){for(var n=0,i=a.length;n<i;++n){var c=String(a[n]),l=c.lastIndexOf("@"),d=c.slice(0,l).replace(X,se).replace(X,o).replace(ee,P),u=c.slice(l+1);try{u=t.iri?b(u):w(q(u,t).toLowerCase())}catch(e){s.error=s.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}a[n]=d+"@"+u}s.path=a.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var p in f)f[p]!==J[p]&&h.push(p.replace(X,se).replace(X,o).replace(te,P)+"="+f[p].replace(X,se).replace(X,o).replace(re,P));return h.length&&(s.query=h.join("&")),s}},ae=/^([^\:]+)\:(.*)/,ne={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ae),s=e;if(r){var o=t.scheme||s.scheme||"urn",a=r[1].toLowerCase(),n=r[2],i=E[o+":"+(t.nid||a)];s.nid=a,s.nss=n,s.path=void 0,i&&(s=i.parse(s,t))}else s.error=s.error||"URN can not be parsed.";return s},serialize:function(e,t){var r=e.nid,s=E[(t.scheme||e.scheme||"urn")+":"+(t.nid||r)];s&&(e=s.serialize(e,t));var o=e;return o.path=(r||t.nid)+":"+e.nss,o}},ie=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ce={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ie)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};E[z.scheme]=z,E[K.scheme]=K,E[H.scheme]=H,E[G.scheme]=G,E[oe.scheme]=oe,E[ne.scheme]=ne,E[ce.scheme]=ce,e.SCHEMES=E,e.pctEncChar=P,e.pctDecChars=S,e.parse=T,e.removeDotSegments=V,e.serialize=F,e.resolveComponents=U,e.resolve=function(e,t,r){var s=function(e,t){var r={scheme:"null"};if(t)for(var s in t)r[s]=t[s];return r}(0,r);return F(U(T(e,s),T(t,s),s,!0),s)},e.normalize=function(e,t){return"string"==typeof e?e=F(T(e,t),t):"object"===s(e)&&(e=T(F(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=F(T(e,r),r):"object"===s(e)&&(e=F(e,r)),"string"==typeof t?t=F(T(t,r),r):"object"===s(t)&&(t=F(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?i.ESCAPE:n.ESCAPE,P)},e.unescapeComponent=q,Object.defineProperty(e,"__esModule",{value:!0})}(t)});x.code='require("ajv/dist/runtime/uri").default';var T=/*#__PURE__*/Object.defineProperty({default:x},"__esModule",{value:!0}),R=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0,Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return P.KeywordCxt}}),Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});const r=c,s=(e,t)=>new RegExp(e,t);s.code="new RegExp";const o=["removeAdditional","useDefaults","coerceTypes"],a=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),n={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},i={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function d(e){var t,r,o,a,n,i,c,l,d,u,f,h,p,m,y,v,g,$,_,w,b,E,P,S,k;const N=e.strict,j=null===(t=e.code)||void 0===t?void 0:t.optimize,C=!0===j||void 0===j?1:j||0,O=null!==(o=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==o?o:s,x=null!==(a=e.uriResolver)&&void 0!==a?a:T.default;return{strictSchema:null===(i=null!==(n=e.strictSchema)&&void 0!==n?n:N)||void 0===i||i,strictNumbers:null===(l=null!==(c=e.strictNumbers)&&void 0!==c?c:N)||void 0===l||l,strictTypes:null!==(u=null!==(d=e.strictTypes)&&void 0!==d?d:N)&&void 0!==u?u:"log",strictTuples:null!==(h=null!==(f=e.strictTuples)&&void 0!==f?f:N)&&void 0!==h?h:"log",strictRequired:null!==(m=null!==(p=e.strictRequired)&&void 0!==p?p:N)&&void 0!==m&&m,code:e.code?{...e.code,optimize:C,regExp:O}:{optimize:C,regExp:O},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:200,meta:null===(g=e.meta)||void 0===g||g,messages:null===($=e.messages)||void 0===$||$,inlineRefs:null===(_=e.inlineRefs)||void 0===_||_,schemaId:null!==(w=e.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(b=e.addUsedSchema)||void 0===b||b,validateSchema:null===(E=e.validateSchema)||void 0===E||E,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(S=e.unicodeRegExp)||void 0===S||S,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:x}}class u{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...d(e)};const{es5:t,lines:s}=this.opts.code;this.scope=new r.ValueScope({scope:{},prefixes:a,es5:t,lines:s}),this.logger=function(e){if(!1===e)return _;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,p.getRules)(),f.call(this,n,e,"NOT SUPPORTED"),f.call(this,i,e,"DEPRECATED","warn"),this._metaOpts=$.call(this),e.formats&&v.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&g.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),m.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let s=O;"id"===r&&(s={...O},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||a.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await s.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof j.default))throw t;return n.call(this,t),await i.call(this,t.missingSchema),a.call(this,e)}}function n({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function i(e){const r=await c.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,s);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,E.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const s=this.validate(r,e);if(!s&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return s}getSchema(e){let t;for(;"string"==typeof(t=h.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,s=new C.SchemaEnv({schema:{},schemaId:r});if(t=C.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=h.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,E.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(b.call(this,r,t),!t)return(0,l.eachItem)(r,e=>S.call(this,e)),this;x.call(this,t);const s={...t,type:(0,y.getJSONTypes)(t.type),schemaType:(0,y.getJSONTypes)(t.schemaType)};return(0,l.eachItem)(r,0===s.type.length?e=>S.call(this,e,s):e=>s.type.forEach(t=>S.call(this,e,s,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const s of t){const t=s.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:s}=t.definition,a=o[e];s&&a&&(o[e]=I(a))}}return e}_removeAllSchemas(e,t){for(const r in e){const s=e[r];t&&!t.test(r)||("string"==typeof s?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,o=this.opts.addUsedSchema){let a;const{schemaId:n}=this.opts;if("object"==typeof e)a=e[n];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(void 0!==i)return i;r=(0,E.normalizeId)(a||r);const c=E.getSchemaRefs.call(this,e,r);return i=new C.SchemaEnv({schema:e,schemaId:n,meta:t,baseId:r,localRefs:c}),this._cache.set(i.schema,i),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=i),s&&this.validateSchema(e,!0),i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):C.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{C.compileSchema.call(this,e)}finally{this.opts=t}}}function f(e,t,r,s="error"){for(const o in e){const a=o;a in t&&this.logger[s](`${r}: option ${o}. ${e[a]}`)}}function h(e){return e=(0,E.normalizeId)(e),this.schemas[e]||this.refs[e]}function m(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function v(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function g(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function $(){const e={...this.opts};for(const t of o)delete e[t];return e}t.default=u,u.ValidationError=k.default,u.MissingRefError=j.default;const _={log(){},warn(){},error(){}},w=/^[a-z_$][a-z0-9_$:-]*$/i;function b(e,t){const{RULES:r}=this;if((0,l.eachItem)(e,e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!w.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function S(e,t,r){var s;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:a}=this;let n=o?a.post:a.rules.find(({type:e})=>e===r);if(n||(n={type:r,rules:[]},a.rules.push(n)),a.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:(0,y.getJSONTypes)(t.type),schemaType:(0,y.getJSONTypes)(t.schemaType)}};t.before?N.call(this,n,i,t.before):n.rules.push(i),a.all[e]=i,null===(s=t.implements)||void 0===s||s.forEach(e=>this.addKeyword(e))}function N(e,t,r){const s=e.rules.findIndex(e=>e.keyword===r);s>=0?e.rules.splice(s,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function x(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=I(t)),e.validateSchema=this.compile(t,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function I(e){return{anyOf:[e,R]}}}),I=/*#__PURE__*/Object.defineProperty({default:{keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},"__esModule",{value:!0}),D=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:a}=e,{baseId:n,schemaEnv:i,validateName:l,opts:d,self:u}=a,{root:f}=i;if(("#"===r||"#/"===r)&&n===f.baseId)return function(){if(i===f)return o(e,l,i,i.$async);const r=t.scopeValue("root",{ref:f});return o(e,c._`${r}.validate`,f,f.$async)}();const h=C.resolveRef.call(u,f,n,r);if(void 0===h)throw new j.default(a.opts.uriResolver,n,r);return h instanceof C.SchemaEnv?function(t){const r=s(e,t);o(e,r,t,t.$async)}(h):function(s){const o=t.scopeValue("schema",!0===d.code.source?{ref:s,code:(0,c.stringify)(s)}:{ref:s}),a=t.name("valid"),n=e.subschema({schema:s,dataTypes:[],schemaPath:c.nil,topSchemaRef:o,errSchemaPath:r},a);e.mergeEvaluated(n),e.ok(a)}(h)}};function s(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):c._`${r.scopeValue("wrapper",{ref:t})}.validate`}function o(e,t,r,s){const{gen:o,it:a}=e,{allErrors:n,schemaEnv:i,opts:d}=a,f=d.passContext?u.default.this:c.nil;function h(e){const t=c._`${e}.errors`;o.assign(u.default.vErrors,c._`${u.default.vErrors} === null ? ${t} : ${u.default.vErrors}.concat(${t})`),o.assign(u.default.errors,c._`${u.default.vErrors}.length`)}function p(e){var t;if(!a.opts.unevaluated)return;const s=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==a.props)if(s&&!s.dynamicProps)void 0!==s.props&&(a.props=l.mergeEvaluated.props(o,s.props,a.props));else{const t=o.var("props",c._`${e}.evaluated.props`);a.props=l.mergeEvaluated.props(o,t,a.props,c.Name)}if(!0!==a.items)if(s&&!s.dynamicItems)void 0!==s.items&&(a.items=l.mergeEvaluated.items(o,s.items,a.items));else{const t=o.var("items",c._`${e}.evaluated.items`);a.items=l.mergeEvaluated.items(o,t,a.items,c.Name)}}s?function(){if(!i.$async)throw new Error("async schema referenced by sync schema");const r=o.let("valid");o.try(()=>{o.code(c._`await ${(0,g.callValidateCode)(e,t,f)}`),p(t),n||o.assign(r,!0)},e=>{o.if(c._`!(${e} instanceof ${a.ValidationError})`,()=>o.throw(e)),h(e),n||o.assign(r,!1)}),e.ok(r)}():e.result((0,g.callValidateCode)(e,t,f),()=>p(t),()=>h(t))}t.getValidate=s,t.callRef=o,t.default=r}),A=/*#__PURE__*/Object.defineProperty({default:["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",I.default,D.default]},"__esModule",{value:!0});const M=c.operators,V={maximum:{okStr:"<=",ok:M.LTE,fail:M.GT},minimum:{okStr:">=",ok:M.GTE,fail:M.LT},exclusiveMaximum:{okStr:"<",ok:M.LT,fail:M.GTE},exclusiveMinimum:{okStr:">",ok:M.GT,fail:M.LTE}},F={message:({keyword:e,schemaCode:t})=>c.str`must be ${V[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>c._`{comparison: ${V[e].okStr}, limit: ${t}}`},U={keyword:Object.keys(V),type:"number",schemaType:"number",$data:!0,error:F,code(e){const{keyword:t,data:r,schemaCode:s}=e;e.fail$data(c._`${r} ${V[t].fail} ${s} || isNaN(${r})`)}};var q=/*#__PURE__*/Object.defineProperty({default:U},"__esModule",{value:!0}),z=/*#__PURE__*/Object.defineProperty({default:{keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>c.str`must be multiple of ${e}`,params:({schemaCode:e})=>c._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:s,it:o}=e,a=o.opts.multipleOfPrecision,n=t.let("res"),i=a?c._`Math.abs(Math.round(${n}) - ${n}) > 1e-${a}`:c._`${n} !== parseInt(${n})`;e.fail$data(c._`(${s} === 0 || (${n} = ${r}/${s}, ${i}))`)}}},"__esModule",{value:!0});function K(e){const t=e.length;let r,s=0,o=0;for(;o<t;)s++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return s}var L=K;K.code='require("ajv/dist/runtime/ucs2length").default';var H=/*#__PURE__*/Object.defineProperty({default:L},"__esModule",{value:!0}),G=/*#__PURE__*/Object.defineProperty({default:{keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>c.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:o}=e,a="maxLength"===t?c.operators.GT:c.operators.LT,n=!1===o.opts.unicode?c._`${r}.length`:c._`${(0,l.useFunc)(e.gen,H.default)}(${r})`;e.fail$data(c._`${n} ${a} ${s}`)}}},"__esModule",{value:!0}),J=/*#__PURE__*/Object.defineProperty({default:{keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>c.str`must match pattern "${e}"`,params:({schemaCode:e})=>c._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:s,schemaCode:o,it:a}=e,n=r?c._`(new RegExp(${o}, ${a.opts.unicodeRegExp?"u":""}))`:(0,g.usePattern)(e,s);e.fail$data(c._`!${n}.test(${t})`)}}},"__esModule",{value:!0}),B=/*#__PURE__*/Object.defineProperty({default:{keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>c.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s}=e;e.fail$data(c._`Object.keys(${r}).length ${"maxProperties"===t?c.operators.GT:c.operators.LT} ${s}`)}}},"__esModule",{value:!0}),W=/*#__PURE__*/Object.defineProperty({default:{keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>c.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>c._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:o,$data:a,it:n}=e,{opts:i}=n;if(!a&&0===r.length)return;const d=r.length>=i.loopRequired;if(n.allErrors?function(){if(d||a)e.block$data(c.nil,u);else for(const t of r)(0,g.checkReportMissingProp)(e,t)}():function(){const n=t.let("missing");if(d||a){const r=t.let("valid",!0);e.block$data(r,()=>function(r,a){e.setParams({missingProperty:r}),t.forOf(r,s,()=>{t.assign(a,(0,g.propertyInData)(t,o,r,i.ownProperties)),t.if((0,c.not)(a),()=>{e.error(),t.break()})},c.nil)}(n,r)),e.ok(r)}else t.if((0,g.checkMissingProp)(e,r,n)),(0,g.reportMissingProp)(e,n),t.else()}(),i.strictRequired){const t=e.parentSchema.properties,{definedProperties:s}=e.it;for(const e of r)void 0!==(null==t?void 0:t[e])||s.has(e)||(0,l.checkStrictMode)(n,`required property "${e}" is not defined at "${n.schemaEnv.baseId+n.errSchemaPath}" (strictRequired)`,n.opts.strictRequired)}function u(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,g.noPropertyInData)(t,o,r,i.ownProperties),()=>e.error())})}}}},"__esModule",{value:!0}),Q=/*#__PURE__*/Object.defineProperty({default:{keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>c.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>c._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s}=e;e.fail$data(c._`${r}.length ${"maxItems"===t?c.operators.GT:c.operators.LT} ${s}`)}}},"__esModule",{value:!0});w.code='require("ajv/dist/runtime/equal").default';var Z=/*#__PURE__*/Object.defineProperty({default:w},"__esModule",{value:!0}),Y=/*#__PURE__*/Object.defineProperty({default:[q.default,z.default,G.default,J.default,B.default,W.default,Q.default,/*#__PURE__*/Object.defineProperty({default:{keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>c.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>c._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:s,schema:o,parentSchema:a,schemaCode:n,it:i}=e;if(!s&&!o)return;const d=t.let("valid"),u=a.items?(0,y.getSchemaTypes)(a.items):[];function f(s,o){const a=t.name("item"),n=(0,y.checkDataTypes)(u,a,i.opts.strictNumbers,y.DataType.Wrong),l=t.const("indices",c._`{}`);t.for(c._`;${s}--;`,()=>{t.let(a,c._`${r}[${s}]`),t.if(n,c._`continue`),u.length>1&&t.if(c._`typeof ${a} == "string"`,c._`${a} += "_"`),t.if(c._`typeof ${l}[${a}] == "number"`,()=>{t.assign(o,c._`${l}[${a}]`),e.error(),t.assign(d,!1).break()}).code(c._`${l}[${a}] = ${s}`)})}function h(s,o){const a=(0,l.useFunc)(t,Z.default),n=t.name("outer");t.label(n).for(c._`;${s}--;`,()=>t.for(c._`${o} = ${s}; ${o}--;`,()=>t.if(c._`${a}(${r}[${s}], ${r}[${o}])`,()=>{e.error(),t.assign(d,!1).break(n)})))}e.block$data(d,function(){const s=t.let("i",c._`${r}.length`),o=t.let("j");e.setParams({i:s,j:o}),t.assign(d,!0),t.if(c._`${s} > 1`,()=>(u.length>0&&!u.some(e=>"object"===e||"array"===e)?f:h)(s,o))},c._`${n} === false`),e.ok(d)}}},"__esModule",{value:!0}).default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},/*#__PURE__*/Object.defineProperty({default:{keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>c._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:o,schema:a}=e;s||a&&"object"==typeof a?e.fail$data(c._`!${(0,l.useFunc)(t,Z.default)}(${r}, ${o})`):e.fail(c._`${a} !== ${r}`)}}},"__esModule",{value:!0}).default,/*#__PURE__*/Object.defineProperty({default:{keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>c._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:o,schemaCode:a,it:n}=e;if(!s&&0===o.length)throw new Error("enum must have non-empty array");let i;const d=()=>null!=i?i:i=(0,l.useFunc)(t,Z.default);let u;if(o.length>=n.opts.loopEnum||s)u=t.let("valid"),e.block$data(u,function(){t.assign(u,!1),t.forOf("v",a,e=>t.if(c._`${d()}(${r}, ${e})`,()=>t.assign(u,!0).break()))});else{if(!Array.isArray(o))throw new Error("ajv implementation error");const e=t.const("vSchema",a);u=(0,c.or)(...o.map((t,s)=>function(e,t){const s=o[t];return"object"==typeof s&&null!==s?c._`${d()}(${r}, ${e}[${t}])`:c._`${r} === ${s}`}(e,s)))}e.pass(u)}}},"__esModule",{value:!0}).default]},"__esModule",{value:!0}),X=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:o}=t;Array.isArray(o)?s(e,o):(0,l.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:s,data:o,keyword:a,it:n}=e;n.items=!0;const i=r.const("len",c._`${o}.length`);if(!1===s)e.setParams({len:t.length}),e.pass(c._`${i} <= ${t.length}`);else if("object"==typeof s&&!(0,l.alwaysValidSchema)(n,s)){const s=r.var("valid",c._`${i} <= ${t.length}`);r.if((0,c.not)(s),()=>function(s){r.forRange("i",t.length,i,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:l.Type.Num},s),n.allErrors||r.if((0,c.not)(s),()=>r.break())})}(s)),e.ok(s)}}t.validateAdditionalItems=s,t.default=r}),ee=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return s(e,"additionalItems",t);r.items=!0,(0,l.alwaysValidSchema)(r,t)||e.ok((0,g.validateArray)(e))}};function s(e,t,r=e.schema){const{gen:s,parentSchema:o,data:a,keyword:n,it:i}=e;!function(e){const{opts:s,errSchemaPath:o}=i,a=r.length;s.strictTuples&&(a!==e.minItems||a!==e.maxItems&&!1!==e[t])&&(0,l.checkStrictMode)(i,`"${n}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`,s.strictTuples)}(o),i.opts.unevaluated&&r.length&&!0!==i.items&&(i.items=l.mergeEvaluated.items(s,r.length,i.items));const d=s.name("valid"),u=s.const("len",c._`${a}.length`);r.forEach((t,r)=>{(0,l.alwaysValidSchema)(i,t)||(s.if(c._`${u} > ${r}`,()=>e.subschema({keyword:n,schemaProp:r,dataProp:r},d)),e.ok(d))})}t.validateTuple=s,t.default=r}),te=/*#__PURE__*/Object.defineProperty({default:{keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,ee.validateTuple)(e,"items")}},"__esModule",{value:!0}),re=/*#__PURE__*/Object.defineProperty({default:{keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>c.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:s}=e,{prefixItems:o}=r;s.items=!0,(0,l.alwaysValidSchema)(s,t)||(o?(0,X.validateAdditionalItems)(e,o):e.ok((0,g.validateArray)(e)))}}},"__esModule",{value:!0}),se=/*#__PURE__*/Object.defineProperty({default:{keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?c.str`must contain at least ${e} valid item(s)`:c.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?c._`{minContains: ${e}}`:c._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:s,data:o,it:a}=e;let n,i;const{minContains:d,maxContains:u}=s;a.opts.next?(n=void 0===d?1:d,i=u):n=1;const f=t.const("len",c._`${o}.length`);if(e.setParams({min:n,max:i}),void 0===i&&0===n)return void(0,l.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==i&&n>i)return(0,l.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,l.alwaysValidSchema)(a,r)){let t=c._`${f} >= ${n}`;return void 0!==i&&(t=c._`${t} && ${f} <= ${i}`),void e.pass(t)}a.items=!0;const h=t.name("valid");function p(){const e=t.name("_valid"),r=t.let("count",0);m(e,()=>t.if(e,()=>function(e){t.code(c._`${e}++`),void 0===i?t.if(c._`${e} >= ${n}`,()=>t.assign(h,!0).break()):(t.if(c._`${e} > ${i}`,()=>t.assign(h,!1).break()),1===n?t.assign(h,!0):t.if(c._`${e} >= ${n}`,()=>t.assign(h,!0)))}(r)))}function m(r,s){t.forRange("i",0,f,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:l.Type.Num,compositeRule:!0},r),s()})}void 0===i&&1===n?m(h,()=>t.if(h,()=>t.break())):0===n?(t.let(h,!0),void 0!==i&&t.if(c._`${o}.length > 0`,p)):(t.let(h,!1),p()),e.result(h,()=>e.reset())}}},"__esModule",{value:!0}),oe=a(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0,t.error={message:({params:{property:e,depsCount:t,deps:r}})=>c.str`must have ${1===t?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:s}})=>c._`{property: ${e},
@@ -1,2 +1,2 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","react-hook-form"],r):r((e||self).hookformResolvers={},e.reactHookForm)}(this,function(e,r){var o=function(e,o,t){if(e&&"reportValidity"in e){var i=r.get(t,o);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},t=function(e,r){var t=function(t){var i=r.fields[t];i&&i.ref&&"reportValidity"in i.ref?o(i.ref,t,e):i.refs&&i.refs.forEach(function(r){return o(r,t,e)})};for(var i in r.fields)t(i)};e.toNestError=function(e,o){o.shouldUseNativeValidation&&t(e,o);var i={};for(var f in e){var n=r.get(o.fields,f);r.set(i,f,Object.assign(e[f],{ref:n&&n.ref}))}return i},e.validateFieldsNatively=t});
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","react-hook-form"],o):o((e||self).hookformResolvers={},e.ReactHookForm)}(this,function(e,o){var r=function(e,r,t){if(e&&"reportValidity"in e){var i=o.get(t,r);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},t=function(e,o){var t=function(t){var i=o.fields[t];i&&i.ref&&"reportValidity"in i.ref?r(i.ref,t,e):i.refs&&i.refs.forEach(function(o){return r(o,t,e)})};for(var i in o.fields)t(i)};e.toNestError=function(e,r){r.shouldUseNativeValidation&&t(e,r);var i={};for(var f in e){var n=o.get(r.fields,f);o.set(i,f,Object.assign(e[f],{ref:n&&n.ref}))}return i},e.validateFieldsNatively=t});
2
2
  //# sourceMappingURL=resolvers.umd.js.map
@@ -1,6 +1,6 @@
1
1
  import * as t from 'io-ts';
2
2
  import { FieldError, FieldValues, ResolverOptions, ResolverResult } from 'react-hook-form';
3
- export declare type Resolver = <T, TFieldValues, TContext>(codec: t.Decoder<FieldValues, T>) => (values: TFieldValues, _context: TContext | undefined, options: ResolverOptions<TFieldValues>) => ResolverResult<TFieldValues>;
3
+ export declare type Resolver = <T, TFieldValues extends FieldValues, TContext>(codec: t.Decoder<FieldValues, T>) => (values: TFieldValues, _context: TContext | undefined, options: ResolverOptions<TFieldValues>) => ResolverResult<TFieldValues>;
4
4
  export declare type ErrorObject = Record<string, FieldError>;
5
5
  export declare type FieldErrorWithPath = FieldError & {
6
6
  path: string;
@@ -6,7 +6,7 @@ import {
6
6
  ResolverResult,
7
7
  } from 'react-hook-form';
8
8
 
9
- export type Resolver = <T, TFieldValues, TContext>(
9
+ export type Resolver = <T, TFieldValues extends FieldValues, TContext>(
10
10
  codec: t.Decoder<FieldValues, T>,
11
11
  ) => (
12
12
  values: TFieldValues,
@@ -1,2 +1,2 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react-hook-form"),require("@hookform/resolvers")):"function"==typeof define&&define.amd?define(["exports","react-hook-form","@hookform/resolvers"],r):r((e||self).hookformResolversJoi={},e.reactHookForm,e.hookformResolvers)}(this,function(e,r,o){e.joiResolver=function(e,t,n){return void 0===t&&(t={abortEarly:!1}),void 0===n&&(n={}),function(i,s,a){try{var u=function(){return f.error?{values:{},errors:o.toNestError((e=f.error,t=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,e.details.length?e.details.reduce(function(e,o){var n=o.path.join(".");if(e[n]||(e[n]={message:o.message,type:o.type}),t){var i=e[n].types,s=i&&i[o.type];e[n]=r.appendErrors(n,t,e,o.type,s?[].concat(s,o.message):o.message)}return e},{}):{}),a)}:(a.shouldUseNativeValidation&&o.validateFieldsNatively({},a),{errors:{},values:f.value});var e,t},l=Object.assign({},t,{context:s}),f={},c=function(){if("sync"===n.mode)f=e.validate(i,l);else{var r=function(e,r){try{var o=e()}catch(e){return r(e)}return o&&o.then?o.then(void 0,r):o}(function(){return Promise.resolve(e.validateAsync(i,l)).then(function(e){f.value=e})},function(e){f.error=e});if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(c&&c.then?c.then(u):u())}catch(e){return Promise.reject(e)}}}});
1
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react-hook-form"),require("@hookform/resolvers")):"function"==typeof define&&define.amd?define(["exports","react-hook-form","@hookform/resolvers"],r):r((e||self).hookformResolversJoi={},e.ReactHookForm,e.hookformResolvers)}(this,function(e,r,o){e.joiResolver=function(e,t,n){return void 0===t&&(t={abortEarly:!1}),void 0===n&&(n={}),function(i,s,a){try{var u=function(){return f.error?{values:{},errors:o.toNestError((e=f.error,t=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,e.details.length?e.details.reduce(function(e,o){var n=o.path.join(".");if(e[n]||(e[n]={message:o.message,type:o.type}),t){var i=e[n].types,s=i&&i[o.type];e[n]=r.appendErrors(n,t,e,o.type,s?[].concat(s,o.message):o.message)}return e},{}):{}),a)}:(a.shouldUseNativeValidation&&o.validateFieldsNatively({},a),{errors:{},values:f.value});var e,t},l=Object.assign({},t,{context:s}),f={},c=function(){if("sync"===n.mode)f=e.validate(i,l);else{var r=function(e,r){try{var o=e()}catch(e){return r(e)}return o&&o.then?o.then(void 0,r):o}(function(){return Promise.resolve(e.validateAsync(i,l)).then(function(e){f.value=e})},function(e){f.error=e});if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(c&&c.then?c.then(u):u())}catch(e){return Promise.reject(e)}}}});
2
2
  //# sourceMappingURL=joi.umd.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hookform/resolvers",
3
3
  "amdName": "hookformResolvers",
4
- "version": "2.9.7",
4
+ "version": "2.9.9",
5
5
  "description": "React Hook Form validation resolvers: Yup, Joi, Superstruct, Zod, Vest, Class Validator, io-ts, Nope, computed-types and Typanion",
6
6
  "main": "dist/resolvers.js",
7
7
  "module": "dist/resolvers.module.js",
@@ -114,18 +114,18 @@
114
114
  "scripts": {
115
115
  "prepare": "run-s build:src build && check-export-map && husky install",
116
116
  "build": "npm-run-all --parallel build:*",
117
- "build:src": "microbundle build",
118
- "build:zod": "microbundle --cwd zod --globals '@hookform/resolvers=hookformResolvers'",
119
- "build:yup": "microbundle --cwd yup --globals '@hookform/resolvers=hookformResolvers'",
120
- "build:joi": "microbundle --cwd joi --globals '@hookform/resolvers=hookformResolvers'",
121
- "build:superstruct": "microbundle --cwd superstruct --globals '@hookform/resolvers=hookformResolvers'",
122
- "build:io-ts": "microbundle --cwd io-ts --globals '@hookform/resolvers=hookformResolvers'",
123
- "build:vest": "microbundle --cwd vest --globals '@hookform/resolvers=hookformResolvers'",
124
- "build:class-validator": "microbundle --cwd class-validator --globals '@hookform/resolvers=hookformResolvers'",
125
- "build:nope": "microbundle --cwd nope --globals '@hookform/resolvers=hookformResolvers'",
126
- "build:computed-types": "microbundle --cwd computed-types --globals '@hookform/resolvers=hookformResolvers'",
127
- "build:typanion": "microbundle --cwd typanion --globals '@hookform/resolvers=hookformResolvers'",
128
- "build:ajv": "microbundle --cwd ajv --globals '@hookform/resolvers=hookformResolvers'",
117
+ "build:src": "microbundle build --globals react-hook-form=ReactHookForm",
118
+ "build:zod": "microbundle --cwd zod --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
119
+ "build:yup": "microbundle --cwd yup --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
120
+ "build:joi": "microbundle --cwd joi --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
121
+ "build:superstruct": "microbundle --cwd superstruct --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
122
+ "build:io-ts": "microbundle --cwd io-ts --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
123
+ "build:vest": "microbundle --cwd vest --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
124
+ "build:class-validator": "microbundle --cwd class-validator --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
125
+ "build:nope": "microbundle --cwd nope --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
126
+ "build:computed-types": "microbundle --cwd computed-types --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
127
+ "build:typanion": "microbundle --cwd typanion --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
128
+ "build:ajv": "microbundle --cwd ajv --globals @hookform/resolvers=hookformResolvers,react-hook-form=ReactHookForm",
129
129
  "postbuild": "node ./config/node-13-exports.js",
130
130
  "lint": "eslint . --ext .ts,.js --ignore-path .gitignore",
131
131
  "lint:types": "tsc",
@@ -1,2 +1,2 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hookform/resolvers"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form"],o):o((e||self).hookformResolversYup={},e.hookformResolvers,e.reactHookForm)}(this,function(e,o,t){e.yupResolver=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),function(s,a,i){try{return Promise.resolve(function(t,u){try{var c=(r.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},r,{context:a}))).then(function(e){return i.shouldUseNativeValidation&&o.validateFieldsNatively({},i),{values:n.rawValues?s:e,errors:{}}}))}catch(e){return u(e)}return c&&c.then?c.then(void 0,u):c}(0,function(e){if(!e.inner)throw e;return{values:{},errors:o.toNestError((r=e,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(r.inner||[]).reduce(function(e,o){if(e[o.path]||(e[o.path]={message:o.message,type:o.type}),n){var r=e[o.path].types,s=r&&r[o.type];e[o.path]=t.appendErrors(o.path,n,e,o.type,s?[].concat(s,o.message):o.message)}return e},{})),i)};var r,n}))}catch(e){return Promise.reject(e)}}}});
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hookform/resolvers"),require("react-hook-form")):"function"==typeof define&&define.amd?define(["exports","@hookform/resolvers","react-hook-form"],o):o((e||self).hookformResolversYup={},e.hookformResolvers,e.ReactHookForm)}(this,function(e,o,t){e.yupResolver=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),function(s,a,i){try{return Promise.resolve(function(t,u){try{var c=(r.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},r,{context:a}))).then(function(e){return i.shouldUseNativeValidation&&o.validateFieldsNatively({},i),{values:n.rawValues?s:e,errors:{}}}))}catch(e){return u(e)}return c&&c.then?c.then(void 0,u):c}(0,function(e){if(!e.inner)throw e;return{values:{},errors:o.toNestError((r=e,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(r.inner||[]).reduce(function(e,o){if(e[o.path]||(e[o.path]={message:o.message,type:o.type}),n){var r=e[o.path].types,s=r&&r[o.type];e[o.path]=t.appendErrors(o.path,n,e,o.type,s?[].concat(s,o.message):o.message)}return e},{})),i)};var r,n}))}catch(e){return Promise.reject(e)}}}});
2
2
  //# sourceMappingURL=yup.umd.js.map
@@ -1,2 +1,2 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react-hook-form"),require("@hookform/resolvers")):"function"==typeof define&&define.amd?define(["exports","react-hook-form","@hookform/resolvers"],r):r((e||self).hookformResolversZod={},e.reactHookForm,e.hookformResolvers)}(this,function(e,r,o){var s=function(e,o){for(var s={};e.length;){var n=e[0],t=n.code,i=n.message,a=n.path.join(".");if(!s[a])if("unionErrors"in n){var u=n.unionErrors[0].errors[0];s[a]={message:u.message,type:u.code}}else s[a]={message:i,type:t};if("unionErrors"in n&&n.unionErrors.forEach(function(r){return r.errors.forEach(function(r){return e.push(r)})}),o){var f=s[a].types,c=f&&f[n.code];s[a]=r.appendErrors(a,o,s,t,c?[].concat(c,n.message):n.message)}e.shift()}return s};e.zodResolver=function(e,r,n){return void 0===n&&(n={}),function(t,i,a){try{return Promise.resolve(function(s,i){try{var u=Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](t,r)).then(function(e){return a.shouldUseNativeValidation&&o.validateFieldsNatively({},a),{errors:{},values:n.rawValues?t:e}})}catch(e){return i(e)}return u&&u.then?u.then(void 0,i):u}(0,function(e){return{values:{},errors:e.isEmpty?{}:o.toNestError(s(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)}}))}catch(e){return Promise.reject(e)}}}});
1
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react-hook-form"),require("@hookform/resolvers")):"function"==typeof define&&define.amd?define(["exports","react-hook-form","@hookform/resolvers"],r):r((e||self).hookformResolversZod={},e.ReactHookForm,e.hookformResolvers)}(this,function(e,r,o){var s=function(e,o){for(var s={};e.length;){var n=e[0],t=n.code,i=n.message,a=n.path.join(".");if(!s[a])if("unionErrors"in n){var u=n.unionErrors[0].errors[0];s[a]={message:u.message,type:u.code}}else s[a]={message:i,type:t};if("unionErrors"in n&&n.unionErrors.forEach(function(r){return r.errors.forEach(function(r){return e.push(r)})}),o){var f=s[a].types,c=f&&f[n.code];s[a]=r.appendErrors(a,o,s,t,c?[].concat(c,n.message):n.message)}e.shift()}return s};e.zodResolver=function(e,r,n){return void 0===n&&(n={}),function(t,i,a){try{return Promise.resolve(function(s,i){try{var u=Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](t,r)).then(function(e){return a.shouldUseNativeValidation&&o.validateFieldsNatively({},a),{errors:{},values:n.rawValues?t:e}})}catch(e){return i(e)}return u&&u.then?u.then(void 0,i):u}(0,function(e){return{values:{},errors:e.isEmpty?{}:o.toNestError(s(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)}}))}catch(e){return Promise.reject(e)}}}});
2
2
  //# sourceMappingURL=zod.umd.js.map