@anov/cic-standard-sdk 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cic-sdk.cjs.js +6 -6
- package/dist/cic-sdk.es.js +2657 -2555
- package/dist/cic-sdk.umd.js +6 -6
- package/dist/sdk/CICSDK.d.ts +10 -10
- package/dist/sdk/generators/ajv.d.ts +7 -0
- package/dist/sdk/generators/common.d.ts +13 -9
- package/dist/sdk/generators/dependency.d.ts +3 -3
- package/dist/sdk/generators/meta.d.ts +5 -5
- package/dist/sdk/generators/registry.d.ts +3 -3
- package/dist/sdk/generators/variables.d.ts +3 -3
- package/package.json +1 -1
package/dist/cic-sdk.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(Ee,Se){typeof exports=="object"&&typeof module<"u"?Se(exports):typeof define=="function"&&define.amd?define(["exports"],Se):(Ee=typeof globalThis<"u"?globalThis:Ee||self,Se(Ee.CICSDK={}))})(this,(function(Ee){"use strict";function Se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var De={exports:{}},Mt={},he={},$e={},At={},Vt={},zt={},tr;function Me(){return tr||(tr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends t{constructor(r){if(super(),!e.IDENTIFIER.test(r))throw new Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=a;class n extends t{constructor(r){super(),this._items=typeof r=="string"?[r]:r}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const r=this._items[0];return r===""||r==='""'}get str(){var r;return(r=this._str)!==null&&r!==void 0?r:this._str=this._items.reduce((o,h)=>`${o}${h}`,"")}get names(){var r;return(r=this._names)!==null&&r!==void 0?r:this._names=this._items.reduce((o,h)=>(h instanceof a&&(o[h.str]=(o[h.str]||0)+1),o),{})}}e._Code=n,e.nil=new n("");function y(d,...r){const o=[d[0]];let h=0;for(;h<r.length;)u(o,r[h]),o.push(d[++h]);return new n(o)}e._=y;const i=new n("+");function p(d,...r){const o=[g(d[0])];let h=0;for(;h<r.length;)o.push(i),u(o,r[h]),o.push(i,g(d[++h]));return m(o),new n(o)}e.str=p;function u(d,r){r instanceof n?d.push(...r._items):r instanceof a?d.push(r):d.push(S(r))}e.addCodeArg=u;function m(d){let r=1;for(;r<d.length-1;){if(d[r]===i){const o=b(d[r-1],d[r+1]);if(o!==void 0){d.splice(r-1,3,o);continue}d[r++]="+"}r++}}function b(d,r){if(r==='""')return d;if(d==='""')return r;if(typeof d=="string")return r instanceof a||d[d.length-1]!=='"'?void 0:typeof r!="string"?`${d.slice(0,-1)}${r}"`:r[0]==='"'?d.slice(0,-1)+r.slice(1):void 0;if(typeof r=="string"&&r[0]==='"'&&!(d instanceof a))return`"${d}${r.slice(1)}`}function _(d,r){return r.emptyStr()?d:d.emptyStr()?r:p`${d}${r}`}e.strConcat=_;function S(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:g(Array.isArray(d)?d.join(","):d)}function $(d){return new n(g(d))}e.stringify=$;function g(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function v(d){return typeof d=="string"&&e.IDENTIFIER.test(d)?new n(`.${d}`):y`[${d}]`}e.getProperty=v;function w(d){if(typeof d=="string"&&e.IDENTIFIER.test(d))return new n(`${d}`);throw new Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}e.getEsmExportName=w;function c(d){return new n(d.toString())}e.regexpCode=c})(zt)),zt}var Ft={},rr;function nr(){return rr||(rr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Me();class a extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`),this.value=b.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class y{constructor({prefixes:b,parent:_}={}){this._names={},this._prefixes=b,this._parent=_}toName(b){return b instanceof t.Name?b:this.name(b)}name(b){return new t.Name(this._newName(b))}_newName(b){const _=this._names[b]||this._nameGroup(b);return`${b}${_.index++}`}_nameGroup(b){var _,S;if(!((S=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||S===void 0)&&S.has(b)||this._prefixes&&!this._prefixes.has(b))throw new Error(`CodeGen: prefix "${b}" is not allowed in this scope`);return this._names[b]={prefix:b,index:0}}}e.Scope=y;class i extends t.Name{constructor(b,_){super(_),this.prefix=b}setValue(b,{property:_,itemIndex:S}){this.value=b,this.scopePath=(0,t._)`.${new t.Name(_)}[${S}]`}}e.ValueScopeName=i;const p=(0,t._)`\n`;class u extends y{constructor(b){super(b),this._values={},this._scope=b.scope,this.opts={...b,_n:b.lines?p:t.nil}}get(){return this._scope}name(b){return new i(b,this._newName(b))}value(b,_){var S;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(b),{prefix:g}=$,v=(S=_.key)!==null&&S!==void 0?S:_.ref;let w=this._values[g];if(w){const r=w.get(v);if(r)return r}else w=this._values[g]=new Map;w.set(v,$);const c=this._scope[g]||(this._scope[g]=[]),d=c.length;return c[d]=_.ref,$.setValue(_,{property:g,itemIndex:d}),$}getValue(b,_){const S=this._values[b];if(S)return S.get(_)}scopeRefs(b,_=this._values){return this._reduceValues(_,S=>{if(S.scopePath===void 0)throw new Error(`CodeGen: name "${S}" has no value`);return(0,t._)`${b}${S.scopePath}`})}scopeCode(b=this._values,_,S){return this._reduceValues(b,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},_,S)}_reduceValues(b,_,S={},$){let g=t.nil;for(const v in b){const w=b[v];if(!w)continue;const c=S[v]=S[v]||new Map;w.forEach(d=>{if(c.has(d))return;c.set(d,n.Started);let r=_(d);if(r){const o=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${o} ${d} = ${r};${this.opts._n}`}else if(r=$?.(d))g=(0,t._)`${g}${r}${this.opts._n}`;else throw new a(d);c.set(d,n.Completed)})}return g}}e.ValueScope=u})(Ft)),Ft}var ir;function G(){return ir||(ir=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Me(),a=nr();var n=Me();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var y=nr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return y.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return y.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return y.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return y.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(l,E){return this}}class p extends i{constructor(l,E,O){super(),this.varKind=l,this.name=E,this.rhs=O}render({es5:l,_n:E}){const O=l?a.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${O} ${this.name}${U};`+E}optimizeNames(l,E){if(l[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,l,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(l,E,O){super(),this.lhs=l,this.rhs=E,this.sideEffects=O}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,E){if(!(this.lhs instanceof t.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,l,E),this}get names(){const l=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(l,this.rhs)}}class m extends u{constructor(l,E,O,U){super(l,O,U),this.op=E}render({_n:l}){return`${this.lhs} ${this.op}= ${this.rhs};`+l}}class b extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`${this.label}:`+l}}class _ extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`break${this.label?` ${this.label}`:""};`+l}}class S extends i{constructor(l){super(),this.error=l}render({_n:l}){return`throw ${this.error};`+l}get names(){return this.error.names}}class $ extends i{constructor(l){super(),this.code=l}render({_n:l}){return`${this.code};`+l}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(l,E){return this.code=L(this.code,l,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends i{constructor(l=[]){super(),this.nodes=l}render(l){return this.nodes.reduce((E,O)=>E+O.render(l),"")}optimizeNodes(){const{nodes:l}=this;let E=l.length;for(;E--;){const O=l[E].optimizeNodes();Array.isArray(O)?l.splice(E,1,...O):O?l[E]=O:l.splice(E,1)}return l.length>0?this:void 0}optimizeNames(l,E){const{nodes:O}=this;let U=O.length;for(;U--;){const H=O[U];H.optimizeNames(l,E)||(Q(l,H.names),O.splice(U,1))}return O.length>0?this:void 0}get names(){return this.nodes.reduce((l,E)=>V(l,E.names),{})}}class v extends g{render(l){return"{"+l._n+super.render(l)+"}"+l._n}}class w extends g{}class c extends v{}c.kind="else";class d extends v{constructor(l,E){super(E),this.condition=l}render(l){let E=`if(${this.condition})`+super.render(l);return this.else&&(E+="else "+this.else.render(l)),E}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let E=this.else;if(E){const O=E.optimizeNodes();E=this.else=Array.isArray(O)?new c(O):O}if(E)return l===!1?E instanceof d?E:E.nodes:this.nodes.length?this:new d(ie(l),E instanceof d?[E]:E.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,E){var O;if(this.else=(O=this.else)===null||O===void 0?void 0:O.optimizeNames(l,E),!!(super.optimizeNames(l,E)||this.else))return this.condition=L(this.condition,l,E),this}get names(){const l=super.names;return F(l,this.condition),this.else&&V(l,this.else.names),l}}d.kind="if";class r extends v{}r.kind="for";class o extends r{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iteration=L(this.iteration,l,E),this}get names(){return V(super.names,this.iteration.names)}}class h extends r{constructor(l,E,O,U){super(),this.varKind=l,this.name=E,this.from=O,this.to=U}render(l){const E=l.es5?a.varKinds.var:this.varKind,{name:O,from:U,to:H}=this;return`for(${E} ${O}=${U}; ${O}<${H}; ${O}++)`+super.render(l)}get names(){const l=F(super.names,this.from);return F(l,this.to)}}class s extends r{constructor(l,E,O,U){super(),this.loop=l,this.varKind=E,this.name=O,this.iterable=U}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iterable=L(this.iterable,l,E),this}get names(){return V(super.names,this.iterable.names)}}class f extends v{constructor(l,E,O){super(),this.name=l,this.args=E,this.async=O}render(l){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(l)}}f.kind="func";class P extends g{render(l){return"return "+super.render(l)}}P.kind="return";class N extends v{render(l){let E="try"+super.render(l);return this.catch&&(E+=this.catch.render(l)),this.finally&&(E+=this.finally.render(l)),E}optimizeNodes(){var l,E;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(l,E){var O,U;return super.optimizeNames(l,E),(O=this.catch)===null||O===void 0||O.optimizeNames(l,E),(U=this.finally)===null||U===void 0||U.optimizeNames(l,E),this}get names(){const l=super.names;return this.catch&&V(l,this.catch.names),this.finally&&V(l,this.finally.names),l}}class D extends v{constructor(l){super(),this.error=l}render(l){return`catch(${this.error})`+super.render(l)}}D.kind="catch";class z extends v{render(l){return"finally"+super.render(l)}}z.kind="finally";class q{constructor(l,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
|
|
2
|
-
`:""},this._extScope=l,this._scope=new a.Scope({parent:l}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,E){const O=this._extScope.value(l,E);return(this._values[O.prefix]||(this._values[O.prefix]=new Set)).add(O),O}getScopeValue(l,E){return this._extScope.getValue(l,E)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,E,O,U){const H=this._scope.toName(E);return O!==void 0&&U&&(this._constants[H.str]=O),this._leafNode(new p(l,H,O)),H}const(l,E,O){return this._def(a.varKinds.const,l,E,O)}let(l,E,O){return this._def(a.varKinds.let,l,E,O)}var(l,E,O){return this._def(a.varKinds.var,l,E,O)}assign(l,E,O){return this._leafNode(new u(l,E,O))}add(l,E){return this._leafNode(new m(l,e.operators.ADD,E))}code(l){return typeof l=="function"?l():l!==t.nil&&this._leafNode(new $(l)),this}object(...l){const E=["{"];for(const[O,U]of l)E.length>1&&E.push(","),E.push(O),(O!==U||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,U));return E.push("}"),new t._Code(E)}if(l,E,O){if(this._blockNode(new d(l)),E&&O)this.code(E).else().code(O).endIf();else if(E)this.code(E).endIf();else if(O)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new d(l))}else(){return this._elseNode(new c)}endIf(){return this._endBlockNode(d,c)}_for(l,E){return this._blockNode(l),E&&this.code(E).endFor(),this}for(l,E){return this._for(new o(l),E)}forRange(l,E,O,U,H=this.opts.es5?a.varKinds.var:a.varKinds.let){const Z=this._scope.toName(l);return this._for(new h(H,Z,E,O),()=>U(Z))}forOf(l,E,O,U=a.varKinds.const){const H=this._scope.toName(l);if(this.opts.es5){const Z=E instanceof t.Name?E:this.var("_arr",E);return this.forRange("_i",0,(0,t._)`${Z}.length`,B=>{this.var(H,(0,t._)`${Z}[${B}]`),O(H)})}return this._for(new s("of",U,H,E),()=>O(H))}forIn(l,E,O,U=this.opts.es5?a.varKinds.var:a.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,t._)`Object.keys(${E})`,O);const H=this._scope.toName(l);return this._for(new s("in",U,H,E),()=>O(H))}endFor(){return this._endBlockNode(r)}label(l){return this._leafNode(new b(l))}break(l){return this._leafNode(new _(l))}return(l){const E=new P;if(this._blockNode(E),this.code(l),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(l,E,O){if(!E&&!O)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new N;if(this._blockNode(U),this.code(l),E){const H=this.name("e");this._currNode=U.catch=new D(H),E(H)}return O&&(this._currNode=U.finally=new z,this.code(O)),this._endBlockNode(D,z)}throw(l){return this._leafNode(new S(l))}block(l,E){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(E),this}endBlock(l){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const O=this._nodes.length-E;if(O<0||l!==void 0&&O!==l)throw new Error(`CodeGen: wrong number of nodes: ${O} vs ${l} expected`);return this._nodes.length=E,this}func(l,E=t.nil,O,U){return this._blockNode(new f(l,E,O)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(f)}optimize(l=1){for(;l-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(l){return this._currNode.nodes.push(l),this}_blockNode(l){this._currNode.nodes.push(l),this._nodes.push(l)}_endBlockNode(l,E){const O=this._currNode;if(O instanceof l||E&&O instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${l.kind}/${E.kind}`:l.kind}"`)}_elseNode(l){const E=this._currNode;if(!(E instanceof d))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const E=this._nodes;E[E.length-1]=l}}e.CodeGen=q;function V(R,l){for(const E in l)R[E]=(R[E]||0)+(l[E]||0);return R}function F(R,l){return l instanceof t._CodeOrName?V(R,l.names):R}function L(R,l,E){if(R instanceof t.Name)return O(R);if(!U(R))return R;return new t._Code(R._items.reduce((H,Z)=>(Z instanceof t.Name&&(Z=O(Z)),Z instanceof t._Code?H.push(...Z._items):H.push(Z),H),[]));function O(H){const Z=E[H.str];return Z===void 0||l[H.str]!==1?H:(delete l[H.str],Z)}function U(H){return H instanceof t._Code&&H._items.some(Z=>Z instanceof t.Name&&l[Z.str]===1&&E[Z.str]!==void 0)}}function Q(R,l){for(const E in l)R[E]=(R[E]||0)-(l[E]||0)}function ie(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,t._)`!${T(R)}`}e.not=ie;const se=k(e.operators.AND);function x(...R){return R.reduce(se)}e.and=x;const pe=k(e.operators.OR);function M(...R){return R.reduce(pe)}e.or=M;function k(R){return(l,E)=>l===t.nil?E:E===t.nil?l:(0,t._)`${T(l)} ${R} ${T(E)}`}function T(R){return R instanceof t.Name?R:(0,t._)`(${R})`}})(Vt)),Vt}var J={},sr;function Y(){if(sr)return J;sr=1,Object.defineProperty(J,"__esModule",{value:!0}),J.checkStrictMode=J.getErrorPath=J.Type=J.useFunc=J.setEvaluated=J.evaluatedPropsToName=J.mergeEvaluated=J.eachItem=J.unescapeJsonPointer=J.escapeJsonPointer=J.escapeFragment=J.unescapeFragment=J.schemaRefOrVal=J.schemaHasRulesButRef=J.schemaHasRules=J.checkUnknownRules=J.alwaysValidSchema=J.toHash=void 0;const e=G(),t=Me();function a(s){const f={};for(const P of s)f[P]=!0;return f}J.toHash=a;function n(s,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(y(s,f),!i(f,s.self.RULES.all))}J.alwaysValidSchema=n;function y(s,f=s.schema){const{opts:P,self:N}=s;if(!P.strictSchema||typeof f=="boolean")return;const D=N.RULES.keywords;for(const z in f)D[z]||h(s,`unknown keyword: "${z}"`)}J.checkUnknownRules=y;function i(s,f){if(typeof s=="boolean")return!s;for(const P in s)if(f[P])return!0;return!1}J.schemaHasRules=i;function p(s,f){if(typeof s=="boolean")return!s;for(const P in s)if(P!=="$ref"&&f.all[P])return!0;return!1}J.schemaHasRulesButRef=p;function u({topSchemaRef:s,schemaPath:f},P,N,D){if(!D){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${s}${f}${(0,e.getProperty)(N)}`}J.schemaRefOrVal=u;function m(s){return S(decodeURIComponent(s))}J.unescapeFragment=m;function b(s){return encodeURIComponent(_(s))}J.escapeFragment=b;function _(s){return typeof s=="number"?`${s}`:s.replace(/~/g,"~0").replace(/\//g,"~1")}J.escapeJsonPointer=_;function S(s){return s.replace(/~1/g,"/").replace(/~0/g,"~")}J.unescapeJsonPointer=S;function $(s,f){if(Array.isArray(s))for(const P of s)f(P);else f(s)}J.eachItem=$;function g({mergeNames:s,mergeToName:f,mergeValues:P,resultToName:N}){return(D,z,q,V)=>{const F=q===void 0?z:q instanceof e.Name?(z instanceof e.Name?s(D,z,q):f(D,z,q),q):z instanceof e.Name?(f(D,q,z),z):P(z,q);return V===e.Name&&!(F instanceof e.Name)?N(D,F):F}}J.mergeEvaluated={props:g({mergeNames:(s,f,P)=>s.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>{s.if((0,e._)`${f} === true`,()=>s.assign(P,!0),()=>s.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${f})`))}),mergeToName:(s,f,P)=>s.if((0,e._)`${P} !== true`,()=>{f===!0?s.assign(P,!0):(s.assign(P,(0,e._)`${P} || {}`),w(s,P,f))}),mergeValues:(s,f)=>s===!0?!0:{...s,...f},resultToName:v}),items:g({mergeNames:(s,f,P)=>s.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>s.assign(P,(0,e._)`${f} === true ? true : ${P} > ${f} ? ${P} : ${f}`)),mergeToName:(s,f,P)=>s.if((0,e._)`${P} !== true`,()=>s.assign(P,f===!0?!0:(0,e._)`${P} > ${f} ? ${P} : ${f}`)),mergeValues:(s,f)=>s===!0?!0:Math.max(s,f),resultToName:(s,f)=>s.var("items",f)})};function v(s,f){if(f===!0)return s.var("props",!0);const P=s.var("props",(0,e._)`{}`);return f!==void 0&&w(s,P,f),P}J.evaluatedPropsToName=v;function w(s,f,P){Object.keys(P).forEach(N=>s.assign((0,e._)`${f}${(0,e.getProperty)(N)}`,!0))}J.setEvaluated=w;const c={};function d(s,f){return s.scopeValue("func",{ref:f,code:c[f.code]||(c[f.code]=new t._Code(f.code))})}J.useFunc=d;var r;(function(s){s[s.Num=0]="Num",s[s.Str=1]="Str"})(r||(J.Type=r={}));function o(s,f,P){if(s instanceof e.Name){const N=f===r.Num;return P?N?(0,e._)`"[" + ${s} + "]"`:(0,e._)`"['" + ${s} + "']"`:N?(0,e._)`"/" + ${s}`:(0,e._)`"/" + ${s}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(s).toString():"/"+_(s)}J.getErrorPath=o;function h(s,f,P=s.opts.strictSchema){if(P){if(f=`strict mode: ${f}`,P===!0)throw new Error(f);s.self.logger.warn(f)}}return J.checkStrictMode=h,J}var Ae={},or;function ve(){if(or)return Ae;or=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=G(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ae.default=t,Ae}var ar;function Ve(){return ar||(ar=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=G(),a=Y(),n=ve();e.keywordError={message:({keyword:c})=>(0,t.str)`must pass "${c}" keyword validation`},e.keyword$DataError={message:({keyword:c,schemaType:d})=>d?(0,t.str)`"${c}" keyword must be ${d} ($data)`:(0,t.str)`"${c}" keyword is invalid ($data)`};function y(c,d=e.keywordError,r,o){const{it:h}=c,{gen:s,compositeRule:f,allErrors:P}=h,N=S(c,d,r);o??(f||P)?m(s,N):b(h,(0,t._)`[${N}]`)}e.reportError=y;function i(c,d=e.keywordError,r){const{it:o}=c,{gen:h,compositeRule:s,allErrors:f}=o,P=S(c,d,r);m(h,P),s||f||b(o,n.default.vErrors)}e.reportExtraError=i;function p(c,d){c.assign(n.default.errors,d),c.if((0,t._)`${n.default.vErrors} !== null`,()=>c.if(d,()=>c.assign((0,t._)`${n.default.vErrors}.length`,d),()=>c.assign(n.default.vErrors,null)))}e.resetErrorsCount=p;function u({gen:c,keyword:d,schemaValue:r,data:o,errsCount:h,it:s}){if(h===void 0)throw new Error("ajv implementation error");const f=c.name("err");c.forRange("i",h,n.default.errors,P=>{c.const(f,(0,t._)`${n.default.vErrors}[${P}]`),c.if((0,t._)`${f}.instancePath === undefined`,()=>c.assign((0,t._)`${f}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath))),c.assign((0,t._)`${f}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${d}`),s.opts.verbose&&(c.assign((0,t._)`${f}.schema`,r),c.assign((0,t._)`${f}.data`,o))})}e.extendErrors=u;function m(c,d){const r=c.const("err",d);c.if((0,t._)`${n.default.vErrors} === null`,()=>c.assign(n.default.vErrors,(0,t._)`[${r}]`),(0,t._)`${n.default.vErrors}.push(${r})`),c.code((0,t._)`${n.default.errors}++`)}function b(c,d){const{gen:r,validateName:o,schemaEnv:h}=c;h.$async?r.throw((0,t._)`new ${c.ValidationError}(${d})`):(r.assign((0,t._)`${o}.errors`,d),r.return(!1))}const _={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function S(c,d,r){const{createErrors:o}=c.it;return o===!1?(0,t._)`{}`:$(c,d,r)}function $(c,d,r={}){const{gen:o,it:h}=c,s=[g(h,r),v(c,r)];return w(c,d,s),o.object(...s)}function g({errorPath:c},{instancePath:d}){const r=d?(0,t.str)`${c}${(0,a.getErrorPath)(d,a.Type.Str)}`:c;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,r)]}function v({keyword:c,it:{errSchemaPath:d}},{schemaPath:r,parentSchema:o}){let h=o?d:(0,t.str)`${d}/${c}`;return r&&(h=(0,t.str)`${h}${(0,a.getErrorPath)(r,a.Type.Str)}`),[_.schemaPath,h]}function w(c,{params:d,message:r},o){const{keyword:h,data:s,schemaValue:f,it:P}=c,{opts:N,propertyName:D,topSchemaRef:z,schemaPath:q}=P;o.push([_.keyword,h],[_.params,typeof d=="function"?d(c):d||(0,t._)`{}`]),N.messages&&o.push([_.message,typeof r=="function"?r(c):r]),N.verbose&&o.push([_.schema,f],[_.parentSchema,(0,t._)`${z}${q}`],[n.default.data,s]),D&&o.push([_.propertyName,D])}})(At)),At}var cr;function Ln(){if(cr)return $e;cr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.boolOrEmptySchema=$e.topBoolOrEmptySchema=void 0;const e=Ve(),t=G(),a=ve(),n={message:"boolean schema is false"};function y(u){const{gen:m,schema:b,validateName:_}=u;b===!1?p(u,!1):typeof b=="object"&&b.$async===!0?m.return(a.default.data):(m.assign((0,t._)`${_}.errors`,null),m.return(!0))}$e.topBoolOrEmptySchema=y;function i(u,m){const{gen:b,schema:_}=u;_===!1?(b.var(m,!1),p(u)):b.var(m,!0)}$e.boolOrEmptySchema=i;function p(u,m){const{gen:b,data:_}=u,S={gen:b,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(S,n,void 0,m)}return $e}var ee={},be={},dr;function ur(){if(dr)return be;dr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.getRules=be.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function a(y){return typeof y=="string"&&t.has(y)}be.isJSONType=a;function n(){const y={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...y,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},y.number,y.string,y.array,y.object],post:{rules:[]},all:{},keywords:{}}}return be.getRules=n,be}var ye={},lr;function fr(){if(lr)return ye;lr=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.shouldUseRule=ye.shouldUseGroup=ye.schemaHasRulesForType=void 0;function e({schema:n,self:y},i){const p=y.RULES.types[i];return p&&p!==!0&&t(n,p)}ye.schemaHasRulesForType=e;function t(n,y){return y.rules.some(i=>a(n,i))}ye.shouldUseGroup=t;function a(n,y){var i;return n[y.keyword]!==void 0||((i=y.definition.implements)===null||i===void 0?void 0:i.some(p=>n[p]!==void 0))}return ye.shouldUseRule=a,ye}var pr;function ze(){if(pr)return ee;pr=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.reportTypeError=ee.checkDataTypes=ee.checkDataType=ee.coerceAndCheckDataType=ee.getJSONTypes=ee.getSchemaTypes=ee.DataType=void 0;const e=ur(),t=fr(),a=Ve(),n=G(),y=Y();var i;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(i||(ee.DataType=i={}));function p(r){const o=u(r.type);if(o.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!o.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&o.push("null")}return o}ee.getSchemaTypes=p;function u(r){const o=Array.isArray(r)?r:r?[r]:[];if(o.every(e.isJSONType))return o;throw new Error("type must be JSONType or JSONType[]: "+o.join(","))}ee.getJSONTypes=u;function m(r,o){const{gen:h,data:s,opts:f}=r,P=_(o,f.coerceTypes),N=o.length>0&&!(P.length===0&&o.length===1&&(0,t.schemaHasRulesForType)(r,o[0]));if(N){const D=v(o,s,f.strictNumbers,i.Wrong);h.if(D,()=>{P.length?S(r,o,P):c(r)})}return N}ee.coerceAndCheckDataType=m;const b=new Set(["string","number","integer","boolean","null"]);function _(r,o){return o?r.filter(h=>b.has(h)||o==="array"&&h==="array"):[]}function S(r,o,h){const{gen:s,data:f,opts:P}=r,N=s.let("dataType",(0,n._)`typeof ${f}`),D=s.let("coerced",(0,n._)`undefined`);P.coerceTypes==="array"&&s.if((0,n._)`${N} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>s.assign(f,(0,n._)`${f}[0]`).assign(N,(0,n._)`typeof ${f}`).if(v(o,f,P.strictNumbers),()=>s.assign(D,f))),s.if((0,n._)`${D} !== undefined`);for(const q of h)(b.has(q)||q==="array"&&P.coerceTypes==="array")&&z(q);s.else(),c(r),s.endIf(),s.if((0,n._)`${D} !== undefined`,()=>{s.assign(f,D),$(r,D)});function z(q){switch(q){case"string":s.elseIf((0,n._)`${N} == "number" || ${N} == "boolean"`).assign(D,(0,n._)`"" + ${f}`).elseIf((0,n._)`${f} === null`).assign(D,(0,n._)`""`);return;case"number":s.elseIf((0,n._)`${N} == "boolean" || ${f} === null
|
|
3
|
-
|| (${
|
|
4
|
-
|| (${
|
|
5
|
-
|| ${N} === "boolean" || ${f} === null`).assign(D,(0,n._)`[${f}]`)}}}function $({gen:r,parentData:o,parentDataProperty:h},s){r.if((0,n._)`${o} !== undefined`,()=>r.assign((0,n._)`${o}[${h}]`,s))}function g(r,o,h,s=i.Correct){const f=s===i.Correct?n.operators.EQ:n.operators.NEQ;let P;switch(r){case"null":return(0,n._)`${o} ${f} null`;case"array":P=(0,n._)`Array.isArray(${o})`;break;case"object":P=(0,n._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":P=N((0,n._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":P=N();break;default:return(0,n._)`typeof ${o} ${f} ${r}`}return s===i.Correct?P:(0,n.not)(P);function N(D=n.nil){return(0,n.and)((0,n._)`typeof ${o} == "number"`,D,h?(0,n._)`isFinite(${o})`:n.nil)}}ee.checkDataType=g;function v(r,o,h,s){if(r.length===1)return g(r[0],o,h,s);let f;const P=(0,y.toHash)(r);if(P.array&&P.object){const N=(0,n._)`typeof ${o} != "object"`;f=P.null?N:(0,n._)`!${o} || ${N}`,delete P.null,delete P.array,delete P.object}else f=n.nil;P.number&&delete P.integer;for(const N in P)f=(0,n.and)(f,g(N,o,h,s));return f}ee.checkDataTypes=v;const w={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:o})=>typeof r=="string"?(0,n._)`{type: ${r}}`:(0,n._)`{type: ${o}}`};function c(r){const o=d(r);(0,a.reportError)(o,w)}ee.reportTypeError=c;function d(r){const{gen:o,data:h,schema:s}=r,f=(0,y.schemaRefOrVal)(r,s,"type");return{gen:o,keyword:"type",data:h,schema:s.type,schemaCode:f,schemaValue:f,parentSchema:s,params:{},it:r}}return ee}var Re={},mr;function Un(){if(mr)return Re;mr=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.assignDefaults=void 0;const e=G(),t=Y();function a(y,i){const{properties:p,items:u}=y.schema;if(i==="object"&&p)for(const m in p)n(y,m,p[m].default);else i==="array"&&Array.isArray(u)&&u.forEach((m,b)=>n(y,b,m.default))}Re.assignDefaults=a;function n(y,i,p){const{gen:u,compositeRule:m,data:b,opts:_}=y;if(p===void 0)return;const S=(0,e._)`${b}${(0,e.getProperty)(i)}`;if(m){(0,t.checkStrictMode)(y,`default is ignored for: ${S}`);return}let $=(0,e._)`${S} === undefined`;_.useDefaults==="empty"&&($=(0,e._)`${$} || ${S} === null || ${S} === ""`),u.if($,(0,e._)`${S} = ${(0,e.stringify)(p)}`)}return Re}var le={},X={},hr;function fe(){if(hr)return X;hr=1,Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const e=G(),t=Y(),a=ve(),n=Y();function y(r,o){const{gen:h,data:s,it:f}=r;h.if(_(h,s,o,f.opts.ownProperties),()=>{r.setParams({missingProperty:(0,e._)`${o}`},!0),r.error()})}X.checkReportMissingProp=y;function i({gen:r,data:o,it:{opts:h}},s,f){return(0,e.or)(...s.map(P=>(0,e.and)(_(r,o,P,h.ownProperties),(0,e._)`${f} = ${P}`)))}X.checkMissingProp=i;function p(r,o){r.setParams({missingProperty:o},!0),r.error()}X.reportMissingProp=p;function u(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=u;function m(r,o,h){return(0,e._)`${u(r)}.call(${o}, ${h})`}X.isOwnProperty=m;function b(r,o,h,s){const f=(0,e._)`${o}${(0,e.getProperty)(h)} !== undefined`;return s?(0,e._)`${f} && ${m(r,o,h)}`:f}X.propertyInData=b;function _(r,o,h,s){const f=(0,e._)`${o}${(0,e.getProperty)(h)} === undefined`;return s?(0,e.or)(f,(0,e.not)(m(r,o,h))):f}X.noPropertyInData=_;function S(r){return r?Object.keys(r).filter(o=>o!=="__proto__"):[]}X.allSchemaProperties=S;function $(r,o){return S(o).filter(h=>!(0,t.alwaysValidSchema)(r,o[h]))}X.schemaProperties=$;function g({schemaCode:r,data:o,it:{gen:h,topSchemaRef:s,schemaPath:f,errorPath:P},it:N},D,z,q){const V=q?(0,e._)`${r}, ${o}, ${s}${f}`:o,F=[[a.default.instancePath,(0,e.strConcat)(a.default.instancePath,P)],[a.default.parentData,N.parentData],[a.default.parentDataProperty,N.parentDataProperty],[a.default.rootData,a.default.rootData]];N.opts.dynamicRef&&F.push([a.default.dynamicAnchors,a.default.dynamicAnchors]);const L=(0,e._)`${V}, ${h.object(...F)}`;return z!==e.nil?(0,e._)`${D}.call(${z}, ${L})`:(0,e._)`${D}(${L})`}X.callValidateCode=g;const v=(0,e._)`new RegExp`;function w({gen:r,it:{opts:o}},h){const s=o.unicodeRegExp?"u":"",{regExp:f}=o.code,P=f(h,s);return r.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${f.code==="new RegExp"?v:(0,n.useFunc)(r,f)}(${h}, ${s})`})}X.usePattern=w;function c(r){const{gen:o,data:h,keyword:s,it:f}=r,P=o.name("valid");if(f.allErrors){const D=o.let("valid",!0);return N(()=>o.assign(D,!1)),D}return o.var(P,!0),N(()=>o.break()),P;function N(D){const z=o.const("len",(0,e._)`${h}.length`);o.forRange("i",0,z,q=>{r.subschema({keyword:s,dataProp:q,dataPropType:t.Type.Num},P),o.if((0,e.not)(P),D)})}}X.validateArray=c;function d(r){const{gen:o,schema:h,keyword:s,it:f}=r;if(!Array.isArray(h))throw new Error("ajv implementation error");if(h.some(z=>(0,t.alwaysValidSchema)(f,z))&&!f.opts.unevaluated)return;const N=o.let("valid",!1),D=o.name("_valid");o.block(()=>h.forEach((z,q)=>{const V=r.subschema({keyword:s,schemaProp:q,compositeRule:!0},D);o.assign(N,(0,e._)`${N} || ${D}`),r.mergeValidEvaluated(V,D)||o.if((0,e.not)(N))})),r.result(N,()=>r.reset(),()=>r.error(!0))}return X.validateUnion=d,X}var yr;function Kn(){if(yr)return le;yr=1,Object.defineProperty(le,"__esModule",{value:!0}),le.validateKeywordUsage=le.validSchemaType=le.funcKeywordCode=le.macroKeywordCode=void 0;const e=G(),t=ve(),a=fe(),n=Ve();function y($,g){const{gen:v,keyword:w,schema:c,parentSchema:d,it:r}=$,o=g.macro.call(r.self,c,d,r),h=b(v,w,o);r.opts.validateSchema!==!1&&r.self.validateSchema(o,!0);const s=v.name("valid");$.subschema({schema:o,schemaPath:e.nil,errSchemaPath:`${r.errSchemaPath}/${w}`,topSchemaRef:h,compositeRule:!0},s),$.pass(s,()=>$.error(!0))}le.macroKeywordCode=y;function i($,g){var v;const{gen:w,keyword:c,schema:d,parentSchema:r,$data:o,it:h}=$;m(h,g);const s=!o&&g.compile?g.compile.call(h.self,d,r,h):g.validate,f=b(w,c,s),P=w.let("valid");$.block$data(P,N),$.ok((v=g.valid)!==null&&v!==void 0?v:P);function N(){if(g.errors===!1)q(),g.modifying&&p($),V(()=>$.error());else{const F=g.async?D():z();g.modifying&&p($),V(()=>u($,F))}}function D(){const F=w.let("ruleErrs",null);return w.try(()=>q((0,e._)`await `),L=>w.assign(P,!1).if((0,e._)`${L} instanceof ${h.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${f}.errors`;return w.assign(F,null),q(e.nil),F}function q(F=g.async?(0,e._)`await `:e.nil){const L=h.opts.passContext?t.default.this:t.default.self,Q=!("compile"in g&&!o||g.schema===!1);w.assign(P,(0,e._)`${F}${(0,a.callValidateCode)($,f,L,Q)}`,g.modifying)}function V(F){var L;w.if((0,e.not)((L=g.valid)!==null&&L!==void 0?L:P),F)}}le.funcKeywordCode=i;function p($){const{gen:g,data:v,it:w}=$;g.if(w.parentData,()=>g.assign(v,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function u($,g){const{gen:v}=$;v.if((0,e._)`Array.isArray(${g})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)($)},()=>$.error())}function m({schemaEnv:$},g){if(g.async&&!$.$async)throw new Error("async keyword in sync schema")}function b($,g,v){if(v===void 0)throw new Error(`keyword "${g}" failed to compile`);return $.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function _($,g,v=!1){return!g.length||g.some(w=>w==="array"?Array.isArray($):w==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==w||v&&typeof $>"u")}le.validSchemaType=_;function S({schema:$,opts:g,self:v,errSchemaPath:w},c,d){if(Array.isArray(c.keyword)?!c.keyword.includes(d):c.keyword!==d)throw new Error("ajv implementation error");const r=c.dependencies;if(r?.some(o=>!Object.prototype.hasOwnProperty.call($,o)))throw new Error(`parent schema must have dependencies of ${d}: ${r.join(",")}`);if(c.validateSchema&&!c.validateSchema($[d])){const h=`keyword "${d}" value is invalid at path "${w}": `+v.errorsText(c.validateSchema.errors);if(g.validateSchema==="log")v.logger.error(h);else throw new Error(h)}}return le.validateKeywordUsage=S,le}var ge={},gr;function Hn(){if(gr)return ge;gr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.extendSubschemaMode=ge.extendSubschemaData=ge.getSubschema=void 0;const e=G(),t=Y();function a(i,{keyword:p,schemaProp:u,schema:m,schemaPath:b,errSchemaPath:_,topSchemaRef:S}){if(p!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(p!==void 0){const $=i.schema[p];return u===void 0?{schema:$,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(p)}`,errSchemaPath:`${i.errSchemaPath}/${p}`}:{schema:$[u],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(p)}${(0,e.getProperty)(u)}`,errSchemaPath:`${i.errSchemaPath}/${p}/${(0,t.escapeFragment)(u)}`}}if(m!==void 0){if(b===void 0||_===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:b,topSchemaRef:S,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}ge.getSubschema=a;function n(i,p,{dataProp:u,dataPropType:m,data:b,dataTypes:_,propertyName:S}){if(b!==void 0&&u!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:$}=p;if(u!==void 0){const{errorPath:v,dataPathArr:w,opts:c}=p,d=$.let("data",(0,e._)`${p.data}${(0,e.getProperty)(u)}`,!0);g(d),i.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(u,m,c.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${u}`,i.dataPathArr=[...w,i.parentDataProperty]}if(b!==void 0){const v=b instanceof e.Name?b:$.let("data",b,!0);g(v),S!==void 0&&(i.propertyName=S)}_&&(i.dataTypes=_);function g(v){i.data=v,i.dataLevel=p.dataLevel+1,i.dataTypes=[],p.definedProperties=new Set,i.parentData=p.data,i.dataNames=[...p.dataNames,v]}}ge.extendSubschemaData=n;function y(i,{jtdDiscriminator:p,jtdMetadata:u,compositeRule:m,createErrors:b,allErrors:_}){m!==void 0&&(i.compositeRule=m),b!==void 0&&(i.createErrors=b),_!==void 0&&(i.allErrors=_),i.jtdDiscriminator=p,i.jtdMetadata=u}return ge.extendSubschemaMode=y,ge}var ne={},Lt,vr;function _r(){return vr||(vr=1,Lt=function e(t,a){if(t===a)return!0;if(t&&a&&typeof t=="object"&&typeof a=="object"){if(t.constructor!==a.constructor)return!1;var n,y,i;if(Array.isArray(t)){if(n=t.length,n!=a.length)return!1;for(y=n;y--!==0;)if(!e(t[y],a[y]))return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(a).length)return!1;for(y=n;y--!==0;)if(!Object.prototype.hasOwnProperty.call(a,i[y]))return!1;for(y=n;y--!==0;){var p=i[y];if(!e(t[p],a[p]))return!1}return!0}return t!==t&&a!==a}),Lt}var Ut={exports:{}},$r;function Gn(){if($r)return Ut.exports;$r=1;var e=Ut.exports=function(n,y,i){typeof y=="function"&&(i=y,y={}),i=y.cb||i;var p=typeof i=="function"?i:i.pre||function(){},u=i.post||function(){};t(y,p,u,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,y,i,p,u,m,b,_,S,$){if(p&&typeof p=="object"&&!Array.isArray(p)){y(p,u,m,b,_,S,$);for(var g in p){var v=p[g];if(Array.isArray(v)){if(g in e.arrayKeywords)for(var w=0;w<v.length;w++)t(n,y,i,v[w],u+"/"+g+"/"+w,m,u,g,p,w)}else if(g in e.propsKeywords){if(v&&typeof v=="object")for(var c in v)t(n,y,i,v[c],u+"/"+g+"/"+a(c),m,u,g,p,c)}else(g in e.keywords||n.allKeys&&!(g in e.skipKeywords))&&t(n,y,i,v,u+"/"+g,m,u,g,p)}i(p,u,m,b,_,S,$)}}function a(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Ut.exports}var br;function Fe(){if(br)return ne;br=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;const e=Y(),t=_r(),a=Gn(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function y(w,c=!0){return typeof w=="boolean"?!0:c===!0?!p(w):c?u(w)<=c:!1}ne.inlineRef=y;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function p(w){for(const c in w){if(i.has(c))return!0;const d=w[c];if(Array.isArray(d)&&d.some(p)||typeof d=="object"&&p(d))return!0}return!1}function u(w){let c=0;for(const d in w){if(d==="$ref")return 1/0;if(c++,!n.has(d)&&(typeof w[d]=="object"&&(0,e.eachItem)(w[d],r=>c+=u(r)),c===1/0))return 1/0}return c}function m(w,c="",d){d!==!1&&(c=S(c));const r=w.parse(c);return b(w,r)}ne.getFullPath=m;function b(w,c){return w.serialize(c).split("#")[0]+"#"}ne._getFullPath=b;const _=/#\/?$/;function S(w){return w?w.replace(_,""):""}ne.normalizeId=S;function $(w,c,d){return d=S(d),w.resolve(c,d)}ne.resolveUrl=$;const g=/^[a-z_][-a-z0-9._]*$/i;function v(w,c){if(typeof w=="boolean")return{};const{schemaId:d,uriResolver:r}=this.opts,o=S(w[d]||c),h={"":o},s=m(r,o,!1),f={},P=new Set;return a(w,{allKeys:!0},(z,q,V,F)=>{if(F===void 0)return;const L=s+q;let Q=h[F];typeof z[d]=="string"&&(Q=ie.call(this,z[d])),se.call(this,z.$anchor),se.call(this,z.$dynamicAnchor),h[q]=Q;function ie(x){const pe=this.opts.uriResolver.resolve;if(x=S(Q?pe(Q,x):x),P.has(x))throw D(x);P.add(x);let M=this.refs[x];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?N(z,M.schema,x):x!==S(L)&&(x[0]==="#"?(N(z,f[x],x),f[x]=z):this.refs[x]=L),x}function se(x){if(typeof x=="string"){if(!g.test(x))throw new Error(`invalid anchor "${x}"`);ie.call(this,`#${x}`)}}}),f;function N(z,q,V){if(q!==void 0&&!t(z,q))throw D(V)}function D(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ne.getSchemaRefs=v,ne}var wr;function Le(){if(wr)return he;wr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=Ln(),t=ze(),a=fr(),n=ze(),y=Un(),i=Kn(),p=Hn(),u=G(),m=ve(),b=Fe(),_=Y(),S=Ve();function $(j){if(s(j)&&(P(j),h(j))){c(j);return}g(j,()=>(0,e.topBoolOrEmptySchema)(j))}he.validateFunctionCode=$;function g({gen:j,validateName:I,schema:C,schemaEnv:A,opts:K},W){K.code.es5?j.func(I,(0,u._)`${m.default.data}, ${m.default.valCxt}`,A.$async,()=>{j.code((0,u._)`"use strict"; ${r(C,K)}`),w(j,K),j.code(W)}):j.func(I,(0,u._)`${m.default.data}, ${v(K)}`,A.$async,()=>j.code(r(C,K)).code(W))}function v(j){return(0,u._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${j.dynamicRef?(0,u._)`, ${m.default.dynamicAnchors}={}`:u.nil}}={}`}function w(j,I){j.if(m.default.valCxt,()=>{j.var(m.default.instancePath,(0,u._)`${m.default.valCxt}.${m.default.instancePath}`),j.var(m.default.parentData,(0,u._)`${m.default.valCxt}.${m.default.parentData}`),j.var(m.default.parentDataProperty,(0,u._)`${m.default.valCxt}.${m.default.parentDataProperty}`),j.var(m.default.rootData,(0,u._)`${m.default.valCxt}.${m.default.rootData}`),I.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{j.var(m.default.instancePath,(0,u._)`""`),j.var(m.default.parentData,(0,u._)`undefined`),j.var(m.default.parentDataProperty,(0,u._)`undefined`),j.var(m.default.rootData,m.default.data),I.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`{}`)})}function c(j){const{schema:I,opts:C,gen:A}=j;g(j,()=>{C.$comment&&I.$comment&&F(j),z(j),A.let(m.default.vErrors,null),A.let(m.default.errors,0),C.unevaluated&&d(j),N(j),L(j)})}function d(j){const{gen:I,validateName:C}=j;j.evaluated=I.const("evaluated",(0,u._)`${C}.evaluated`),I.if((0,u._)`${j.evaluated}.dynamicProps`,()=>I.assign((0,u._)`${j.evaluated}.props`,(0,u._)`undefined`)),I.if((0,u._)`${j.evaluated}.dynamicItems`,()=>I.assign((0,u._)`${j.evaluated}.items`,(0,u._)`undefined`))}function r(j,I){const C=typeof j=="object"&&j[I.schemaId];return C&&(I.code.source||I.code.process)?(0,u._)`/*# sourceURL=${C} */`:u.nil}function o(j,I){if(s(j)&&(P(j),h(j))){f(j,I);return}(0,e.boolOrEmptySchema)(j,I)}function h({schema:j,self:I}){if(typeof j=="boolean")return!j;for(const C in j)if(I.RULES.all[C])return!0;return!1}function s(j){return typeof j.schema!="boolean"}function f(j,I){const{schema:C,gen:A,opts:K}=j;K.$comment&&C.$comment&&F(j),q(j),V(j);const W=A.const("_errs",m.default.errors);N(j,W),A.var(I,(0,u._)`${W} === ${m.default.errors}`)}function P(j){(0,_.checkUnknownRules)(j),D(j)}function N(j,I){if(j.opts.jtd)return ie(j,[],!1,I);const C=(0,t.getSchemaTypes)(j.schema),A=(0,t.coerceAndCheckDataType)(j,C);ie(j,C,!A,I)}function D(j){const{schema:I,errSchemaPath:C,opts:A,self:K}=j;I.$ref&&A.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${C}"`)}function z(j){const{schema:I,opts:C}=j;I.default!==void 0&&C.useDefaults&&C.strictSchema&&(0,_.checkStrictMode)(j,"default is ignored in the schema root")}function q(j){const I=j.schema[j.opts.schemaId];I&&(j.baseId=(0,b.resolveUrl)(j.opts.uriResolver,j.baseId,I))}function V(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:j,schemaEnv:I,schema:C,errSchemaPath:A,opts:K}){const W=C.$comment;if(K.$comment===!0)j.code((0,u._)`${m.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const te=(0,u.str)`${A}/$comment`,me=j.scopeValue("root",{ref:I.root});j.code((0,u._)`${m.default.self}.opts.$comment(${W}, ${te}, ${me}.schema)`)}}function L(j){const{gen:I,schemaEnv:C,validateName:A,ValidationError:K,opts:W}=j;C.$async?I.if((0,u._)`${m.default.errors} === 0`,()=>I.return(m.default.data),()=>I.throw((0,u._)`new ${K}(${m.default.vErrors})`)):(I.assign((0,u._)`${A}.errors`,m.default.vErrors),W.unevaluated&&Q(j),I.return((0,u._)`${m.default.errors} === 0`))}function Q({gen:j,evaluated:I,props:C,items:A}){C instanceof u.Name&&j.assign((0,u._)`${I}.props`,C),A instanceof u.Name&&j.assign((0,u._)`${I}.items`,A)}function ie(j,I,C,A){const{gen:K,schema:W,data:te,allErrors:me,opts:ae,self:ce}=j,{RULES:re}=ce;if(W.$ref&&(ae.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,re))){K.block(()=>U(j,"$ref",re.all.$ref.definition));return}ae.jtd||x(j,I),K.block(()=>{for(const ue of re.rules)Ie(ue);Ie(re.post)});function Ie(ue){(0,a.shouldUseGroup)(W,ue)&&(ue.type?(K.if((0,n.checkDataType)(ue.type,te,ae.strictNumbers)),se(j,ue),I.length===1&&I[0]===ue.type&&C&&(K.else(),(0,n.reportTypeError)(j)),K.endIf()):se(j,ue),me||K.if((0,u._)`${m.default.errors} === ${A||0}`))}}function se(j,I){const{gen:C,schema:A,opts:{useDefaults:K}}=j;K&&(0,y.assignDefaults)(j,I.type),C.block(()=>{for(const W of I.rules)(0,a.shouldUseRule)(A,W)&&U(j,W.keyword,W.definition,I.type)})}function x(j,I){j.schemaEnv.meta||!j.opts.strictTypes||(pe(j,I),j.opts.allowUnionTypes||M(j,I),k(j,j.dataTypes))}function pe(j,I){if(I.length){if(!j.dataTypes.length){j.dataTypes=I;return}I.forEach(C=>{R(j.dataTypes,C)||E(j,`type "${C}" not allowed by context "${j.dataTypes.join(",")}"`)}),l(j,I)}}function M(j,I){I.length>1&&!(I.length===2&&I.includes("null"))&&E(j,"use allowUnionTypes to allow union type keyword")}function k(j,I){const C=j.self.RULES.all;for(const A in C){const K=C[A];if(typeof K=="object"&&(0,a.shouldUseRule)(j.schema,K)){const{type:W}=K.definition;W.length&&!W.some(te=>T(I,te))&&E(j,`missing type "${W.join(",")}" for keyword "${A}"`)}}}function T(j,I){return j.includes(I)||I==="number"&&j.includes("integer")}function R(j,I){return j.includes(I)||I==="integer"&&j.includes("number")}function l(j,I){const C=[];for(const A of j.dataTypes)R(I,A)?C.push(A):I.includes("integer")&&A==="number"&&C.push("integer");j.dataTypes=C}function E(j,I){const C=j.schemaEnv.baseId+j.errSchemaPath;I+=` at "${C}" (strictTypes)`,(0,_.checkStrictMode)(j,I,j.opts.strictTypes)}class O{constructor(I,C,A){if((0,i.validateKeywordUsage)(I,C,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=C.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=C.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=C,this.$data)this.schemaCode=I.gen.const("vSchema",B(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,C.schemaType,C.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(C.schemaType)}`);("code"in C?C.trackErrors:C.errors!==!1)&&(this.errsCount=I.gen.const("_errs",m.default.errors))}result(I,C,A){this.failResult((0,u.not)(I),C,A)}failResult(I,C,A){this.gen.if(I),A?A():this.error(),C?(this.gen.else(),C(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,C){this.failResult((0,u.not)(I),void 0,C)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:C}=this;this.fail((0,u._)`${C} !== undefined && (${(0,u.or)(this.invalid$data(),I)})`)}error(I,C,A){if(C){this.setParams(C),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,C){(I?S.reportExtraError:S.reportError)(this,this.def.error,C)}$dataError(){(0,S.reportError)(this,this.def.$dataError||S.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,S.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,C){C?Object.assign(this.params,I):this.params=I}block$data(I,C,A=u.nil){this.gen.block(()=>{this.check$data(I,A),C()})}check$data(I=u.nil,C=u.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:te}=this;A.if((0,u.or)((0,u._)`${K} === undefined`,C)),I!==u.nil&&A.assign(I,!0),(W.length||te.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==u.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:C,schemaType:A,def:K,it:W}=this;return(0,u.or)(te(),me());function te(){if(A.length){if(!(C instanceof u.Name))throw new Error("ajv implementation error");const ae=Array.isArray(A)?A:[A];return(0,u._)`${(0,n.checkDataTypes)(ae,C,W.opts.strictNumbers,n.DataType.Wrong)}`}return u.nil}function me(){if(K.validateSchema){const ae=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,u._)`!${ae}(${C})`}return u.nil}}subschema(I,C){const A=(0,p.getSubschema)(this.it,I);(0,p.extendSubschemaData)(A,this.it,I),(0,p.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return o(K,C),K}mergeEvaluated(I,C){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=_.mergeEvaluated.props(K,I.props,A.props,C)),A.items!==!0&&I.items!==void 0&&(A.items=_.mergeEvaluated.items(K,I.items,A.items,C)))}mergeValidEvaluated(I,C){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(C,()=>this.mergeEvaluated(I,u.Name)),!0}}he.KeywordCxt=O;function U(j,I,C,A){const K=new O(j,C,I);"code"in C?C.code(K,A):K.$data&&C.validate?(0,i.funcKeywordCode)(K,C):"macro"in C?(0,i.macroKeywordCode)(K,C):(C.compile||C.validate)&&(0,i.funcKeywordCode)(K,C)}const H=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(j,{dataLevel:I,dataNames:C,dataPathArr:A}){let K,W;if(j==="")return m.default.rootData;if(j[0]==="/"){if(!H.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);K=j,W=m.default.rootData}else{const ce=Z.exec(j);if(!ce)throw new Error(`Invalid JSON-pointer: ${j}`);const re=+ce[1];if(K=ce[2],K==="#"){if(re>=I)throw new Error(ae("property/index",re));return A[I-re]}if(re>I)throw new Error(ae("data",re));if(W=C[I-re],!K)return W}let te=W;const me=K.split("/");for(const ce of me)ce&&(W=(0,u._)`${W}${(0,u.getProperty)((0,_.unescapeJsonPointer)(ce))}`,te=(0,u._)`${te} && ${W}`);return te;function ae(ce,re){return`Cannot access ${ce} ${re} levels up, current level is ${I}`}}return he.getData=B,he}var Ue={},Pr;function Kt(){if(Pr)return Ue;Pr=1,Object.defineProperty(Ue,"__esModule",{value:!0});class e extends Error{constructor(a){super("validation failed"),this.errors=a,this.ajv=this.validation=!0}}return Ue.default=e,Ue}var Ke={},Er;function He(){if(Er)return Ke;Er=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=Fe();class t extends Error{constructor(n,y,i,p){super(p||`can't resolve reference ${i} from id ${y}`),this.missingRef=(0,e.resolveUrl)(n,y,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Ke.default=t,Ke}var de={},Sr;function Ht(){if(Sr)return de;Sr=1,Object.defineProperty(de,"__esModule",{value:!0}),de.resolveSchema=de.getCompilingSchema=de.resolveRef=de.compileSchema=de.SchemaEnv=void 0;const e=G(),t=Kt(),a=ve(),n=Fe(),y=Y(),i=Le();class p{constructor(d){var r;this.refs={},this.dynamicAnchors={};let o;typeof d.schema=="object"&&(o=d.schema),this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(r=d.baseId)!==null&&r!==void 0?r:(0,n.normalizeId)(o?.[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=o?.$async,this.refs={}}}de.SchemaEnv=p;function u(c){const d=_.call(this,c);if(d)return d;const r=(0,n.getFullPath)(this.opts.uriResolver,c.root.baseId),{es5:o,lines:h}=this.opts.code,{ownProperties:s}=this.opts,f=new e.CodeGen(this.scope,{es5:o,lines:h,ownProperties:s});let P;c.$async&&(P=f.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const N=f.scopeName("validate");c.validateName=N;const D={gen:f,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:c.schema,code:(0,e.stringify)(c.schema)}:{ref:c.schema}),validateName:N,ValidationError:P,schema:c.schema,schemaEnv:c,rootId:r,baseId:c.baseId||r,schemaPath:e.nil,errSchemaPath:c.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(c),(0,i.validateFunctionCode)(D),f.optimize(this.opts.code.optimize);const q=f.toString();z=`${f.scopeRefs(a.default.scope)}return ${q}`,this.opts.code.process&&(z=this.opts.code.process(z,c));const F=new Function(`${a.default.self}`,`${a.default.scope}`,z)(this,this.scope.get());if(this.scope.value(N,{ref:F}),F.errors=null,F.schema=c.schema,F.schemaEnv=c,c.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:N,validateCode:q,scopeValues:f._values}),this.opts.unevaluated){const{props:L,items:Q}=D;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return c.validate=F,c}catch(q){throw delete c.validate,delete c.validateName,z&&this.logger.error("Error compiling schema, function code:",z),q}finally{this._compilations.delete(c)}}de.compileSchema=u;function m(c,d,r){var o;r=(0,n.resolveUrl)(this.opts.uriResolver,d,r);const h=c.refs[r];if(h)return h;let s=$.call(this,c,r);if(s===void 0){const f=(o=c.localRefs)===null||o===void 0?void 0:o[r],{schemaId:P}=this.opts;f&&(s=new p({schema:f,schemaId:P,root:c,baseId:d}))}if(s!==void 0)return c.refs[r]=b.call(this,s)}de.resolveRef=m;function b(c){return(0,n.inlineRef)(c.schema,this.opts.inlineRefs)?c.schema:c.validate?c:u.call(this,c)}function _(c){for(const d of this._compilations)if(S(d,c))return d}de.getCompilingSchema=_;function S(c,d){return c.schema===d.schema&&c.root===d.root&&c.baseId===d.baseId}function $(c,d){let r;for(;typeof(r=this.refs[d])=="string";)d=r;return r||this.schemas[d]||g.call(this,c,d)}function g(c,d){const r=this.opts.uriResolver.parse(d),o=(0,n._getFullPath)(this.opts.uriResolver,r);let h=(0,n.getFullPath)(this.opts.uriResolver,c.baseId,void 0);if(Object.keys(c.schema).length>0&&o===h)return w.call(this,r,c);const s=(0,n.normalizeId)(o),f=this.refs[s]||this.schemas[s];if(typeof f=="string"){const P=g.call(this,c,f);return typeof P?.schema!="object"?void 0:w.call(this,r,P)}if(typeof f?.schema=="object"){if(f.validate||u.call(this,f),s===(0,n.normalizeId)(d)){const{schema:P}=f,{schemaId:N}=this.opts,D=P[N];return D&&(h=(0,n.resolveUrl)(this.opts.uriResolver,h,D)),new p({schema:P,schemaId:N,root:c,baseId:h})}return w.call(this,r,f)}}de.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(c,{baseId:d,schema:r,root:o}){var h;if(((h=c.fragment)===null||h===void 0?void 0:h[0])!=="/")return;for(const P of c.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const N=r[(0,y.unescapeFragment)(P)];if(N===void 0)return;r=N;const D=typeof r=="object"&&r[this.opts.schemaId];!v.has(P)&&D&&(d=(0,n.resolveUrl)(this.opts.uriResolver,d,D))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,y.schemaHasRulesButRef)(r,this.RULES)){const P=(0,n.resolveUrl)(this.opts.uriResolver,d,r.$ref);s=g.call(this,o,P)}const{schemaId:f}=this.opts;if(s=s||new p({schema:r,schemaId:f,root:o,baseId:d}),s.schema!==s.root.schema)return s}return de}const Jn={$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};var Ge={},Ne={exports:{}},Gt,jr;function kr(){if(jr)return Gt;jr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function a($){let g="",v=0,w=0;for(w=0;w<$.length;w++)if(v=$[w].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w];break}for(w+=1;w<$.length;w++){if(v=$[w].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w]}return g}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y($){return $.length=0,!0}function i($,g,v){if($.length){const w=a($);if(w!=="")g.push(w);else return v.error=!0,!1;$.length=0}return!0}function p($){let g=0;const v={error:!1,address:"",zone:""},w=[],c=[];let d=!1,r=!1,o=i;for(let h=0;h<$.length;h++){const s=$[h];if(!(s==="["||s==="]"))if(s===":"){if(d===!0&&(r=!0),!o(c,w,v))break;if(++g>7){v.error=!0;break}h>0&&$[h-1]===":"&&(d=!0),w.push(":");continue}else if(s==="%"){if(!o(c,w,v))break;o=y}else{c.push(s);continue}}return c.length&&(o===y?v.zone=c.join(""):r?w.push(c.join("")):w.push(a(c))),v.address=w.join(""),v}function u($){if(m($,":")<2)return{host:$,isIPV6:!1};const g=p($);if(g.error)return{host:$,isIPV6:!1};{let v=g.address,w=g.address;return g.zone&&(v+="%"+g.zone,w+="%25"+g.zone),{host:v,isIPV6:!0,escapedHost:w}}}function m($,g){let v=0;for(let w=0;w<$.length;w++)$[w]===g&&v++;return v}function b($){let g=$;const v=[];let w=-1,c=0;for(;c=g.length;){if(c===1){if(g===".")break;if(g==="/"){v.push("/");break}else{v.push(g);break}}else if(c===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){v.push("/");break}}else if(c===3&&g==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(g[0]==="."){if(g[1]==="."){if(g[2]==="/"){g=g.slice(3);continue}}else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&g[1]==="."){if(g[2]==="/"){g=g.slice(2);continue}else if(g[2]==="."&&g[3]==="/"){g=g.slice(3),v.length!==0&&v.pop();continue}}if((w=g.indexOf("/",1))===-1){v.push(g);break}else v.push(g.slice(0,w)),g=g.slice(w)}return v.join("")}function _($,g){const v=g!==!0?escape:unescape;return $.scheme!==void 0&&($.scheme=v($.scheme)),$.userinfo!==void 0&&($.userinfo=v($.userinfo)),$.host!==void 0&&($.host=v($.host)),$.path!==void 0&&($.path=v($.path)),$.query!==void 0&&($.query=v($.query)),$.fragment!==void 0&&($.fragment=v($.fragment)),$}function S($){const g=[];if($.userinfo!==void 0&&(g.push($.userinfo),g.push("@")),$.host!==void 0){let v=unescape($.host);if(!t(v)){const w=u(v);w.isIPV6===!0?v=`[${w.escapedHost}]`:v=$.host}g.push(v)}return(typeof $.port=="number"||typeof $.port=="string")&&(g.push(":"),g.push(String($.port))),g.length?g.join(""):void 0}return Gt={nonSimpleDomain:n,recomposeAuthority:S,normalizeComponentEncoding:_,removeDotSegments:b,isIPv4:t,isUUID:e,normalizeIPv6:u,stringArrayToHexStripped:a},Gt}var Jt,Ir;function Wn(){if(Ir)return Jt;Ir=1;const{isUUID:e}=kr(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function n(s){return a.indexOf(s)!==-1}function y(s){return s.secure===!0?!0:s.secure===!1?!1:s.scheme?s.scheme.length===3&&(s.scheme[0]==="w"||s.scheme[0]==="W")&&(s.scheme[1]==="s"||s.scheme[1]==="S")&&(s.scheme[2]==="s"||s.scheme[2]==="S"):!1}function i(s){return s.host||(s.error=s.error||"HTTP URIs must have a host."),s}function p(s){const f=String(s.scheme).toLowerCase()==="https";return(s.port===(f?443:80)||s.port==="")&&(s.port=void 0),s.path||(s.path="/"),s}function u(s){return s.secure=y(s),s.resourceName=(s.path||"/")+(s.query?"?"+s.query:""),s.path=void 0,s.query=void 0,s}function m(s){if((s.port===(y(s)?443:80)||s.port==="")&&(s.port=void 0),typeof s.secure=="boolean"&&(s.scheme=s.secure?"wss":"ws",s.secure=void 0),s.resourceName){const[f,P]=s.resourceName.split("?");s.path=f&&f!=="/"?f:void 0,s.query=P,s.resourceName=void 0}return s.fragment=void 0,s}function b(s,f){if(!s.path)return s.error="URN can not be parsed",s;const P=s.path.match(t);if(P){const N=f.scheme||s.scheme||"urn";s.nid=P[1].toLowerCase(),s.nss=P[2];const D=`${N}:${f.nid||s.nid}`,z=h(D);s.path=void 0,z&&(s=z.parse(s,f))}else s.error=s.error||"URN can not be parsed.";return s}function _(s,f){if(s.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=f.scheme||s.scheme||"urn",N=s.nid.toLowerCase(),D=`${P}:${f.nid||N}`,z=h(D);z&&(s=z.serialize(s,f));const q=s,V=s.nss;return q.path=`${N||f.nid}:${V}`,f.skipEscape=!0,q}function S(s,f){const P=s;return P.uuid=P.nss,P.nss=void 0,!f.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function $(s){const f=s;return f.nss=(s.uuid||"").toLowerCase(),f}const g={scheme:"http",domainHost:!0,parse:i,serialize:p},v={scheme:"https",domainHost:g.domainHost,parse:i,serialize:p},w={scheme:"ws",domainHost:!0,parse:u,serialize:m},c={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},o={http:g,https:v,ws:w,wss:c,urn:{scheme:"urn",parse:b,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:S,serialize:$,skipNormalize:!0}};Object.setPrototypeOf(o,null);function h(s){return s&&(o[s]||o[s.toLowerCase()])||void 0}return Jt={wsIsSecure:y,SCHEMES:o,isValidSchemeName:n,getSchemeHandler:h},Jt}var Rr;function Bn(){if(Rr)return Ne.exports;Rr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:a,normalizeComponentEncoding:n,isIPv4:y,nonSimpleDomain:i}=kr(),{SCHEMES:p,getSchemeHandler:u}=Wn();function m(c,d){return typeof c=="string"?c=$(v(c,d),d):typeof c=="object"&&(c=v($(c,d),d)),c}function b(c,d,r){const o=r?Object.assign({scheme:"null"},r):{scheme:"null"},h=_(v(c,o),v(d,o),o,!0);return o.skipEscape=!0,$(h,o)}function _(c,d,r,o){const h={};return o||(c=v($(c,r),r),d=v($(d,r),r)),r=r||{},!r.tolerant&&d.scheme?(h.scheme=d.scheme,h.userinfo=d.userinfo,h.host=d.host,h.port=d.port,h.path=t(d.path||""),h.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(h.userinfo=d.userinfo,h.host=d.host,h.port=d.port,h.path=t(d.path||""),h.query=d.query):(d.path?(d.path[0]==="/"?h.path=t(d.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?h.path="/"+d.path:c.path?h.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+d.path:h.path=d.path,h.path=t(h.path)),h.query=d.query):(h.path=c.path,d.query!==void 0?h.query=d.query:h.query=c.query),h.userinfo=c.userinfo,h.host=c.host,h.port=c.port),h.scheme=c.scheme),h.fragment=d.fragment,h}function S(c,d,r){return typeof c=="string"?(c=unescape(c),c=$(n(v(c,r),!0),{...r,skipEscape:!0})):typeof c=="object"&&(c=$(n(c,!0),{...r,skipEscape:!0})),typeof d=="string"?(d=unescape(d),d=$(n(v(d,r),!0),{...r,skipEscape:!0})):typeof d=="object"&&(d=$(n(d,!0),{...r,skipEscape:!0})),c.toLowerCase()===d.toLowerCase()}function $(c,d){const r={host:c.host,scheme:c.scheme,userinfo:c.userinfo,port:c.port,path:c.path,query:c.query,nid:c.nid,nss:c.nss,uuid:c.uuid,fragment:c.fragment,reference:c.reference,resourceName:c.resourceName,secure:c.secure,error:""},o=Object.assign({},d),h=[],s=u(o.scheme||r.scheme);s&&s.serialize&&s.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&h.push(r.scheme,":");const f=a(r);if(f!==void 0&&(o.reference!=="suffix"&&h.push("//"),h.push(f),r.path&&r.path[0]!=="/"&&h.push("/")),r.path!==void 0){let P=r.path;!o.absolutePath&&(!s||!s.absolutePath)&&(P=t(P)),f===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),h.push(P)}return r.query!==void 0&&h.push("?",r.query),r.fragment!==void 0&&h.push("#",r.fragment),h.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(c,d){const r=Object.assign({},d),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1;r.reference==="suffix"&&(r.scheme?c=r.scheme+":"+c:c="//"+c);const s=c.match(g);if(s){if(o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]),o.host)if(y(o.host)===!1){const N=e(o.host);o.host=N.host.toLowerCase(),h=N.isIPV6}else h=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const f=u(r.scheme||o.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&o.host&&(r.domainHost||f&&f.domainHost)&&h===!1&&i(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(P){o.error=o.error||"Host's domain name can not be converted to ASCII: "+P}(!f||f&&!f.skipNormalize)&&(c.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),f&&f.parse&&f.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}const w={SCHEMES:p,normalize:m,resolve:b,resolveComponent:_,equal:S,serialize:$,parse:v};return Ne.exports=w,Ne.exports.default=w,Ne.exports.fastUri=w,Ne.exports}var Nr;function Yn(){if(Nr)return Ge;Nr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=Bn();return e.code='require("ajv/dist/runtime/uri").default',Ge.default=e,Ge}var Or;function Zn(){return Or||(Or=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Le();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var a=G();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return a.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return a.CodeGen}});const n=Kt(),y=He(),i=ur(),p=Ht(),u=G(),m=Fe(),b=ze(),_=Y(),S=Jn,$=Yn(),g=(M,k)=>new RegExp(M,k);g.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),c={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."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},r=200;function o(M){var k,T,R,l,E,O,U,H,Z,B,j,I,C,A,K,W,te,me,ae,ce,re,Ie,ue,Xt,xt;const Te=M.strict,er=(k=M.code)===null||k===void 0?void 0:k.optimize,zn=er===!0||er===void 0?1:er||0,Fn=(R=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&R!==void 0?R:g,as=(l=M.uriResolver)!==null&&l!==void 0?l:$.default;return{strictSchema:(O=(E=M.strictSchema)!==null&&E!==void 0?E:Te)!==null&&O!==void 0?O:!0,strictNumbers:(H=(U=M.strictNumbers)!==null&&U!==void 0?U:Te)!==null&&H!==void 0?H:!0,strictTypes:(B=(Z=M.strictTypes)!==null&&Z!==void 0?Z:Te)!==null&&B!==void 0?B:"log",strictTuples:(I=(j=M.strictTuples)!==null&&j!==void 0?j:Te)!==null&&I!==void 0?I:"log",strictRequired:(A=(C=M.strictRequired)!==null&&C!==void 0?C:Te)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:zn,regExp:Fn}:{optimize:zn,regExp:Fn},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:r,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:r,meta:(te=M.meta)!==null&&te!==void 0?te:!0,messages:(me=M.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ae=M.inlineRefs)!==null&&ae!==void 0?ae:!0,schemaId:(ce=M.schemaId)!==null&&ce!==void 0?ce:"$id",addUsedSchema:(re=M.addUsedSchema)!==null&&re!==void 0?re:!0,validateSchema:(Ie=M.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(ue=M.validateFormats)!==null&&ue!==void 0?ue:!0,unicodeRegExp:(Xt=M.unicodeRegExp)!==null&&Xt!==void 0?Xt:!0,int32range:(xt=M.int32range)!==null&&xt!==void 0?xt:!0,uriResolver:as}}class h{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...o(k)};const{es5:T,lines:R}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:w,es5:T,lines:R}),this.logger=V(k.logger);const l=k.validateFormats;k.validateFormats=!1,this.RULES=(0,i.getRules)(),s.call(this,c,k,"NOT SUPPORTED"),s.call(this,d,k,"DEPRECATED","warn"),this._metaOpts=z.call(this),k.formats&&N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&D.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),P.call(this),k.validateFormats=l}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:T,schemaId:R}=this.opts;let l=S;R==="id"&&(l={...S},l.id=l.$id,delete l.$id),T&&k&&this.addMetaSchema(l,l[R],!1)}defaultMeta(){const{meta:k,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[T]||k:void 0}validate(k,T){let R;if(typeof k=="string"){if(R=this.getSchema(k),!R)throw new Error(`no schema with key or ref "${k}"`)}else R=this.compile(k);const l=R(T);return"$async"in R||(this.errors=R.errors),l}compile(k,T){const R=this._addSchema(k,T);return R.validate||this._compileSchemaEnv(R)}compileAsync(k,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return l.call(this,k,T);async function l(B,j){await E.call(this,B.$schema);const I=this._addSchema(B,j);return I.validate||O.call(this,I)}async function E(B){B&&!this.getSchema(B)&&await l.call(this,{$ref:B},!0)}async function O(B){try{return this._compileSchemaEnv(B)}catch(j){if(!(j instanceof y.default))throw j;return U.call(this,j),await H.call(this,j.missingSchema),O.call(this,B)}}function U({missingSchema:B,missingRef:j}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${j} cannot be resolved`)}async function H(B){const j=await Z.call(this,B);this.refs[B]||await E.call(this,j.$schema),this.refs[B]||this.addSchema(j,B,T)}async function Z(B){const j=this._loading[B];if(j)return j;try{return await(this._loading[B]=R(B))}finally{delete this._loading[B]}}}addSchema(k,T,R,l=this.opts.validateSchema){if(Array.isArray(k)){for(const O of k)this.addSchema(O,void 0,R,l);return this}let E;if(typeof k=="object"){const{schemaId:O}=this.opts;if(E=k[O],E!==void 0&&typeof E!="string")throw new Error(`schema ${O} must be string`)}return T=(0,m.normalizeId)(T||E),this._checkUnique(T),this.schemas[T]=this._addSchema(k,R,T,l,!0),this}addMetaSchema(k,T,R=this.opts.validateSchema){return this.addSchema(k,T,!0,R),this}validateSchema(k,T){if(typeof k=="boolean")return!0;let R;if(R=k.$schema,R!==void 0&&typeof R!="string")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 l=this.validate(R,k);if(!l&&T){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return l}getSchema(k){let T;for(;typeof(T=f.call(this,k))=="string";)k=T;if(T===void 0){const{schemaId:R}=this.opts,l=new p.SchemaEnv({schema:{},schemaId:R});if(T=p.resolveSchema.call(this,l,k),!T)return;this.refs[k]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=f.call(this,k);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{const T=k;this._cache.delete(T);let R=k[this.opts.schemaId];return R&&(R=(0,m.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(const T of k)this.addKeyword(T);return this}addKeyword(k,T){let R;if(typeof k=="string")R=k,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=R);else if(typeof k=="object"&&T===void 0){if(T=k,R=T.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,R,T),!T)return(0,_.eachItem)(R,E=>Q.call(this,E)),this;se.call(this,T);const l={...T,type:(0,b.getJSONTypes)(T.type),schemaType:(0,b.getJSONTypes)(T.schemaType)};return(0,_.eachItem)(R,l.type.length===0?E=>Q.call(this,E,l):E=>l.type.forEach(O=>Q.call(this,E,l,O))),this}getKeyword(k){const T=this.RULES.all[k];return typeof T=="object"?T.definition:!!T}removeKeyword(k){const{RULES:T}=this;delete T.keywords[k],delete T.all[k];for(const R of T.rules){const l=R.rules.findIndex(E=>E.keyword===k);l>=0&&R.rules.splice(l,1)}return this}addFormat(k,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[k]=T,this}errorsText(k=this.errors,{separator:T=", ",dataVar:R="data"}={}){return!k||k.length===0?"No errors":k.map(l=>`${R}${l.instancePath} ${l.message}`).reduce((l,E)=>l+T+E)}$dataMetaSchema(k,T){const R=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const l of T){const E=l.split("/").slice(1);let O=k;for(const U of E)O=O[U];for(const U in R){const H=R[U];if(typeof H!="object")continue;const{$data:Z}=H.definition,B=O[U];Z&&B&&(O[U]=pe(B))}}return k}_removeAllSchemas(k,T){for(const R in k){const l=k[R];(!T||T.test(R))&&(typeof l=="string"?delete k[R]:l&&!l.meta&&(this._cache.delete(l.schema),delete k[R]))}}_addSchema(k,T,R,l=this.opts.validateSchema,E=this.opts.addUsedSchema){let O;const{schemaId:U}=this.opts;if(typeof k=="object")O=k[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(k);if(H!==void 0)return H;R=(0,m.normalizeId)(O||R);const Z=m.getSchemaRefs.call(this,k,R);return H=new p.SchemaEnv({schema:k,schemaId:U,meta:T,baseId:R,localRefs:Z}),this._cache.set(H.schema,H),E&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=H),l&&this.validateSchema(k,!0),H}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):p.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){const T=this.opts;this.opts=this._metaOpts;try{p.compileSchema.call(this,k)}finally{this.opts=T}}}h.ValidationError=n.default,h.MissingRefError=y.default,e.default=h;function s(M,k,T,R="error"){for(const l in M){const E=l;E in k&&this.logger[R](`${T}: option ${l}. ${M[E]}`)}}function f(M){return M=(0,m.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const k in M)this.addSchema(M[k],k)}function N(){for(const M in this.opts.formats){const k=this.opts.formats[M];k&&this.addFormat(M,k)}}function D(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const k in M){const T=M[k];T.keyword||(T.keyword=k),this.addKeyword(T)}}function z(){const M={...this.opts};for(const k of v)delete M[k];return M}const q={log(){},warn(){},error(){}};function V(M){if(M===!1)return q;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,k){const{RULES:T}=this;if((0,_.eachItem)(M,R=>{if(T.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!F.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw new Error('$data keyword must have "code" or "validate" function')}function Q(M,k,T){var R;const l=k?.post;if(T&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let O=l?E.post:E.rules.find(({type:H})=>H===T);if(O||(O={type:T,rules:[]},E.rules.push(O)),E.keywords[M]=!0,!k)return;const U={keyword:M,definition:{...k,type:(0,b.getJSONTypes)(k.type),schemaType:(0,b.getJSONTypes)(k.schemaType)}};k.before?ie.call(this,O,U,k.before):O.rules.push(U),E.all[M]=U,(R=k.implements)===null||R===void 0||R.forEach(H=>this.addKeyword(H))}function ie(M,k,T){const R=M.rules.findIndex(l=>l.keyword===T);R>=0?M.rules.splice(R,0,k):(M.rules.push(k),this.logger.warn(`rule ${T} is not defined`))}function se(M){let{metaSchema:k}=M;k!==void 0&&(M.$data&&this.opts.$data&&(k=pe(k)),M.validateSchema=this.compile(k,!0))}const x={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(M){return{anyOf:[M,x]}}})(Mt)),Mt}var Je={},We={},Be={},qr;function Qn(){if(qr)return Be;qr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Be.default=e,Be}var _e={},Cr;function Xn(){if(Cr)return _e;Cr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.callRef=_e.getValidate=void 0;const e=He(),t=fe(),a=G(),n=ve(),y=Ht(),i=Y(),p={keyword:"$ref",schemaType:"string",code(b){const{gen:_,schema:S,it:$}=b,{baseId:g,schemaEnv:v,validateName:w,opts:c,self:d}=$,{root:r}=v;if((S==="#"||S==="#/")&&g===r.baseId)return h();const o=y.resolveRef.call(d,r,g,S);if(o===void 0)throw new e.default($.opts.uriResolver,g,S);if(o instanceof y.SchemaEnv)return s(o);return f(o);function h(){if(v===r)return m(b,w,v,v.$async);const P=_.scopeValue("root",{ref:r});return m(b,(0,a._)`${P}.validate`,r,r.$async)}function s(P){const N=u(b,P);m(b,N,P,P.$async)}function f(P){const N=_.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,a.stringify)(P)}:{ref:P}),D=_.name("valid"),z=b.subschema({schema:P,dataTypes:[],schemaPath:a.nil,topSchemaRef:N,errSchemaPath:S},D);b.mergeEvaluated(z),b.ok(D)}}};function u(b,_){const{gen:S}=b;return _.validate?S.scopeValue("validate",{ref:_.validate}):(0,a._)`${S.scopeValue("wrapper",{ref:_})}.validate`}_e.getValidate=u;function m(b,_,S,$){const{gen:g,it:v}=b,{allErrors:w,schemaEnv:c,opts:d}=v,r=d.passContext?n.default.this:a.nil;$?o():h();function o(){if(!c.$async)throw new Error("async schema referenced by sync schema");const P=g.let("valid");g.try(()=>{g.code((0,a._)`await ${(0,t.callValidateCode)(b,_,r)}`),f(_),w||g.assign(P,!0)},N=>{g.if((0,a._)`!(${N} instanceof ${v.ValidationError})`,()=>g.throw(N)),s(N),w||g.assign(P,!1)}),b.ok(P)}function h(){b.result((0,t.callValidateCode)(b,_,r),()=>f(_),()=>s(_))}function s(P){const N=(0,a._)`${P}.errors`;g.assign(n.default.vErrors,(0,a._)`${n.default.vErrors} === null ? ${N} : ${n.default.vErrors}.concat(${N})`),g.assign(n.default.errors,(0,a._)`${n.default.vErrors}.length`)}function f(P){var N;if(!v.opts.unevaluated)return;const D=(N=S?.validate)===null||N===void 0?void 0:N.evaluated;if(v.props!==!0)if(D&&!D.dynamicProps)D.props!==void 0&&(v.props=i.mergeEvaluated.props(g,D.props,v.props));else{const z=g.var("props",(0,a._)`${P}.evaluated.props`);v.props=i.mergeEvaluated.props(g,z,v.props,a.Name)}if(v.items!==!0)if(D&&!D.dynamicItems)D.items!==void 0&&(v.items=i.mergeEvaluated.items(g,D.items,v.items));else{const z=g.var("items",(0,a._)`${P}.evaluated.items`);v.items=i.mergeEvaluated.items(g,z,v.items,a.Name)}}}return _e.callRef=m,_e.default=p,_e}var Tr;function xn(){if(Tr)return We;Tr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=Qn(),t=Xn(),a=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return We.default=a,We}var Ye={},Ze={},Dr;function ei(){if(Dr)return Ze;Dr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=G(),t=e.operators,a={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:i,schemaCode:p})=>(0,e.str)`must be ${a[i].okStr} ${p}`,params:({keyword:i,schemaCode:p})=>(0,e._)`{comparison: ${a[i].okStr}, limit: ${p}}`},y={keyword:Object.keys(a),type:"number",schemaType:"number",$data:!0,error:n,code(i){const{keyword:p,data:u,schemaCode:m}=i;i.fail$data((0,e._)`${u} ${a[p].fail} ${m} || isNaN(${u})`)}};return Ze.default=y,Ze}var Qe={},Mr;function ti(){if(Mr)return Qe;Mr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=G(),a={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:y,data:i,schemaCode:p,it:u}=n,m=u.opts.multipleOfPrecision,b=y.let("res"),_=m?(0,e._)`Math.abs(Math.round(${b}) - ${b}) > 1e-${m}`:(0,e._)`${b} !== parseInt(${b})`;n.fail$data((0,e._)`(${p} === 0 || (${b} = ${i}/${p}, ${_}))`)}};return Qe.default=a,Qe}var Xe={},xe={},Ar;function ri(){if(Ar)return xe;Ar=1,Object.defineProperty(xe,"__esModule",{value:!0});function e(t){const a=t.length;let n=0,y=0,i;for(;y<a;)n++,i=t.charCodeAt(y++),i>=55296&&i<=56319&&y<a&&(i=t.charCodeAt(y),(i&64512)===56320&&y++);return n}return xe.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',xe}var Vr;function ni(){if(Vr)return Xe;Vr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),t=Y(),a=ri(),y={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:p}){const u=i==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${p} characters`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:p,data:u,schemaCode:m,it:b}=i,_=p==="maxLength"?e.operators.GT:e.operators.LT,S=b.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,t.useFunc)(i.gen,a.default)}(${u})`;i.fail$data((0,e._)`${S} ${_} ${m}`)}};return Xe.default=y,Xe}var et={},zr;function ii(){if(zr)return et;zr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=fe(),t=G(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:y})=>(0,t.str)`must match pattern "${y}"`,params:({schemaCode:y})=>(0,t._)`{pattern: ${y}}`},code(y){const{data:i,$data:p,schema:u,schemaCode:m,it:b}=y,_=b.opts.unicodeRegExp?"u":"",S=p?(0,t._)`(new RegExp(${m}, ${_}))`:(0,e.usePattern)(y,u);y.fail$data((0,t._)`!${S}.test(${i})`)}};return et.default=n,et}var tt={},Fr;function si(){if(Fr)return tt;Fr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=G(),a={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:y}){const i=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${y} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:y,data:i,schemaCode:p}=n,u=y==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${i}).length ${u} ${p}`)}};return tt.default=a,tt}var rt={},Lr;function oi(){if(Lr)return rt;Lr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=fe(),t=G(),a=Y(),y={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,t.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,t._)`{missingProperty: ${i}}`},code(i){const{gen:p,schema:u,schemaCode:m,data:b,$data:_,it:S}=i,{opts:$}=S;if(!_&&u.length===0)return;const g=u.length>=$.loopRequired;if(S.allErrors?v():w(),$.strictRequired){const r=i.parentSchema.properties,{definedProperties:o}=i.it;for(const h of u)if(r?.[h]===void 0&&!o.has(h)){const s=S.schemaEnv.baseId+S.errSchemaPath,f=`required property "${h}" is not defined at "${s}" (strictRequired)`;(0,a.checkStrictMode)(S,f,S.opts.strictRequired)}}function v(){if(g||_)i.block$data(t.nil,c);else for(const r of u)(0,e.checkReportMissingProp)(i,r)}function w(){const r=p.let("missing");if(g||_){const o=p.let("valid",!0);i.block$data(o,()=>d(r,o)),i.ok(o)}else p.if((0,e.checkMissingProp)(i,u,r)),(0,e.reportMissingProp)(i,r),p.else()}function c(){p.forOf("prop",m,r=>{i.setParams({missingProperty:r}),p.if((0,e.noPropertyInData)(p,b,r,$.ownProperties),()=>i.error())})}function d(r,o){i.setParams({missingProperty:r}),p.forOf(r,m,()=>{p.assign(o,(0,e.propertyInData)(p,b,r,$.ownProperties)),p.if((0,t.not)(o),()=>{i.error(),p.break()})},t.nil)}}};return rt.default=y,rt}var nt={},Ur;function ai(){if(Ur)return nt;Ur=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=G(),a={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:y}){const i=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${y} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:y,data:i,schemaCode:p}=n,u=y==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${i}.length ${u} ${p}`)}};return nt.default=a,nt}var it={},st={},Kr;function Wt(){if(Kr)return st;Kr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=_r();return e.code='require("ajv/dist/runtime/equal").default',st.default=e,st}var Hr;function ci(){if(Hr)return it;Hr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=ze(),t=G(),a=Y(),n=Wt(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:p,j:u}})=>(0,t.str)`must NOT have duplicate items (items ## ${u} and ${p} are identical)`,params:({params:{i:p,j:u}})=>(0,t._)`{i: ${p}, j: ${u}}`},code(p){const{gen:u,data:m,$data:b,schema:_,parentSchema:S,schemaCode:$,it:g}=p;if(!b&&!_)return;const v=u.let("valid"),w=S.items?(0,e.getSchemaTypes)(S.items):[];p.block$data(v,c,(0,t._)`${$} === false`),p.ok(v);function c(){const h=u.let("i",(0,t._)`${m}.length`),s=u.let("j");p.setParams({i:h,j:s}),u.assign(v,!0),u.if((0,t._)`${h} > 1`,()=>(d()?r:o)(h,s))}function d(){return w.length>0&&!w.some(h=>h==="object"||h==="array")}function r(h,s){const f=u.name("item"),P=(0,e.checkDataTypes)(w,f,g.opts.strictNumbers,e.DataType.Wrong),N=u.const("indices",(0,t._)`{}`);u.for((0,t._)`;${h}--;`,()=>{u.let(f,(0,t._)`${m}[${h}]`),u.if(P,(0,t._)`continue`),w.length>1&&u.if((0,t._)`typeof ${f} == "string"`,(0,t._)`${f} += "_"`),u.if((0,t._)`typeof ${N}[${f}] == "number"`,()=>{u.assign(s,(0,t._)`${N}[${f}]`),p.error(),u.assign(v,!1).break()}).code((0,t._)`${N}[${f}] = ${h}`)})}function o(h,s){const f=(0,a.useFunc)(u,n.default),P=u.name("outer");u.label(P).for((0,t._)`;${h}--;`,()=>u.for((0,t._)`${s} = ${h}; ${s}--;`,()=>u.if((0,t._)`${f}(${m}[${h}], ${m}[${s}])`,()=>{p.error(),u.assign(v,!1).break(P)})))}}};return it.default=i,it}var ot={},Gr;function di(){if(Gr)return ot;Gr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=G(),t=Y(),a=Wt(),y={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,e._)`{allowedValue: ${i}}`},code(i){const{gen:p,data:u,$data:m,schemaCode:b,schema:_}=i;m||_&&typeof _=="object"?i.fail$data((0,e._)`!${(0,t.useFunc)(p,a.default)}(${u}, ${b})`):i.fail((0,e._)`${_} !== ${u}`)}};return ot.default=y,ot}var at={},Jr;function ui(){if(Jr)return at;Jr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=G(),t=Y(),a=Wt(),y={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,e._)`{allowedValues: ${i}}`},code(i){const{gen:p,data:u,$data:m,schema:b,schemaCode:_,it:S}=i;if(!m&&b.length===0)throw new Error("enum must have non-empty array");const $=b.length>=S.opts.loopEnum;let g;const v=()=>g??(g=(0,t.useFunc)(p,a.default));let w;if($||m)w=p.let("valid"),i.block$data(w,c);else{if(!Array.isArray(b))throw new Error("ajv implementation error");const r=p.const("vSchema",_);w=(0,e.or)(...b.map((o,h)=>d(r,h)))}i.pass(w);function c(){p.assign(w,!1),p.forOf("v",_,r=>p.if((0,e._)`${v()}(${u}, ${r})`,()=>p.assign(w,!0).break()))}function d(r,o){const h=b[o];return typeof h=="object"&&h!==null?(0,e._)`${v()}(${u}, ${r}[${o}])`:(0,e._)`${u} === ${h}`}}};return at.default=y,at}var Wr;function li(){if(Wr)return Ye;Wr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=ei(),t=ti(),a=ni(),n=ii(),y=si(),i=oi(),p=ai(),u=ci(),m=di(),b=ui(),_=[e.default,t.default,a.default,n.default,y.default,i.default,p.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,b.default];return Ye.default=_,Ye}var ct={},je={},Br;function Yr(){if(Br)return je;Br=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateAdditionalItems=void 0;const e=G(),t=Y(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{parentSchema:p,it:u}=i,{items:m}=p;if(!Array.isArray(m)){(0,t.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}y(i,m)}};function y(i,p){const{gen:u,schema:m,data:b,keyword:_,it:S}=i;S.items=!0;const $=u.const("len",(0,e._)`${b}.length`);if(m===!1)i.setParams({len:p.length}),i.pass((0,e._)`${$} <= ${p.length}`);else if(typeof m=="object"&&!(0,t.alwaysValidSchema)(S,m)){const v=u.var("valid",(0,e._)`${$} <= ${p.length}`);u.if((0,e.not)(v),()=>g(v)),i.ok(v)}function g(v){u.forRange("i",p.length,$,w=>{i.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},v),S.allErrors||u.if((0,e.not)(v),()=>u.break())})}}return je.validateAdditionalItems=y,je.default=n,je}var dt={},ke={},Zr;function Qr(){if(Zr)return ke;Zr=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.validateTuple=void 0;const e=G(),t=Y(),a=fe(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:p,it:u}=i;if(Array.isArray(p))return y(i,"additionalItems",p);u.items=!0,!(0,t.alwaysValidSchema)(u,p)&&i.ok((0,a.validateArray)(i))}};function y(i,p,u=i.schema){const{gen:m,parentSchema:b,data:_,keyword:S,it:$}=i;w(b),$.opts.unevaluated&&u.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(m,u.length,$.items));const g=m.name("valid"),v=m.const("len",(0,e._)`${_}.length`);u.forEach((c,d)=>{(0,t.alwaysValidSchema)($,c)||(m.if((0,e._)`${v} > ${d}`,()=>i.subschema({keyword:S,schemaProp:d,dataProp:d},g)),i.ok(g))});function w(c){const{opts:d,errSchemaPath:r}=$,o=u.length,h=o===c.minItems&&(o===c.maxItems||c[p]===!1);if(d.strictTuples&&!h){const s=`"${S}" is ${o}-tuple, but minItems or maxItems/${p} are not specified or different at path "${r}"`;(0,t.checkStrictMode)($,s,d.strictTuples)}}}return ke.validateTuple=y,ke.default=n,ke}var Xr;function fi(){if(Xr)return dt;Xr=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=Qr(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a=>(0,e.validateTuple)(a,"items")};return dt.default=t,dt}var ut={},xr;function pi(){if(xr)return ut;xr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=G(),t=Y(),a=fe(),n=Yr(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:p}})=>(0,e.str)`must NOT have more than ${p} items`,params:({params:{len:p}})=>(0,e._)`{limit: ${p}}`},code(p){const{schema:u,parentSchema:m,it:b}=p,{prefixItems:_}=m;b.items=!0,!(0,t.alwaysValidSchema)(b,u)&&(_?(0,n.validateAdditionalItems)(p,_):p.ok((0,a.validateArray)(p)))}};return ut.default=i,ut}var lt={},en;function mi(){if(en)return lt;en=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:y,max:i}})=>i===void 0?(0,e.str)`must contain at least ${y} valid item(s)`:(0,e.str)`must contain at least ${y} and no more than ${i} valid item(s)`,params:({params:{min:y,max:i}})=>i===void 0?(0,e._)`{minContains: ${y}}`:(0,e._)`{minContains: ${y}, maxContains: ${i}}`},code(y){const{gen:i,schema:p,parentSchema:u,data:m,it:b}=y;let _,S;const{minContains:$,maxContains:g}=u;b.opts.next?(_=$===void 0?1:$,S=g):_=1;const v=i.const("len",(0,e._)`${m}.length`);if(y.setParams({min:_,max:S}),S===void 0&&_===0){(0,t.checkStrictMode)(b,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(S!==void 0&&_>S){(0,t.checkStrictMode)(b,'"minContains" > "maxContains" is always invalid'),y.fail();return}if((0,t.alwaysValidSchema)(b,p)){let o=(0,e._)`${v} >= ${_}`;S!==void 0&&(o=(0,e._)`${o} && ${v} <= ${S}`),y.pass(o);return}b.items=!0;const w=i.name("valid");S===void 0&&_===1?d(w,()=>i.if(w,()=>i.break())):_===0?(i.let(w,!0),S!==void 0&&i.if((0,e._)`${m}.length > 0`,c)):(i.let(w,!1),c()),y.result(w,()=>y.reset());function c(){const o=i.name("_valid"),h=i.let("count",0);d(o,()=>i.if(o,()=>r(h)))}function d(o,h){i.forRange("i",0,v,s=>{y.subschema({keyword:"contains",dataProp:s,dataPropType:t.Type.Num,compositeRule:!0},o),h()})}function r(o){i.code((0,e._)`${o}++`),S===void 0?i.if((0,e._)`${o} >= ${_}`,()=>i.assign(w,!0).break()):(i.if((0,e._)`${o} > ${S}`,()=>i.assign(w,!1).break()),_===1?i.assign(w,!0):i.if((0,e._)`${o} >= ${_}`,()=>i.assign(w,!0)))}}};return lt.default=n,lt}var Bt={},tn;function hi(){return tn||(tn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),a=Y(),n=fe();e.error={message:({params:{property:m,depsCount:b,deps:_}})=>{const S=b===1?"property":"properties";return(0,t.str)`must have ${S} ${_} when property ${m} is present`},params:({params:{property:m,depsCount:b,deps:_,missingProperty:S}})=>(0,t._)`{property: ${m},
|
|
1
|
+
(function(Ee,je){typeof exports=="object"&&typeof module<"u"?je(exports):typeof define=="function"&&define.amd?define(["exports"],je):(Ee=typeof globalThis<"u"?globalThis:Ee||self,je(Ee.CICSDK={}))})(this,(function(Ee){"use strict";function je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ae={exports:{}},Qt={},ve={},Pe={},Xt={},xt={},er={},yr;function Ve(){return yr||(yr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(n){if(super(),!e.IDENTIFIER.test(n))throw new Error("CodeGen: name must be a valid identifier");this.str=n}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class i extends t{constructor(n){super(),this._items=typeof n=="string"?[n]:n}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const n=this._items[0];return n===""||n==='""'}get str(){var n;return(n=this._str)!==null&&n!==void 0?n:this._str=this._items.reduce((a,y)=>`${a}${y}`,"")}get names(){var n;return(n=this._names)!==null&&n!==void 0?n:this._names=this._items.reduce((a,y)=>(y instanceof r&&(a[y.str]=(a[y.str]||0)+1),a),{})}}e._Code=i,e.nil=new i("");function m(u,...n){const a=[u[0]];let y=0;for(;y<n.length;)d(a,n[y]),a.push(u[++y]);return new i(a)}e._=m;const s=new i("+");function p(u,...n){const a=[g(u[0])];let y=0;for(;y<n.length;)a.push(s),d(a,n[y]),a.push(s,g(u[++y]));return h(a),new i(a)}e.str=p;function d(u,n){n instanceof i?u.push(...n._items):n instanceof r?u.push(n):u.push(S(n))}e.addCodeArg=d;function h(u){let n=1;for(;n<u.length-1;){if(u[n]===s){const a=b(u[n-1],u[n+1]);if(a!==void 0){u.splice(n-1,3,a);continue}u[n++]="+"}n++}}function b(u,n){if(n==='""')return u;if(u==='""')return n;if(typeof u=="string")return n instanceof r||u[u.length-1]!=='"'?void 0:typeof n!="string"?`${u.slice(0,-1)}${n}"`:n[0]==='"'?u.slice(0,-1)+n.slice(1):void 0;if(typeof n=="string"&&n[0]==='"'&&!(u instanceof r))return`"${u}${n.slice(1)}`}function _(u,n){return n.emptyStr()?u:u.emptyStr()?n:p`${u}${n}`}e.strConcat=_;function S(u){return typeof u=="number"||typeof u=="boolean"||u===null?u:g(Array.isArray(u)?u.join(","):u)}function $(u){return new i(g(u))}e.stringify=$;function g(u){return JSON.stringify(u).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function v(u){return typeof u=="string"&&e.IDENTIFIER.test(u)?new i(`.${u}`):m`[${u}]`}e.getProperty=v;function w(u){if(typeof u=="string"&&e.IDENTIFIER.test(u))return new i(`${u}`);throw new Error(`CodeGen: invalid export name: ${u}, use explicit $id name mapping`)}e.getEsmExportName=w;function c(u){return new i(u.toString())}e.regexpCode=c})(er)),er}var tr={},gr;function vr(){return gr||(gr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Ve();class r extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`),this.value=b.value}}var i;(function(h){h[h.Started=0]="Started",h[h.Completed=1]="Completed"})(i||(e.UsedValueState=i={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class m{constructor({prefixes:b,parent:_}={}){this._names={},this._prefixes=b,this._parent=_}toName(b){return b instanceof t.Name?b:this.name(b)}name(b){return new t.Name(this._newName(b))}_newName(b){const _=this._names[b]||this._nameGroup(b);return`${b}${_.index++}`}_nameGroup(b){var _,S;if(!((S=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||S===void 0)&&S.has(b)||this._prefixes&&!this._prefixes.has(b))throw new Error(`CodeGen: prefix "${b}" is not allowed in this scope`);return this._names[b]={prefix:b,index:0}}}e.Scope=m;class s extends t.Name{constructor(b,_){super(_),this.prefix=b}setValue(b,{property:_,itemIndex:S}){this.value=b,this.scopePath=(0,t._)`.${new t.Name(_)}[${S}]`}}e.ValueScopeName=s;const p=(0,t._)`\n`;class d extends m{constructor(b){super(b),this._values={},this._scope=b.scope,this.opts={...b,_n:b.lines?p:t.nil}}get(){return this._scope}name(b){return new s(b,this._newName(b))}value(b,_){var S;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(b),{prefix:g}=$,v=(S=_.key)!==null&&S!==void 0?S:_.ref;let w=this._values[g];if(w){const n=w.get(v);if(n)return n}else w=this._values[g]=new Map;w.set(v,$);const c=this._scope[g]||(this._scope[g]=[]),u=c.length;return c[u]=_.ref,$.setValue(_,{property:g,itemIndex:u}),$}getValue(b,_){const S=this._values[b];if(S)return S.get(_)}scopeRefs(b,_=this._values){return this._reduceValues(_,S=>{if(S.scopePath===void 0)throw new Error(`CodeGen: name "${S}" has no value`);return(0,t._)`${b}${S.scopePath}`})}scopeCode(b=this._values,_,S){return this._reduceValues(b,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},_,S)}_reduceValues(b,_,S={},$){let g=t.nil;for(const v in b){const w=b[v];if(!w)continue;const c=S[v]=S[v]||new Map;w.forEach(u=>{if(c.has(u))return;c.set(u,i.Started);let n=_(u);if(n){const a=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${a} ${u} = ${n};${this.opts._n}`}else if(n=$?.(u))g=(0,t._)`${g}${n}${this.opts._n}`;else throw new r(u);c.set(u,i.Completed)})}return g}}e.ValueScope=d})(tr)),tr}var _r;function G(){return _r||(_r=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Ve(),r=vr();var i=Ve();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return i.Name}});var m=vr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return m.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return m.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return m.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return m.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(l,k){return this}}class p extends s{constructor(l,k,I){super(),this.varKind=l,this.name=k,this.rhs=I}render({es5:l,_n:k}){const I=l?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${U};`+k}optimizeNames(l,k){if(l[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,l,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class d extends s{constructor(l,k,I){super(),this.lhs=l,this.rhs=k,this.sideEffects=I}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,k){if(!(this.lhs instanceof t.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,l,k),this}get names(){const l=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(l,this.rhs)}}class h extends d{constructor(l,k,I,U){super(l,I,U),this.op=k}render({_n:l}){return`${this.lhs} ${this.op}= ${this.rhs};`+l}}class b extends s{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`${this.label}:`+l}}class _ extends s{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`break${this.label?` ${this.label}`:""};`+l}}class S extends s{constructor(l){super(),this.error=l}render({_n:l}){return`throw ${this.error};`+l}get names(){return this.error.names}}class $ extends s{constructor(l){super(),this.code=l}render({_n:l}){return`${this.code};`+l}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(l,k){return this.code=L(this.code,l,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends s{constructor(l=[]){super(),this.nodes=l}render(l){return this.nodes.reduce((k,I)=>k+I.render(l),"")}optimizeNodes(){const{nodes:l}=this;let k=l.length;for(;k--;){const I=l[k].optimizeNodes();Array.isArray(I)?l.splice(k,1,...I):I?l[k]=I:l.splice(k,1)}return l.length>0?this:void 0}optimizeNames(l,k){const{nodes:I}=this;let U=I.length;for(;U--;){const H=I[U];H.optimizeNames(l,k)||(X(l,H.names),I.splice(U,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((l,k)=>V(l,k.names),{})}}class v extends g{render(l){return"{"+l._n+super.render(l)+"}"+l._n}}class w extends g{}class c extends v{}c.kind="else";class u extends v{constructor(l,k){super(k),this.condition=l}render(l){let k=`if(${this.condition})`+super.render(l);return this.else&&(k+="else "+this.else.render(l)),k}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let k=this.else;if(k){const I=k.optimizeNodes();k=this.else=Array.isArray(I)?new c(I):I}if(k)return l===!1?k instanceof u?k:k.nodes:this.nodes.length?this:new u(oe(l),k instanceof u?[k]:k.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,k){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(l,k),!!(super.optimizeNames(l,k)||this.else))return this.condition=L(this.condition,l,k),this}get names(){const l=super.names;return F(l,this.condition),this.else&&V(l,this.else.names),l}}u.kind="if";class n extends v{}n.kind="for";class a extends n{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,k){if(super.optimizeNames(l,k))return this.iteration=L(this.iteration,l,k),this}get names(){return V(super.names,this.iteration.names)}}class y extends n{constructor(l,k,I,U){super(),this.varKind=l,this.name=k,this.from=I,this.to=U}render(l){const k=l.es5?r.varKinds.var:this.varKind,{name:I,from:U,to:H}=this;return`for(${k} ${I}=${U}; ${I}<${H}; ${I}++)`+super.render(l)}get names(){const l=F(super.names,this.from);return F(l,this.to)}}class o extends n{constructor(l,k,I,U){super(),this.loop=l,this.varKind=k,this.name=I,this.iterable=U}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,k){if(super.optimizeNames(l,k))return this.iterable=L(this.iterable,l,k),this}get names(){return V(super.names,this.iterable.names)}}class f extends v{constructor(l,k,I){super(),this.name=l,this.args=k,this.async=I}render(l){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(l)}}f.kind="func";class P extends g{render(l){return"return "+super.render(l)}}P.kind="return";class O extends v{render(l){let k="try"+super.render(l);return this.catch&&(k+=this.catch.render(l)),this.finally&&(k+=this.finally.render(l)),k}optimizeNodes(){var l,k;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(l,k){var I,U;return super.optimizeNames(l,k),(I=this.catch)===null||I===void 0||I.optimizeNames(l,k),(U=this.finally)===null||U===void 0||U.optimizeNames(l,k),this}get names(){const l=super.names;return this.catch&&V(l,this.catch.names),this.finally&&V(l,this.finally.names),l}}class D extends v{constructor(l){super(),this.error=l}render(l){return`catch(${this.error})`+super.render(l)}}D.kind="catch";class z extends v{render(l){return"finally"+super.render(l)}}z.kind="finally";class C{constructor(l,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
|
|
2
|
+
`:""},this._extScope=l,this._scope=new r.Scope({parent:l}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,k){const I=this._extScope.value(l,k);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(l,k){return this._extScope.getValue(l,k)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,k,I,U){const H=this._scope.toName(k);return I!==void 0&&U&&(this._constants[H.str]=I),this._leafNode(new p(l,H,I)),H}const(l,k,I){return this._def(r.varKinds.const,l,k,I)}let(l,k,I){return this._def(r.varKinds.let,l,k,I)}var(l,k,I){return this._def(r.varKinds.var,l,k,I)}assign(l,k,I){return this._leafNode(new d(l,k,I))}add(l,k){return this._leafNode(new h(l,e.operators.ADD,k))}code(l){return typeof l=="function"?l():l!==t.nil&&this._leafNode(new $(l)),this}object(...l){const k=["{"];for(const[I,U]of l)k.length>1&&k.push(","),k.push(I),(I!==U||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,U));return k.push("}"),new t._Code(k)}if(l,k,I){if(this._blockNode(new u(l)),k&&I)this.code(k).else().code(I).endIf();else if(k)this.code(k).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new u(l))}else(){return this._elseNode(new c)}endIf(){return this._endBlockNode(u,c)}_for(l,k){return this._blockNode(l),k&&this.code(k).endFor(),this}for(l,k){return this._for(new a(l),k)}forRange(l,k,I,U,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const Q=this._scope.toName(l);return this._for(new y(H,Q,k,I),()=>U(Q))}forOf(l,k,I,U=r.varKinds.const){const H=this._scope.toName(l);if(this.opts.es5){const Q=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${Q}.length`,Y=>{this.var(H,(0,t._)`${Q}[${Y}]`),I(H)})}return this._for(new o("of",U,H,k),()=>I(H))}forIn(l,k,I,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,t._)`Object.keys(${k})`,I);const H=this._scope.toName(l);return this._for(new o("in",U,H,k),()=>I(H))}endFor(){return this._endBlockNode(n)}label(l){return this._leafNode(new b(l))}break(l){return this._leafNode(new _(l))}return(l){const k=new P;if(this._blockNode(k),this.code(l),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(l,k,I){if(!k&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new O;if(this._blockNode(U),this.code(l),k){const H=this.name("e");this._currNode=U.catch=new D(H),k(H)}return I&&(this._currNode=U.finally=new z,this.code(I)),this._endBlockNode(D,z)}throw(l){return this._leafNode(new S(l))}block(l,k){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(k),this}endBlock(l){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-k;if(I<0||l!==void 0&&I!==l)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${l} expected`);return this._nodes.length=k,this}func(l,k=t.nil,I,U){return this._blockNode(new f(l,k,I)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(f)}optimize(l=1){for(;l-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(l){return this._currNode.nodes.push(l),this}_blockNode(l){this._currNode.nodes.push(l),this._nodes.push(l)}_endBlockNode(l,k){const I=this._currNode;if(I instanceof l||k&&I instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${l.kind}/${k.kind}`:l.kind}"`)}_elseNode(l){const k=this._currNode;if(!(k instanceof u))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const k=this._nodes;k[k.length-1]=l}}e.CodeGen=C;function V(N,l){for(const k in l)N[k]=(N[k]||0)+(l[k]||0);return N}function F(N,l){return l instanceof t._CodeOrName?V(N,l.names):N}function L(N,l,k){if(N instanceof t.Name)return I(N);if(!U(N))return N;return new t._Code(N._items.reduce((H,Q)=>(Q instanceof t.Name&&(Q=I(Q)),Q instanceof t._Code?H.push(...Q._items):H.push(Q),H),[]));function I(H){const Q=k[H.str];return Q===void 0||l[H.str]!==1?H:(delete l[H.str],Q)}function U(H){return H instanceof t._Code&&H._items.some(Q=>Q instanceof t.Name&&l[Q.str]===1&&k[Q.str]!==void 0)}}function X(N,l){for(const k in l)N[k]=(N[k]||0)-(l[k]||0)}function oe(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,t._)`!${T(N)}`}e.not=oe;const ae=j(e.operators.AND);function ee(...N){return N.reduce(ae)}e.and=ee;const ye=j(e.operators.OR);function M(...N){return N.reduce(ye)}e.or=M;function j(N){return(l,k)=>l===t.nil?k:k===t.nil?l:(0,t._)`${T(l)} ${N} ${T(k)}`}function T(N){return N instanceof t.Name?N:(0,t._)`(${N})`}})(xt)),xt}var W={},$r;function Z(){if($r)return W;$r=1,Object.defineProperty(W,"__esModule",{value:!0}),W.checkStrictMode=W.getErrorPath=W.Type=W.useFunc=W.setEvaluated=W.evaluatedPropsToName=W.mergeEvaluated=W.eachItem=W.unescapeJsonPointer=W.escapeJsonPointer=W.escapeFragment=W.unescapeFragment=W.schemaRefOrVal=W.schemaHasRulesButRef=W.schemaHasRules=W.checkUnknownRules=W.alwaysValidSchema=W.toHash=void 0;const e=G(),t=Ve();function r(o){const f={};for(const P of o)f[P]=!0;return f}W.toHash=r;function i(o,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(m(o,f),!s(f,o.self.RULES.all))}W.alwaysValidSchema=i;function m(o,f=o.schema){const{opts:P,self:O}=o;if(!P.strictSchema||typeof f=="boolean")return;const D=O.RULES.keywords;for(const z in f)D[z]||y(o,`unknown keyword: "${z}"`)}W.checkUnknownRules=m;function s(o,f){if(typeof o=="boolean")return!o;for(const P in o)if(f[P])return!0;return!1}W.schemaHasRules=s;function p(o,f){if(typeof o=="boolean")return!o;for(const P in o)if(P!=="$ref"&&f.all[P])return!0;return!1}W.schemaHasRulesButRef=p;function d({topSchemaRef:o,schemaPath:f},P,O,D){if(!D){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${o}${f}${(0,e.getProperty)(O)}`}W.schemaRefOrVal=d;function h(o){return S(decodeURIComponent(o))}W.unescapeFragment=h;function b(o){return encodeURIComponent(_(o))}W.escapeFragment=b;function _(o){return typeof o=="number"?`${o}`:o.replace(/~/g,"~0").replace(/\//g,"~1")}W.escapeJsonPointer=_;function S(o){return o.replace(/~1/g,"/").replace(/~0/g,"~")}W.unescapeJsonPointer=S;function $(o,f){if(Array.isArray(o))for(const P of o)f(P);else f(o)}W.eachItem=$;function g({mergeNames:o,mergeToName:f,mergeValues:P,resultToName:O}){return(D,z,C,V)=>{const F=C===void 0?z:C instanceof e.Name?(z instanceof e.Name?o(D,z,C):f(D,z,C),C):z instanceof e.Name?(f(D,C,z),z):P(z,C);return V===e.Name&&!(F instanceof e.Name)?O(D,F):F}}W.mergeEvaluated={props:g({mergeNames:(o,f,P)=>o.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>{o.if((0,e._)`${f} === true`,()=>o.assign(P,!0),()=>o.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${f})`))}),mergeToName:(o,f,P)=>o.if((0,e._)`${P} !== true`,()=>{f===!0?o.assign(P,!0):(o.assign(P,(0,e._)`${P} || {}`),w(o,P,f))}),mergeValues:(o,f)=>o===!0?!0:{...o,...f},resultToName:v}),items:g({mergeNames:(o,f,P)=>o.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>o.assign(P,(0,e._)`${f} === true ? true : ${P} > ${f} ? ${P} : ${f}`)),mergeToName:(o,f,P)=>o.if((0,e._)`${P} !== true`,()=>o.assign(P,f===!0?!0:(0,e._)`${P} > ${f} ? ${P} : ${f}`)),mergeValues:(o,f)=>o===!0?!0:Math.max(o,f),resultToName:(o,f)=>o.var("items",f)})};function v(o,f){if(f===!0)return o.var("props",!0);const P=o.var("props",(0,e._)`{}`);return f!==void 0&&w(o,P,f),P}W.evaluatedPropsToName=v;function w(o,f,P){Object.keys(P).forEach(O=>o.assign((0,e._)`${f}${(0,e.getProperty)(O)}`,!0))}W.setEvaluated=w;const c={};function u(o,f){return o.scopeValue("func",{ref:f,code:c[f.code]||(c[f.code]=new t._Code(f.code))})}W.useFunc=u;var n;(function(o){o[o.Num=0]="Num",o[o.Str=1]="Str"})(n||(W.Type=n={}));function a(o,f,P){if(o instanceof e.Name){const O=f===n.Num;return P?O?(0,e._)`"[" + ${o} + "]"`:(0,e._)`"['" + ${o} + "']"`:O?(0,e._)`"/" + ${o}`:(0,e._)`"/" + ${o}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(o).toString():"/"+_(o)}W.getErrorPath=a;function y(o,f,P=o.opts.strictSchema){if(P){if(f=`strict mode: ${f}`,P===!0)throw new Error(f);o.self.logger.warn(f)}}return W.checkStrictMode=y,W}var ze={},br;function be(){if(br)return ze;br=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=G(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return ze.default=t,ze}var wr;function Fe(){return wr||(wr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=G(),r=Z(),i=be();e.keywordError={message:({keyword:c})=>(0,t.str)`must pass "${c}" keyword validation`},e.keyword$DataError={message:({keyword:c,schemaType:u})=>u?(0,t.str)`"${c}" keyword must be ${u} ($data)`:(0,t.str)`"${c}" keyword is invalid ($data)`};function m(c,u=e.keywordError,n,a){const{it:y}=c,{gen:o,compositeRule:f,allErrors:P}=y,O=S(c,u,n);a??(f||P)?h(o,O):b(y,(0,t._)`[${O}]`)}e.reportError=m;function s(c,u=e.keywordError,n){const{it:a}=c,{gen:y,compositeRule:o,allErrors:f}=a,P=S(c,u,n);h(y,P),o||f||b(a,i.default.vErrors)}e.reportExtraError=s;function p(c,u){c.assign(i.default.errors,u),c.if((0,t._)`${i.default.vErrors} !== null`,()=>c.if(u,()=>c.assign((0,t._)`${i.default.vErrors}.length`,u),()=>c.assign(i.default.vErrors,null)))}e.resetErrorsCount=p;function d({gen:c,keyword:u,schemaValue:n,data:a,errsCount:y,it:o}){if(y===void 0)throw new Error("ajv implementation error");const f=c.name("err");c.forRange("i",y,i.default.errors,P=>{c.const(f,(0,t._)`${i.default.vErrors}[${P}]`),c.if((0,t._)`${f}.instancePath === undefined`,()=>c.assign((0,t._)`${f}.instancePath`,(0,t.strConcat)(i.default.instancePath,o.errorPath))),c.assign((0,t._)`${f}.schemaPath`,(0,t.str)`${o.errSchemaPath}/${u}`),o.opts.verbose&&(c.assign((0,t._)`${f}.schema`,n),c.assign((0,t._)`${f}.data`,a))})}e.extendErrors=d;function h(c,u){const n=c.const("err",u);c.if((0,t._)`${i.default.vErrors} === null`,()=>c.assign(i.default.vErrors,(0,t._)`[${n}]`),(0,t._)`${i.default.vErrors}.push(${n})`),c.code((0,t._)`${i.default.errors}++`)}function b(c,u){const{gen:n,validateName:a,schemaEnv:y}=c;y.$async?n.throw((0,t._)`new ${c.ValidationError}(${u})`):(n.assign((0,t._)`${a}.errors`,u),n.return(!1))}const _={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function S(c,u,n){const{createErrors:a}=c.it;return a===!1?(0,t._)`{}`:$(c,u,n)}function $(c,u,n={}){const{gen:a,it:y}=c,o=[g(y,n),v(c,n)];return w(c,u,o),a.object(...o)}function g({errorPath:c},{instancePath:u}){const n=u?(0,t.str)`${c}${(0,r.getErrorPath)(u,r.Type.Str)}`:c;return[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,n)]}function v({keyword:c,it:{errSchemaPath:u}},{schemaPath:n,parentSchema:a}){let y=a?u:(0,t.str)`${u}/${c}`;return n&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(n,r.Type.Str)}`),[_.schemaPath,y]}function w(c,{params:u,message:n},a){const{keyword:y,data:o,schemaValue:f,it:P}=c,{opts:O,propertyName:D,topSchemaRef:z,schemaPath:C}=P;a.push([_.keyword,y],[_.params,typeof u=="function"?u(c):u||(0,t._)`{}`]),O.messages&&a.push([_.message,typeof n=="function"?n(c):n]),O.verbose&&a.push([_.schema,f],[_.parentSchema,(0,t._)`${z}${C}`],[i.default.data,o]),D&&a.push([_.propertyName,D])}})(Xt)),Xt}var Pr;function es(){if(Pr)return Pe;Pr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.boolOrEmptySchema=Pe.topBoolOrEmptySchema=void 0;const e=Fe(),t=G(),r=be(),i={message:"boolean schema is false"};function m(d){const{gen:h,schema:b,validateName:_}=d;b===!1?p(d,!1):typeof b=="object"&&b.$async===!0?h.return(r.default.data):(h.assign((0,t._)`${_}.errors`,null),h.return(!0))}Pe.topBoolOrEmptySchema=m;function s(d,h){const{gen:b,schema:_}=d;_===!1?(b.var(h,!1),p(d)):b.var(h,!0)}Pe.boolOrEmptySchema=s;function p(d,h){const{gen:b,data:_}=d,S={gen:b,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:d};(0,e.reportError)(S,i,void 0,h)}return Pe}var re={},ke={},kr;function Sr(){if(kr)return ke;kr=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getRules=ke.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(m){return typeof m=="string"&&t.has(m)}ke.isJSONType=r;function i(){const m={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...m,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},m.number,m.string,m.array,m.object],post:{rules:[]},all:{},keywords:{}}}return ke.getRules=i,ke}var _e={},Er;function jr(){if(Er)return _e;Er=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:i,self:m},s){const p=m.RULES.types[s];return p&&p!==!0&&t(i,p)}_e.schemaHasRulesForType=e;function t(i,m){return m.rules.some(s=>r(i,s))}_e.shouldUseGroup=t;function r(i,m){var s;return i[m.keyword]!==void 0||((s=m.definition.implements)===null||s===void 0?void 0:s.some(p=>i[p]!==void 0))}return _e.shouldUseRule=r,_e}var Rr;function Le(){if(Rr)return re;Rr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=Sr(),t=jr(),r=Fe(),i=G(),m=Z();var s;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(s||(re.DataType=s={}));function p(n){const a=d(n.type);if(a.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!a.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&a.push("null")}return a}re.getSchemaTypes=p;function d(n){const a=Array.isArray(n)?n:n?[n]:[];if(a.every(e.isJSONType))return a;throw new Error("type must be JSONType or JSONType[]: "+a.join(","))}re.getJSONTypes=d;function h(n,a){const{gen:y,data:o,opts:f}=n,P=_(a,f.coerceTypes),O=a.length>0&&!(P.length===0&&a.length===1&&(0,t.schemaHasRulesForType)(n,a[0]));if(O){const D=v(a,o,f.strictNumbers,s.Wrong);y.if(D,()=>{P.length?S(n,a,P):c(n)})}return O}re.coerceAndCheckDataType=h;const b=new Set(["string","number","integer","boolean","null"]);function _(n,a){return a?n.filter(y=>b.has(y)||a==="array"&&y==="array"):[]}function S(n,a,y){const{gen:o,data:f,opts:P}=n,O=o.let("dataType",(0,i._)`typeof ${f}`),D=o.let("coerced",(0,i._)`undefined`);P.coerceTypes==="array"&&o.if((0,i._)`${O} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>o.assign(f,(0,i._)`${f}[0]`).assign(O,(0,i._)`typeof ${f}`).if(v(a,f,P.strictNumbers),()=>o.assign(D,f))),o.if((0,i._)`${D} !== undefined`);for(const C of y)(b.has(C)||C==="array"&&P.coerceTypes==="array")&&z(C);o.else(),c(n),o.endIf(),o.if((0,i._)`${D} !== undefined`,()=>{o.assign(f,D),$(n,D)});function z(C){switch(C){case"string":o.elseIf((0,i._)`${O} == "number" || ${O} == "boolean"`).assign(D,(0,i._)`"" + ${f}`).elseIf((0,i._)`${f} === null`).assign(D,(0,i._)`""`);return;case"number":o.elseIf((0,i._)`${O} == "boolean" || ${f} === null
|
|
3
|
+
|| (${O} == "string" && ${f} && ${f} == +${f})`).assign(D,(0,i._)`+${f}`);return;case"integer":o.elseIf((0,i._)`${O} === "boolean" || ${f} === null
|
|
4
|
+
|| (${O} === "string" && ${f} && ${f} == +${f} && !(${f} % 1))`).assign(D,(0,i._)`+${f}`);return;case"boolean":o.elseIf((0,i._)`${f} === "false" || ${f} === 0 || ${f} === null`).assign(D,!1).elseIf((0,i._)`${f} === "true" || ${f} === 1`).assign(D,!0);return;case"null":o.elseIf((0,i._)`${f} === "" || ${f} === 0 || ${f} === false`),o.assign(D,null);return;case"array":o.elseIf((0,i._)`${O} === "string" || ${O} === "number"
|
|
5
|
+
|| ${O} === "boolean" || ${f} === null`).assign(D,(0,i._)`[${f}]`)}}}function $({gen:n,parentData:a,parentDataProperty:y},o){n.if((0,i._)`${a} !== undefined`,()=>n.assign((0,i._)`${a}[${y}]`,o))}function g(n,a,y,o=s.Correct){const f=o===s.Correct?i.operators.EQ:i.operators.NEQ;let P;switch(n){case"null":return(0,i._)`${a} ${f} null`;case"array":P=(0,i._)`Array.isArray(${a})`;break;case"object":P=(0,i._)`${a} && typeof ${a} == "object" && !Array.isArray(${a})`;break;case"integer":P=O((0,i._)`!(${a} % 1) && !isNaN(${a})`);break;case"number":P=O();break;default:return(0,i._)`typeof ${a} ${f} ${n}`}return o===s.Correct?P:(0,i.not)(P);function O(D=i.nil){return(0,i.and)((0,i._)`typeof ${a} == "number"`,D,y?(0,i._)`isFinite(${a})`:i.nil)}}re.checkDataType=g;function v(n,a,y,o){if(n.length===1)return g(n[0],a,y,o);let f;const P=(0,m.toHash)(n);if(P.array&&P.object){const O=(0,i._)`typeof ${a} != "object"`;f=P.null?O:(0,i._)`!${a} || ${O}`,delete P.null,delete P.array,delete P.object}else f=i.nil;P.number&&delete P.integer;for(const O in P)f=(0,i.and)(f,g(O,a,y,o));return f}re.checkDataTypes=v;const w={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:a})=>typeof n=="string"?(0,i._)`{type: ${n}}`:(0,i._)`{type: ${a}}`};function c(n){const a=u(n);(0,r.reportError)(a,w)}re.reportTypeError=c;function u(n){const{gen:a,data:y,schema:o}=n,f=(0,m.schemaRefOrVal)(n,o,"type");return{gen:a,keyword:"type",data:y,schema:o.type,schemaCode:f,schemaValue:f,parentSchema:o,params:{},it:n}}return re}var Ie={},Nr;function ts(){if(Nr)return Ie;Nr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.assignDefaults=void 0;const e=G(),t=Z();function r(m,s){const{properties:p,items:d}=m.schema;if(s==="object"&&p)for(const h in p)i(m,h,p[h].default);else s==="array"&&Array.isArray(d)&&d.forEach((h,b)=>i(m,b,h.default))}Ie.assignDefaults=r;function i(m,s,p){const{gen:d,compositeRule:h,data:b,opts:_}=m;if(p===void 0)return;const S=(0,e._)`${b}${(0,e.getProperty)(s)}`;if(h){(0,t.checkStrictMode)(m,`default is ignored for: ${S}`);return}let $=(0,e._)`${S} === undefined`;_.useDefaults==="empty"&&($=(0,e._)`${$} || ${S} === null || ${S} === ""`),d.if($,(0,e._)`${S} = ${(0,e.stringify)(p)}`)}return Ie}var pe={},x={},Or;function me(){if(Or)return x;Or=1,Object.defineProperty(x,"__esModule",{value:!0}),x.validateUnion=x.validateArray=x.usePattern=x.callValidateCode=x.schemaProperties=x.allSchemaProperties=x.noPropertyInData=x.propertyInData=x.isOwnProperty=x.hasPropFunc=x.reportMissingProp=x.checkMissingProp=x.checkReportMissingProp=void 0;const e=G(),t=Z(),r=be(),i=Z();function m(n,a){const{gen:y,data:o,it:f}=n;y.if(_(y,o,a,f.opts.ownProperties),()=>{n.setParams({missingProperty:(0,e._)`${a}`},!0),n.error()})}x.checkReportMissingProp=m;function s({gen:n,data:a,it:{opts:y}},o,f){return(0,e.or)(...o.map(P=>(0,e.and)(_(n,a,P,y.ownProperties),(0,e._)`${f} = ${P}`)))}x.checkMissingProp=s;function p(n,a){n.setParams({missingProperty:a},!0),n.error()}x.reportMissingProp=p;function d(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}x.hasPropFunc=d;function h(n,a,y){return(0,e._)`${d(n)}.call(${a}, ${y})`}x.isOwnProperty=h;function b(n,a,y,o){const f=(0,e._)`${a}${(0,e.getProperty)(y)} !== undefined`;return o?(0,e._)`${f} && ${h(n,a,y)}`:f}x.propertyInData=b;function _(n,a,y,o){const f=(0,e._)`${a}${(0,e.getProperty)(y)} === undefined`;return o?(0,e.or)(f,(0,e.not)(h(n,a,y))):f}x.noPropertyInData=_;function S(n){return n?Object.keys(n).filter(a=>a!=="__proto__"):[]}x.allSchemaProperties=S;function $(n,a){return S(a).filter(y=>!(0,t.alwaysValidSchema)(n,a[y]))}x.schemaProperties=$;function g({schemaCode:n,data:a,it:{gen:y,topSchemaRef:o,schemaPath:f,errorPath:P},it:O},D,z,C){const V=C?(0,e._)`${n}, ${a}, ${o}${f}`:a,F=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,O.parentData],[r.default.parentDataProperty,O.parentDataProperty],[r.default.rootData,r.default.rootData]];O.opts.dynamicRef&&F.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const L=(0,e._)`${V}, ${y.object(...F)}`;return z!==e.nil?(0,e._)`${D}.call(${z}, ${L})`:(0,e._)`${D}(${L})`}x.callValidateCode=g;const v=(0,e._)`new RegExp`;function w({gen:n,it:{opts:a}},y){const o=a.unicodeRegExp?"u":"",{regExp:f}=a.code,P=f(y,o);return n.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${f.code==="new RegExp"?v:(0,i.useFunc)(n,f)}(${y}, ${o})`})}x.usePattern=w;function c(n){const{gen:a,data:y,keyword:o,it:f}=n,P=a.name("valid");if(f.allErrors){const D=a.let("valid",!0);return O(()=>a.assign(D,!1)),D}return a.var(P,!0),O(()=>a.break()),P;function O(D){const z=a.const("len",(0,e._)`${y}.length`);a.forRange("i",0,z,C=>{n.subschema({keyword:o,dataProp:C,dataPropType:t.Type.Num},P),a.if((0,e.not)(P),D)})}}x.validateArray=c;function u(n){const{gen:a,schema:y,keyword:o,it:f}=n;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(f,z))&&!f.opts.unevaluated)return;const O=a.let("valid",!1),D=a.name("_valid");a.block(()=>y.forEach((z,C)=>{const V=n.subschema({keyword:o,schemaProp:C,compositeRule:!0},D);a.assign(O,(0,e._)`${O} || ${D}`),n.mergeValidEvaluated(V,D)||a.if((0,e.not)(O))})),n.result(O,()=>n.reset(),()=>n.error(!0))}return x.validateUnion=u,x}var Ir;function rs(){if(Ir)return pe;Ir=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateKeywordUsage=pe.validSchemaType=pe.funcKeywordCode=pe.macroKeywordCode=void 0;const e=G(),t=be(),r=me(),i=Fe();function m($,g){const{gen:v,keyword:w,schema:c,parentSchema:u,it:n}=$,a=g.macro.call(n.self,c,u,n),y=b(v,w,a);n.opts.validateSchema!==!1&&n.self.validateSchema(a,!0);const o=v.name("valid");$.subschema({schema:a,schemaPath:e.nil,errSchemaPath:`${n.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},o),$.pass(o,()=>$.error(!0))}pe.macroKeywordCode=m;function s($,g){var v;const{gen:w,keyword:c,schema:u,parentSchema:n,$data:a,it:y}=$;h(y,g);const o=!a&&g.compile?g.compile.call(y.self,u,n,y):g.validate,f=b(w,c,o),P=w.let("valid");$.block$data(P,O),$.ok((v=g.valid)!==null&&v!==void 0?v:P);function O(){if(g.errors===!1)C(),g.modifying&&p($),V(()=>$.error());else{const F=g.async?D():z();g.modifying&&p($),V(()=>d($,F))}}function D(){const F=w.let("ruleErrs",null);return w.try(()=>C((0,e._)`await `),L=>w.assign(P,!1).if((0,e._)`${L} instanceof ${y.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${f}.errors`;return w.assign(F,null),C(e.nil),F}function C(F=g.async?(0,e._)`await `:e.nil){const L=y.opts.passContext?t.default.this:t.default.self,X=!("compile"in g&&!a||g.schema===!1);w.assign(P,(0,e._)`${F}${(0,r.callValidateCode)($,f,L,X)}`,g.modifying)}function V(F){var L;w.if((0,e.not)((L=g.valid)!==null&&L!==void 0?L:P),F)}}pe.funcKeywordCode=s;function p($){const{gen:g,data:v,it:w}=$;g.if(w.parentData,()=>g.assign(v,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function d($,g){const{gen:v}=$;v.if((0,e._)`Array.isArray(${g})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,i.extendErrors)($)},()=>$.error())}function h({schemaEnv:$},g){if(g.async&&!$.$async)throw new Error("async keyword in sync schema")}function b($,g,v){if(v===void 0)throw new Error(`keyword "${g}" failed to compile`);return $.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function _($,g,v=!1){return!g.length||g.some(w=>w==="array"?Array.isArray($):w==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==w||v&&typeof $>"u")}pe.validSchemaType=_;function S({schema:$,opts:g,self:v,errSchemaPath:w},c,u){if(Array.isArray(c.keyword)?!c.keyword.includes(u):c.keyword!==u)throw new Error("ajv implementation error");const n=c.dependencies;if(n?.some(a=>!Object.prototype.hasOwnProperty.call($,a)))throw new Error(`parent schema must have dependencies of ${u}: ${n.join(",")}`);if(c.validateSchema&&!c.validateSchema($[u])){const y=`keyword "${u}" value is invalid at path "${w}": `+v.errorsText(c.validateSchema.errors);if(g.validateSchema==="log")v.logger.error(y);else throw new Error(y)}}return pe.validateKeywordUsage=S,pe}var $e={},Cr;function ns(){if(Cr)return $e;Cr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=G(),t=Z();function r(s,{keyword:p,schemaProp:d,schema:h,schemaPath:b,errSchemaPath:_,topSchemaRef:S}){if(p!==void 0&&h!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(p!==void 0){const $=s.schema[p];return d===void 0?{schema:$,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(p)}`,errSchemaPath:`${s.errSchemaPath}/${p}`}:{schema:$[d],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(p)}${(0,e.getProperty)(d)}`,errSchemaPath:`${s.errSchemaPath}/${p}/${(0,t.escapeFragment)(d)}`}}if(h!==void 0){if(b===void 0||_===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:h,schemaPath:b,topSchemaRef:S,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function i(s,p,{dataProp:d,dataPropType:h,data:b,dataTypes:_,propertyName:S}){if(b!==void 0&&d!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:$}=p;if(d!==void 0){const{errorPath:v,dataPathArr:w,opts:c}=p,u=$.let("data",(0,e._)`${p.data}${(0,e.getProperty)(d)}`,!0);g(u),s.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(d,h,c.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${d}`,s.dataPathArr=[...w,s.parentDataProperty]}if(b!==void 0){const v=b instanceof e.Name?b:$.let("data",b,!0);g(v),S!==void 0&&(s.propertyName=S)}_&&(s.dataTypes=_);function g(v){s.data=v,s.dataLevel=p.dataLevel+1,s.dataTypes=[],p.definedProperties=new Set,s.parentData=p.data,s.dataNames=[...p.dataNames,v]}}$e.extendSubschemaData=i;function m(s,{jtdDiscriminator:p,jtdMetadata:d,compositeRule:h,createErrors:b,allErrors:_}){h!==void 0&&(s.compositeRule=h),b!==void 0&&(s.createErrors=b),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=p,s.jtdMetadata=d}return $e.extendSubschemaMode=m,$e}var ie={},rr,qr;function Tr(){return qr||(qr=1,rr=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var i,m,s;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(m=i;m--!==0;)if(!e(t[m],r[m]))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=Object.keys(t),i=s.length,i!==Object.keys(r).length)return!1;for(m=i;m--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[m]))return!1;for(m=i;m--!==0;){var p=s[m];if(!e(t[p],r[p]))return!1}return!0}return t!==t&&r!==r}),rr}var nr={exports:{}},Dr;function ss(){if(Dr)return nr.exports;Dr=1;var e=nr.exports=function(i,m,s){typeof m=="function"&&(s=m,m={}),s=m.cb||s;var p=typeof s=="function"?s:s.pre||function(){},d=s.post||function(){};t(m,p,d,i,"",i)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(i,m,s,p,d,h,b,_,S,$){if(p&&typeof p=="object"&&!Array.isArray(p)){m(p,d,h,b,_,S,$);for(var g in p){var v=p[g];if(Array.isArray(v)){if(g in e.arrayKeywords)for(var w=0;w<v.length;w++)t(i,m,s,v[w],d+"/"+g+"/"+w,h,d,g,p,w)}else if(g in e.propsKeywords){if(v&&typeof v=="object")for(var c in v)t(i,m,s,v[c],d+"/"+g+"/"+r(c),h,d,g,p,c)}else(g in e.keywords||i.allKeys&&!(g in e.skipKeywords))&&t(i,m,s,v,d+"/"+g,h,d,g,p)}s(p,d,h,b,_,S,$)}}function r(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}return nr.exports}var Mr;function Ue(){if(Mr)return ie;Mr=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.getSchemaRefs=ie.resolveUrl=ie.normalizeId=ie._getFullPath=ie.getFullPath=ie.inlineRef=void 0;const e=Z(),t=Tr(),r=ss(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function m(w,c=!0){return typeof w=="boolean"?!0:c===!0?!p(w):c?d(w)<=c:!1}ie.inlineRef=m;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function p(w){for(const c in w){if(s.has(c))return!0;const u=w[c];if(Array.isArray(u)&&u.some(p)||typeof u=="object"&&p(u))return!0}return!1}function d(w){let c=0;for(const u in w){if(u==="$ref")return 1/0;if(c++,!i.has(u)&&(typeof w[u]=="object"&&(0,e.eachItem)(w[u],n=>c+=d(n)),c===1/0))return 1/0}return c}function h(w,c="",u){u!==!1&&(c=S(c));const n=w.parse(c);return b(w,n)}ie.getFullPath=h;function b(w,c){return w.serialize(c).split("#")[0]+"#"}ie._getFullPath=b;const _=/#\/?$/;function S(w){return w?w.replace(_,""):""}ie.normalizeId=S;function $(w,c,u){return u=S(u),w.resolve(c,u)}ie.resolveUrl=$;const g=/^[a-z_][-a-z0-9._]*$/i;function v(w,c){if(typeof w=="boolean")return{};const{schemaId:u,uriResolver:n}=this.opts,a=S(w[u]||c),y={"":a},o=h(n,a,!1),f={},P=new Set;return r(w,{allKeys:!0},(z,C,V,F)=>{if(F===void 0)return;const L=o+C;let X=y[F];typeof z[u]=="string"&&(X=oe.call(this,z[u])),ae.call(this,z.$anchor),ae.call(this,z.$dynamicAnchor),y[C]=X;function oe(ee){const ye=this.opts.uriResolver.resolve;if(ee=S(X?ye(X,ee):ee),P.has(ee))throw D(ee);P.add(ee);let M=this.refs[ee];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?O(z,M.schema,ee):ee!==S(L)&&(ee[0]==="#"?(O(z,f[ee],ee),f[ee]=z):this.refs[ee]=L),ee}function ae(ee){if(typeof ee=="string"){if(!g.test(ee))throw new Error(`invalid anchor "${ee}"`);oe.call(this,`#${ee}`)}}}),f;function O(z,C,V){if(C!==void 0&&!t(z,C))throw D(V)}function D(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ie.getSchemaRefs=v,ie}var Ar;function Ke(){if(Ar)return ve;Ar=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=es(),t=Le(),r=jr(),i=Le(),m=ts(),s=rs(),p=ns(),d=G(),h=be(),b=Ue(),_=Z(),S=Fe();function $(E){if(o(E)&&(P(E),y(E))){c(E);return}g(E,()=>(0,e.topBoolOrEmptySchema)(E))}ve.validateFunctionCode=$;function g({gen:E,validateName:R,schema:q,schemaEnv:A,opts:K},B){K.code.es5?E.func(R,(0,d._)`${h.default.data}, ${h.default.valCxt}`,A.$async,()=>{E.code((0,d._)`"use strict"; ${n(q,K)}`),w(E,K),E.code(B)}):E.func(R,(0,d._)`${h.default.data}, ${v(K)}`,A.$async,()=>E.code(n(q,K)).code(B))}function v(E){return(0,d._)`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${E.dynamicRef?(0,d._)`, ${h.default.dynamicAnchors}={}`:d.nil}}={}`}function w(E,R){E.if(h.default.valCxt,()=>{E.var(h.default.instancePath,(0,d._)`${h.default.valCxt}.${h.default.instancePath}`),E.var(h.default.parentData,(0,d._)`${h.default.valCxt}.${h.default.parentData}`),E.var(h.default.parentDataProperty,(0,d._)`${h.default.valCxt}.${h.default.parentDataProperty}`),E.var(h.default.rootData,(0,d._)`${h.default.valCxt}.${h.default.rootData}`),R.dynamicRef&&E.var(h.default.dynamicAnchors,(0,d._)`${h.default.valCxt}.${h.default.dynamicAnchors}`)},()=>{E.var(h.default.instancePath,(0,d._)`""`),E.var(h.default.parentData,(0,d._)`undefined`),E.var(h.default.parentDataProperty,(0,d._)`undefined`),E.var(h.default.rootData,h.default.data),R.dynamicRef&&E.var(h.default.dynamicAnchors,(0,d._)`{}`)})}function c(E){const{schema:R,opts:q,gen:A}=E;g(E,()=>{q.$comment&&R.$comment&&F(E),z(E),A.let(h.default.vErrors,null),A.let(h.default.errors,0),q.unevaluated&&u(E),O(E),L(E)})}function u(E){const{gen:R,validateName:q}=E;E.evaluated=R.const("evaluated",(0,d._)`${q}.evaluated`),R.if((0,d._)`${E.evaluated}.dynamicProps`,()=>R.assign((0,d._)`${E.evaluated}.props`,(0,d._)`undefined`)),R.if((0,d._)`${E.evaluated}.dynamicItems`,()=>R.assign((0,d._)`${E.evaluated}.items`,(0,d._)`undefined`))}function n(E,R){const q=typeof E=="object"&&E[R.schemaId];return q&&(R.code.source||R.code.process)?(0,d._)`/*# sourceURL=${q} */`:d.nil}function a(E,R){if(o(E)&&(P(E),y(E))){f(E,R);return}(0,e.boolOrEmptySchema)(E,R)}function y({schema:E,self:R}){if(typeof E=="boolean")return!E;for(const q in E)if(R.RULES.all[q])return!0;return!1}function o(E){return typeof E.schema!="boolean"}function f(E,R){const{schema:q,gen:A,opts:K}=E;K.$comment&&q.$comment&&F(E),C(E),V(E);const B=A.const("_errs",h.default.errors);O(E,B),A.var(R,(0,d._)`${B} === ${h.default.errors}`)}function P(E){(0,_.checkUnknownRules)(E),D(E)}function O(E,R){if(E.opts.jtd)return oe(E,[],!1,R);const q=(0,t.getSchemaTypes)(E.schema),A=(0,t.coerceAndCheckDataType)(E,q);oe(E,q,!A,R)}function D(E){const{schema:R,errSchemaPath:q,opts:A,self:K}=E;R.$ref&&A.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(R,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(E){const{schema:R,opts:q}=E;R.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(E,"default is ignored in the schema root")}function C(E){const R=E.schema[E.opts.schemaId];R&&(E.baseId=(0,b.resolveUrl)(E.opts.uriResolver,E.baseId,R))}function V(E){if(E.schema.$async&&!E.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:E,schemaEnv:R,schema:q,errSchemaPath:A,opts:K}){const B=q.$comment;if(K.$comment===!0)E.code((0,d._)`${h.default.self}.logger.log(${B})`);else if(typeof K.$comment=="function"){const ne=(0,d.str)`${A}/$comment`,ge=E.scopeValue("root",{ref:R.root});E.code((0,d._)`${h.default.self}.opts.$comment(${B}, ${ne}, ${ge}.schema)`)}}function L(E){const{gen:R,schemaEnv:q,validateName:A,ValidationError:K,opts:B}=E;q.$async?R.if((0,d._)`${h.default.errors} === 0`,()=>R.return(h.default.data),()=>R.throw((0,d._)`new ${K}(${h.default.vErrors})`)):(R.assign((0,d._)`${A}.errors`,h.default.vErrors),B.unevaluated&&X(E),R.return((0,d._)`${h.default.errors} === 0`))}function X({gen:E,evaluated:R,props:q,items:A}){q instanceof d.Name&&E.assign((0,d._)`${R}.props`,q),A instanceof d.Name&&E.assign((0,d._)`${R}.items`,A)}function oe(E,R,q,A){const{gen:K,schema:B,data:ne,allErrors:ge,opts:ue,self:de}=E,{RULES:se}=de;if(B.$ref&&(ue.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(B,se))){K.block(()=>U(E,"$ref",se.all.$ref.definition));return}ue.jtd||ee(E,R),K.block(()=>{for(const fe of se.rules)Oe(fe);Oe(se.post)});function Oe(fe){(0,r.shouldUseGroup)(B,fe)&&(fe.type?(K.if((0,i.checkDataType)(fe.type,ne,ue.strictNumbers)),ae(E,fe),R.length===1&&R[0]===fe.type&&q&&(K.else(),(0,i.reportTypeError)(E)),K.endIf()):ae(E,fe),ge||K.if((0,d._)`${h.default.errors} === ${A||0}`))}}function ae(E,R){const{gen:q,schema:A,opts:{useDefaults:K}}=E;K&&(0,m.assignDefaults)(E,R.type),q.block(()=>{for(const B of R.rules)(0,r.shouldUseRule)(A,B)&&U(E,B.keyword,B.definition,R.type)})}function ee(E,R){E.schemaEnv.meta||!E.opts.strictTypes||(ye(E,R),E.opts.allowUnionTypes||M(E,R),j(E,E.dataTypes))}function ye(E,R){if(R.length){if(!E.dataTypes.length){E.dataTypes=R;return}R.forEach(q=>{N(E.dataTypes,q)||k(E,`type "${q}" not allowed by context "${E.dataTypes.join(",")}"`)}),l(E,R)}}function M(E,R){R.length>1&&!(R.length===2&&R.includes("null"))&&k(E,"use allowUnionTypes to allow union type keyword")}function j(E,R){const q=E.self.RULES.all;for(const A in q){const K=q[A];if(typeof K=="object"&&(0,r.shouldUseRule)(E.schema,K)){const{type:B}=K.definition;B.length&&!B.some(ne=>T(R,ne))&&k(E,`missing type "${B.join(",")}" for keyword "${A}"`)}}}function T(E,R){return E.includes(R)||R==="number"&&E.includes("integer")}function N(E,R){return E.includes(R)||R==="integer"&&E.includes("number")}function l(E,R){const q=[];for(const A of E.dataTypes)N(R,A)?q.push(A):R.includes("integer")&&A==="number"&&q.push("integer");E.dataTypes=q}function k(E,R){const q=E.schemaEnv.baseId+E.errSchemaPath;R+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(E,R,E.opts.strictTypes)}class I{constructor(R,q,A){if((0,s.validateKeywordUsage)(R,q,A),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=A,this.data=R.data,this.schema=R.schema[A],this.$data=q.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(R,this.schema,A,this.$data),this.schemaType=q.schemaType,this.parentSchema=R.schema,this.params={},this.it=R,this.def=q,this.$data)this.schemaCode=R.gen.const("vSchema",Y(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=R.gen.const("_errs",h.default.errors))}result(R,q,A){this.failResult((0,d.not)(R),q,A)}failResult(R,q,A){this.gen.if(R),A?A():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(R,q){this.failResult((0,d.not)(R),void 0,q)}fail(R){if(R===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(R),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(R){if(!this.$data)return this.fail(R);const{schemaCode:q}=this;this.fail((0,d._)`${q} !== undefined && (${(0,d.or)(this.invalid$data(),R)})`)}error(R,q,A){if(q){this.setParams(q),this._error(R,A),this.setParams({});return}this._error(R,A)}_error(R,q){(R?S.reportExtraError:S.reportError)(this,this.def.error,q)}$dataError(){(0,S.reportError)(this,this.def.$dataError||S.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,S.resetErrorsCount)(this.gen,this.errsCount)}ok(R){this.allErrors||this.gen.if(R)}setParams(R,q){q?Object.assign(this.params,R):this.params=R}block$data(R,q,A=d.nil){this.gen.block(()=>{this.check$data(R,A),q()})}check$data(R=d.nil,q=d.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:B,def:ne}=this;A.if((0,d.or)((0,d._)`${K} === undefined`,q)),R!==d.nil&&A.assign(R,!0),(B.length||ne.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),R!==d.nil&&A.assign(R,!1)),A.else()}invalid$data(){const{gen:R,schemaCode:q,schemaType:A,def:K,it:B}=this;return(0,d.or)(ne(),ge());function ne(){if(A.length){if(!(q instanceof d.Name))throw new Error("ajv implementation error");const ue=Array.isArray(A)?A:[A];return(0,d._)`${(0,i.checkDataTypes)(ue,q,B.opts.strictNumbers,i.DataType.Wrong)}`}return d.nil}function ge(){if(K.validateSchema){const ue=R.scopeValue("validate$data",{ref:K.validateSchema});return(0,d._)`!${ue}(${q})`}return d.nil}}subschema(R,q){const A=(0,p.getSubschema)(this.it,R);(0,p.extendSubschemaData)(A,this.it,R),(0,p.extendSubschemaMode)(A,R);const K={...this.it,...A,items:void 0,props:void 0};return a(K,q),K}mergeEvaluated(R,q){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&R.props!==void 0&&(A.props=_.mergeEvaluated.props(K,R.props,A.props,q)),A.items!==!0&&R.items!==void 0&&(A.items=_.mergeEvaluated.items(K,R.items,A.items,q)))}mergeValidEvaluated(R,q){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(q,()=>this.mergeEvaluated(R,d.Name)),!0}}ve.KeywordCxt=I;function U(E,R,q,A){const K=new I(E,q,R);"code"in q?q.code(K,A):K.$data&&q.validate?(0,s.funcKeywordCode)(K,q):"macro"in q?(0,s.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(K,q)}const H=/^\/(?:[^~]|~0|~1)*$/,Q=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y(E,{dataLevel:R,dataNames:q,dataPathArr:A}){let K,B;if(E==="")return h.default.rootData;if(E[0]==="/"){if(!H.test(E))throw new Error(`Invalid JSON-pointer: ${E}`);K=E,B=h.default.rootData}else{const de=Q.exec(E);if(!de)throw new Error(`Invalid JSON-pointer: ${E}`);const se=+de[1];if(K=de[2],K==="#"){if(se>=R)throw new Error(ue("property/index",se));return A[R-se]}if(se>R)throw new Error(ue("data",se));if(B=q[R-se],!K)return B}let ne=B;const ge=K.split("/");for(const de of ge)de&&(B=(0,d._)`${B}${(0,d.getProperty)((0,_.unescapeJsonPointer)(de))}`,ne=(0,d._)`${ne} && ${B}`);return ne;function ue(de,se){return`Cannot access ${de} ${se} levels up, current level is ${R}`}}return ve.getData=Y,ve}var He={},Vr;function sr(){if(Vr)return He;Vr=1,Object.defineProperty(He,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return He.default=e,He}var Je={},zr;function Ge(){if(zr)return Je;zr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=Ue();class t extends Error{constructor(i,m,s,p){super(p||`can't resolve reference ${s} from id ${m}`),this.missingRef=(0,e.resolveUrl)(i,m,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(i,this.missingRef))}}return Je.default=t,Je}var le={},Fr;function ir(){if(Fr)return le;Fr=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=G(),t=sr(),r=be(),i=Ue(),m=Z(),s=Ke();class p{constructor(u){var n;this.refs={},this.dynamicAnchors={};let a;typeof u.schema=="object"&&(a=u.schema),this.schema=u.schema,this.schemaId=u.schemaId,this.root=u.root||this,this.baseId=(n=u.baseId)!==null&&n!==void 0?n:(0,i.normalizeId)(a?.[u.schemaId||"$id"]),this.schemaPath=u.schemaPath,this.localRefs=u.localRefs,this.meta=u.meta,this.$async=a?.$async,this.refs={}}}le.SchemaEnv=p;function d(c){const u=_.call(this,c);if(u)return u;const n=(0,i.getFullPath)(this.opts.uriResolver,c.root.baseId),{es5:a,lines:y}=this.opts.code,{ownProperties:o}=this.opts,f=new e.CodeGen(this.scope,{es5:a,lines:y,ownProperties:o});let P;c.$async&&(P=f.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const O=f.scopeName("validate");c.validateName=O;const D={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:c.schema,code:(0,e.stringify)(c.schema)}:{ref:c.schema}),validateName:O,ValidationError:P,schema:c.schema,schemaEnv:c,rootId:n,baseId:c.baseId||n,schemaPath:e.nil,errSchemaPath:c.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(c),(0,s.validateFunctionCode)(D),f.optimize(this.opts.code.optimize);const C=f.toString();z=`${f.scopeRefs(r.default.scope)}return ${C}`,this.opts.code.process&&(z=this.opts.code.process(z,c));const F=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(O,{ref:F}),F.errors=null,F.schema=c.schema,F.schemaEnv=c,c.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:O,validateCode:C,scopeValues:f._values}),this.opts.unevaluated){const{props:L,items:X}=D;F.evaluated={props:L instanceof e.Name?void 0:L,items:X instanceof e.Name?void 0:X,dynamicProps:L instanceof e.Name,dynamicItems:X instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return c.validate=F,c}catch(C){throw delete c.validate,delete c.validateName,z&&this.logger.error("Error compiling schema, function code:",z),C}finally{this._compilations.delete(c)}}le.compileSchema=d;function h(c,u,n){var a;n=(0,i.resolveUrl)(this.opts.uriResolver,u,n);const y=c.refs[n];if(y)return y;let o=$.call(this,c,n);if(o===void 0){const f=(a=c.localRefs)===null||a===void 0?void 0:a[n],{schemaId:P}=this.opts;f&&(o=new p({schema:f,schemaId:P,root:c,baseId:u}))}if(o!==void 0)return c.refs[n]=b.call(this,o)}le.resolveRef=h;function b(c){return(0,i.inlineRef)(c.schema,this.opts.inlineRefs)?c.schema:c.validate?c:d.call(this,c)}function _(c){for(const u of this._compilations)if(S(u,c))return u}le.getCompilingSchema=_;function S(c,u){return c.schema===u.schema&&c.root===u.root&&c.baseId===u.baseId}function $(c,u){let n;for(;typeof(n=this.refs[u])=="string";)u=n;return n||this.schemas[u]||g.call(this,c,u)}function g(c,u){const n=this.opts.uriResolver.parse(u),a=(0,i._getFullPath)(this.opts.uriResolver,n);let y=(0,i.getFullPath)(this.opts.uriResolver,c.baseId,void 0);if(Object.keys(c.schema).length>0&&a===y)return w.call(this,n,c);const o=(0,i.normalizeId)(a),f=this.refs[o]||this.schemas[o];if(typeof f=="string"){const P=g.call(this,c,f);return typeof P?.schema!="object"?void 0:w.call(this,n,P)}if(typeof f?.schema=="object"){if(f.validate||d.call(this,f),o===(0,i.normalizeId)(u)){const{schema:P}=f,{schemaId:O}=this.opts,D=P[O];return D&&(y=(0,i.resolveUrl)(this.opts.uriResolver,y,D)),new p({schema:P,schemaId:O,root:c,baseId:y})}return w.call(this,n,f)}}le.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(c,{baseId:u,schema:n,root:a}){var y;if(((y=c.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of c.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const O=n[(0,m.unescapeFragment)(P)];if(O===void 0)return;n=O;const D=typeof n=="object"&&n[this.opts.schemaId];!v.has(P)&&D&&(u=(0,i.resolveUrl)(this.opts.uriResolver,u,D))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,m.schemaHasRulesButRef)(n,this.RULES)){const P=(0,i.resolveUrl)(this.opts.uriResolver,u,n.$ref);o=g.call(this,a,P)}const{schemaId:f}=this.opts;if(o=o||new p({schema:n,schemaId:f,root:a,baseId:u}),o.schema!==o.root.schema)return o}return le}const is={$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};var We={},Ce={exports:{}},or,Lr;function Ur(){if(Lr)return or;Lr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function r($){let g="",v=0,w=0;for(w=0;w<$.length;w++)if(v=$[w].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w];break}for(w+=1;w<$.length;w++){if(v=$[w].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w]}return g}const i=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function m($){return $.length=0,!0}function s($,g,v){if($.length){const w=r($);if(w!=="")g.push(w);else return v.error=!0,!1;$.length=0}return!0}function p($){let g=0;const v={error:!1,address:"",zone:""},w=[],c=[];let u=!1,n=!1,a=s;for(let y=0;y<$.length;y++){const o=$[y];if(!(o==="["||o==="]"))if(o===":"){if(u===!0&&(n=!0),!a(c,w,v))break;if(++g>7){v.error=!0;break}y>0&&$[y-1]===":"&&(u=!0),w.push(":");continue}else if(o==="%"){if(!a(c,w,v))break;a=m}else{c.push(o);continue}}return c.length&&(a===m?v.zone=c.join(""):n?w.push(c.join("")):w.push(r(c))),v.address=w.join(""),v}function d($){if(h($,":")<2)return{host:$,isIPV6:!1};const g=p($);if(g.error)return{host:$,isIPV6:!1};{let v=g.address,w=g.address;return g.zone&&(v+="%"+g.zone,w+="%25"+g.zone),{host:v,isIPV6:!0,escapedHost:w}}}function h($,g){let v=0;for(let w=0;w<$.length;w++)$[w]===g&&v++;return v}function b($){let g=$;const v=[];let w=-1,c=0;for(;c=g.length;){if(c===1){if(g===".")break;if(g==="/"){v.push("/");break}else{v.push(g);break}}else if(c===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){v.push("/");break}}else if(c===3&&g==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(g[0]==="."){if(g[1]==="."){if(g[2]==="/"){g=g.slice(3);continue}}else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&g[1]==="."){if(g[2]==="/"){g=g.slice(2);continue}else if(g[2]==="."&&g[3]==="/"){g=g.slice(3),v.length!==0&&v.pop();continue}}if((w=g.indexOf("/",1))===-1){v.push(g);break}else v.push(g.slice(0,w)),g=g.slice(w)}return v.join("")}function _($,g){const v=g!==!0?escape:unescape;return $.scheme!==void 0&&($.scheme=v($.scheme)),$.userinfo!==void 0&&($.userinfo=v($.userinfo)),$.host!==void 0&&($.host=v($.host)),$.path!==void 0&&($.path=v($.path)),$.query!==void 0&&($.query=v($.query)),$.fragment!==void 0&&($.fragment=v($.fragment)),$}function S($){const g=[];if($.userinfo!==void 0&&(g.push($.userinfo),g.push("@")),$.host!==void 0){let v=unescape($.host);if(!t(v)){const w=d(v);w.isIPV6===!0?v=`[${w.escapedHost}]`:v=$.host}g.push(v)}return(typeof $.port=="number"||typeof $.port=="string")&&(g.push(":"),g.push(String($.port))),g.length?g.join(""):void 0}return or={nonSimpleDomain:i,recomposeAuthority:S,normalizeComponentEncoding:_,removeDotSegments:b,isIPv4:t,isUUID:e,normalizeIPv6:d,stringArrayToHexStripped:r},or}var ar,Kr;function os(){if(Kr)return ar;Kr=1;const{isUUID:e}=Ur(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function i(o){return r.indexOf(o)!==-1}function m(o){return o.secure===!0?!0:o.secure===!1?!1:o.scheme?o.scheme.length===3&&(o.scheme[0]==="w"||o.scheme[0]==="W")&&(o.scheme[1]==="s"||o.scheme[1]==="S")&&(o.scheme[2]==="s"||o.scheme[2]==="S"):!1}function s(o){return o.host||(o.error=o.error||"HTTP URIs must have a host."),o}function p(o){const f=String(o.scheme).toLowerCase()==="https";return(o.port===(f?443:80)||o.port==="")&&(o.port=void 0),o.path||(o.path="/"),o}function d(o){return o.secure=m(o),o.resourceName=(o.path||"/")+(o.query?"?"+o.query:""),o.path=void 0,o.query=void 0,o}function h(o){if((o.port===(m(o)?443:80)||o.port==="")&&(o.port=void 0),typeof o.secure=="boolean"&&(o.scheme=o.secure?"wss":"ws",o.secure=void 0),o.resourceName){const[f,P]=o.resourceName.split("?");o.path=f&&f!=="/"?f:void 0,o.query=P,o.resourceName=void 0}return o.fragment=void 0,o}function b(o,f){if(!o.path)return o.error="URN can not be parsed",o;const P=o.path.match(t);if(P){const O=f.scheme||o.scheme||"urn";o.nid=P[1].toLowerCase(),o.nss=P[2];const D=`${O}:${f.nid||o.nid}`,z=y(D);o.path=void 0,z&&(o=z.parse(o,f))}else o.error=o.error||"URN can not be parsed.";return o}function _(o,f){if(o.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=f.scheme||o.scheme||"urn",O=o.nid.toLowerCase(),D=`${P}:${f.nid||O}`,z=y(D);z&&(o=z.serialize(o,f));const C=o,V=o.nss;return C.path=`${O||f.nid}:${V}`,f.skipEscape=!0,C}function S(o,f){const P=o;return P.uuid=P.nss,P.nss=void 0,!f.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function $(o){const f=o;return f.nss=(o.uuid||"").toLowerCase(),f}const g={scheme:"http",domainHost:!0,parse:s,serialize:p},v={scheme:"https",domainHost:g.domainHost,parse:s,serialize:p},w={scheme:"ws",domainHost:!0,parse:d,serialize:h},c={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},a={http:g,https:v,ws:w,wss:c,urn:{scheme:"urn",parse:b,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:S,serialize:$,skipNormalize:!0}};Object.setPrototypeOf(a,null);function y(o){return o&&(a[o]||a[o.toLowerCase()])||void 0}return ar={wsIsSecure:m,SCHEMES:a,isValidSchemeName:i,getSchemeHandler:y},ar}var Hr;function as(){if(Hr)return Ce.exports;Hr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:i,isIPv4:m,nonSimpleDomain:s}=Ur(),{SCHEMES:p,getSchemeHandler:d}=os();function h(c,u){return typeof c=="string"?c=$(v(c,u),u):typeof c=="object"&&(c=v($(c,u),u)),c}function b(c,u,n){const a=n?Object.assign({scheme:"null"},n):{scheme:"null"},y=_(v(c,a),v(u,a),a,!0);return a.skipEscape=!0,$(y,a)}function _(c,u,n,a){const y={};return a||(c=v($(c,n),n),u=v($(u,n),n)),n=n||{},!n.tolerant&&u.scheme?(y.scheme=u.scheme,y.userinfo=u.userinfo,y.host=u.host,y.port=u.port,y.path=t(u.path||""),y.query=u.query):(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0?(y.userinfo=u.userinfo,y.host=u.host,y.port=u.port,y.path=t(u.path||""),y.query=u.query):(u.path?(u.path[0]==="/"?y.path=t(u.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?y.path="/"+u.path:c.path?y.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+u.path:y.path=u.path,y.path=t(y.path)),y.query=u.query):(y.path=c.path,u.query!==void 0?y.query=u.query:y.query=c.query),y.userinfo=c.userinfo,y.host=c.host,y.port=c.port),y.scheme=c.scheme),y.fragment=u.fragment,y}function S(c,u,n){return typeof c=="string"?(c=unescape(c),c=$(i(v(c,n),!0),{...n,skipEscape:!0})):typeof c=="object"&&(c=$(i(c,!0),{...n,skipEscape:!0})),typeof u=="string"?(u=unescape(u),u=$(i(v(u,n),!0),{...n,skipEscape:!0})):typeof u=="object"&&(u=$(i(u,!0),{...n,skipEscape:!0})),c.toLowerCase()===u.toLowerCase()}function $(c,u){const n={host:c.host,scheme:c.scheme,userinfo:c.userinfo,port:c.port,path:c.path,query:c.query,nid:c.nid,nss:c.nss,uuid:c.uuid,fragment:c.fragment,reference:c.reference,resourceName:c.resourceName,secure:c.secure,error:""},a=Object.assign({},u),y=[],o=d(a.scheme||n.scheme);o&&o.serialize&&o.serialize(n,a),n.path!==void 0&&(a.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),a.reference!=="suffix"&&n.scheme&&y.push(n.scheme,":");const f=r(n);if(f!==void 0&&(a.reference!=="suffix"&&y.push("//"),y.push(f),n.path&&n.path[0]!=="/"&&y.push("/")),n.path!==void 0){let P=n.path;!a.absolutePath&&(!o||!o.absolutePath)&&(P=t(P)),f===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return n.query!==void 0&&y.push("?",n.query),n.fragment!==void 0&&y.push("#",n.fragment),y.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(c,u){const n=Object.assign({},u),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;n.reference==="suffix"&&(n.scheme?c=n.scheme+":"+c:c="//"+c);const o=c.match(g);if(o){if(a.scheme=o[1],a.userinfo=o[3],a.host=o[4],a.port=parseInt(o[5],10),a.path=o[6]||"",a.query=o[7],a.fragment=o[8],isNaN(a.port)&&(a.port=o[5]),a.host)if(m(a.host)===!1){const O=e(a.host);a.host=O.host.toLowerCase(),y=O.isIPV6}else y=!0;a.scheme===void 0&&a.userinfo===void 0&&a.host===void 0&&a.port===void 0&&a.query===void 0&&!a.path?a.reference="same-document":a.scheme===void 0?a.reference="relative":a.fragment===void 0?a.reference="absolute":a.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==a.reference&&(a.error=a.error||"URI is not a "+n.reference+" reference.");const f=d(n.scheme||a.scheme);if(!n.unicodeSupport&&(!f||!f.unicodeSupport)&&a.host&&(n.domainHost||f&&f.domainHost)&&y===!1&&s(a.host))try{a.host=URL.domainToASCII(a.host.toLowerCase())}catch(P){a.error=a.error||"Host's domain name can not be converted to ASCII: "+P}(!f||f&&!f.skipNormalize)&&(c.indexOf("%")!==-1&&(a.scheme!==void 0&&(a.scheme=unescape(a.scheme)),a.host!==void 0&&(a.host=unescape(a.host))),a.path&&(a.path=escape(unescape(a.path))),a.fragment&&(a.fragment=encodeURI(decodeURIComponent(a.fragment)))),f&&f.parse&&f.parse(a,n)}else a.error=a.error||"URI can not be parsed.";return a}const w={SCHEMES:p,normalize:h,resolve:b,resolveComponent:_,equal:S,serialize:$,parse:v};return Ce.exports=w,Ce.exports.default=w,Ce.exports.fastUri=w,Ce.exports}var Jr;function cs(){if(Jr)return We;Jr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=as();return e.code='require("ajv/dist/runtime/uri").default',We.default=e,We}var Gr;function us(){return Gr||(Gr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ke();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=G();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const i=sr(),m=Ge(),s=Sr(),p=ir(),d=G(),h=Ue(),b=Le(),_=Z(),S=is,$=cs(),g=(M,j)=>new RegExp(M,j);g.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),c={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."},u={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},n=200;function a(M){var j,T,N,l,k,I,U,H,Q,Y,E,R,q,A,K,B,ne,ge,ue,de,se,Oe,fe,pr,mr;const Me=M.strict,hr=(j=M.code)===null||j===void 0?void 0:j.optimize,Xn=hr===!0||hr===void 0?1:hr||0,xn=(N=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&N!==void 0?N:g,$i=(l=M.uriResolver)!==null&&l!==void 0?l:$.default;return{strictSchema:(I=(k=M.strictSchema)!==null&&k!==void 0?k:Me)!==null&&I!==void 0?I:!0,strictNumbers:(H=(U=M.strictNumbers)!==null&&U!==void 0?U:Me)!==null&&H!==void 0?H:!0,strictTypes:(Y=(Q=M.strictTypes)!==null&&Q!==void 0?Q:Me)!==null&&Y!==void 0?Y:"log",strictTuples:(R=(E=M.strictTuples)!==null&&E!==void 0?E:Me)!==null&&R!==void 0?R:"log",strictRequired:(A=(q=M.strictRequired)!==null&&q!==void 0?q:Me)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:Xn,regExp:xn}:{optimize:Xn,regExp:xn},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:n,loopEnum:(B=M.loopEnum)!==null&&B!==void 0?B:n,meta:(ne=M.meta)!==null&&ne!==void 0?ne:!0,messages:(ge=M.messages)!==null&&ge!==void 0?ge:!0,inlineRefs:(ue=M.inlineRefs)!==null&&ue!==void 0?ue:!0,schemaId:(de=M.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(se=M.addUsedSchema)!==null&&se!==void 0?se:!0,validateSchema:(Oe=M.validateSchema)!==null&&Oe!==void 0?Oe:!0,validateFormats:(fe=M.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(pr=M.unicodeRegExp)!==null&&pr!==void 0?pr:!0,int32range:(mr=M.int32range)!==null&&mr!==void 0?mr:!0,uriResolver:$i}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...a(j)};const{es5:T,lines:N}=this.opts.code;this.scope=new d.ValueScope({scope:{},prefixes:w,es5:T,lines:N}),this.logger=V(j.logger);const l=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),o.call(this,c,j,"NOT SUPPORTED"),o.call(this,u,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&D.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=l}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:T,schemaId:N}=this.opts;let l=S;N==="id"&&(l={...S},l.id=l.$id,delete l.$id),T&&j&&this.addMetaSchema(l,l[N],!1)}defaultMeta(){const{meta:j,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[T]||j:void 0}validate(j,T){let N;if(typeof j=="string"){if(N=this.getSchema(j),!N)throw new Error(`no schema with key or ref "${j}"`)}else N=this.compile(j);const l=N(T);return"$async"in N||(this.errors=N.errors),l}compile(j,T){const N=this._addSchema(j,T);return N.validate||this._compileSchemaEnv(N)}compileAsync(j,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:N}=this.opts;return l.call(this,j,T);async function l(Y,E){await k.call(this,Y.$schema);const R=this._addSchema(Y,E);return R.validate||I.call(this,R)}async function k(Y){Y&&!this.getSchema(Y)&&await l.call(this,{$ref:Y},!0)}async function I(Y){try{return this._compileSchemaEnv(Y)}catch(E){if(!(E instanceof m.default))throw E;return U.call(this,E),await H.call(this,E.missingSchema),I.call(this,Y)}}function U({missingSchema:Y,missingRef:E}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${E} cannot be resolved`)}async function H(Y){const E=await Q.call(this,Y);this.refs[Y]||await k.call(this,E.$schema),this.refs[Y]||this.addSchema(E,Y,T)}async function Q(Y){const E=this._loading[Y];if(E)return E;try{return await(this._loading[Y]=N(Y))}finally{delete this._loading[Y]}}}addSchema(j,T,N,l=this.opts.validateSchema){if(Array.isArray(j)){for(const I of j)this.addSchema(I,void 0,N,l);return this}let k;if(typeof j=="object"){const{schemaId:I}=this.opts;if(k=j[I],k!==void 0&&typeof k!="string")throw new Error(`schema ${I} must be string`)}return T=(0,h.normalizeId)(T||k),this._checkUnique(T),this.schemas[T]=this._addSchema(j,N,T,l,!0),this}addMetaSchema(j,T,N=this.opts.validateSchema){return this.addSchema(j,T,!0,N),this}validateSchema(j,T){if(typeof j=="boolean")return!0;let N;if(N=j.$schema,N!==void 0&&typeof N!="string")throw new Error("$schema must be a string");if(N=N||this.opts.defaultMeta||this.defaultMeta(),!N)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const l=this.validate(N,j);if(!l&&T){const k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return l}getSchema(j){let T;for(;typeof(T=f.call(this,j))=="string";)j=T;if(T===void 0){const{schemaId:N}=this.opts,l=new p.SchemaEnv({schema:{},schemaId:N});if(T=p.resolveSchema.call(this,l,j),!T)return;this.refs[j]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=f.call(this,j);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const T=j;this._cache.delete(T);let N=j[this.opts.schemaId];return N&&(N=(0,h.normalizeId)(N),delete this.schemas[N],delete this.refs[N]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const T of j)this.addKeyword(T);return this}addKeyword(j,T){let N;if(typeof j=="string")N=j,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=N);else if(typeof j=="object"&&T===void 0){if(T=j,N=T.keyword,Array.isArray(N)&&!N.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,N,T),!T)return(0,_.eachItem)(N,k=>X.call(this,k)),this;ae.call(this,T);const l={...T,type:(0,b.getJSONTypes)(T.type),schemaType:(0,b.getJSONTypes)(T.schemaType)};return(0,_.eachItem)(N,l.type.length===0?k=>X.call(this,k,l):k=>l.type.forEach(I=>X.call(this,k,l,I))),this}getKeyword(j){const T=this.RULES.all[j];return typeof T=="object"?T.definition:!!T}removeKeyword(j){const{RULES:T}=this;delete T.keywords[j],delete T.all[j];for(const N of T.rules){const l=N.rules.findIndex(k=>k.keyword===j);l>=0&&N.rules.splice(l,1)}return this}addFormat(j,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[j]=T,this}errorsText(j=this.errors,{separator:T=", ",dataVar:N="data"}={}){return!j||j.length===0?"No errors":j.map(l=>`${N}${l.instancePath} ${l.message}`).reduce((l,k)=>l+T+k)}$dataMetaSchema(j,T){const N=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const l of T){const k=l.split("/").slice(1);let I=j;for(const U of k)I=I[U];for(const U in N){const H=N[U];if(typeof H!="object")continue;const{$data:Q}=H.definition,Y=I[U];Q&&Y&&(I[U]=ye(Y))}}return j}_removeAllSchemas(j,T){for(const N in j){const l=j[N];(!T||T.test(N))&&(typeof l=="string"?delete j[N]:l&&!l.meta&&(this._cache.delete(l.schema),delete j[N]))}}_addSchema(j,T,N,l=this.opts.validateSchema,k=this.opts.addUsedSchema){let I;const{schemaId:U}=this.opts;if(typeof j=="object")I=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(j);if(H!==void 0)return H;N=(0,h.normalizeId)(I||N);const Q=h.getSchemaRefs.call(this,j,N);return H=new p.SchemaEnv({schema:j,schemaId:U,meta:T,baseId:N,localRefs:Q}),this._cache.set(H.schema,H),k&&!N.startsWith("#")&&(N&&this._checkUnique(N),this.refs[N]=H),l&&this.validateSchema(j,!0),H}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):p.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const T=this.opts;this.opts=this._metaOpts;try{p.compileSchema.call(this,j)}finally{this.opts=T}}}y.ValidationError=i.default,y.MissingRefError=m.default,e.default=y;function o(M,j,T,N="error"){for(const l in M){const k=l;k in j&&this.logger[N](`${T}: option ${l}. ${M[k]}`)}}function f(M){return M=(0,h.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const j in M)this.addSchema(M[j],j)}function O(){for(const M in this.opts.formats){const j=this.opts.formats[M];j&&this.addFormat(M,j)}}function D(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in M){const T=M[j];T.keyword||(T.keyword=j),this.addKeyword(T)}}function z(){const M={...this.opts};for(const j of v)delete M[j];return M}const C={log(){},warn(){},error(){}};function V(M){if(M===!1)return C;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,j){const{RULES:T}=this;if((0,_.eachItem)(M,N=>{if(T.keywords[N])throw new Error(`Keyword ${N} is already defined`);if(!F.test(N))throw new Error(`Keyword ${N} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function X(M,j,T){var N;const l=j?.post;if(T&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let I=l?k.post:k.rules.find(({type:H})=>H===T);if(I||(I={type:T,rules:[]},k.rules.push(I)),k.keywords[M]=!0,!j)return;const U={keyword:M,definition:{...j,type:(0,b.getJSONTypes)(j.type),schemaType:(0,b.getJSONTypes)(j.schemaType)}};j.before?oe.call(this,I,U,j.before):I.rules.push(U),k.all[M]=U,(N=j.implements)===null||N===void 0||N.forEach(H=>this.addKeyword(H))}function oe(M,j,T){const N=M.rules.findIndex(l=>l.keyword===T);N>=0?M.rules.splice(N,0,j):(M.rules.push(j),this.logger.warn(`rule ${T} is not defined`))}function ae(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=ye(j)),M.validateSchema=this.compile(j,!0))}const ee={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(M){return{anyOf:[M,ee]}}})(Qt)),Qt}var Be={},Ye={},Ze={},Wr;function ds(){if(Wr)return Ze;Wr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ze.default=e,Ze}var we={},Br;function ls(){if(Br)return we;Br=1,Object.defineProperty(we,"__esModule",{value:!0}),we.callRef=we.getValidate=void 0;const e=Ge(),t=me(),r=G(),i=be(),m=ir(),s=Z(),p={keyword:"$ref",schemaType:"string",code(b){const{gen:_,schema:S,it:$}=b,{baseId:g,schemaEnv:v,validateName:w,opts:c,self:u}=$,{root:n}=v;if((S==="#"||S==="#/")&&g===n.baseId)return y();const a=m.resolveRef.call(u,n,g,S);if(a===void 0)throw new e.default($.opts.uriResolver,g,S);if(a instanceof m.SchemaEnv)return o(a);return f(a);function y(){if(v===n)return h(b,w,v,v.$async);const P=_.scopeValue("root",{ref:n});return h(b,(0,r._)`${P}.validate`,n,n.$async)}function o(P){const O=d(b,P);h(b,O,P,P.$async)}function f(P){const O=_.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),D=_.name("valid"),z=b.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:O,errSchemaPath:S},D);b.mergeEvaluated(z),b.ok(D)}}};function d(b,_){const{gen:S}=b;return _.validate?S.scopeValue("validate",{ref:_.validate}):(0,r._)`${S.scopeValue("wrapper",{ref:_})}.validate`}we.getValidate=d;function h(b,_,S,$){const{gen:g,it:v}=b,{allErrors:w,schemaEnv:c,opts:u}=v,n=u.passContext?i.default.this:r.nil;$?a():y();function a(){if(!c.$async)throw new Error("async schema referenced by sync schema");const P=g.let("valid");g.try(()=>{g.code((0,r._)`await ${(0,t.callValidateCode)(b,_,n)}`),f(_),w||g.assign(P,!0)},O=>{g.if((0,r._)`!(${O} instanceof ${v.ValidationError})`,()=>g.throw(O)),o(O),w||g.assign(P,!1)}),b.ok(P)}function y(){b.result((0,t.callValidateCode)(b,_,n),()=>f(_),()=>o(_))}function o(P){const O=(0,r._)`${P}.errors`;g.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${O} : ${i.default.vErrors}.concat(${O})`),g.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function f(P){var O;if(!v.opts.unevaluated)return;const D=(O=S?.validate)===null||O===void 0?void 0:O.evaluated;if(v.props!==!0)if(D&&!D.dynamicProps)D.props!==void 0&&(v.props=s.mergeEvaluated.props(g,D.props,v.props));else{const z=g.var("props",(0,r._)`${P}.evaluated.props`);v.props=s.mergeEvaluated.props(g,z,v.props,r.Name)}if(v.items!==!0)if(D&&!D.dynamicItems)D.items!==void 0&&(v.items=s.mergeEvaluated.items(g,D.items,v.items));else{const z=g.var("items",(0,r._)`${P}.evaluated.items`);v.items=s.mergeEvaluated.items(g,z,v.items,r.Name)}}}return we.callRef=h,we.default=p,we}var Yr;function fs(){if(Yr)return Ye;Yr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=ds(),t=ls(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ye.default=r,Ye}var Qe={},Xe={},Zr;function ps(){if(Zr)return Xe;Zr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},i={message:({keyword:s,schemaCode:p})=>(0,e.str)`must be ${r[s].okStr} ${p}`,params:({keyword:s,schemaCode:p})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${p}}`},m={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:i,code(s){const{keyword:p,data:d,schemaCode:h}=s;s.fail$data((0,e._)`${d} ${r[p].fail} ${h} || isNaN(${d})`)}};return Xe.default=m,Xe}var xe={},Qr;function ms(){if(Qr)return xe;Qr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=G(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:i})=>(0,e.str)`must be multiple of ${i}`,params:({schemaCode:i})=>(0,e._)`{multipleOf: ${i}}`},code(i){const{gen:m,data:s,schemaCode:p,it:d}=i,h=d.opts.multipleOfPrecision,b=m.let("res"),_=h?(0,e._)`Math.abs(Math.round(${b}) - ${b}) > 1e-${h}`:(0,e._)`${b} !== parseInt(${b})`;i.fail$data((0,e._)`(${p} === 0 || (${b} = ${s}/${p}, ${_}))`)}};return xe.default=r,xe}var et={},tt={},Xr;function hs(){if(Xr)return tt;Xr=1,Object.defineProperty(tt,"__esModule",{value:!0});function e(t){const r=t.length;let i=0,m=0,s;for(;m<r;)i++,s=t.charCodeAt(m++),s>=55296&&s<=56319&&m<r&&(s=t.charCodeAt(m),(s&64512)===56320&&m++);return i}return tt.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',tt}var xr;function ys(){if(xr)return et;xr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=G(),t=Z(),r=hs(),m={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:p}){const d=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${d} than ${p} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:p,data:d,schemaCode:h,it:b}=s,_=p==="maxLength"?e.operators.GT:e.operators.LT,S=b.opts.unicode===!1?(0,e._)`${d}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${d})`;s.fail$data((0,e._)`${S} ${_} ${h}`)}};return et.default=m,et}var rt={},en;function gs(){if(en)return rt;en=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=me(),t=G(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:m})=>(0,t.str)`must match pattern "${m}"`,params:({schemaCode:m})=>(0,t._)`{pattern: ${m}}`},code(m){const{data:s,$data:p,schema:d,schemaCode:h,it:b}=m,_=b.opts.unicodeRegExp?"u":"",S=p?(0,t._)`(new RegExp(${h}, ${_}))`:(0,e.usePattern)(m,d);m.fail$data((0,t._)`!${S}.test(${s})`)}};return rt.default=i,rt}var nt={},tn;function vs(){if(tn)return nt;tn=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=G(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:m}){const s=i==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${m} properties`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:m,data:s,schemaCode:p}=i,d=m==="maxProperties"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`Object.keys(${s}).length ${d} ${p}`)}};return nt.default=r,nt}var st={},rn;function _s(){if(rn)return st;rn=1,Object.defineProperty(st,"__esModule",{value:!0});const e=me(),t=G(),r=Z(),m={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:p,schema:d,schemaCode:h,data:b,$data:_,it:S}=s,{opts:$}=S;if(!_&&d.length===0)return;const g=d.length>=$.loopRequired;if(S.allErrors?v():w(),$.strictRequired){const n=s.parentSchema.properties,{definedProperties:a}=s.it;for(const y of d)if(n?.[y]===void 0&&!a.has(y)){const o=S.schemaEnv.baseId+S.errSchemaPath,f=`required property "${y}" is not defined at "${o}" (strictRequired)`;(0,r.checkStrictMode)(S,f,S.opts.strictRequired)}}function v(){if(g||_)s.block$data(t.nil,c);else for(const n of d)(0,e.checkReportMissingProp)(s,n)}function w(){const n=p.let("missing");if(g||_){const a=p.let("valid",!0);s.block$data(a,()=>u(n,a)),s.ok(a)}else p.if((0,e.checkMissingProp)(s,d,n)),(0,e.reportMissingProp)(s,n),p.else()}function c(){p.forOf("prop",h,n=>{s.setParams({missingProperty:n}),p.if((0,e.noPropertyInData)(p,b,n,$.ownProperties),()=>s.error())})}function u(n,a){s.setParams({missingProperty:n}),p.forOf(n,h,()=>{p.assign(a,(0,e.propertyInData)(p,b,n,$.ownProperties)),p.if((0,t.not)(a),()=>{s.error(),p.break()})},t.nil)}}};return st.default=m,st}var it={},nn;function $s(){if(nn)return it;nn=1,Object.defineProperty(it,"__esModule",{value:!0});const e=G(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:m}){const s=i==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${m} items`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:m,data:s,schemaCode:p}=i,d=m==="maxItems"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`${s}.length ${d} ${p}`)}};return it.default=r,it}var ot={},at={},sn;function cr(){if(sn)return at;sn=1,Object.defineProperty(at,"__esModule",{value:!0});const e=Tr();return e.code='require("ajv/dist/runtime/equal").default',at.default=e,at}var on;function bs(){if(on)return ot;on=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=Le(),t=G(),r=Z(),i=cr(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:p,j:d}})=>(0,t.str)`must NOT have duplicate items (items ## ${d} and ${p} are identical)`,params:({params:{i:p,j:d}})=>(0,t._)`{i: ${p}, j: ${d}}`},code(p){const{gen:d,data:h,$data:b,schema:_,parentSchema:S,schemaCode:$,it:g}=p;if(!b&&!_)return;const v=d.let("valid"),w=S.items?(0,e.getSchemaTypes)(S.items):[];p.block$data(v,c,(0,t._)`${$} === false`),p.ok(v);function c(){const y=d.let("i",(0,t._)`${h}.length`),o=d.let("j");p.setParams({i:y,j:o}),d.assign(v,!0),d.if((0,t._)`${y} > 1`,()=>(u()?n:a)(y,o))}function u(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function n(y,o){const f=d.name("item"),P=(0,e.checkDataTypes)(w,f,g.opts.strictNumbers,e.DataType.Wrong),O=d.const("indices",(0,t._)`{}`);d.for((0,t._)`;${y}--;`,()=>{d.let(f,(0,t._)`${h}[${y}]`),d.if(P,(0,t._)`continue`),w.length>1&&d.if((0,t._)`typeof ${f} == "string"`,(0,t._)`${f} += "_"`),d.if((0,t._)`typeof ${O}[${f}] == "number"`,()=>{d.assign(o,(0,t._)`${O}[${f}]`),p.error(),d.assign(v,!1).break()}).code((0,t._)`${O}[${f}] = ${y}`)})}function a(y,o){const f=(0,r.useFunc)(d,i.default),P=d.name("outer");d.label(P).for((0,t._)`;${y}--;`,()=>d.for((0,t._)`${o} = ${y}; ${o}--;`,()=>d.if((0,t._)`${f}(${h}[${y}], ${h}[${o}])`,()=>{p.error(),d.assign(v,!1).break(P)})))}}};return ot.default=s,ot}var ct={},an;function ws(){if(an)return ct;an=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=G(),t=Z(),r=cr(),m={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:p,data:d,$data:h,schemaCode:b,schema:_}=s;h||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(p,r.default)}(${d}, ${b})`):s.fail((0,e._)`${_} !== ${d}`)}};return ct.default=m,ct}var ut={},cn;function Ps(){if(cn)return ut;cn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=G(),t=Z(),r=cr(),m={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:p,data:d,$data:h,schema:b,schemaCode:_,it:S}=s;if(!h&&b.length===0)throw new Error("enum must have non-empty array");const $=b.length>=S.opts.loopEnum;let g;const v=()=>g??(g=(0,t.useFunc)(p,r.default));let w;if($||h)w=p.let("valid"),s.block$data(w,c);else{if(!Array.isArray(b))throw new Error("ajv implementation error");const n=p.const("vSchema",_);w=(0,e.or)(...b.map((a,y)=>u(n,y)))}s.pass(w);function c(){p.assign(w,!1),p.forOf("v",_,n=>p.if((0,e._)`${v()}(${d}, ${n})`,()=>p.assign(w,!0).break()))}function u(n,a){const y=b[a];return typeof y=="object"&&y!==null?(0,e._)`${v()}(${d}, ${n}[${a}])`:(0,e._)`${d} === ${y}`}}};return ut.default=m,ut}var un;function ks(){if(un)return Qe;un=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=ps(),t=ms(),r=ys(),i=gs(),m=vs(),s=_s(),p=$s(),d=bs(),h=ws(),b=Ps(),_=[e.default,t.default,r.default,i.default,m.default,s.default,p.default,d.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},h.default,b.default];return Qe.default=_,Qe}var dt={},Re={},dn;function ln(){if(dn)return Re;dn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.validateAdditionalItems=void 0;const e=G(),t=Z(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:p,it:d}=s,{items:h}=p;if(!Array.isArray(h)){(0,t.checkStrictMode)(d,'"additionalItems" is ignored when "items" is not an array of schemas');return}m(s,h)}};function m(s,p){const{gen:d,schema:h,data:b,keyword:_,it:S}=s;S.items=!0;const $=d.const("len",(0,e._)`${b}.length`);if(h===!1)s.setParams({len:p.length}),s.pass((0,e._)`${$} <= ${p.length}`);else if(typeof h=="object"&&!(0,t.alwaysValidSchema)(S,h)){const v=d.var("valid",(0,e._)`${$} <= ${p.length}`);d.if((0,e.not)(v),()=>g(v)),s.ok(v)}function g(v){d.forRange("i",p.length,$,w=>{s.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},v),S.allErrors||d.if((0,e.not)(v),()=>d.break())})}}return Re.validateAdditionalItems=m,Re.default=i,Re}var lt={},Ne={},fn;function pn(){if(fn)return Ne;fn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.validateTuple=void 0;const e=G(),t=Z(),r=me(),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:p,it:d}=s;if(Array.isArray(p))return m(s,"additionalItems",p);d.items=!0,!(0,t.alwaysValidSchema)(d,p)&&s.ok((0,r.validateArray)(s))}};function m(s,p,d=s.schema){const{gen:h,parentSchema:b,data:_,keyword:S,it:$}=s;w(b),$.opts.unevaluated&&d.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(h,d.length,$.items));const g=h.name("valid"),v=h.const("len",(0,e._)`${_}.length`);d.forEach((c,u)=>{(0,t.alwaysValidSchema)($,c)||(h.if((0,e._)`${v} > ${u}`,()=>s.subschema({keyword:S,schemaProp:u,dataProp:u},g)),s.ok(g))});function w(c){const{opts:u,errSchemaPath:n}=$,a=d.length,y=a===c.minItems&&(a===c.maxItems||c[p]===!1);if(u.strictTuples&&!y){const o=`"${S}" is ${a}-tuple, but minItems or maxItems/${p} are not specified or different at path "${n}"`;(0,t.checkStrictMode)($,o,u.strictTuples)}}}return Ne.validateTuple=m,Ne.default=i,Ne}var mn;function Ss(){if(mn)return lt;mn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=pn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return lt.default=t,lt}var ft={},hn;function Es(){if(hn)return ft;hn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=G(),t=Z(),r=me(),i=ln(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:p}})=>(0,e.str)`must NOT have more than ${p} items`,params:({params:{len:p}})=>(0,e._)`{limit: ${p}}`},code(p){const{schema:d,parentSchema:h,it:b}=p,{prefixItems:_}=h;b.items=!0,!(0,t.alwaysValidSchema)(b,d)&&(_?(0,i.validateAdditionalItems)(p,_):p.ok((0,r.validateArray)(p)))}};return ft.default=s,ft}var pt={},yn;function js(){if(yn)return pt;yn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=G(),t=Z(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:m,max:s}})=>s===void 0?(0,e.str)`must contain at least ${m} valid item(s)`:(0,e.str)`must contain at least ${m} and no more than ${s} valid item(s)`,params:({params:{min:m,max:s}})=>s===void 0?(0,e._)`{minContains: ${m}}`:(0,e._)`{minContains: ${m}, maxContains: ${s}}`},code(m){const{gen:s,schema:p,parentSchema:d,data:h,it:b}=m;let _,S;const{minContains:$,maxContains:g}=d;b.opts.next?(_=$===void 0?1:$,S=g):_=1;const v=s.const("len",(0,e._)`${h}.length`);if(m.setParams({min:_,max:S}),S===void 0&&_===0){(0,t.checkStrictMode)(b,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(S!==void 0&&_>S){(0,t.checkStrictMode)(b,'"minContains" > "maxContains" is always invalid'),m.fail();return}if((0,t.alwaysValidSchema)(b,p)){let a=(0,e._)`${v} >= ${_}`;S!==void 0&&(a=(0,e._)`${a} && ${v} <= ${S}`),m.pass(a);return}b.items=!0;const w=s.name("valid");S===void 0&&_===1?u(w,()=>s.if(w,()=>s.break())):_===0?(s.let(w,!0),S!==void 0&&s.if((0,e._)`${h}.length > 0`,c)):(s.let(w,!1),c()),m.result(w,()=>m.reset());function c(){const a=s.name("_valid"),y=s.let("count",0);u(a,()=>s.if(a,()=>n(y)))}function u(a,y){s.forRange("i",0,v,o=>{m.subschema({keyword:"contains",dataProp:o,dataPropType:t.Type.Num,compositeRule:!0},a),y()})}function n(a){s.code((0,e._)`${a}++`),S===void 0?s.if((0,e._)`${a} >= ${_}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${a} > ${S}`,()=>s.assign(w,!1).break()),_===1?s.assign(w,!0):s.if((0,e._)`${a} >= ${_}`,()=>s.assign(w,!0)))}}};return pt.default=i,pt}var ur={},gn;function Rs(){return gn||(gn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),r=Z(),i=me();e.error={message:({params:{property:h,depsCount:b,deps:_}})=>{const S=b===1?"property":"properties";return(0,t.str)`must have ${S} ${_} when property ${h} is present`},params:({params:{property:h,depsCount:b,deps:_,missingProperty:S}})=>(0,t._)`{property: ${h},
|
|
6
6
|
missingProperty: ${S},
|
|
7
7
|
depsCount: ${b},
|
|
8
|
-
deps: ${_}}`};const y={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[b,_]=i(m);p(m,b),u(m,_)}};function i({schema:m}){const b={},_={};for(const S in m){if(S==="__proto__")continue;const $=Array.isArray(m[S])?b:_;$[S]=m[S]}return[b,_]}function p(m,b=m.schema){const{gen:_,data:S,it:$}=m;if(Object.keys(b).length===0)return;const g=_.let("missing");for(const v in b){const w=b[v];if(w.length===0)continue;const c=(0,n.propertyInData)(_,S,v,$.opts.ownProperties);m.setParams({property:v,depsCount:w.length,deps:w.join(", ")}),$.allErrors?_.if(c,()=>{for(const d of w)(0,n.checkReportMissingProp)(m,d)}):(_.if((0,t._)`${c} && (${(0,n.checkMissingProp)(m,w,g)})`),(0,n.reportMissingProp)(m,g),_.else())}}e.validatePropertyDeps=p;function u(m,b=m.schema){const{gen:_,data:S,keyword:$,it:g}=m,v=_.name("valid");for(const w in b)(0,a.alwaysValidSchema)(g,b[w])||(_.if((0,n.propertyInData)(_,S,w,g.opts.ownProperties),()=>{const c=m.subschema({keyword:$,schemaProp:w},v);m.mergeValidEvaluated(c,v)},()=>_.var(v,!0)),m.ok(v))}e.validateSchemaDeps=u,e.default=y})(Bt)),Bt}var ft={},rn;function yi(){if(rn)return ft;rn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:y})=>(0,e._)`{propertyName: ${y.propertyName}}`},code(y){const{gen:i,schema:p,data:u,it:m}=y;if((0,t.alwaysValidSchema)(m,p))return;const b=i.name("valid");i.forIn("key",u,_=>{y.setParams({propertyName:_}),y.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},b),i.if((0,e.not)(b),()=>{y.error(!0),m.allErrors||i.break()})}),y.ok(b)}};return ft.default=n,ft}var pt={},nn;function sn(){if(nn)return pt;nn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=fe(),t=G(),a=ve(),n=Y(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:p})=>(0,t._)`{additionalProperty: ${p.additionalProperty}}`},code(p){const{gen:u,schema:m,parentSchema:b,data:_,errsCount:S,it:$}=p;if(!S)throw new Error("ajv implementation error");const{allErrors:g,opts:v}=$;if($.props=!0,v.removeAdditional!=="all"&&(0,n.alwaysValidSchema)($,m))return;const w=(0,e.allSchemaProperties)(b.properties),c=(0,e.allSchemaProperties)(b.patternProperties);d(),p.ok((0,t._)`${S} === ${a.default.errors}`);function d(){u.forIn("key",_,f=>{!w.length&&!c.length?h(f):u.if(r(f),()=>h(f))})}function r(f){let P;if(w.length>8){const N=(0,n.schemaRefOrVal)($,b.properties,"properties");P=(0,e.isOwnProperty)(u,N,f)}else w.length?P=(0,t.or)(...w.map(N=>(0,t._)`${f} === ${N}`)):P=t.nil;return c.length&&(P=(0,t.or)(P,...c.map(N=>(0,t._)`${(0,e.usePattern)(p,N)}.test(${f})`))),(0,t.not)(P)}function o(f){u.code((0,t._)`delete ${_}[${f}]`)}function h(f){if(v.removeAdditional==="all"||v.removeAdditional&&m===!1){o(f);return}if(m===!1){p.setParams({additionalProperty:f}),p.error(),g||u.break();return}if(typeof m=="object"&&!(0,n.alwaysValidSchema)($,m)){const P=u.name("valid");v.removeAdditional==="failing"?(s(f,P,!1),u.if((0,t.not)(P),()=>{p.reset(),o(f)})):(s(f,P),g||u.if((0,t.not)(P),()=>u.break()))}}function s(f,P,N){const D={keyword:"additionalProperties",dataProp:f,dataPropType:n.Type.Str};N===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),p.subschema(D,P)}}};return pt.default=i,pt}var mt={},on;function gi(){if(on)return mt;on=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=Le(),t=fe(),a=Y(),n=sn(),y={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:p,schema:u,parentSchema:m,data:b,it:_}=i;_.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(_,n.default,"additionalProperties"));const S=(0,t.allSchemaProperties)(u);for(const c of S)_.definedProperties.add(c);_.opts.unevaluated&&S.length&&_.props!==!0&&(_.props=a.mergeEvaluated.props(p,(0,a.toHash)(S),_.props));const $=S.filter(c=>!(0,a.alwaysValidSchema)(_,u[c]));if($.length===0)return;const g=p.name("valid");for(const c of $)v(c)?w(c):(p.if((0,t.propertyInData)(p,b,c,_.opts.ownProperties)),w(c),_.allErrors||p.else().var(g,!0),p.endIf()),i.it.definedProperties.add(c),i.ok(g);function v(c){return _.opts.useDefaults&&!_.compositeRule&&u[c].default!==void 0}function w(c){i.subschema({keyword:"properties",schemaProp:c,dataProp:c},g)}}};return mt.default=y,mt}var ht={},an;function vi(){if(an)return ht;an=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=fe(),t=G(),a=Y(),n=Y(),y={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:p,schema:u,data:m,parentSchema:b,it:_}=i,{opts:S}=_,$=(0,e.allSchemaProperties)(u),g=$.filter(h=>(0,a.alwaysValidSchema)(_,u[h]));if($.length===0||g.length===$.length&&(!_.opts.unevaluated||_.props===!0))return;const v=S.strictSchema&&!S.allowMatchingProperties&&b.properties,w=p.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,n.evaluatedPropsToName)(p,_.props));const{props:c}=_;d();function d(){for(const h of $)v&&r(h),_.allErrors?o(h):(p.var(w,!0),o(h),p.if(w))}function r(h){for(const s in v)new RegExp(h).test(s)&&(0,a.checkStrictMode)(_,`property ${s} matches pattern ${h} (use allowMatchingProperties)`)}function o(h){p.forIn("key",m,s=>{p.if((0,t._)`${(0,e.usePattern)(i,h)}.test(${s})`,()=>{const f=g.includes(h);f||i.subschema({keyword:"patternProperties",schemaProp:h,dataProp:s,dataPropType:n.Type.Str},w),_.opts.unevaluated&&c!==!0?p.assign((0,t._)`${c}[${s}]`,!0):!f&&!_.allErrors&&p.if((0,t.not)(w),()=>p.break())})})}}};return ht.default=y,ht}var yt={},cn;function _i(){if(cn)return yt;cn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(a){const{gen:n,schema:y,it:i}=a;if((0,e.alwaysValidSchema)(i,y)){a.fail();return}const p=n.name("valid");a.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},p),a.failResult(p,()=>a.reset(),()=>a.error())},error:{message:"must NOT be valid"}};return yt.default=t,yt}var gt={},dn;function $i(){if(dn)return gt;dn=1,Object.defineProperty(gt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fe().validateUnion,error:{message:"must match a schema in anyOf"}};return gt.default=t,gt}var vt={},un;function bi(){if(un)return vt;un=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:y})=>(0,e._)`{passingSchemas: ${y.passing}}`},code(y){const{gen:i,schema:p,parentSchema:u,it:m}=y;if(!Array.isArray(p))throw new Error("ajv implementation error");if(m.opts.discriminator&&u.discriminator)return;const b=p,_=i.let("valid",!1),S=i.let("passing",null),$=i.name("_valid");y.setParams({passing:S}),i.block(g),y.result(_,()=>y.reset(),()=>y.error(!0));function g(){b.forEach((v,w)=>{let c;(0,t.alwaysValidSchema)(m,v)?i.var($,!0):c=y.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},$),w>0&&i.if((0,e._)`${$} && ${_}`).assign(_,!1).assign(S,(0,e._)`[${S}, ${w}]`).else(),i.if($,()=>{i.assign(_,!0),i.assign(S,w),c&&y.mergeEvaluated(c,e.Name)})})}}};return vt.default=n,vt}var _t={},ln;function wi(){if(ln)return _t;ln=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(a){const{gen:n,schema:y,it:i}=a;if(!Array.isArray(y))throw new Error("ajv implementation error");const p=n.name("valid");y.forEach((u,m)=>{if((0,e.alwaysValidSchema)(i,u))return;const b=a.subschema({keyword:"allOf",schemaProp:m},p);a.ok(p),a.mergeEvaluated(b)})}};return _t.default=t,_t}var $t={},fn;function Pi(){if(fn)return $t;fn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,e.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,e._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:p,parentSchema:u,it:m}=i;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const b=y(m,"then"),_=y(m,"else");if(!b&&!_)return;const S=p.let("valid",!0),$=p.name("_valid");if(g(),i.reset(),b&&_){const w=p.let("ifClause");i.setParams({ifClause:w}),p.if($,v("then",w),v("else",w))}else b?p.if($,v("then")):p.if((0,e.not)($),v("else"));i.pass(S,()=>i.error(!0));function g(){const w=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);i.mergeEvaluated(w)}function v(w,c){return()=>{const d=i.subschema({keyword:w},$);p.assign(S,$),i.mergeValidEvaluated(d,S),c?p.assign(c,(0,e._)`${w}`):i.setParams({ifClause:w})}}}};function y(i,p){const u=i.schema[p];return u!==void 0&&!(0,t.alwaysValidSchema)(i,u)}return $t.default=n,$t}var bt={},pn;function Ei(){if(pn)return bt;pn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:a,parentSchema:n,it:y}){n.if===void 0&&(0,e.checkStrictMode)(y,`"${a}" without "if" is ignored`)}};return bt.default=t,bt}var mn;function Si(){if(mn)return ct;mn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Yr(),t=fi(),a=Qr(),n=pi(),y=mi(),i=hi(),p=yi(),u=sn(),m=gi(),b=vi(),_=_i(),S=$i(),$=bi(),g=wi(),v=Pi(),w=Ei();function c(d=!1){const r=[_.default,S.default,$.default,g.default,v.default,w.default,p.default,u.default,i.default,m.default,b.default];return d?r.push(t.default,n.default):r.push(e.default,a.default),r.push(y.default),r}return ct.default=c,ct}var wt={},Pt={},hn;function ji(){if(hn)return Pt;hn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=G(),a={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,y){const{gen:i,data:p,$data:u,schema:m,schemaCode:b,it:_}=n,{opts:S,errSchemaPath:$,schemaEnv:g,self:v}=_;if(!S.validateFormats)return;u?w():c();function w(){const d=i.scopeValue("formats",{ref:v.formats,code:S.code.formats}),r=i.const("fDef",(0,e._)`${d}[${b}]`),o=i.let("fType"),h=i.let("format");i.if((0,e._)`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>i.assign(o,(0,e._)`${r}.type || "string"`).assign(h,(0,e._)`${r}.validate`),()=>i.assign(o,(0,e._)`"string"`).assign(h,r)),n.fail$data((0,e.or)(s(),f()));function s(){return S.strictSchema===!1?e.nil:(0,e._)`${b} && !${h}`}function f(){const P=g.$async?(0,e._)`(${r}.async ? await ${h}(${p}) : ${h}(${p}))`:(0,e._)`${h}(${p})`,N=(0,e._)`(typeof ${h} == "function" ? ${P} : ${h}.test(${p}))`;return(0,e._)`${h} && ${h} !== true && ${o} === ${y} && !${N}`}}function c(){const d=v.formats[m];if(!d){s();return}if(d===!0)return;const[r,o,h]=f(d);r===y&&n.pass(P());function s(){if(S.strictSchema===!1){v.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${m}" ignored in schema at path "${$}"`}}function f(N){const D=N instanceof RegExp?(0,e.regexpCode)(N):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(m)}`:void 0,z=i.scopeValue("formats",{key:m,ref:N,code:D});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,e._)`${z}.validate`]:["string",N,z]}function P(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${h}(${p})`}return typeof o=="function"?(0,e._)`${h}(${p})`:(0,e._)`${h}.test(${p})`}}}};return Pt.default=a,Pt}var yn;function ki(){if(yn)return wt;yn=1,Object.defineProperty(wt,"__esModule",{value:!0});const t=[ji().default];return wt.default=t,wt}var we={},gn;function Ii(){return gn||(gn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.contentVocabulary=we.metadataVocabulary=void 0,we.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],we.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),we}var vn;function Ri(){if(vn)return Je;vn=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=xn(),t=li(),a=Si(),n=ki(),y=Ii(),i=[e.default,t.default,(0,a.default)(),n.default,y.metadataVocabulary,y.contentVocabulary];return Je.default=i,Je}var Et={},Oe={},_n;function Ni(){if(_n)return Oe;_n=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Oe.DiscrError=e={})),Oe}var $n;function Oi(){if($n)return Et;$n=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=G(),t=Ni(),a=Ht(),n=He(),y=Y(),p={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:m}})=>u===t.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:u,tag:m,tagName:b}})=>(0,e._)`{error: ${u}, tag: ${b}, tagValue: ${m}}`},code(u){const{gen:m,data:b,schema:_,parentSchema:S,it:$}=u,{oneOf:g}=S;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const v=_.propertyName;if(typeof v!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const w=m.let("valid",!1),c=m.const("tag",(0,e._)`${b}${(0,e.getProperty)(v)}`);m.if((0,e._)`typeof ${c} == "string"`,()=>d(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:c,tagName:v})),u.ok(w);function d(){const h=o();m.if(!1);for(const s in h)m.elseIf((0,e._)`${c} === ${s}`),m.assign(w,r(h[s]));m.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:c,tagName:v}),m.endIf()}function r(h){const s=m.name("valid"),f=u.subschema({keyword:"oneOf",schemaProp:h},s);return u.mergeEvaluated(f,e.Name),s}function o(){var h;const s={},f=N(S);let P=!0;for(let q=0;q<g.length;q++){let V=g[q];if(V?.$ref&&!(0,y.schemaHasRulesButRef)(V,$.self.RULES)){const L=V.$ref;if(V=a.resolveRef.call($.self,$.schemaEnv.root,$.baseId,L),V instanceof a.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default($.opts.uriResolver,$.baseId,L)}const F=(h=V?.properties)===null||h===void 0?void 0:h[v];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);P=P&&(f||N(V)),D(F,q)}if(!P)throw new Error(`discriminator: "${v}" must be required`);return s;function N({required:q}){return Array.isArray(q)&&q.includes(v)}function D(q,V){if(q.const)z(q.const,V);else if(q.enum)for(const F of q.enum)z(F,V);else throw new Error(`discriminator: "properties/${v}" must have "const" or "enum"`)}function z(q,V){if(typeof q!="string"||q in s)throw new Error(`discriminator: "${v}" values must be unique strings`);s[q]=V}}}};return Et.default=p,Et}const qi={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};var bn;function wn(){return bn||(bn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const a=Zn(),n=Ri(),y=Oi(),i=qi,p=["/properties"],u="http://json-schema.org/draft-07/schema";class m extends a.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(y.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(i,p):i;this.addMetaSchema(v,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=m,e.exports=t=m,e.exports.Ajv=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var b=Le();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var _=G();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var S=Kt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return S.default}});var $=He();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})})(De,De.exports)),De.exports}var Ci=wn();const Pn=Se(Ci);var St={exports:{}},Yt={},En;function Ti(){return En||(En=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(q,V){return{validate:q,compare:V}}e.fullFormats={date:t(i,p),time:t(m(!0),b),"date-time":t($(!0),g),"iso-time":t(m(),_),"iso-date-time":t($(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:o,int32:{type:"number",validate:f},int64:{type:"number",validate:P},float:{type:"number",validate:N},double:{type:"number",validate:N},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,p),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function a(q){return q%4===0&&(q%100!==0||q%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,y=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(q){const V=n.exec(q);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&a(F)?29:y[L])}function p(q,V){if(q&&V)return q>V?1:q<V?-1:0}const u=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function m(q){return function(F){const L=u.exec(F);if(!L)return!1;const Q=+L[1],ie=+L[2],se=+L[3],x=L[4],pe=L[5]==="-"?-1:1,M=+(L[6]||0),k=+(L[7]||0);if(M>23||k>59||q&&!x)return!1;if(Q<=23&&ie<=59&&se<60)return!0;const T=ie-k*pe,R=Q-M*pe-(T<0?1:0);return(R===23||R===-1)&&(T===59||T===-1)&&se<61}}function b(q,V){if(!(q&&V))return;const F=new Date("2020-01-01T"+q).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function _(q,V){if(!(q&&V))return;const F=u.exec(q),L=u.exec(V);if(F&&L)return q=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],q>V?1:q<V?-1:0}const S=/t|\s/i;function $(q){const V=m(q);return function(L){const Q=L.split(S);return Q.length===2&&i(Q[0])&&V(Q[1])}}function g(q,V){if(!(q&&V))return;const F=new Date(q).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function v(q,V){if(!(q&&V))return;const[F,L]=q.split(S),[Q,ie]=V.split(S),se=p(F,Q);if(se!==void 0)return se||b(L,ie)}const w=/\/|:/,c=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function d(q){return w.test(q)&&c.test(q)}const r=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function o(q){return r.lastIndex=0,r.test(q)}const h=-2147483648,s=2**31-1;function f(q){return Number.isInteger(q)&&q<=s&&q>=h}function P(q){return Number.isInteger(q)}function N(){return!0}const D=/[^\\]\\Z/;function z(q){if(D.test(q))return!1;try{return new RegExp(q),!0}catch{return!1}}})(Yt)),Yt}var Zt={},Sn;function Di(){return Sn||(Sn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=wn(),a=G(),n=a.operators,y={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},i={message:({keyword:u,schemaCode:m})=>(0,a.str)`should be ${y[u].okStr} ${m}`,params:({keyword:u,schemaCode:m})=>(0,a._)`{comparison: ${y[u].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(y),type:"string",schemaType:"string",$data:!0,error:i,code(u){const{gen:m,data:b,schemaCode:_,keyword:S,it:$}=u,{opts:g,self:v}=$;if(!g.validateFormats)return;const w=new t.KeywordCxt($,v.RULES.all.format.definition,"format");w.$data?c():d();function c(){const o=m.scopeValue("formats",{ref:v.formats,code:g.code.formats}),h=m.const("fmt",(0,a._)`${o}[${w.schemaCode}]`);u.fail$data((0,a.or)((0,a._)`typeof ${h} != "object"`,(0,a._)`${h} instanceof RegExp`,(0,a._)`typeof ${h}.compare != "function"`,r(h)))}function d(){const o=w.schema,h=v.formats[o];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${S}": format "${o}" does not define "compare" function`);const s=m.scopeValue("formats",{key:o,ref:h,code:g.code.formats?(0,a._)`${g.code.formats}${(0,a.getProperty)(o)}`:void 0});u.fail$data(r(s))}function r(o){return(0,a._)`${o}.compare(${b}, ${_}) ${y[S].fail} 0`}},dependencies:["format"]};const p=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=p})(Zt)),Zt}var jn;function Mi(){return jn||(jn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const a=Ti(),n=Di(),y=G(),i=new y.Name("fullFormats"),p=new y.Name("fastFormats"),u=(b,_={keywords:!0})=>{if(Array.isArray(_))return m(b,_,a.fullFormats,i),b;const[S,$]=_.mode==="fast"?[a.fastFormats,p]:[a.fullFormats,i],g=_.formats||a.formatNames;return m(b,g,S,$),_.keywords&&(0,n.default)(b),b};u.get=(b,_="full")=>{const $=(_==="fast"?a.fastFormats:a.fullFormats)[b];if(!$)throw new Error(`Unknown format "${b}"`);return $};function m(b,_,S,$){var g,v;(g=(v=b.opts.code).formats)!==null&&g!==void 0||(v.formats=(0,y._)`require("ajv-formats/dist/formats").${$}`);for(const w of _)b.addFormat(w,S[w])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u})(St,St.exports)),St.exports}var Ai=Mi();const kn=Se(Ai),qe={$schema:"http://json-schema.org/draft-07/schema#",$ref:"#/definitions/CICConfig",definitions:JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}')};let jt=null;const In=()=>(jt||(jt=new Pn({allErrors:!0,strict:!1}),kn(jt)),jt),kt=new Map,Rn=JSON.stringify(qe),Vi={CICPage:["#/definitions/CICPage","#/$defs/CICPage","#/properties/pages/items","#/definitions/CICConfig/properties/pages/items"],Meta:["#/definitions/Meta","#/$defs/Meta","#/properties/meta"],Layout:["#/definitions/Layout","#/$defs/Layout","#/properties/meta/properties/layout"],ComponentInstance:["#/definitions/ComponentInstance","#/$defs/ComponentInstance"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Nn=(e,t)=>e.compile({$ref:t,definitions:qe.definitions,properties:qe.properties}),zi=e=>{const t=In(),a=`${e}::${Rn}`,n=kt.get(a);if(n)return n;const y=Nn(t,e);return kt.set(a,y),y},Pe=e=>{const t=In(),a=`type:${e}::${Rn}`,n=kt.get(a);if(n)return n;const y=Vi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const i of y)try{const p=Nn(t,i);return kt.set(a,p),p}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Ce=e=>typeof e=="number"&&isFinite(e)&&e>0,Qt=()=>{const e=globalThis;if(e?.crypto?.randomUUID)return e.crypto.randomUUID();if(e?.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const a=Array.from(t,n=>n.toString(16).padStart(2,"0"));return`${a[0]}${a[1]}${a[2]}${a[3]}-${a[4]}${a[5]}-${a[6]}${a[7]}-${a[8]}${a[9]}-${a[10]}${a[11]}${a[12]}${a[13]}${a[14]}${a[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const a=Math.random()*16|0;return(t==="x"?a:a&3|8).toString(16)})},Fi=(e,t="https://example.com/resource")=>typeof e=="string"&&/^https?:\/\//.test(e)?e:t,Li=(e,t="wss://example.com/socket")=>typeof e=="string"&&/^wss?:\/\//.test(e)?e:t,It=Pe("DataSourceItem"),Ui=(e,t)=>{const a={...t?.defaults||{}},n={...e};if(t?.generateId&&!n.id&&(n.id=Qt()),!n.type)throw new Error("type is required");return n.type==="rest"?(n.url=Fi(n.url),n.method=n.method||"GET",n.headers=n.headers||{},n.params=n.params||{},n.body=n.body||{},n.pollInterval=Ce(n.pollInterval)?Math.round(n.pollInterval):a.pollInterval??1e3,n.timeout=Ce(n.timeout)?Math.round(n.timeout):a.timeout??1e3):n.type==="websocket"?(n.url=Li(n.url),n.heartbeat&&typeof n.heartbeat=="object"&&(n.heartbeat.interval=Ce(n.heartbeat.interval)?Math.round(n.heartbeat.interval):a.heartbeatInterval??1e3,n.heartbeat.message=n.heartbeat.message??{}),n.pollInterval=Ce(n.pollInterval)?Math.round(n.pollInterval):a.pollInterval??1e3):n.type==="static"?n.value=n.value??{}:n.type==="function"&&(n.code=typeof n.code=="string"?n.code:"export default async function(ctx){ return null }",n.timeout=Ce(n.timeout)?Math.round(n.timeout):a.timeout??1e3),n},Ki=e=>It(e)?{ok:!0}:{ok:!1,errors:It.errors||[]},On=(e,t)=>{debugger;const a=Ui(e,t);return It(a)?{ok:!0,value:a}:{ok:!1,errors:It.errors||[]}},Hi=(e,t)=>{const a=On(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Rt=Pe("ComponentInstance"),Gi=(e,t)=>{const a={...e};if(t?.generateId&&!a.id&&(a.id=Qt()),!a.role)throw new Error("role is required");if(a.role==="view"){if(!a.component)throw new Error("component is required for view");delete a.children}else if(a.role==="container"){if(!Array.isArray(a.children))throw new Error("children is required for container");delete a.component}else if(a.role==="logic"){if(!a.component)throw new Error("component is required for logic");delete a.children}return a},Ji=e=>Rt(e)?{ok:!0}:{ok:!1,errors:Rt.errors||[]},qn=(e,t)=>{const a=Gi(e,t);return Rt(a)?{ok:!0,value:a}:{ok:!1,errors:Rt.errors||[]}},Wi=(e,t)=>{const a=qn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Nt=Pe("CICPage"),Bi=(e,t)=>{const a={...e};return t?.generateId&&!a.id&&(a.id=Qt()),a},Yi=e=>Nt(e)?{ok:!0}:{ok:!1,errors:Nt.errors||[]},Cn=(e,t)=>{const a=Bi(e,t);return Nt(a)?{ok:!0,value:a}:{ok:!1,errors:Nt.errors||[]}},Zi=(e,t)=>{const a=Cn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Ot=Pe("Meta"),qt=Pe("Layout"),Qi=e=>Ot(e)?{ok:!0}:{ok:!1,errors:Ot.errors||[]},Xi=e=>qt(e)?{ok:!0}:{ok:!1,errors:qt.errors||[]},Tn=e=>Ot(e)?{ok:!0,value:e}:{ok:!1,errors:Ot.errors||[]},Dn=e=>qt(e)?{ok:!0,value:e}:{ok:!1,errors:qt.errors||[]},xi=e=>{const t=Tn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},es=e=>{const t=Dn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Ct=zi("#/definitions/Variables"),ts=e=>Ct(e)?{ok:!0}:{ok:!1,errors:Ct.errors||[]},Mn=e=>Ct(e)?{ok:!0,value:e}:{ok:!1,errors:Ct.errors||[]},rs=e=>{const t=Mn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Tt=Pe("Dependency"),ns=e=>Tt(e)?{ok:!0}:{ok:!1,errors:Tt.errors||[]},An=e=>Tt(e)?{ok:!0,value:e}:{ok:!1,errors:Tt.errors||[]},is=e=>{const t=An(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Dt=Pe("RegistryComponents"),ss=e=>Dt(e)?{ok:!0}:{ok:!1,errors:Dt.errors||[]},Vn=e=>Dt(e)?{ok:!0,value:e}:{ok:!1,errors:Dt.errors||[]},os=e=>{const t=Vn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value};class oe{config;static validator;static validate;static schemaHash;constructor(t){const a=oe.validateConfig(t);if(!a.valid)throw new Error(`Invalid CIC Configuration: ${a.error}`);this.config=t}getConfig(){return this.config}findComponent(t){let a;return this.walkComponents(n=>n.id===t?(a=n,!1):!0),a}findPageByComponent(t){let a;return this.walkComponents((n,y)=>n.id===t?(a=y,!1):!0),a}getVariable(t,a){const n=this.config.variables;if(n){if(t.componentId&&n.component&&n.component[t.componentId]){const y=n.component[t.componentId][a];if(y)return y.value??y.default}if(t.pageId&&n.page&&n.page[t.pageId]){const y=n.page[t.pageId][a];if(y)return y.value??y.default}if(n.global&&n.global[a]){const y=n.global[a];return y.value??y.default}}}getVariableByRef(t){const a=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!a)return;const[,n,y,i]=a;if(n==="global")return this.getVariable({},i);if(n==="page")return this.getVariable({pageId:y},i);if(n==="component")return this.getVariable({componentId:y},i)}walkComponents(t){if(this.config.pages)for(const a of this.config.pages){const n=[];for(const i of a.components||[])n.push({node:i});let y=!1;for(;n.length>0&&!y;){const{node:i,parent:p}=n.pop();if(t(i,a,p)===!1){y=!0;break}if(i.children&&i.children.length>0)for(let m=i.children.length-1;m>=0;m--)n.push({node:i.children[m],parent:i})}if(y)break}}static validateConfig(t){if(!t)return{valid:!1,error:"Config is null or undefined"};const a=JSON.stringify(qe);return(!oe.validator||oe.schemaHash!==a)&&(oe.validator=new Pn({allErrors:!0,strict:!1}),kn(oe.validator),oe.validator.addFormat("color-hex",/^#[0-9a-fA-F]{6}$/),oe.validate=oe.validator.compile(qe),oe.schemaHash=a),oe.validate(t)?{valid:!0}:{valid:!1,error:oe.validate.errors.map(i=>`${i.instancePath} ${i.message}`).join("; ")}}static getValueByPath(t,a,n){if(t==null||!a)return n;const y=[];a.replace(/\[(\d+)\]/g,".$1").split(".").forEach(p=>{p.trim()&&y.push(p.trim())});let i=t;for(const p of y){if(i==null)return n;i=i[p]}return i===void 0?n:i}static traverseTree(t,a,n){const y=Array.isArray(t)?t:[t];for(const i of y)a(i,n)!==!1&&i.children&&i.children.length>0&&oe.traverseTree(i.children,a,i)}static createDataSource=On;static validateDataSource=Ki;static normalizeDataSource=Hi;static createComponent=qn;static validateComponent=Ji;static normalizeComponent=Wi;static createPage=Cn;static validatePage=Yi;static normalizePage=Zi;static createMeta=Tn;static createLayout=Dn;static validateMeta=Qi;static validateLayout=Xi;static normalizeMeta=xi;static normalizeLayout=es;static createVariables=Mn;static validateVariables=ts;static normalizeVariables=rs;static createDependency=An;static validateDependency=ns;static normalizeDependency=is;static createRegistryComponent=Vn;static validateRegistryComponent=ss;static normalizeRegistryComponent=os}Ee.CICSDK=oe,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"})}));
|
|
8
|
+
deps: ${_}}`};const m={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(h){const[b,_]=s(h);p(h,b),d(h,_)}};function s({schema:h}){const b={},_={};for(const S in h){if(S==="__proto__")continue;const $=Array.isArray(h[S])?b:_;$[S]=h[S]}return[b,_]}function p(h,b=h.schema){const{gen:_,data:S,it:$}=h;if(Object.keys(b).length===0)return;const g=_.let("missing");for(const v in b){const w=b[v];if(w.length===0)continue;const c=(0,i.propertyInData)(_,S,v,$.opts.ownProperties);h.setParams({property:v,depsCount:w.length,deps:w.join(", ")}),$.allErrors?_.if(c,()=>{for(const u of w)(0,i.checkReportMissingProp)(h,u)}):(_.if((0,t._)`${c} && (${(0,i.checkMissingProp)(h,w,g)})`),(0,i.reportMissingProp)(h,g),_.else())}}e.validatePropertyDeps=p;function d(h,b=h.schema){const{gen:_,data:S,keyword:$,it:g}=h,v=_.name("valid");for(const w in b)(0,r.alwaysValidSchema)(g,b[w])||(_.if((0,i.propertyInData)(_,S,w,g.opts.ownProperties),()=>{const c=h.subschema({keyword:$,schemaProp:w},v);h.mergeValidEvaluated(c,v)},()=>_.var(v,!0)),h.ok(v))}e.validateSchemaDeps=d,e.default=m})(ur)),ur}var mt={},vn;function Ns(){if(vn)return mt;vn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=G(),t=Z(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:m})=>(0,e._)`{propertyName: ${m.propertyName}}`},code(m){const{gen:s,schema:p,data:d,it:h}=m;if((0,t.alwaysValidSchema)(h,p))return;const b=s.name("valid");s.forIn("key",d,_=>{m.setParams({propertyName:_}),m.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},b),s.if((0,e.not)(b),()=>{m.error(!0),h.allErrors||s.break()})}),m.ok(b)}};return mt.default=i,mt}var ht={},_n;function $n(){if(_n)return ht;_n=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=me(),t=G(),r=be(),i=Z(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:p})=>(0,t._)`{additionalProperty: ${p.additionalProperty}}`},code(p){const{gen:d,schema:h,parentSchema:b,data:_,errsCount:S,it:$}=p;if(!S)throw new Error("ajv implementation error");const{allErrors:g,opts:v}=$;if($.props=!0,v.removeAdditional!=="all"&&(0,i.alwaysValidSchema)($,h))return;const w=(0,e.allSchemaProperties)(b.properties),c=(0,e.allSchemaProperties)(b.patternProperties);u(),p.ok((0,t._)`${S} === ${r.default.errors}`);function u(){d.forIn("key",_,f=>{!w.length&&!c.length?y(f):d.if(n(f),()=>y(f))})}function n(f){let P;if(w.length>8){const O=(0,i.schemaRefOrVal)($,b.properties,"properties");P=(0,e.isOwnProperty)(d,O,f)}else w.length?P=(0,t.or)(...w.map(O=>(0,t._)`${f} === ${O}`)):P=t.nil;return c.length&&(P=(0,t.or)(P,...c.map(O=>(0,t._)`${(0,e.usePattern)(p,O)}.test(${f})`))),(0,t.not)(P)}function a(f){d.code((0,t._)`delete ${_}[${f}]`)}function y(f){if(v.removeAdditional==="all"||v.removeAdditional&&h===!1){a(f);return}if(h===!1){p.setParams({additionalProperty:f}),p.error(),g||d.break();return}if(typeof h=="object"&&!(0,i.alwaysValidSchema)($,h)){const P=d.name("valid");v.removeAdditional==="failing"?(o(f,P,!1),d.if((0,t.not)(P),()=>{p.reset(),a(f)})):(o(f,P),g||d.if((0,t.not)(P),()=>d.break()))}}function o(f,P,O){const D={keyword:"additionalProperties",dataProp:f,dataPropType:i.Type.Str};O===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),p.subschema(D,P)}}};return ht.default=s,ht}var yt={},bn;function Os(){if(bn)return yt;bn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=Ke(),t=me(),r=Z(),i=$n(),m={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:p,schema:d,parentSchema:h,data:b,it:_}=s;_.opts.removeAdditional==="all"&&h.additionalProperties===void 0&&i.default.code(new e.KeywordCxt(_,i.default,"additionalProperties"));const S=(0,t.allSchemaProperties)(d);for(const c of S)_.definedProperties.add(c);_.opts.unevaluated&&S.length&&_.props!==!0&&(_.props=r.mergeEvaluated.props(p,(0,r.toHash)(S),_.props));const $=S.filter(c=>!(0,r.alwaysValidSchema)(_,d[c]));if($.length===0)return;const g=p.name("valid");for(const c of $)v(c)?w(c):(p.if((0,t.propertyInData)(p,b,c,_.opts.ownProperties)),w(c),_.allErrors||p.else().var(g,!0),p.endIf()),s.it.definedProperties.add(c),s.ok(g);function v(c){return _.opts.useDefaults&&!_.compositeRule&&d[c].default!==void 0}function w(c){s.subschema({keyword:"properties",schemaProp:c,dataProp:c},g)}}};return yt.default=m,yt}var gt={},wn;function Is(){if(wn)return gt;wn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=me(),t=G(),r=Z(),i=Z(),m={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:p,schema:d,data:h,parentSchema:b,it:_}=s,{opts:S}=_,$=(0,e.allSchemaProperties)(d),g=$.filter(y=>(0,r.alwaysValidSchema)(_,d[y]));if($.length===0||g.length===$.length&&(!_.opts.unevaluated||_.props===!0))return;const v=S.strictSchema&&!S.allowMatchingProperties&&b.properties,w=p.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,i.evaluatedPropsToName)(p,_.props));const{props:c}=_;u();function u(){for(const y of $)v&&n(y),_.allErrors?a(y):(p.var(w,!0),a(y),p.if(w))}function n(y){for(const o in v)new RegExp(y).test(o)&&(0,r.checkStrictMode)(_,`property ${o} matches pattern ${y} (use allowMatchingProperties)`)}function a(y){p.forIn("key",h,o=>{p.if((0,t._)`${(0,e.usePattern)(s,y)}.test(${o})`,()=>{const f=g.includes(y);f||s.subschema({keyword:"patternProperties",schemaProp:y,dataProp:o,dataPropType:i.Type.Str},w),_.opts.unevaluated&&c!==!0?p.assign((0,t._)`${c}[${o}]`,!0):!f&&!_.allErrors&&p.if((0,t.not)(w),()=>p.break())})})}}};return gt.default=m,gt}var vt={},Pn;function Cs(){if(Pn)return vt;Pn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=Z(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:i,schema:m,it:s}=r;if((0,e.alwaysValidSchema)(s,m)){r.fail();return}const p=i.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},p),r.failResult(p,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return vt.default=t,vt}var _t={},kn;function qs(){if(kn)return _t;kn=1,Object.defineProperty(_t,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:me().validateUnion,error:{message:"must match a schema in anyOf"}};return _t.default=t,_t}var $t={},Sn;function Ts(){if(Sn)return $t;Sn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=G(),t=Z(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:m})=>(0,e._)`{passingSchemas: ${m.passing}}`},code(m){const{gen:s,schema:p,parentSchema:d,it:h}=m;if(!Array.isArray(p))throw new Error("ajv implementation error");if(h.opts.discriminator&&d.discriminator)return;const b=p,_=s.let("valid",!1),S=s.let("passing",null),$=s.name("_valid");m.setParams({passing:S}),s.block(g),m.result(_,()=>m.reset(),()=>m.error(!0));function g(){b.forEach((v,w)=>{let c;(0,t.alwaysValidSchema)(h,v)?s.var($,!0):c=m.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},$),w>0&&s.if((0,e._)`${$} && ${_}`).assign(_,!1).assign(S,(0,e._)`[${S}, ${w}]`).else(),s.if($,()=>{s.assign(_,!0),s.assign(S,w),c&&m.mergeEvaluated(c,e.Name)})})}}};return $t.default=i,$t}var bt={},En;function Ds(){if(En)return bt;En=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=Z(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:i,schema:m,it:s}=r;if(!Array.isArray(m))throw new Error("ajv implementation error");const p=i.name("valid");m.forEach((d,h)=>{if((0,e.alwaysValidSchema)(s,d))return;const b=r.subschema({keyword:"allOf",schemaProp:h},p);r.ok(p),r.mergeEvaluated(b)})}};return bt.default=t,bt}var wt={},jn;function Ms(){if(jn)return wt;jn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=G(),t=Z(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:p,parentSchema:d,it:h}=s;d.then===void 0&&d.else===void 0&&(0,t.checkStrictMode)(h,'"if" without "then" and "else" is ignored');const b=m(h,"then"),_=m(h,"else");if(!b&&!_)return;const S=p.let("valid",!0),$=p.name("_valid");if(g(),s.reset(),b&&_){const w=p.let("ifClause");s.setParams({ifClause:w}),p.if($,v("then",w),v("else",w))}else b?p.if($,v("then")):p.if((0,e.not)($),v("else"));s.pass(S,()=>s.error(!0));function g(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);s.mergeEvaluated(w)}function v(w,c){return()=>{const u=s.subschema({keyword:w},$);p.assign(S,$),s.mergeValidEvaluated(u,S),c?p.assign(c,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function m(s,p){const d=s.schema[p];return d!==void 0&&!(0,t.alwaysValidSchema)(s,d)}return wt.default=i,wt}var Pt={},Rn;function As(){if(Rn)return Pt;Rn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=Z(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:i,it:m}){i.if===void 0&&(0,e.checkStrictMode)(m,`"${r}" without "if" is ignored`)}};return Pt.default=t,Pt}var Nn;function Vs(){if(Nn)return dt;Nn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=ln(),t=Ss(),r=pn(),i=Es(),m=js(),s=Rs(),p=Ns(),d=$n(),h=Os(),b=Is(),_=Cs(),S=qs(),$=Ts(),g=Ds(),v=Ms(),w=As();function c(u=!1){const n=[_.default,S.default,$.default,g.default,v.default,w.default,p.default,d.default,s.default,h.default,b.default];return u?n.push(t.default,i.default):n.push(e.default,r.default),n.push(m.default),n}return dt.default=c,dt}var kt={},St={},On;function zs(){if(On)return St;On=1,Object.defineProperty(St,"__esModule",{value:!0});const e=G(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,e.str)`must match format "${i}"`,params:({schemaCode:i})=>(0,e._)`{format: ${i}}`},code(i,m){const{gen:s,data:p,$data:d,schema:h,schemaCode:b,it:_}=i,{opts:S,errSchemaPath:$,schemaEnv:g,self:v}=_;if(!S.validateFormats)return;d?w():c();function w(){const u=s.scopeValue("formats",{ref:v.formats,code:S.code.formats}),n=s.const("fDef",(0,e._)`${u}[${b}]`),a=s.let("fType"),y=s.let("format");s.if((0,e._)`typeof ${n} == "object" && !(${n} instanceof RegExp)`,()=>s.assign(a,(0,e._)`${n}.type || "string"`).assign(y,(0,e._)`${n}.validate`),()=>s.assign(a,(0,e._)`"string"`).assign(y,n)),i.fail$data((0,e.or)(o(),f()));function o(){return S.strictSchema===!1?e.nil:(0,e._)`${b} && !${y}`}function f(){const P=g.$async?(0,e._)`(${n}.async ? await ${y}(${p}) : ${y}(${p}))`:(0,e._)`${y}(${p})`,O=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${p}))`;return(0,e._)`${y} && ${y} !== true && ${a} === ${m} && !${O}`}}function c(){const u=v.formats[h];if(!u){o();return}if(u===!0)return;const[n,a,y]=f(u);n===m&&i.pass(P());function o(){if(S.strictSchema===!1){v.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${h}" ignored in schema at path "${$}"`}}function f(O){const D=O instanceof RegExp?(0,e.regexpCode)(O):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(h)}`:void 0,z=s.scopeValue("formats",{key:h,ref:O,code:D});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,e._)`${z}.validate`]:["string",O,z]}function P(){if(typeof u=="object"&&!(u instanceof RegExp)&&u.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${p})`}return typeof a=="function"?(0,e._)`${y}(${p})`:(0,e._)`${y}.test(${p})`}}}};return St.default=r,St}var In;function Fs(){if(In)return kt;In=1,Object.defineProperty(kt,"__esModule",{value:!0});const t=[zs().default];return kt.default=t,kt}var Se={},Cn;function Ls(){return Cn||(Cn=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.contentVocabulary=Se.metadataVocabulary=void 0,Se.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Se.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Se}var qn;function Us(){if(qn)return Be;qn=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=fs(),t=ks(),r=Vs(),i=Fs(),m=Ls(),s=[e.default,t.default,(0,r.default)(),i.default,m.metadataVocabulary,m.contentVocabulary];return Be.default=s,Be}var Et={},qe={},Tn;function Ks(){if(Tn)return qe;Tn=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(qe.DiscrError=e={})),qe}var Dn;function Hs(){if(Dn)return Et;Dn=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=G(),t=Ks(),r=ir(),i=Ge(),m=Z(),p={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:d,tagName:h}})=>d===t.DiscrError.Tag?`tag "${h}" must be string`:`value of tag "${h}" must be in oneOf`,params:({params:{discrError:d,tag:h,tagName:b}})=>(0,e._)`{error: ${d}, tag: ${b}, tagValue: ${h}}`},code(d){const{gen:h,data:b,schema:_,parentSchema:S,it:$}=d,{oneOf:g}=S;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const v=_.propertyName;if(typeof v!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const w=h.let("valid",!1),c=h.const("tag",(0,e._)`${b}${(0,e.getProperty)(v)}`);h.if((0,e._)`typeof ${c} == "string"`,()=>u(),()=>d.error(!1,{discrError:t.DiscrError.Tag,tag:c,tagName:v})),d.ok(w);function u(){const y=a();h.if(!1);for(const o in y)h.elseIf((0,e._)`${c} === ${o}`),h.assign(w,n(y[o]));h.else(),d.error(!1,{discrError:t.DiscrError.Mapping,tag:c,tagName:v}),h.endIf()}function n(y){const o=h.name("valid"),f=d.subschema({keyword:"oneOf",schemaProp:y},o);return d.mergeEvaluated(f,e.Name),o}function a(){var y;const o={},f=O(S);let P=!0;for(let C=0;C<g.length;C++){let V=g[C];if(V?.$ref&&!(0,m.schemaHasRulesButRef)(V,$.self.RULES)){const L=V.$ref;if(V=r.resolveRef.call($.self,$.schemaEnv.root,$.baseId,L),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new i.default($.opts.uriResolver,$.baseId,L)}const F=(y=V?.properties)===null||y===void 0?void 0:y[v];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);P=P&&(f||O(V)),D(F,C)}if(!P)throw new Error(`discriminator: "${v}" must be required`);return o;function O({required:C}){return Array.isArray(C)&&C.includes(v)}function D(C,V){if(C.const)z(C.const,V);else if(C.enum)for(const F of C.enum)z(F,V);else throw new Error(`discriminator: "properties/${v}" must have "const" or "enum"`)}function z(C,V){if(typeof C!="string"||C in o)throw new Error(`discriminator: "${v}" values must be unique strings`);o[C]=V}}}};return Et.default=p,Et}const Js={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};var Mn;function An(){return Mn||(Mn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=us(),i=Us(),m=Hs(),s=Js,p=["/properties"],d="http://json-schema.org/draft-07/schema";class h extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(m.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(s,p):s;this.addMetaSchema(v,d,!1),this.refs["http://json-schema.org/schema"]=d}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(d)?d:void 0)}}t.Ajv=h,e.exports=t=h,e.exports.Ajv=h,Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var b=Ke();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var _=G();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var S=sr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return S.default}});var $=Ge();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})})(Ae,Ae.exports)),Ae.exports}var Gs=An();const Vn=je(Gs);var jt={exports:{}},dr={},zn;function Ws(){return zn||(zn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(C,V){return{validate:C,compare:V}}e.fullFormats={date:t(s,p),time:t(h(!0),b),"date-time":t($(!0),g),"iso-time":t(h(),_),"iso-date-time":t($(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:u,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:a,int32:{type:"number",validate:f},int64:{type:"number",validate:P},float:{type:"number",validate:O},double:{type:"number",validate:O},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,p),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(C){return C%4===0&&(C%100!==0||C%400===0)}const i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,m=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const V=i.exec(C);if(!V)return!1;const F=+V[1],L=+V[2],X=+V[3];return L>=1&&L<=12&&X>=1&&X<=(L===2&&r(F)?29:m[L])}function p(C,V){if(C&&V)return C>V?1:C<V?-1:0}const d=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function h(C){return function(F){const L=d.exec(F);if(!L)return!1;const X=+L[1],oe=+L[2],ae=+L[3],ee=L[4],ye=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||C&&!ee)return!1;if(X<=23&&oe<=59&&ae<60)return!0;const T=oe-j*ye,N=X-M*ye-(T<0?1:0);return(N===23||N===-1)&&(T===59||T===-1)&&ae<61}}function b(C,V){if(!(C&&V))return;const F=new Date("2020-01-01T"+C).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function _(C,V){if(!(C&&V))return;const F=d.exec(C),L=d.exec(V);if(F&&L)return C=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],C>V?1:C<V?-1:0}const S=/t|\s/i;function $(C){const V=h(C);return function(L){const X=L.split(S);return X.length===2&&s(X[0])&&V(X[1])}}function g(C,V){if(!(C&&V))return;const F=new Date(C).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function v(C,V){if(!(C&&V))return;const[F,L]=C.split(S),[X,oe]=V.split(S),ae=p(F,X);if(ae!==void 0)return ae||b(L,oe)}const w=/\/|:/,c=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function u(C){return w.test(C)&&c.test(C)}const n=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function a(C){return n.lastIndex=0,n.test(C)}const y=-2147483648,o=2**31-1;function f(C){return Number.isInteger(C)&&C<=o&&C>=y}function P(C){return Number.isInteger(C)}function O(){return!0}const D=/[^\\]\\Z/;function z(C){if(D.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(dr)),dr}var lr={},Fn;function Bs(){return Fn||(Fn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=An(),r=G(),i=r.operators,m={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:d,schemaCode:h})=>(0,r.str)`should be ${m[d].okStr} ${h}`,params:({keyword:d,schemaCode:h})=>(0,r._)`{comparison: ${m[d].okStr}, limit: ${h}}`};e.formatLimitDefinition={keyword:Object.keys(m),type:"string",schemaType:"string",$data:!0,error:s,code(d){const{gen:h,data:b,schemaCode:_,keyword:S,it:$}=d,{opts:g,self:v}=$;if(!g.validateFormats)return;const w=new t.KeywordCxt($,v.RULES.all.format.definition,"format");w.$data?c():u();function c(){const a=h.scopeValue("formats",{ref:v.formats,code:g.code.formats}),y=h.const("fmt",(0,r._)`${a}[${w.schemaCode}]`);d.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,n(y)))}function u(){const a=w.schema,y=v.formats[a];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${S}": format "${a}" does not define "compare" function`);const o=h.scopeValue("formats",{key:a,ref:y,code:g.code.formats?(0,r._)`${g.code.formats}${(0,r.getProperty)(a)}`:void 0});d.fail$data(n(o))}function n(a){return(0,r._)`${a}.compare(${b}, ${_}) ${m[S].fail} 0`}},dependencies:["format"]};const p=d=>(d.addKeyword(e.formatLimitDefinition),d);e.default=p})(lr)),lr}var Ln;function Ys(){return Ln||(Ln=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Ws(),i=Bs(),m=G(),s=new m.Name("fullFormats"),p=new m.Name("fastFormats"),d=(b,_={keywords:!0})=>{if(Array.isArray(_))return h(b,_,r.fullFormats,s),b;const[S,$]=_.mode==="fast"?[r.fastFormats,p]:[r.fullFormats,s],g=_.formats||r.formatNames;return h(b,g,S,$),_.keywords&&(0,i.default)(b),b};d.get=(b,_="full")=>{const $=(_==="fast"?r.fastFormats:r.fullFormats)[b];if(!$)throw new Error(`Unknown format "${b}"`);return $};function h(b,_,S,$){var g,v;(g=(v=b.opts.code).formats)!==null&&g!==void 0||(v.formats=(0,m._)`require("ajv-formats/dist/formats").${$}`);for(const w of _)b.addFormat(w,S[w])}e.exports=t=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d})(jt,jt.exports)),jt.exports}var Zs=Ys();const Un=je(Zs),Te={$schema:"http://json-schema.org/draft-07/schema#",$ref:"#/definitions/CICConfig",definitions:JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}')},De=e=>typeof e=="number"&&isFinite(e)&&e>0,fr=()=>{const e=globalThis;if(e?.crypto?.randomUUID)return e.crypto.randomUUID();if(e?.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const r=Array.from(t,i=>i.toString(16).padStart(2,"0"));return`${r[0]}${r[1]}${r[2]}${r[3]}-${r[4]}${r[5]}-${r[6]}${r[7]}-${r[8]}${r[9]}-${r[10]}${r[11]}${r[12]}${r[13]}${r[14]}${r[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})},J=e=>Array.isArray(e)?e.map(t=>{const r=t.instancePath||"",i=t.keyword,m=t.params||{};let s=t.message||"";if(i==="required"&&m.missingProperty&&(s=`缺少必填字段:${m.missingProperty}`),i==="type"&&t.schema&&(s=`类型必须为:${t.schema}`),i==="enum"){const p=Array.isArray(m.allowedValues)?m.allowedValues:void 0;s=p?`取值必须为枚举之一:${p.join(", ")}`:"取值必须为枚举之一"}if(i==="const"){const p=m.allowedValue;s=p!==void 0?`取值必须为:${JSON.stringify(p)}`:"必须等于常量"}return i==="additionalProperties"&&m.additionalProperty&&(s=`不允许额外字段:${m.additionalProperty}`),{path:r,message:s,keyword:i,params:m}}):[],he=(e,t)=>{if(!t||typeof t!="object")return e;const r=e||{};for(const i of Object.keys(t))(!(i in r)||r[i]===void 0)&&(r[i]=t[i]);return r};let Rt=null;const Qs=()=>(Rt||(Rt=new Vn({allErrors:!0,strict:!1}),Un(Rt)),Rt),Kn=new Map,Xs=JSON.stringify(Te),xs={CICPage:["#/definitions/CICPage","#/$defs/CICPage","#/properties/pages/items","#/definitions/CICConfig/properties/pages/items"],Meta:["#/definitions/Meta","#/$defs/Meta","#/properties/meta"],Layout:["#/definitions/Layout","#/$defs/Layout","#/properties/meta/properties/layout"],ComponentInstance:["#/definitions/ComponentInstance","#/$defs/ComponentInstance"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},ei=(e,t)=>e.compile({$ref:t,definitions:Te.definitions,properties:Te.properties}),te=e=>{const t=Qs(),r=`type:${e}::${Xs}`,i=Kn.get(r);if(i)return i;const m=xs[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of m)try{const p=ei(t,s);return Kn.set(r,p),p}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Nt=te("DataSourceItem"),Ot=te("DataSourceRest"),It=te("DataSourceWebSocket"),Ct=te("DataSourceStatic"),qt=te("DataSourceFunction"),ti=(e,t)=>{const r={...e};if(t?.generateId&&!r.id&&(r.id=fr()),!r.type)throw new Error("type is required");return r.type==="rest"?(t?.strict||("pollInterval"in r&&De(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&De(r.timeout)&&(r.timeout=Math.round(r.timeout))),he(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&De(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&De(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),he(r,t?.defaults)):r.type==="static"?he(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&De(r.timeout)&&(r.timeout=Math.round(r.timeout)),he(r,t?.defaults)),r},ri=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string"){if(t.type==="rest")return Ot(e)?{ok:!0}:{ok:!1,errors:J(Ot.errors||[])};if(t.type==="websocket")return It(e)?{ok:!0}:{ok:!1,errors:J(It.errors||[])};if(t.type==="static")return Ct(e)?{ok:!0}:{ok:!1,errors:J(Ct.errors||[])};if(t.type==="function")return qt(e)?{ok:!0}:{ok:!1,errors:J(qt.errors||[])}}return Nt(e)?{ok:!0}:{ok:!1,errors:J(Nt.errors||[])}},Hn=(e,t)=>{const r=ti(e,t);if(r&&typeof r=="object"&&typeof r.type=="string"){if(r.type==="rest")return Ot(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ot.errors||[])};if(r.type==="websocket")return It(r)?{ok:!0,value:r}:{ok:!1,errors:J(It.errors||[])};if(r.type==="static")return Ct(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ct.errors||[])};if(r.type==="function")return qt(r)?{ok:!0,value:r}:{ok:!1,errors:J(qt.errors||[])}}return Nt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Nt.errors||[])}},ni=(e,t)=>{const r=Hn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Tt=te("ComponentInstance"),Dt=te("ViewComponentInstance"),Mt=te("ContainerComponentInstance"),At=te("LogicComponentInstanceRef"),si=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=fr()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),he(r,t?.defaults),r},ii=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.role=="string"){if(t.role==="view")return Dt(e)?{ok:!0}:{ok:!1,errors:J(Dt.errors||[])};if(t.role==="container")return Mt(e)?{ok:!0}:{ok:!1,errors:J(Mt.errors||[])};if(t.role==="logic")return At(e)?{ok:!0}:{ok:!1,errors:J(At.errors||[])}}return Tt(e)?{ok:!0}:{ok:!1,errors:J(Tt.errors||[])}},Jn=(e,t)=>{const r=si(e,t);if(r&&typeof r=="object"&&typeof r.role=="string"){if(r.role==="view")return Dt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Dt.errors||[])};if(r.role==="container")return Mt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Mt.errors||[])};if(r.role==="logic")return At(r)?{ok:!0,value:r}:{ok:!1,errors:J(At.errors||[])}}return Tt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Tt.errors||[])}},oi=(e,t)=>{const r=Jn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Vt=te("CICPage"),ai=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=fr()),he(r,t?.defaults),r},ci=e=>Vt(e)?{ok:!0}:{ok:!1,errors:J(Vt.errors||[])},Gn=(e,t)=>{const r=ai(e,t);return Vt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Vt.errors||[])}},ui=(e,t)=>{const r=Gn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},zt=te("Meta"),Ft=te("Layout"),di=e=>zt(e)?{ok:!0}:{ok:!1,errors:J(zt.errors||[])},li=e=>Ft(e)?{ok:!0}:{ok:!1,errors:J(Ft.errors||[])},Wn=(e,t)=>{const r=he(e,t?.defaults);return zt(r)?{ok:!0,value:r}:{ok:!1,errors:J(zt.errors||[])}},Bn=(e,t)=>{const r=he(e,t?.defaults);return Ft(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ft.errors||[])}},fi=(e,t)=>{const r=Wn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},pi=(e,t)=>{const r=Bn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Lt=te("Variables"),mi=e=>Lt(e)?{ok:!0}:{ok:!1,errors:J(Lt.errors||[])},Yn=(e,t)=>{const r=he(e,t?.defaults);return Lt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Lt.errors||[])}},hi=(e,t)=>{const r=Yn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Ut=te("Dependency"),Kt=te("JSDependency"),Ht=te("CSSDependency"),Jt=te("FontDependency"),Gt=te("ImageDependency"),Wt=te("JSONDependency"),Bt=te("WasmDependency"),Yt=te("OtherDependency"),yi=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string")switch(t.type){case"js":return Kt(e)?{ok:!0}:{ok:!1,errors:J(Kt.errors||[])};case"css":return Ht(e)?{ok:!0}:{ok:!1,errors:J(Ht.errors||[])};case"font":return Jt(e)?{ok:!0}:{ok:!1,errors:J(Jt.errors||[])};case"image":return Gt(e)?{ok:!0}:{ok:!1,errors:J(Gt.errors||[])};case"json":return Wt(e)?{ok:!0}:{ok:!1,errors:J(Wt.errors||[])};case"wasm":return Bt(e)?{ok:!0}:{ok:!1,errors:J(Bt.errors||[])};case"other":return Yt(e)?{ok:!0}:{ok:!1,errors:J(Yt.errors||[])}}return Ut(e)?{ok:!0}:{ok:!1,errors:J(Ut.errors||[])}},Zn=(e,t)=>{const r=he(e,t?.defaults);if(r&&typeof r=="object"&&typeof r.type=="string")switch(r.type){case"js":return Kt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Kt.errors||[])};case"css":return Ht(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ht.errors||[])};case"font":return Jt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Jt.errors||[])};case"image":return Gt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Gt.errors||[])};case"json":return Wt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Wt.errors||[])};case"wasm":return Bt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Bt.errors||[])};case"other":return Yt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Yt.errors||[])}}return Ut(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ut.errors||[])}},gi=(e,t)=>{const r=Zn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Zt=te("RegistryComponents"),vi=e=>Zt(e)?{ok:!0}:{ok:!1,errors:J(Zt.errors||[])},Qn=(e,t)=>{const r=he(e,t?.defaults);return Zt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Zt.errors||[])}},_i=(e,t)=>{const r=Qn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value};class ce{config;static validator;static validate;static schemaHash;constructor(t){const r=ce.validateConfig(t);if(!r.valid)throw new Error(`Invalid CIC Configuration: ${r.error}`);this.config=t}getConfig(){return this.config}findComponent(t){let r;return this.walkComponents(i=>i.id===t?(r=i,!1):!0),r}findPageByComponent(t){let r;return this.walkComponents((i,m)=>i.id===t?(r=m,!1):!0),r}getVariable(t,r){const i=this.config.variables;if(i){if(t.componentId&&i.component&&i.component[t.componentId]){const m=i.component[t.componentId][r];if(m)return m.value??m.default}if(t.pageId&&i.page&&i.page[t.pageId]){const m=i.page[t.pageId][r];if(m)return m.value??m.default}if(i.global&&i.global[r]){const m=i.global[r];return m.value??m.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,i,m,s]=r;if(i==="global")return this.getVariable({},s);if(i==="page")return this.getVariable({pageId:m},s);if(i==="component")return this.getVariable({componentId:m},s)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const i=[];for(const s of r.components||[])i.push({node:s});let m=!1;for(;i.length>0&&!m;){const{node:s,parent:p}=i.pop();if(t(s,r,p)===!1){m=!0;break}if(s.children&&s.children.length>0)for(let h=s.children.length-1;h>=0;h--)i.push({node:s.children[h],parent:s})}if(m)break}}static validateConfig(t){if(!t)return{valid:!1,error:"Config is null or undefined"};const r=JSON.stringify(Te);return(!ce.validator||ce.schemaHash!==r)&&(ce.validator=new Vn({allErrors:!0,strict:!1}),Un(ce.validator),ce.validator.addFormat("color-hex",/^#[0-9a-fA-F]{6}$/),ce.validate=ce.validator.compile(Te),ce.schemaHash=r),ce.validate(t)?{valid:!0}:{valid:!1,error:ce.validate.errors.map(s=>`${s.instancePath} ${s.message}`).join("; ")}}static getValueByPath(t,r,i){if(t==null||!r)return i;const m=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(p=>{p.trim()&&m.push(p.trim())});let s=t;for(const p of m){if(s==null)return i;s=s[p]}return s===void 0?i:s}static traverseTree(t,r,i){const m=Array.isArray(t)?t:[t];for(const s of m)r(s,i)!==!1&&s.children&&s.children.length>0&&ce.traverseTree(s.children,r,s)}static createDataSource=Hn;static validateDataSource=ri;static normalizeDataSource=ni;static createComponent=Jn;static validateComponent=ii;static normalizeComponent=oi;static createPage=Gn;static validatePage=ci;static normalizePage=ui;static createMeta=Wn;static createLayout=Bn;static validateMeta=di;static validateLayout=li;static normalizeMeta=fi;static normalizeLayout=pi;static createVariables=Yn;static validateVariables=mi;static normalizeVariables=hi;static createDependency=Zn;static validateDependency=yi;static normalizeDependency=gi;static createRegistryComponent=Qn;static validateRegistryComponent=vi;static normalizeRegistryComponent=_i}Ee.CICSDK=ce,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"})}));
|