@anov/cic-standard-sdk 0.0.15 → 0.0.16
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 +2122 -2089
- package/dist/cic-sdk.umd.js +6 -6
- package/dist/sdk/CICSDK.d.ts +21 -21
- package/dist/sdk/ICICSDK.d.ts +1 -1
- package/dist/sdk/core/ajv.d.ts +32 -0
- package/dist/sdk/core/errors.d.ts +100 -0
- package/dist/sdk/core/index.d.ts +6 -0
- package/dist/sdk/core/pipeline.d.ts +22 -0
- package/dist/sdk/core/rules.d.ts +21 -0
- package/dist/sdk/core/types.d.ts +112 -0
- package/dist/sdk/core/union.d.ts +8 -0
- package/dist/sdk/core/utils.d.ts +16 -0
- package/dist/sdk/generators/cicConfig.d.ts +1 -1
- package/dist/sdk/generators/component.d.ts +2 -2
- package/dist/sdk/generators/dataSource.d.ts +1 -1
- package/dist/sdk/generators/dependency.d.ts +1 -1
- package/dist/sdk/generators/meta.d.ts +1 -1
- package/dist/sdk/generators/page.d.ts +1 -1
- package/dist/sdk/generators/registry.d.ts +1 -1
- package/dist/sdk/generators/variables.d.ts +1 -1
- package/dist/sdk/rules/components/componentIdUnique.rule.d.ts +1 -1
- package/dist/sdk/rules/datasources/dataSourceIdUnique.rule.d.ts +1 -1
- package/dist/sdk/rules/index.d.ts +1 -1
- package/dist/sdk/rules/page/pageNameUnique.rule.d.ts +1 -1
- package/dist/sdk/rules/page/pagePathUnique.rule.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/page.d.ts +1 -1
- package/package.json +2 -1
- package/dist/sdk/engine/context.d.ts +0 -8
- package/dist/sdk/engine/types.d.ts +0 -47
- package/dist/sdk/engine/validatorEngine.d.ts +0 -13
- package/dist/sdk/generators/ajv.d.ts +0 -16
- package/dist/sdk/generators/common.d.ts +0 -85
- /package/dist/types/{componets.d.ts → components.d.ts} +0 -0
package/dist/cic-sdk.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Rn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ze={exports:{}},Ut={},ve={},Ee={},Lt={},Kt={},Jt={},dr;function Et(){return dr||(dr=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(s){if(super(),!e.IDENTIFIER.test(s))throw new Error("CodeGen: name must be a valid identifier");this.str=s}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class i extends t{constructor(s){super(),this._items=typeof s=="string"?[s]:s}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const s=this._items[0];return s===""||s==='""'}get str(){var s;return(s=this._str)!==null&&s!==void 0?s:this._str=this._items.reduce((d,g)=>`${d}${g}`,"")}get names(){var s;return(s=this._names)!==null&&s!==void 0?s:this._names=this._items.reduce((d,g)=>(g instanceof r&&(d[g.str]=(d[g.str]||0)+1),d),{})}}e._Code=i,e.nil=new i("");function p(l,...s){const d=[l[0]];let g=0;for(;g<s.length;)o(d,s[g]),d.push(l[++g]);return new i(d)}e._=p;const n=new i("+");function u(l,...s){const d=[v(l[0])];let g=0;for(;g<s.length;)d.push(n),o(d,s[g]),d.push(n,v(l[++g]));return f(d),new i(d)}e.str=u;function o(l,s){s instanceof i?l.push(...s._items):s instanceof r?l.push(s):l.push(E(s))}e.addCodeArg=o;function f(l){let s=1;for(;s<l.length-1;){if(l[s]===n){const d=$(l[s-1],l[s+1]);if(d!==void 0){l.splice(s-1,3,d);continue}l[s++]="+"}s++}}function $(l,s){if(s==='""')return l;if(l==='""')return s;if(typeof l=="string")return s instanceof r||l[l.length-1]!=='"'?void 0:typeof s!="string"?`${l.slice(0,-1)}${s}"`:s[0]==='"'?l.slice(0,-1)+s.slice(1):void 0;if(typeof s=="string"&&s[0]==='"'&&!(l instanceof r))return`"${l}${s.slice(1)}`}function b(l,s){return s.emptyStr()?l:l.emptyStr()?s:u`${l}${s}`}e.strConcat=b;function E(l){return typeof l=="number"||typeof l=="boolean"||l===null?l:v(Array.isArray(l)?l.join(","):l)}function _(l){return new i(v(l))}e.stringify=_;function v(l){return JSON.stringify(l).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function w(l){return typeof l=="string"&&e.IDENTIFIER.test(l)?new i(`.${l}`):p`[${l}]`}e.getProperty=w;function y(l){if(typeof l=="string"&&e.IDENTIFIER.test(l))return new i(`${l}`);throw new Error(`CodeGen: invalid export name: ${l}, use explicit $id name mapping`)}e.getEsmExportName=y;function c(l){return new i(l.toString())}e.regexpCode=c})(Jt)),Jt}var Ht={},ur;function lr(){return ur||(ur=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Et();class r extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var i;(function(f){f[f.Started=0]="Started",f[f.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 p{constructor({prefixes:$,parent:b}={}){this._names={},this._prefixes=$,this._parent=b}toName($){return $ instanceof t.Name?$:this.name($)}name($){return new t.Name(this._newName($))}_newName($){const b=this._names[$]||this._nameGroup($);return`${$}${b.index++}`}_nameGroup($){var b,E;if(!((E=(b=this._parent)===null||b===void 0?void 0:b._prefixes)===null||E===void 0)&&E.has($)||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}e.Scope=p;class n extends t.Name{constructor($,b){super(b),this.prefix=$}setValue($,{property:b,itemIndex:E}){this.value=$,this.scopePath=(0,t._)`.${new t.Name(b)}[${E}]`}}e.ValueScopeName=n;const u=(0,t._)`\n`;class o extends p{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?u:t.nil}}get(){return this._scope}name($){return new n($,this._newName($))}value($,b){var E;if(b.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName($),{prefix:v}=_,w=(E=b.key)!==null&&E!==void 0?E:b.ref;let y=this._values[v];if(y){const s=y.get(w);if(s)return s}else y=this._values[v]=new Map;y.set(w,_);const c=this._scope[v]||(this._scope[v]=[]),l=c.length;return c[l]=b.ref,_.setValue(b,{property:v,itemIndex:l}),_}getValue($,b){const E=this._values[$];if(E)return E.get(b)}scopeRefs($,b=this._values){return this._reduceValues(b,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${$}${E.scopePath}`})}scopeCode($=this._values,b,E){return this._reduceValues($,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},b,E)}_reduceValues($,b,E={},_){let v=t.nil;for(const w in $){const y=$[w];if(!y)continue;const c=E[w]=E[w]||new Map;y.forEach(l=>{if(c.has(l))return;c.set(l,i.Started);let s=b(l);if(s){const d=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${d} ${l} = ${s};${this.opts._n}`}else if(s=_?.(l))v=(0,t._)`${v}${s}${this.opts._n}`;else throw new r(l);c.set(l,i.Completed)})}return v}}e.ValueScope=o})(Ht)),Ht}var fr;function G(){return fr||(fr=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=Et(),r=lr();var i=Et();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 p=lr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return p.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return p.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return p.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return p.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 n{optimizeNodes(){return this}optimizeNames(m,S){return this}}class u extends n{constructor(m,S,N){super(),this.varKind=m,this.name=S,this.rhs=N}render({es5:m,_n:S}){const N=m?r.varKinds.var:this.varKind,L=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${L};`+S}optimizeNames(m,S){if(m[this.name.str])return this.rhs&&(this.rhs=U(this.rhs,m,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends n{constructor(m,S,N){super(),this.lhs=m,this.rhs=S,this.sideEffects=N}render({_n:m}){return`${this.lhs} = ${this.rhs};`+m}optimizeNames(m,S){if(!(this.lhs instanceof t.Name&&!m[this.lhs.str]&&!this.sideEffects))return this.rhs=U(this.rhs,m,S),this}get names(){const m=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(m,this.rhs)}}class f extends o{constructor(m,S,N,L){super(m,N,L),this.op=S}render({_n:m}){return`${this.lhs} ${this.op}= ${this.rhs};`+m}}class $ extends n{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`${this.label}:`+m}}class b extends n{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`break${this.label?` ${this.label}`:""};`+m}}class E extends n{constructor(m){super(),this.error=m}render({_n:m}){return`throw ${this.error};`+m}get names(){return this.error.names}}class _ extends n{constructor(m){super(),this.code=m}render({_n:m}){return`${this.code};`+m}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(m,S){return this.code=U(this.code,m,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends n{constructor(m=[]){super(),this.nodes=m}render(m){return this.nodes.reduce((S,N)=>S+N.render(m),"")}optimizeNodes(){const{nodes:m}=this;let S=m.length;for(;S--;){const N=m[S].optimizeNodes();Array.isArray(N)?m.splice(S,1,...N):N?m[S]=N:m.splice(S,1)}return m.length>0?this:void 0}optimizeNames(m,S){const{nodes:N}=this;let L=N.length;for(;L--;){const J=N[L];J.optimizeNames(m,S)||(Q(m,J.names),N.splice(L,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((m,S)=>V(m,S.names),{})}}class w extends v{render(m){return"{"+m._n+super.render(m)+"}"+m._n}}class y extends v{}class c extends w{}c.kind="else";class l extends w{constructor(m,S){super(S),this.condition=m}render(m){let S=`if(${this.condition})`+super.render(m);return this.else&&(S+="else "+this.else.render(m)),S}optimizeNodes(){super.optimizeNodes();const m=this.condition;if(m===!0)return this.nodes;let S=this.else;if(S){const N=S.optimizeNodes();S=this.else=Array.isArray(N)?new c(N):N}if(S)return m===!1?S instanceof l?S:S.nodes:this.nodes.length?this:new l(ie(m),S instanceof l?[S]:S.nodes);if(!(m===!1||!this.nodes.length))return this}optimizeNames(m,S){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(m,S),!!(super.optimizeNames(m,S)||this.else))return this.condition=U(this.condition,m,S),this}get names(){const m=super.names;return F(m,this.condition),this.else&&V(m,this.else.names),m}}l.kind="if";class s extends w{}s.kind="for";class d extends s{constructor(m){super(),this.iteration=m}render(m){return`for(${this.iteration})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iteration=U(this.iteration,m,S),this}get names(){return V(super.names,this.iteration.names)}}class g extends s{constructor(m,S,N,L){super(),this.varKind=m,this.name=S,this.from=N,this.to=L}render(m){const S=m.es5?r.varKinds.var:this.varKind,{name:N,from:L,to:J}=this;return`for(${S} ${N}=${L}; ${N}<${J}; ${N}++)`+super.render(m)}get names(){const m=F(super.names,this.from);return F(m,this.to)}}class a extends s{constructor(m,S,N,L){super(),this.loop=m,this.varKind=S,this.name=N,this.iterable=L}render(m){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iterable=U(this.iterable,m,S),this}get names(){return V(super.names,this.iterable.names)}}class h extends w{constructor(m,S,N){super(),this.name=m,this.args=S,this.async=N}render(m){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(m)}}h.kind="func";class P extends v{render(m){return"return "+super.render(m)}}P.kind="return";class O extends w{render(m){let S="try"+super.render(m);return this.catch&&(S+=this.catch.render(m)),this.finally&&(S+=this.finally.render(m)),S}optimizeNodes(){var m,S;return super.optimizeNodes(),(m=this.catch)===null||m===void 0||m.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(m,S){var N,L;return super.optimizeNames(m,S),(N=this.catch)===null||N===void 0||N.optimizeNames(m,S),(L=this.finally)===null||L===void 0||L.optimizeNames(m,S),this}get names(){const m=super.names;return this.catch&&V(m,this.catch.names),this.finally&&V(m,this.finally.names),m}}class T extends w{constructor(m){super(),this.error=m}render(m){return`catch(${this.error})`+super.render(m)}}T.kind="catch";class z extends w{render(m){return"finally"+super.render(m)}}z.kind="finally";class C{constructor(m,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
|
|
2
|
-
`:""},this._extScope=m,this._scope=new r.Scope({parent:m}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(m){return this._scope.name(m)}scopeName(m){return this._extScope.name(m)}scopeValue(m,S){const N=this._extScope.value(m,S);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(m,S){return this._extScope.getValue(m,S)}scopeRefs(m){return this._extScope.scopeRefs(m,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(m,S,N,L){const J=this._scope.toName(S);return N!==void 0&&L&&(this._constants[J.str]=N),this._leafNode(new u(m,J,N)),J}const(m,S,N){return this._def(r.varKinds.const,m,S,N)}let(m,S,N){return this._def(r.varKinds.let,m,S,N)}var(m,S,N){return this._def(r.varKinds.var,m,S,N)}assign(m,S,N){return this._leafNode(new o(m,S,N))}add(m,S){return this._leafNode(new f(m,e.operators.ADD,S))}code(m){return typeof m=="function"?m():m!==t.nil&&this._leafNode(new _(m)),this}object(...m){const S=["{"];for(const[N,L]of m)S.length>1&&S.push(","),S.push(N),(N!==L||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,L));return S.push("}"),new t._Code(S)}if(m,S,N){if(this._blockNode(new l(m)),S&&N)this.code(S).else().code(N).endIf();else if(S)this.code(S).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(m){return this._elseNode(new l(m))}else(){return this._elseNode(new c)}endIf(){return this._endBlockNode(l,c)}_for(m,S){return this._blockNode(m),S&&this.code(S).endFor(),this}for(m,S){return this._for(new d(m),S)}forRange(m,S,N,L,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const x=this._scope.toName(m);return this._for(new g(J,x,S,N),()=>L(x))}forOf(m,S,N,L=r.varKinds.const){const J=this._scope.toName(m);if(this.opts.es5){const x=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${x}.length`,B=>{this.var(J,(0,t._)`${x}[${B}]`),N(J)})}return this._for(new a("of",L,J,S),()=>N(J))}forIn(m,S,N,L=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(m,(0,t._)`Object.keys(${S})`,N);const J=this._scope.toName(m);return this._for(new a("in",L,J,S),()=>N(J))}endFor(){return this._endBlockNode(s)}label(m){return this._leafNode(new $(m))}break(m){return this._leafNode(new b(m))}return(m){const S=new P;if(this._blockNode(S),this.code(m),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(m,S,N){if(!S&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const L=new O;if(this._blockNode(L),this.code(m),S){const J=this.name("e");this._currNode=L.catch=new T(J),S(J)}return N&&(this._currNode=L.finally=new z,this.code(N)),this._endBlockNode(T,z)}throw(m){return this._leafNode(new E(m))}block(m,S){return this._blockStarts.push(this._nodes.length),m&&this.code(m).endBlock(S),this}endBlock(m){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-S;if(N<0||m!==void 0&&N!==m)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${m} expected`);return this._nodes.length=S,this}func(m,S=t.nil,N,L){return this._blockNode(new h(m,S,N)),L&&this.code(L).endFunc(),this}endFunc(){return this._endBlockNode(h)}optimize(m=1){for(;m-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(m){return this._currNode.nodes.push(m),this}_blockNode(m){this._currNode.nodes.push(m),this._nodes.push(m)}_endBlockNode(m,S){const N=this._currNode;if(N instanceof m||S&&N instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${m.kind}/${S.kind}`:m.kind}"`)}_elseNode(m){const S=this._currNode;if(!(S instanceof l))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=m,this}get _root(){return this._nodes[0]}get _currNode(){const m=this._nodes;return m[m.length-1]}set _currNode(m){const S=this._nodes;S[S.length-1]=m}}e.CodeGen=C;function V(I,m){for(const S in m)I[S]=(I[S]||0)+(m[S]||0);return I}function F(I,m){return m instanceof t._CodeOrName?V(I,m.names):I}function U(I,m,S){if(I instanceof t.Name)return N(I);if(!L(I))return I;return new t._Code(I._items.reduce((J,x)=>(x instanceof t.Name&&(x=N(x)),x instanceof t._Code?J.push(...x._items):J.push(x),J),[]));function N(J){const x=S[J.str];return x===void 0||m[J.str]!==1?J:(delete m[J.str],x)}function L(J){return J instanceof t._Code&&J._items.some(x=>x instanceof t.Name&&m[x.str]===1&&S[x.str]!==void 0)}}function Q(I,m){for(const S in m)I[S]=(I[S]||0)-(m[S]||0)}function ie(I){return typeof I=="boolean"||typeof I=="number"||I===null?!I:(0,t._)`!${D(I)}`}e.not=ie;const oe=j(e.operators.AND);function X(...I){return I.reduce(oe)}e.and=X;const pe=j(e.operators.OR);function A(...I){return I.reduce(pe)}e.or=A;function j(I){return(m,S)=>m===t.nil?S:S===t.nil?m:(0,t._)`${D(m)} ${I} ${D(S)}`}function D(I){return I instanceof t.Name?I:(0,t._)`(${I})`}})(Kt)),Kt}var H={},pr;function Y(){if(pr)return H;pr=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=G(),t=Et();function r(a){const h={};for(const P of a)h[P]=!0;return h}H.toHash=r;function i(a,h){return typeof h=="boolean"?h:Object.keys(h).length===0?!0:(p(a,h),!n(h,a.self.RULES.all))}H.alwaysValidSchema=i;function p(a,h=a.schema){const{opts:P,self:O}=a;if(!P.strictSchema||typeof h=="boolean")return;const T=O.RULES.keywords;for(const z in h)T[z]||g(a,`unknown keyword: "${z}"`)}H.checkUnknownRules=p;function n(a,h){if(typeof a=="boolean")return!a;for(const P in a)if(h[P])return!0;return!1}H.schemaHasRules=n;function u(a,h){if(typeof a=="boolean")return!a;for(const P in a)if(P!=="$ref"&&h.all[P])return!0;return!1}H.schemaHasRulesButRef=u;function o({topSchemaRef:a,schemaPath:h},P,O,T){if(!T){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${a}${h}${(0,e.getProperty)(O)}`}H.schemaRefOrVal=o;function f(a){return E(decodeURIComponent(a))}H.unescapeFragment=f;function $(a){return encodeURIComponent(b(a))}H.escapeFragment=$;function b(a){return typeof a=="number"?`${a}`:a.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=b;function E(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=E;function _(a,h){if(Array.isArray(a))for(const P of a)h(P);else h(a)}H.eachItem=_;function v({mergeNames:a,mergeToName:h,mergeValues:P,resultToName:O}){return(T,z,C,V)=>{const F=C===void 0?z:C instanceof e.Name?(z instanceof e.Name?a(T,z,C):h(T,z,C),C):z instanceof e.Name?(h(T,C,z),z):P(z,C);return V===e.Name&&!(F instanceof e.Name)?O(T,F):F}}H.mergeEvaluated={props:v({mergeNames:(a,h,P)=>a.if((0,e._)`${P} !== true && ${h} !== undefined`,()=>{a.if((0,e._)`${h} === true`,()=>a.assign(P,!0),()=>a.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${h})`))}),mergeToName:(a,h,P)=>a.if((0,e._)`${P} !== true`,()=>{h===!0?a.assign(P,!0):(a.assign(P,(0,e._)`${P} || {}`),y(a,P,h))}),mergeValues:(a,h)=>a===!0?!0:{...a,...h},resultToName:w}),items:v({mergeNames:(a,h,P)=>a.if((0,e._)`${P} !== true && ${h} !== undefined`,()=>a.assign(P,(0,e._)`${h} === true ? true : ${P} > ${h} ? ${P} : ${h}`)),mergeToName:(a,h,P)=>a.if((0,e._)`${P} !== true`,()=>a.assign(P,h===!0?!0:(0,e._)`${P} > ${h} ? ${P} : ${h}`)),mergeValues:(a,h)=>a===!0?!0:Math.max(a,h),resultToName:(a,h)=>a.var("items",h)})};function w(a,h){if(h===!0)return a.var("props",!0);const P=a.var("props",(0,e._)`{}`);return h!==void 0&&y(a,P,h),P}H.evaluatedPropsToName=w;function y(a,h,P){Object.keys(P).forEach(O=>a.assign((0,e._)`${h}${(0,e.getProperty)(O)}`,!0))}H.setEvaluated=y;const c={};function l(a,h){return a.scopeValue("func",{ref:h,code:c[h.code]||(c[h.code]=new t._Code(h.code))})}H.useFunc=l;var s;(function(a){a[a.Num=0]="Num",a[a.Str=1]="Str"})(s||(H.Type=s={}));function d(a,h,P){if(a instanceof e.Name){const O=h===s.Num;return P?O?(0,e._)`"[" + ${a} + "]"`:(0,e._)`"['" + ${a} + "']"`:O?(0,e._)`"/" + ${a}`:(0,e._)`"/" + ${a}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(a).toString():"/"+b(a)}H.getErrorPath=d;function g(a,h,P=a.opts.strictSchema){if(P){if(h=`strict mode: ${h}`,P===!0)throw new Error(h);a.self.logger.warn(h)}}return H.checkStrictMode=g,H}var Fe={},mr;function Se(){if(mr)return Fe;mr=1,Object.defineProperty(Fe,"__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 Fe.default=t,Fe}var hr;function Dt(){return hr||(hr=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=Y(),i=Se();e.keywordError={message:({keyword:c})=>(0,t.str)`must pass "${c}" keyword validation`},e.keyword$DataError={message:({keyword:c,schemaType:l})=>l?(0,t.str)`"${c}" keyword must be ${l} ($data)`:(0,t.str)`"${c}" keyword is invalid ($data)`};function p(c,l=e.keywordError,s,d){const{it:g}=c,{gen:a,compositeRule:h,allErrors:P}=g,O=E(c,l,s);d??(h||P)?f(a,O):$(g,(0,t._)`[${O}]`)}e.reportError=p;function n(c,l=e.keywordError,s){const{it:d}=c,{gen:g,compositeRule:a,allErrors:h}=d,P=E(c,l,s);f(g,P),a||h||$(d,i.default.vErrors)}e.reportExtraError=n;function u(c,l){c.assign(i.default.errors,l),c.if((0,t._)`${i.default.vErrors} !== null`,()=>c.if(l,()=>c.assign((0,t._)`${i.default.vErrors}.length`,l),()=>c.assign(i.default.vErrors,null)))}e.resetErrorsCount=u;function o({gen:c,keyword:l,schemaValue:s,data:d,errsCount:g,it:a}){if(g===void 0)throw new Error("ajv implementation error");const h=c.name("err");c.forRange("i",g,i.default.errors,P=>{c.const(h,(0,t._)`${i.default.vErrors}[${P}]`),c.if((0,t._)`${h}.instancePath === undefined`,()=>c.assign((0,t._)`${h}.instancePath`,(0,t.strConcat)(i.default.instancePath,a.errorPath))),c.assign((0,t._)`${h}.schemaPath`,(0,t.str)`${a.errSchemaPath}/${l}`),a.opts.verbose&&(c.assign((0,t._)`${h}.schema`,s),c.assign((0,t._)`${h}.data`,d))})}e.extendErrors=o;function f(c,l){const s=c.const("err",l);c.if((0,t._)`${i.default.vErrors} === null`,()=>c.assign(i.default.vErrors,(0,t._)`[${s}]`),(0,t._)`${i.default.vErrors}.push(${s})`),c.code((0,t._)`${i.default.errors}++`)}function $(c,l){const{gen:s,validateName:d,schemaEnv:g}=c;g.$async?s.throw((0,t._)`new ${c.ValidationError}(${l})`):(s.assign((0,t._)`${d}.errors`,l),s.return(!1))}const b={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 E(c,l,s){const{createErrors:d}=c.it;return d===!1?(0,t._)`{}`:_(c,l,s)}function _(c,l,s={}){const{gen:d,it:g}=c,a=[v(g,s),w(c,s)];return y(c,l,a),d.object(...a)}function v({errorPath:c},{instancePath:l}){const s=l?(0,t.str)`${c}${(0,r.getErrorPath)(l,r.Type.Str)}`:c;return[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,s)]}function w({keyword:c,it:{errSchemaPath:l}},{schemaPath:s,parentSchema:d}){let g=d?l:(0,t.str)`${l}/${c}`;return s&&(g=(0,t.str)`${g}${(0,r.getErrorPath)(s,r.Type.Str)}`),[b.schemaPath,g]}function y(c,{params:l,message:s},d){const{keyword:g,data:a,schemaValue:h,it:P}=c,{opts:O,propertyName:T,topSchemaRef:z,schemaPath:C}=P;d.push([b.keyword,g],[b.params,typeof l=="function"?l(c):l||(0,t._)`{}`]),O.messages&&d.push([b.message,typeof s=="function"?s(c):s]),O.verbose&&d.push([b.schema,h],[b.parentSchema,(0,t._)`${z}${C}`],[i.default.data,a]),T&&d.push([b.propertyName,T])}})(Lt)),Lt}var yr;function ls(){if(yr)return Ee;yr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.boolOrEmptySchema=Ee.topBoolOrEmptySchema=void 0;const e=Dt(),t=G(),r=Se(),i={message:"boolean schema is false"};function p(o){const{gen:f,schema:$,validateName:b}=o;$===!1?u(o,!1):typeof $=="object"&&$.$async===!0?f.return(r.default.data):(f.assign((0,t._)`${b}.errors`,null),f.return(!0))}Ee.topBoolOrEmptySchema=p;function n(o,f){const{gen:$,schema:b}=o;b===!1?($.var(f,!1),u(o)):$.var(f,!0)}Ee.boolOrEmptySchema=n;function u(o,f){const{gen:$,data:b}=o,E={gen:$,keyword:"false schema",data:b,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(E,i,void 0,f)}return Ee}var se={},ke={},gr;function In(){if(gr)return ke;gr=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(p){return typeof p=="string"&&t.has(p)}ke.isJSONType=r;function i(){const p={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...p,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},p.number,p.string,p.array,p.object],post:{rules:[]},all:{},keywords:{}}}return ke.getRules=i,ke}var _e={},vr;function On(){if(vr)return _e;vr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:i,self:p},n){const u=p.RULES.types[n];return u&&u!==!0&&t(i,u)}_e.schemaHasRulesForType=e;function t(i,p){return p.rules.some(n=>r(i,n))}_e.shouldUseGroup=t;function r(i,p){var n;return i[p.keyword]!==void 0||((n=p.definition.implements)===null||n===void 0?void 0:n.some(u=>i[u]!==void 0))}return _e.shouldUseRule=r,_e}var _r;function kt(){if(_r)return se;_r=1,Object.defineProperty(se,"__esModule",{value:!0}),se.reportTypeError=se.checkDataTypes=se.checkDataType=se.coerceAndCheckDataType=se.getJSONTypes=se.getSchemaTypes=se.DataType=void 0;const e=In(),t=On(),r=Dt(),i=G(),p=Y();var n;(function(s){s[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong"})(n||(se.DataType=n={}));function u(s){const d=o(s.type);if(d.includes("null")){if(s.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!d.length&&s.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');s.nullable===!0&&d.push("null")}return d}se.getSchemaTypes=u;function o(s){const d=Array.isArray(s)?s:s?[s]:[];if(d.every(e.isJSONType))return d;throw new Error("type must be JSONType or JSONType[]: "+d.join(","))}se.getJSONTypes=o;function f(s,d){const{gen:g,data:a,opts:h}=s,P=b(d,h.coerceTypes),O=d.length>0&&!(P.length===0&&d.length===1&&(0,t.schemaHasRulesForType)(s,d[0]));if(O){const T=w(d,a,h.strictNumbers,n.Wrong);g.if(T,()=>{P.length?E(s,d,P):c(s)})}return O}se.coerceAndCheckDataType=f;const $=new Set(["string","number","integer","boolean","null"]);function b(s,d){return d?s.filter(g=>$.has(g)||d==="array"&&g==="array"):[]}function E(s,d,g){const{gen:a,data:h,opts:P}=s,O=a.let("dataType",(0,i._)`typeof ${h}`),T=a.let("coerced",(0,i._)`undefined`);P.coerceTypes==="array"&&a.if((0,i._)`${O} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>a.assign(h,(0,i._)`${h}[0]`).assign(O,(0,i._)`typeof ${h}`).if(w(d,h,P.strictNumbers),()=>a.assign(T,h))),a.if((0,i._)`${T} !== undefined`);for(const C of g)($.has(C)||C==="array"&&P.coerceTypes==="array")&&z(C);a.else(),c(s),a.endIf(),a.if((0,i._)`${T} !== undefined`,()=>{a.assign(h,T),_(s,T)});function z(C){switch(C){case"string":a.elseIf((0,i._)`${O} == "number" || ${O} == "boolean"`).assign(T,(0,i._)`"" + ${h}`).elseIf((0,i._)`${h} === null`).assign(T,(0,i._)`""`);return;case"number":a.elseIf((0,i._)`${O} == "boolean" || ${h} === null
|
|
3
|
-
|| (${O} == "string" && ${h} && ${h} == +${h})`).assign(T,(0,
|
|
4
|
-
|| (${O} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(T,(0,
|
|
5
|
-
|| ${O} === "boolean" || ${h} === null`).assign(T,(0,i._)`[${h}]`)}}}function _({gen:s,parentData:d,parentDataProperty:g},a){s.if((0,i._)`${d} !== undefined`,()=>s.assign((0,i._)`${d}[${g}]`,a))}function v(s,d,g,a=n.Correct){const h=a===n.Correct?i.operators.EQ:i.operators.NEQ;let P;switch(s){case"null":return(0,i._)`${d} ${h} null`;case"array":P=(0,i._)`Array.isArray(${d})`;break;case"object":P=(0,i._)`${d} && typeof ${d} == "object" && !Array.isArray(${d})`;break;case"integer":P=O((0,i._)`!(${d} % 1) && !isNaN(${d})`);break;case"number":P=O();break;default:return(0,i._)`typeof ${d} ${h} ${s}`}return a===n.Correct?P:(0,i.not)(P);function O(T=i.nil){return(0,i.and)((0,i._)`typeof ${d} == "number"`,T,g?(0,i._)`isFinite(${d})`:i.nil)}}se.checkDataType=v;function w(s,d,g,a){if(s.length===1)return v(s[0],d,g,a);let h;const P=(0,p.toHash)(s);if(P.array&&P.object){const O=(0,i._)`typeof ${d} != "object"`;h=P.null?O:(0,i._)`!${d} || ${O}`,delete P.null,delete P.array,delete P.object}else h=i.nil;P.number&&delete P.integer;for(const O in P)h=(0,i.and)(h,v(O,d,g,a));return h}se.checkDataTypes=w;const y={message:({schema:s})=>`must be ${s}`,params:({schema:s,schemaValue:d})=>typeof s=="string"?(0,i._)`{type: ${s}}`:(0,i._)`{type: ${d}}`};function c(s){const d=l(s);(0,r.reportError)(d,y)}se.reportTypeError=c;function l(s){const{gen:d,data:g,schema:a}=s,h=(0,p.schemaRefOrVal)(s,a,"type");return{gen:d,keyword:"type",data:g,schema:a.type,schemaCode:h,schemaValue:h,parentSchema:a,params:{},it:s}}return se}var qe={},$r;function fs(){if($r)return qe;$r=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.assignDefaults=void 0;const e=G(),t=Y();function r(p,n){const{properties:u,items:o}=p.schema;if(n==="object"&&u)for(const f in u)i(p,f,u[f].default);else n==="array"&&Array.isArray(o)&&o.forEach((f,$)=>i(p,$,f.default))}qe.assignDefaults=r;function i(p,n,u){const{gen:o,compositeRule:f,data:$,opts:b}=p;if(u===void 0)return;const E=(0,e._)`${$}${(0,e.getProperty)(n)}`;if(f){(0,t.checkStrictMode)(p,`default is ignored for: ${E}`);return}let _=(0,e._)`${E} === undefined`;b.useDefaults==="empty"&&(_=(0,e._)`${_} || ${E} === null || ${E} === ""`),o.if(_,(0,e._)`${E} = ${(0,e.stringify)(u)}`)}return qe}var he={},Z={},br;function ge(){if(br)return Z;br=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.validateUnion=Z.validateArray=Z.usePattern=Z.callValidateCode=Z.schemaProperties=Z.allSchemaProperties=Z.noPropertyInData=Z.propertyInData=Z.isOwnProperty=Z.hasPropFunc=Z.reportMissingProp=Z.checkMissingProp=Z.checkReportMissingProp=void 0;const e=G(),t=Y(),r=Se(),i=Y();function p(s,d){const{gen:g,data:a,it:h}=s;g.if(b(g,a,d,h.opts.ownProperties),()=>{s.setParams({missingProperty:(0,e._)`${d}`},!0),s.error()})}Z.checkReportMissingProp=p;function n({gen:s,data:d,it:{opts:g}},a,h){return(0,e.or)(...a.map(P=>(0,e.and)(b(s,d,P,g.ownProperties),(0,e._)`${h} = ${P}`)))}Z.checkMissingProp=n;function u(s,d){s.setParams({missingProperty:d},!0),s.error()}Z.reportMissingProp=u;function o(s){return s.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Z.hasPropFunc=o;function f(s,d,g){return(0,e._)`${o(s)}.call(${d}, ${g})`}Z.isOwnProperty=f;function $(s,d,g,a){const h=(0,e._)`${d}${(0,e.getProperty)(g)} !== undefined`;return a?(0,e._)`${h} && ${f(s,d,g)}`:h}Z.propertyInData=$;function b(s,d,g,a){const h=(0,e._)`${d}${(0,e.getProperty)(g)} === undefined`;return a?(0,e.or)(h,(0,e.not)(f(s,d,g))):h}Z.noPropertyInData=b;function E(s){return s?Object.keys(s).filter(d=>d!=="__proto__"):[]}Z.allSchemaProperties=E;function _(s,d){return E(d).filter(g=>!(0,t.alwaysValidSchema)(s,d[g]))}Z.schemaProperties=_;function v({schemaCode:s,data:d,it:{gen:g,topSchemaRef:a,schemaPath:h,errorPath:P},it:O},T,z,C){const V=C?(0,e._)`${s}, ${d}, ${a}${h}`:d,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 U=(0,e._)`${V}, ${g.object(...F)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${U})`:(0,e._)`${T}(${U})`}Z.callValidateCode=v;const w=(0,e._)`new RegExp`;function y({gen:s,it:{opts:d}},g){const a=d.unicodeRegExp?"u":"",{regExp:h}=d.code,P=h(g,a);return s.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${h.code==="new RegExp"?w:(0,i.useFunc)(s,h)}(${g}, ${a})`})}Z.usePattern=y;function c(s){const{gen:d,data:g,keyword:a,it:h}=s,P=d.name("valid");if(h.allErrors){const T=d.let("valid",!0);return O(()=>d.assign(T,!1)),T}return d.var(P,!0),O(()=>d.break()),P;function O(T){const z=d.const("len",(0,e._)`${g}.length`);d.forRange("i",0,z,C=>{s.subschema({keyword:a,dataProp:C,dataPropType:t.Type.Num},P),d.if((0,e.not)(P),T)})}}Z.validateArray=c;function l(s){const{gen:d,schema:g,keyword:a,it:h}=s;if(!Array.isArray(g))throw new Error("ajv implementation error");if(g.some(z=>(0,t.alwaysValidSchema)(h,z))&&!h.opts.unevaluated)return;const O=d.let("valid",!1),T=d.name("_valid");d.block(()=>g.forEach((z,C)=>{const V=s.subschema({keyword:a,schemaProp:C,compositeRule:!0},T);d.assign(O,(0,e._)`${O} || ${T}`),s.mergeValidEvaluated(V,T)||d.if((0,e.not)(O))})),s.result(O,()=>s.reset(),()=>s.error(!0))}return Z.validateUnion=l,Z}var wr;function ps(){if(wr)return he;wr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.validateKeywordUsage=he.validSchemaType=he.funcKeywordCode=he.macroKeywordCode=void 0;const e=G(),t=Se(),r=ge(),i=Dt();function p(_,v){const{gen:w,keyword:y,schema:c,parentSchema:l,it:s}=_,d=v.macro.call(s.self,c,l,s),g=$(w,y,d);s.opts.validateSchema!==!1&&s.self.validateSchema(d,!0);const a=w.name("valid");_.subschema({schema:d,schemaPath:e.nil,errSchemaPath:`${s.errSchemaPath}/${y}`,topSchemaRef:g,compositeRule:!0},a),_.pass(a,()=>_.error(!0))}he.macroKeywordCode=p;function n(_,v){var w;const{gen:y,keyword:c,schema:l,parentSchema:s,$data:d,it:g}=_;f(g,v);const a=!d&&v.compile?v.compile.call(g.self,l,s,g):v.validate,h=$(y,c,a),P=y.let("valid");_.block$data(P,O),_.ok((w=v.valid)!==null&&w!==void 0?w:P);function O(){if(v.errors===!1)C(),v.modifying&&u(_),V(()=>_.error());else{const F=v.async?T():z();v.modifying&&u(_),V(()=>o(_,F))}}function T(){const F=y.let("ruleErrs",null);return y.try(()=>C((0,e._)`await `),U=>y.assign(P,!1).if((0,e._)`${U} instanceof ${g.ValidationError}`,()=>y.assign(F,(0,e._)`${U}.errors`),()=>y.throw(U))),F}function z(){const F=(0,e._)`${h}.errors`;return y.assign(F,null),C(e.nil),F}function C(F=v.async?(0,e._)`await `:e.nil){const U=g.opts.passContext?t.default.this:t.default.self,Q=!("compile"in v&&!d||v.schema===!1);y.assign(P,(0,e._)`${F}${(0,r.callValidateCode)(_,h,U,Q)}`,v.modifying)}function V(F){var U;y.if((0,e.not)((U=v.valid)!==null&&U!==void 0?U:P),F)}}he.funcKeywordCode=n;function u(_){const{gen:v,data:w,it:y}=_;v.if(y.parentData,()=>v.assign(w,(0,e._)`${y.parentData}[${y.parentDataProperty}]`))}function o(_,v){const{gen:w}=_;w.if((0,e._)`Array.isArray(${v})`,()=>{w.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${v} : ${t.default.vErrors}.concat(${v})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,i.extendErrors)(_)},()=>_.error())}function f({schemaEnv:_},v){if(v.async&&!_.$async)throw new Error("async keyword in sync schema")}function $(_,v,w){if(w===void 0)throw new Error(`keyword "${v}" failed to compile`);return _.scopeValue("keyword",typeof w=="function"?{ref:w}:{ref:w,code:(0,e.stringify)(w)})}function b(_,v,w=!1){return!v.length||v.some(y=>y==="array"?Array.isArray(_):y==="object"?_&&typeof _=="object"&&!Array.isArray(_):typeof _==y||w&&typeof _>"u")}he.validSchemaType=b;function E({schema:_,opts:v,self:w,errSchemaPath:y},c,l){if(Array.isArray(c.keyword)?!c.keyword.includes(l):c.keyword!==l)throw new Error("ajv implementation error");const s=c.dependencies;if(s?.some(d=>!Object.prototype.hasOwnProperty.call(_,d)))throw new Error(`parent schema must have dependencies of ${l}: ${s.join(",")}`);if(c.validateSchema&&!c.validateSchema(_[l])){const g=`keyword "${l}" value is invalid at path "${y}": `+w.errorsText(c.validateSchema.errors);if(v.validateSchema==="log")w.logger.error(g);else throw new Error(g)}}return he.validateKeywordUsage=E,he}var $e={},Pr;function ms(){if(Pr)return $e;Pr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=G(),t=Y();function r(n,{keyword:u,schemaProp:o,schema:f,schemaPath:$,errSchemaPath:b,topSchemaRef:E}){if(u!==void 0&&f!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(u!==void 0){const _=n.schema[u];return o===void 0?{schema:_,schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(u)}`,errSchemaPath:`${n.errSchemaPath}/${u}`}:{schema:_[o],schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(u)}${(0,e.getProperty)(o)}`,errSchemaPath:`${n.errSchemaPath}/${u}/${(0,t.escapeFragment)(o)}`}}if(f!==void 0){if($===void 0||b===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:f,schemaPath:$,topSchemaRef:E,errSchemaPath:b}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function i(n,u,{dataProp:o,dataPropType:f,data:$,dataTypes:b,propertyName:E}){if($!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:_}=u;if(o!==void 0){const{errorPath:w,dataPathArr:y,opts:c}=u,l=_.let("data",(0,e._)`${u.data}${(0,e.getProperty)(o)}`,!0);v(l),n.errorPath=(0,e.str)`${w}${(0,t.getErrorPath)(o,f,c.jsPropertySyntax)}`,n.parentDataProperty=(0,e._)`${o}`,n.dataPathArr=[...y,n.parentDataProperty]}if($!==void 0){const w=$ instanceof e.Name?$:_.let("data",$,!0);v(w),E!==void 0&&(n.propertyName=E)}b&&(n.dataTypes=b);function v(w){n.data=w,n.dataLevel=u.dataLevel+1,n.dataTypes=[],u.definedProperties=new Set,n.parentData=u.data,n.dataNames=[...u.dataNames,w]}}$e.extendSubschemaData=i;function p(n,{jtdDiscriminator:u,jtdMetadata:o,compositeRule:f,createErrors:$,allErrors:b}){f!==void 0&&(n.compositeRule=f),$!==void 0&&(n.createErrors=$),b!==void 0&&(n.allErrors=b),n.jtdDiscriminator=u,n.jtdMetadata=o}return $e.extendSubschemaMode=p,$e}var ae={},Gt,Sr;function Nn(){return Sr||(Sr=1,Gt=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,p,n;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(p=i;p--!==0;)if(!e(t[p],r[p]))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(n=Object.keys(t),i=n.length,i!==Object.keys(r).length)return!1;for(p=i;p--!==0;)if(!Object.prototype.hasOwnProperty.call(r,n[p]))return!1;for(p=i;p--!==0;){var u=n[p];if(!e(t[u],r[u]))return!1}return!0}return t!==t&&r!==r}),Gt}var Wt={exports:{}},Er;function hs(){if(Er)return Wt.exports;Er=1;var e=Wt.exports=function(i,p,n){typeof p=="function"&&(n=p,p={}),n=p.cb||n;var u=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};t(p,u,o,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,p,n,u,o,f,$,b,E,_){if(u&&typeof u=="object"&&!Array.isArray(u)){p(u,o,f,$,b,E,_);for(var v in u){var w=u[v];if(Array.isArray(w)){if(v in e.arrayKeywords)for(var y=0;y<w.length;y++)t(i,p,n,w[y],o+"/"+v+"/"+y,f,o,v,u,y)}else if(v in e.propsKeywords){if(w&&typeof w=="object")for(var c in w)t(i,p,n,w[c],o+"/"+v+"/"+r(c),f,o,v,u,c)}else(v in e.keywords||i.allKeys&&!(v in e.skipKeywords))&&t(i,p,n,w,o+"/"+v,f,o,v,u)}n(u,o,f,$,b,E,_)}}function r(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}return Wt.exports}var kr;function Tt(){if(kr)return ae;kr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Y(),t=Nn(),r=hs(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function p(y,c=!0){return typeof y=="boolean"?!0:c===!0?!u(y):c?o(y)<=c:!1}ae.inlineRef=p;const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(y){for(const c in y){if(n.has(c))return!0;const l=y[c];if(Array.isArray(l)&&l.some(u)||typeof l=="object"&&u(l))return!0}return!1}function o(y){let c=0;for(const l in y){if(l==="$ref")return 1/0;if(c++,!i.has(l)&&(typeof y[l]=="object"&&(0,e.eachItem)(y[l],s=>c+=o(s)),c===1/0))return 1/0}return c}function f(y,c="",l){l!==!1&&(c=E(c));const s=y.parse(c);return $(y,s)}ae.getFullPath=f;function $(y,c){return y.serialize(c).split("#")[0]+"#"}ae._getFullPath=$;const b=/#\/?$/;function E(y){return y?y.replace(b,""):""}ae.normalizeId=E;function _(y,c,l){return l=E(l),y.resolve(c,l)}ae.resolveUrl=_;const v=/^[a-z_][-a-z0-9._]*$/i;function w(y,c){if(typeof y=="boolean")return{};const{schemaId:l,uriResolver:s}=this.opts,d=E(y[l]||c),g={"":d},a=f(s,d,!1),h={},P=new Set;return r(y,{allKeys:!0},(z,C,V,F)=>{if(F===void 0)return;const U=a+C;let Q=g[F];typeof z[l]=="string"&&(Q=ie.call(this,z[l])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),g[C]=Q;function ie(X){const pe=this.opts.uriResolver.resolve;if(X=E(Q?pe(Q,X):X),P.has(X))throw T(X);P.add(X);let A=this.refs[X];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?O(z,A.schema,X):X!==E(U)&&(X[0]==="#"?(O(z,h[X],X),h[X]=z):this.refs[X]=U),X}function oe(X){if(typeof X=="string"){if(!v.test(X))throw new Error(`invalid anchor "${X}"`);ie.call(this,`#${X}`)}}}),h;function O(z,C,V){if(C!==void 0&&!t(z,C))throw T(V)}function T(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ae.getSchemaRefs=w,ae}var jr;function At(){if(jr)return ve;jr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=ls(),t=kt(),r=On(),i=kt(),p=fs(),n=ps(),u=ms(),o=G(),f=Se(),$=Tt(),b=Y(),E=Dt();function _(k){if(a(k)&&(P(k),g(k))){c(k);return}v(k,()=>(0,e.topBoolOrEmptySchema)(k))}ve.validateFunctionCode=_;function v({gen:k,validateName:R,schema:q,schemaEnv:M,opts:K},W){K.code.es5?k.func(R,(0,o._)`${f.default.data}, ${f.default.valCxt}`,M.$async,()=>{k.code((0,o._)`"use strict"; ${s(q,K)}`),y(k,K),k.code(W)}):k.func(R,(0,o._)`${f.default.data}, ${w(K)}`,M.$async,()=>k.code(s(q,K)).code(W))}function w(k){return(0,o._)`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${k.dynamicRef?(0,o._)`, ${f.default.dynamicAnchors}={}`:o.nil}}={}`}function y(k,R){k.if(f.default.valCxt,()=>{k.var(f.default.instancePath,(0,o._)`${f.default.valCxt}.${f.default.instancePath}`),k.var(f.default.parentData,(0,o._)`${f.default.valCxt}.${f.default.parentData}`),k.var(f.default.parentDataProperty,(0,o._)`${f.default.valCxt}.${f.default.parentDataProperty}`),k.var(f.default.rootData,(0,o._)`${f.default.valCxt}.${f.default.rootData}`),R.dynamicRef&&k.var(f.default.dynamicAnchors,(0,o._)`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{k.var(f.default.instancePath,(0,o._)`""`),k.var(f.default.parentData,(0,o._)`undefined`),k.var(f.default.parentDataProperty,(0,o._)`undefined`),k.var(f.default.rootData,f.default.data),R.dynamicRef&&k.var(f.default.dynamicAnchors,(0,o._)`{}`)})}function c(k){const{schema:R,opts:q,gen:M}=k;v(k,()=>{q.$comment&&R.$comment&&F(k),z(k),M.let(f.default.vErrors,null),M.let(f.default.errors,0),q.unevaluated&&l(k),O(k),U(k)})}function l(k){const{gen:R,validateName:q}=k;k.evaluated=R.const("evaluated",(0,o._)`${q}.evaluated`),R.if((0,o._)`${k.evaluated}.dynamicProps`,()=>R.assign((0,o._)`${k.evaluated}.props`,(0,o._)`undefined`)),R.if((0,o._)`${k.evaluated}.dynamicItems`,()=>R.assign((0,o._)`${k.evaluated}.items`,(0,o._)`undefined`))}function s(k,R){const q=typeof k=="object"&&k[R.schemaId];return q&&(R.code.source||R.code.process)?(0,o._)`/*# sourceURL=${q} */`:o.nil}function d(k,R){if(a(k)&&(P(k),g(k))){h(k,R);return}(0,e.boolOrEmptySchema)(k,R)}function g({schema:k,self:R}){if(typeof k=="boolean")return!k;for(const q in k)if(R.RULES.all[q])return!0;return!1}function a(k){return typeof k.schema!="boolean"}function h(k,R){const{schema:q,gen:M,opts:K}=k;K.$comment&&q.$comment&&F(k),C(k),V(k);const W=M.const("_errs",f.default.errors);O(k,W),M.var(R,(0,o._)`${W} === ${f.default.errors}`)}function P(k){(0,b.checkUnknownRules)(k),T(k)}function O(k,R){if(k.opts.jtd)return ie(k,[],!1,R);const q=(0,t.getSchemaTypes)(k.schema),M=(0,t.coerceAndCheckDataType)(k,q);ie(k,q,!M,R)}function T(k){const{schema:R,errSchemaPath:q,opts:M,self:K}=k;R.$ref&&M.ignoreKeywordsWithRef&&(0,b.schemaHasRulesButRef)(R,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(k){const{schema:R,opts:q}=k;R.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,b.checkStrictMode)(k,"default is ignored in the schema root")}function C(k){const R=k.schema[k.opts.schemaId];R&&(k.baseId=(0,$.resolveUrl)(k.opts.uriResolver,k.baseId,R))}function V(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:k,schemaEnv:R,schema:q,errSchemaPath:M,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,o._)`${f.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const re=(0,o.str)`${M}/$comment`,me=k.scopeValue("root",{ref:R.root});k.code((0,o._)`${f.default.self}.opts.$comment(${W}, ${re}, ${me}.schema)`)}}function U(k){const{gen:R,schemaEnv:q,validateName:M,ValidationError:K,opts:W}=k;q.$async?R.if((0,o._)`${f.default.errors} === 0`,()=>R.return(f.default.data),()=>R.throw((0,o._)`new ${K}(${f.default.vErrors})`)):(R.assign((0,o._)`${M}.errors`,f.default.vErrors),W.unevaluated&&Q(k),R.return((0,o._)`${f.default.errors} === 0`))}function Q({gen:k,evaluated:R,props:q,items:M}){q instanceof o.Name&&k.assign((0,o._)`${R}.props`,q),M instanceof o.Name&&k.assign((0,o._)`${R}.items`,M)}function ie(k,R,q,M){const{gen:K,schema:W,data:re,allErrors:me,opts:ce,self:de}=k,{RULES:ne}=de;if(W.$ref&&(ce.ignoreKeywordsWithRef||!(0,b.schemaHasRulesButRef)(W,ne))){K.block(()=>L(k,"$ref",ne.all.$ref.definition));return}ce.jtd||X(k,R),K.block(()=>{for(const fe of ne.rules)Re(fe);Re(ne.post)});function Re(fe){(0,r.shouldUseGroup)(W,fe)&&(fe.type?(K.if((0,i.checkDataType)(fe.type,re,ce.strictNumbers)),oe(k,fe),R.length===1&&R[0]===fe.type&&q&&(K.else(),(0,i.reportTypeError)(k)),K.endIf()):oe(k,fe),me||K.if((0,o._)`${f.default.errors} === ${M||0}`))}}function oe(k,R){const{gen:q,schema:M,opts:{useDefaults:K}}=k;K&&(0,p.assignDefaults)(k,R.type),q.block(()=>{for(const W of R.rules)(0,r.shouldUseRule)(M,W)&&L(k,W.keyword,W.definition,R.type)})}function X(k,R){k.schemaEnv.meta||!k.opts.strictTypes||(pe(k,R),k.opts.allowUnionTypes||A(k,R),j(k,k.dataTypes))}function pe(k,R){if(R.length){if(!k.dataTypes.length){k.dataTypes=R;return}R.forEach(q=>{I(k.dataTypes,q)||S(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),m(k,R)}}function A(k,R){R.length>1&&!(R.length===2&&R.includes("null"))&&S(k,"use allowUnionTypes to allow union type keyword")}function j(k,R){const q=k.self.RULES.all;for(const M in q){const K=q[M];if(typeof K=="object"&&(0,r.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(re=>D(R,re))&&S(k,`missing type "${W.join(",")}" for keyword "${M}"`)}}}function D(k,R){return k.includes(R)||R==="number"&&k.includes("integer")}function I(k,R){return k.includes(R)||R==="integer"&&k.includes("number")}function m(k,R){const q=[];for(const M of k.dataTypes)I(R,M)?q.push(M):R.includes("integer")&&M==="number"&&q.push("integer");k.dataTypes=q}function S(k,R){const q=k.schemaEnv.baseId+k.errSchemaPath;R+=` at "${q}" (strictTypes)`,(0,b.checkStrictMode)(k,R,k.opts.strictTypes)}class N{constructor(R,q,M){if((0,n.validateKeywordUsage)(R,q,M),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=M,this.data=R.data,this.schema=R.schema[M],this.$data=q.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,b.schemaRefOrVal)(R,this.schema,M,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",B(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,n.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=R.gen.const("_errs",f.default.errors))}result(R,q,M){this.failResult((0,o.not)(R),q,M)}failResult(R,q,M){this.gen.if(R),M?M():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,o.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,o._)`${q} !== undefined && (${(0,o.or)(this.invalid$data(),R)})`)}error(R,q,M){if(q){this.setParams(q),this._error(R,M),this.setParams({});return}this._error(R,M)}_error(R,q){(R?E.reportExtraError:E.reportError)(this,this.def.error,q)}$dataError(){(0,E.reportError)(this,this.def.$dataError||E.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,E.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,M=o.nil){this.gen.block(()=>{this.check$data(R,M),q()})}check$data(R=o.nil,q=o.nil){if(!this.$data)return;const{gen:M,schemaCode:K,schemaType:W,def:re}=this;M.if((0,o.or)((0,o._)`${K} === undefined`,q)),R!==o.nil&&M.assign(R,!0),(W.length||re.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),R!==o.nil&&M.assign(R,!1)),M.else()}invalid$data(){const{gen:R,schemaCode:q,schemaType:M,def:K,it:W}=this;return(0,o.or)(re(),me());function re(){if(M.length){if(!(q instanceof o.Name))throw new Error("ajv implementation error");const ce=Array.isArray(M)?M:[M];return(0,o._)`${(0,i.checkDataTypes)(ce,q,W.opts.strictNumbers,i.DataType.Wrong)}`}return o.nil}function me(){if(K.validateSchema){const ce=R.scopeValue("validate$data",{ref:K.validateSchema});return(0,o._)`!${ce}(${q})`}return o.nil}}subschema(R,q){const M=(0,u.getSubschema)(this.it,R);(0,u.extendSubschemaData)(M,this.it,R),(0,u.extendSubschemaMode)(M,R);const K={...this.it,...M,items:void 0,props:void 0};return d(K,q),K}mergeEvaluated(R,q){const{it:M,gen:K}=this;M.opts.unevaluated&&(M.props!==!0&&R.props!==void 0&&(M.props=b.mergeEvaluated.props(K,R.props,M.props,q)),M.items!==!0&&R.items!==void 0&&(M.items=b.mergeEvaluated.items(K,R.items,M.items,q)))}mergeValidEvaluated(R,q){const{it:M,gen:K}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return K.if(q,()=>this.mergeEvaluated(R,o.Name)),!0}}ve.KeywordCxt=N;function L(k,R,q,M){const K=new N(k,q,R);"code"in q?q.code(K,M):K.$data&&q.validate?(0,n.funcKeywordCode)(K,q):"macro"in q?(0,n.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,n.funcKeywordCode)(K,q)}const J=/^\/(?:[^~]|~0|~1)*$/,x=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:R,dataNames:q,dataPathArr:M}){let K,W;if(k==="")return f.default.rootData;if(k[0]==="/"){if(!J.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);K=k,W=f.default.rootData}else{const de=x.exec(k);if(!de)throw new Error(`Invalid JSON-pointer: ${k}`);const ne=+de[1];if(K=de[2],K==="#"){if(ne>=R)throw new Error(ce("property/index",ne));return M[R-ne]}if(ne>R)throw new Error(ce("data",ne));if(W=q[R-ne],!K)return W}let re=W;const me=K.split("/");for(const de of me)de&&(W=(0,o._)`${W}${(0,o.getProperty)((0,b.unescapeJsonPointer)(de))}`,re=(0,o._)`${re} && ${W}`);return re;function ce(de,ne){return`Cannot access ${de} ${ne} levels up, current level is ${R}`}}return ve.getData=B,ve}var Ue={},Rr;function er(){if(Rr)return Ue;Rr=1,Object.defineProperty(Ue,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ue.default=e,Ue}var Le={},Ir;function Mt(){if(Ir)return Le;Ir=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=Tt();class t extends Error{constructor(i,p,n,u){super(u||`can't resolve reference ${n} from id ${p}`),this.missingRef=(0,e.resolveUrl)(i,p,n),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(i,this.missingRef))}}return Le.default=t,Le}var le={},Or;function tr(){if(Or)return le;Or=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=G(),t=er(),r=Se(),i=Tt(),p=Y(),n=At();class u{constructor(l){var s;this.refs={},this.dynamicAnchors={};let d;typeof l.schema=="object"&&(d=l.schema),this.schema=l.schema,this.schemaId=l.schemaId,this.root=l.root||this,this.baseId=(s=l.baseId)!==null&&s!==void 0?s:(0,i.normalizeId)(d?.[l.schemaId||"$id"]),this.schemaPath=l.schemaPath,this.localRefs=l.localRefs,this.meta=l.meta,this.$async=d?.$async,this.refs={}}}le.SchemaEnv=u;function o(c){const l=b.call(this,c);if(l)return l;const s=(0,i.getFullPath)(this.opts.uriResolver,c.root.baseId),{es5:d,lines:g}=this.opts.code,{ownProperties:a}=this.opts,h=new e.CodeGen(this.scope,{es5:d,lines:g,ownProperties:a});let P;c.$async&&(P=h.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const O=h.scopeName("validate");c.validateName=O;const T={gen:h,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:h.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:s,baseId:c.baseId||s,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,n.validateFunctionCode)(T),h.optimize(this.opts.code.optimize);const C=h.toString();z=`${h.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:h._values}),this.opts.unevaluated){const{props:U,items:Q}=T;F.evaluated={props:U instanceof e.Name?void 0:U,items:Q instanceof e.Name?void 0:Q,dynamicProps:U instanceof e.Name,dynamicItems:Q 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=o;function f(c,l,s){var d;s=(0,i.resolveUrl)(this.opts.uriResolver,l,s);const g=c.refs[s];if(g)return g;let a=_.call(this,c,s);if(a===void 0){const h=(d=c.localRefs)===null||d===void 0?void 0:d[s],{schemaId:P}=this.opts;h&&(a=new u({schema:h,schemaId:P,root:c,baseId:l}))}if(a!==void 0)return c.refs[s]=$.call(this,a)}le.resolveRef=f;function $(c){return(0,i.inlineRef)(c.schema,this.opts.inlineRefs)?c.schema:c.validate?c:o.call(this,c)}function b(c){for(const l of this._compilations)if(E(l,c))return l}le.getCompilingSchema=b;function E(c,l){return c.schema===l.schema&&c.root===l.root&&c.baseId===l.baseId}function _(c,l){let s;for(;typeof(s=this.refs[l])=="string";)l=s;return s||this.schemas[l]||v.call(this,c,l)}function v(c,l){const s=this.opts.uriResolver.parse(l),d=(0,i._getFullPath)(this.opts.uriResolver,s);let g=(0,i.getFullPath)(this.opts.uriResolver,c.baseId,void 0);if(Object.keys(c.schema).length>0&&d===g)return y.call(this,s,c);const a=(0,i.normalizeId)(d),h=this.refs[a]||this.schemas[a];if(typeof h=="string"){const P=v.call(this,c,h);return typeof P?.schema!="object"?void 0:y.call(this,s,P)}if(typeof h?.schema=="object"){if(h.validate||o.call(this,h),a===(0,i.normalizeId)(l)){const{schema:P}=h,{schemaId:O}=this.opts,T=P[O];return T&&(g=(0,i.resolveUrl)(this.opts.uriResolver,g,T)),new u({schema:P,schemaId:O,root:c,baseId:g})}return y.call(this,s,h)}}le.resolveSchema=v;const w=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(c,{baseId:l,schema:s,root:d}){var g;if(((g=c.fragment)===null||g===void 0?void 0:g[0])!=="/")return;for(const P of c.fragment.slice(1).split("/")){if(typeof s=="boolean")return;const O=s[(0,p.unescapeFragment)(P)];if(O===void 0)return;s=O;const T=typeof s=="object"&&s[this.opts.schemaId];!w.has(P)&&T&&(l=(0,i.resolveUrl)(this.opts.uriResolver,l,T))}let a;if(typeof s!="boolean"&&s.$ref&&!(0,p.schemaHasRulesButRef)(s,this.RULES)){const P=(0,i.resolveUrl)(this.opts.uriResolver,l,s.$ref);a=v.call(this,d,P)}const{schemaId:h}=this.opts;if(a=a||new u({schema:s,schemaId:h,root:d,baseId:l}),a.schema!==a.root.schema)return a}return le}const ys="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",gs="Meta-schema for $data reference (JSON AnySchema extension proposal)",vs="object",_s=["$data"],$s={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},bs=!1,ws={$id:ys,description:gs,type:vs,required:_s,properties:$s,additionalProperties:bs};var Ke={},De={exports:{}},Bt,Nr;function Cn(){if(Nr)return Bt;Nr=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 v="",w=0,y=0;for(y=0;y<_.length;y++)if(w=_[y].charCodeAt(0),w!==48){if(!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";v+=_[y];break}for(y+=1;y<_.length;y++){if(w=_[y].charCodeAt(0),!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";v+=_[y]}return v}const i=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function p(_){return _.length=0,!0}function n(_,v,w){if(_.length){const y=r(_);if(y!=="")v.push(y);else return w.error=!0,!1;_.length=0}return!0}function u(_){let v=0;const w={error:!1,address:"",zone:""},y=[],c=[];let l=!1,s=!1,d=n;for(let g=0;g<_.length;g++){const a=_[g];if(!(a==="["||a==="]"))if(a===":"){if(l===!0&&(s=!0),!d(c,y,w))break;if(++v>7){w.error=!0;break}g>0&&_[g-1]===":"&&(l=!0),y.push(":");continue}else if(a==="%"){if(!d(c,y,w))break;d=p}else{c.push(a);continue}}return c.length&&(d===p?w.zone=c.join(""):s?y.push(c.join("")):y.push(r(c))),w.address=y.join(""),w}function o(_){if(f(_,":")<2)return{host:_,isIPV6:!1};const v=u(_);if(v.error)return{host:_,isIPV6:!1};{let w=v.address,y=v.address;return v.zone&&(w+="%"+v.zone,y+="%25"+v.zone),{host:w,isIPV6:!0,escapedHost:y}}}function f(_,v){let w=0;for(let y=0;y<_.length;y++)_[y]===v&&w++;return w}function $(_){let v=_;const w=[];let y=-1,c=0;for(;c=v.length;){if(c===1){if(v===".")break;if(v==="/"){w.push("/");break}else{w.push(v);break}}else if(c===2){if(v[0]==="."){if(v[1]===".")break;if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&(v[1]==="."||v[1]==="/")){w.push("/");break}}else if(c===3&&v==="/.."){w.length!==0&&w.pop(),w.push("/");break}if(v[0]==="."){if(v[1]==="."){if(v[2]==="/"){v=v.slice(3);continue}}else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&v[1]==="."){if(v[2]==="/"){v=v.slice(2);continue}else if(v[2]==="."&&v[3]==="/"){v=v.slice(3),w.length!==0&&w.pop();continue}}if((y=v.indexOf("/",1))===-1){w.push(v);break}else w.push(v.slice(0,y)),v=v.slice(y)}return w.join("")}function b(_,v){const w=v!==!0?escape:unescape;return _.scheme!==void 0&&(_.scheme=w(_.scheme)),_.userinfo!==void 0&&(_.userinfo=w(_.userinfo)),_.host!==void 0&&(_.host=w(_.host)),_.path!==void 0&&(_.path=w(_.path)),_.query!==void 0&&(_.query=w(_.query)),_.fragment!==void 0&&(_.fragment=w(_.fragment)),_}function E(_){const v=[];if(_.userinfo!==void 0&&(v.push(_.userinfo),v.push("@")),_.host!==void 0){let w=unescape(_.host);if(!t(w)){const y=o(w);y.isIPV6===!0?w=`[${y.escapedHost}]`:w=_.host}v.push(w)}return(typeof _.port=="number"||typeof _.port=="string")&&(v.push(":"),v.push(String(_.port))),v.length?v.join(""):void 0}return Bt={nonSimpleDomain:i,recomposeAuthority:E,normalizeComponentEncoding:b,removeDotSegments:$,isIPv4:t,isUUID:e,normalizeIPv6:o,stringArrayToHexStripped:r},Bt}var Yt,Cr;function Ps(){if(Cr)return Yt;Cr=1;const{isUUID:e}=Cn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function i(a){return r.indexOf(a)!==-1}function p(a){return a.secure===!0?!0:a.secure===!1?!1:a.scheme?a.scheme.length===3&&(a.scheme[0]==="w"||a.scheme[0]==="W")&&(a.scheme[1]==="s"||a.scheme[1]==="S")&&(a.scheme[2]==="s"||a.scheme[2]==="S"):!1}function n(a){return a.host||(a.error=a.error||"HTTP URIs must have a host."),a}function u(a){const h=String(a.scheme).toLowerCase()==="https";return(a.port===(h?443:80)||a.port==="")&&(a.port=void 0),a.path||(a.path="/"),a}function o(a){return a.secure=p(a),a.resourceName=(a.path||"/")+(a.query?"?"+a.query:""),a.path=void 0,a.query=void 0,a}function f(a){if((a.port===(p(a)?443:80)||a.port==="")&&(a.port=void 0),typeof a.secure=="boolean"&&(a.scheme=a.secure?"wss":"ws",a.secure=void 0),a.resourceName){const[h,P]=a.resourceName.split("?");a.path=h&&h!=="/"?h:void 0,a.query=P,a.resourceName=void 0}return a.fragment=void 0,a}function $(a,h){if(!a.path)return a.error="URN can not be parsed",a;const P=a.path.match(t);if(P){const O=h.scheme||a.scheme||"urn";a.nid=P[1].toLowerCase(),a.nss=P[2];const T=`${O}:${h.nid||a.nid}`,z=g(T);a.path=void 0,z&&(a=z.parse(a,h))}else a.error=a.error||"URN can not be parsed.";return a}function b(a,h){if(a.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=h.scheme||a.scheme||"urn",O=a.nid.toLowerCase(),T=`${P}:${h.nid||O}`,z=g(T);z&&(a=z.serialize(a,h));const C=a,V=a.nss;return C.path=`${O||h.nid}:${V}`,h.skipEscape=!0,C}function E(a,h){const P=a;return P.uuid=P.nss,P.nss=void 0,!h.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function _(a){const h=a;return h.nss=(a.uuid||"").toLowerCase(),h}const v={scheme:"http",domainHost:!0,parse:n,serialize:u},w={scheme:"https",domainHost:v.domainHost,parse:n,serialize:u},y={scheme:"ws",domainHost:!0,parse:o,serialize:f},c={scheme:"wss",domainHost:y.domainHost,parse:y.parse,serialize:y.serialize},d={http:v,https:w,ws:y,wss:c,urn:{scheme:"urn",parse:$,serialize:b,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(d,null);function g(a){return a&&(d[a]||d[a.toLowerCase()])||void 0}return Yt={wsIsSecure:p,SCHEMES:d,isValidSchemeName:i,getSchemeHandler:g},Yt}var qr;function Ss(){if(qr)return De.exports;qr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:i,isIPv4:p,nonSimpleDomain:n}=Cn(),{SCHEMES:u,getSchemeHandler:o}=Ps();function f(c,l){return typeof c=="string"?c=_(w(c,l),l):typeof c=="object"&&(c=w(_(c,l),l)),c}function $(c,l,s){const d=s?Object.assign({scheme:"null"},s):{scheme:"null"},g=b(w(c,d),w(l,d),d,!0);return d.skipEscape=!0,_(g,d)}function b(c,l,s,d){const g={};return d||(c=w(_(c,s),s),l=w(_(l,s),s)),s=s||{},!s.tolerant&&l.scheme?(g.scheme=l.scheme,g.userinfo=l.userinfo,g.host=l.host,g.port=l.port,g.path=t(l.path||""),g.query=l.query):(l.userinfo!==void 0||l.host!==void 0||l.port!==void 0?(g.userinfo=l.userinfo,g.host=l.host,g.port=l.port,g.path=t(l.path||""),g.query=l.query):(l.path?(l.path[0]==="/"?g.path=t(l.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?g.path="/"+l.path:c.path?g.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+l.path:g.path=l.path,g.path=t(g.path)),g.query=l.query):(g.path=c.path,l.query!==void 0?g.query=l.query:g.query=c.query),g.userinfo=c.userinfo,g.host=c.host,g.port=c.port),g.scheme=c.scheme),g.fragment=l.fragment,g}function E(c,l,s){return typeof c=="string"?(c=unescape(c),c=_(i(w(c,s),!0),{...s,skipEscape:!0})):typeof c=="object"&&(c=_(i(c,!0),{...s,skipEscape:!0})),typeof l=="string"?(l=unescape(l),l=_(i(w(l,s),!0),{...s,skipEscape:!0})):typeof l=="object"&&(l=_(i(l,!0),{...s,skipEscape:!0})),c.toLowerCase()===l.toLowerCase()}function _(c,l){const s={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:""},d=Object.assign({},l),g=[],a=o(d.scheme||s.scheme);a&&a.serialize&&a.serialize(s,d),s.path!==void 0&&(d.skipEscape?s.path=unescape(s.path):(s.path=escape(s.path),s.scheme!==void 0&&(s.path=s.path.split("%3A").join(":")))),d.reference!=="suffix"&&s.scheme&&g.push(s.scheme,":");const h=r(s);if(h!==void 0&&(d.reference!=="suffix"&&g.push("//"),g.push(h),s.path&&s.path[0]!=="/"&&g.push("/")),s.path!==void 0){let P=s.path;!d.absolutePath&&(!a||!a.absolutePath)&&(P=t(P)),h===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),g.push(P)}return s.query!==void 0&&g.push("?",s.query),s.fragment!==void 0&&g.push("#",s.fragment),g.join("")}const v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function w(c,l){const s=Object.assign({},l),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let g=!1;s.reference==="suffix"&&(s.scheme?c=s.scheme+":"+c:c="//"+c);const a=c.match(v);if(a){if(d.scheme=a[1],d.userinfo=a[3],d.host=a[4],d.port=parseInt(a[5],10),d.path=a[6]||"",d.query=a[7],d.fragment=a[8],isNaN(d.port)&&(d.port=a[5]),d.host)if(p(d.host)===!1){const O=e(d.host);d.host=O.host.toLowerCase(),g=O.isIPV6}else g=!0;d.scheme===void 0&&d.userinfo===void 0&&d.host===void 0&&d.port===void 0&&d.query===void 0&&!d.path?d.reference="same-document":d.scheme===void 0?d.reference="relative":d.fragment===void 0?d.reference="absolute":d.reference="uri",s.reference&&s.reference!=="suffix"&&s.reference!==d.reference&&(d.error=d.error||"URI is not a "+s.reference+" reference.");const h=o(s.scheme||d.scheme);if(!s.unicodeSupport&&(!h||!h.unicodeSupport)&&d.host&&(s.domainHost||h&&h.domainHost)&&g===!1&&n(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(P){d.error=d.error||"Host's domain name can not be converted to ASCII: "+P}(!h||h&&!h.skipNormalize)&&(c.indexOf("%")!==-1&&(d.scheme!==void 0&&(d.scheme=unescape(d.scheme)),d.host!==void 0&&(d.host=unescape(d.host))),d.path&&(d.path=escape(unescape(d.path))),d.fragment&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),h&&h.parse&&h.parse(d,s)}else d.error=d.error||"URI can not be parsed.";return d}const y={SCHEMES:u,normalize:f,resolve:$,resolveComponent:b,equal:E,serialize:_,parse:w};return De.exports=y,De.exports.default=y,De.exports.fastUri=y,De.exports}var Dr;function Es(){if(Dr)return Ke;Dr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=Ss();return e.code='require("ajv/dist/runtime/uri").default',Ke.default=e,Ke}var Tr;function ks(){return Tr||(Tr=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=At();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=er(),p=Mt(),n=In(),u=tr(),o=G(),f=Tt(),$=kt(),b=Y(),E=ws,_=Es(),v=(A,j)=>new RegExp(A,j);v.code="new RegExp";const w=["removeAdditional","useDefaults","coerceTypes"],y=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."},l={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},s=200;function d(A){var j,D,I,m,S,N,L,J,x,B,k,R,q,M,K,W,re,me,ce,de,ne,Re,fe,Vt,zt;const Ce=A.strict,Ft=(j=A.code)===null||j===void 0?void 0:j.optimize,ar=Ft===!0||Ft===void 0?1:Ft||0,cr=(I=(D=A.code)===null||D===void 0?void 0:D.regExp)!==null&&I!==void 0?I:v,us=(m=A.uriResolver)!==null&&m!==void 0?m:_.default;return{strictSchema:(N=(S=A.strictSchema)!==null&&S!==void 0?S:Ce)!==null&&N!==void 0?N:!0,strictNumbers:(J=(L=A.strictNumbers)!==null&&L!==void 0?L:Ce)!==null&&J!==void 0?J:!0,strictTypes:(B=(x=A.strictTypes)!==null&&x!==void 0?x:Ce)!==null&&B!==void 0?B:"log",strictTuples:(R=(k=A.strictTuples)!==null&&k!==void 0?k:Ce)!==null&&R!==void 0?R:"log",strictRequired:(M=(q=A.strictRequired)!==null&&q!==void 0?q:Ce)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:ar,regExp:cr}:{optimize:ar,regExp:cr},loopRequired:(K=A.loopRequired)!==null&&K!==void 0?K:s,loopEnum:(W=A.loopEnum)!==null&&W!==void 0?W:s,meta:(re=A.meta)!==null&&re!==void 0?re:!0,messages:(me=A.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ce=A.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(de=A.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(ne=A.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(Re=A.validateSchema)!==null&&Re!==void 0?Re:!0,validateFormats:(fe=A.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(Vt=A.unicodeRegExp)!==null&&Vt!==void 0?Vt:!0,int32range:(zt=A.int32range)!==null&&zt!==void 0?zt:!0,uriResolver:us}}class g{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...d(j)};const{es5:D,lines:I}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:y,es5:D,lines:I}),this.logger=V(j.logger);const m=j.validateFormats;j.validateFormats=!1,this.RULES=(0,n.getRules)(),a.call(this,c,j,"NOT SUPPORTED"),a.call(this,l,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&T.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=m}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:I}=this.opts;let m=E;I==="id"&&(m={...E},m.id=m.$id,delete m.$id),D&&j&&this.addMetaSchema(m,m[I],!1)}defaultMeta(){const{meta:j,schemaId:D}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[D]||j:void 0}validate(j,D){let I;if(typeof j=="string"){if(I=this.getSchema(j),!I)throw new Error(`no schema with key or ref "${j}"`)}else I=this.compile(j);const m=I(D);return"$async"in I||(this.errors=I.errors),m}compile(j,D){const I=this._addSchema(j,D);return I.validate||this._compileSchemaEnv(I)}compileAsync(j,D){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:I}=this.opts;return m.call(this,j,D);async function m(B,k){await S.call(this,B.$schema);const R=this._addSchema(B,k);return R.validate||N.call(this,R)}async function S(B){B&&!this.getSchema(B)&&await m.call(this,{$ref:B},!0)}async function N(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof p.default))throw k;return L.call(this,k),await J.call(this,k.missingSchema),N.call(this,B)}}function L({missingSchema:B,missingRef:k}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${k} cannot be resolved`)}async function J(B){const k=await x.call(this,B);this.refs[B]||await S.call(this,k.$schema),this.refs[B]||this.addSchema(k,B,D)}async function x(B){const k=this._loading[B];if(k)return k;try{return await(this._loading[B]=I(B))}finally{delete this._loading[B]}}}addSchema(j,D,I,m=this.opts.validateSchema){if(Array.isArray(j)){for(const N of j)this.addSchema(N,void 0,I,m);return this}let S;if(typeof j=="object"){const{schemaId:N}=this.opts;if(S=j[N],S!==void 0&&typeof S!="string")throw new Error(`schema ${N} must be string`)}return D=(0,f.normalizeId)(D||S),this._checkUnique(D),this.schemas[D]=this._addSchema(j,I,D,m,!0),this}addMetaSchema(j,D,I=this.opts.validateSchema){return this.addSchema(j,D,!0,I),this}validateSchema(j,D){if(typeof j=="boolean")return!0;let I;if(I=j.$schema,I!==void 0&&typeof I!="string")throw new Error("$schema must be a string");if(I=I||this.opts.defaultMeta||this.defaultMeta(),!I)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const m=this.validate(I,j);if(!m&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return m}getSchema(j){let D;for(;typeof(D=h.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:I}=this.opts,m=new u.SchemaEnv({schema:{},schemaId:I});if(D=u.resolveSchema.call(this,m,j),!D)return;this.refs[j]=D}return D.validate||this._compileSchemaEnv(D)}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 D=h.call(this,j);return typeof D=="object"&&this._cache.delete(D.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const D=j;this._cache.delete(D);let I=j[this.opts.schemaId];return I&&(I=(0,f.normalizeId)(I),delete this.schemas[I],delete this.refs[I]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const D of j)this.addKeyword(D);return this}addKeyword(j,D){let I;if(typeof j=="string")I=j,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=I);else if(typeof j=="object"&&D===void 0){if(D=j,I=D.keyword,Array.isArray(I)&&!I.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(U.call(this,I,D),!D)return(0,b.eachItem)(I,S=>Q.call(this,S)),this;oe.call(this,D);const m={...D,type:(0,$.getJSONTypes)(D.type),schemaType:(0,$.getJSONTypes)(D.schemaType)};return(0,b.eachItem)(I,m.type.length===0?S=>Q.call(this,S,m):S=>m.type.forEach(N=>Q.call(this,S,m,N))),this}getKeyword(j){const D=this.RULES.all[j];return typeof D=="object"?D.definition:!!D}removeKeyword(j){const{RULES:D}=this;delete D.keywords[j],delete D.all[j];for(const I of D.rules){const m=I.rules.findIndex(S=>S.keyword===j);m>=0&&I.rules.splice(m,1)}return this}addFormat(j,D){return typeof D=="string"&&(D=new RegExp(D)),this.formats[j]=D,this}errorsText(j=this.errors,{separator:D=", ",dataVar:I="data"}={}){return!j||j.length===0?"No errors":j.map(m=>`${I}${m.instancePath} ${m.message}`).reduce((m,S)=>m+D+S)}$dataMetaSchema(j,D){const I=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const m of D){const S=m.split("/").slice(1);let N=j;for(const L of S)N=N[L];for(const L in I){const J=I[L];if(typeof J!="object")continue;const{$data:x}=J.definition,B=N[L];x&&B&&(N[L]=pe(B))}}return j}_removeAllSchemas(j,D){for(const I in j){const m=j[I];(!D||D.test(I))&&(typeof m=="string"?delete j[I]:m&&!m.meta&&(this._cache.delete(m.schema),delete j[I]))}}_addSchema(j,D,I,m=this.opts.validateSchema,S=this.opts.addUsedSchema){let N;const{schemaId:L}=this.opts;if(typeof j=="object")N=j[L];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 J=this._cache.get(j);if(J!==void 0)return J;I=(0,f.normalizeId)(N||I);const x=f.getSchemaRefs.call(this,j,I);return J=new u.SchemaEnv({schema:j,schemaId:L,meta:D,baseId:I,localRefs:x}),this._cache.set(J.schema,J),S&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=J),m&&this.validateSchema(j,!0),J}_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):u.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const D=this.opts;this.opts=this._metaOpts;try{u.compileSchema.call(this,j)}finally{this.opts=D}}}g.ValidationError=i.default,g.MissingRefError=p.default,e.default=g;function a(A,j,D,I="error"){for(const m in A){const S=m;S in j&&this.logger[I](`${D}: option ${m}. ${A[S]}`)}}function h(A){return A=(0,f.normalizeId)(A),this.schemas[A]||this.refs[A]}function P(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const j in A)this.addSchema(A[j],j)}function O(){for(const A in this.opts.formats){const j=this.opts.formats[A];j&&this.addFormat(A,j)}}function T(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in A){const D=A[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const A={...this.opts};for(const j of w)delete A[j];return A}const C={log(){},warn(){},error(){}};function V(A){if(A===!1)return C;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function U(A,j){const{RULES:D}=this;if((0,b.eachItem)(A,I=>{if(D.keywords[I])throw new Error(`Keyword ${I} is already defined`);if(!F.test(I))throw new Error(`Keyword ${I} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function Q(A,j,D){var I;const m=j?.post;if(D&&m)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let N=m?S.post:S.rules.find(({type:J})=>J===D);if(N||(N={type:D,rules:[]},S.rules.push(N)),S.keywords[A]=!0,!j)return;const L={keyword:A,definition:{...j,type:(0,$.getJSONTypes)(j.type),schemaType:(0,$.getJSONTypes)(j.schemaType)}};j.before?ie.call(this,N,L,j.before):N.rules.push(L),S.all[A]=L,(I=j.implements)===null||I===void 0||I.forEach(J=>this.addKeyword(J))}function ie(A,j,D){const I=A.rules.findIndex(m=>m.keyword===D);I>=0?A.rules.splice(I,0,j):(A.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function oe(A){let{metaSchema:j}=A;j!==void 0&&(A.$data&&this.opts.$data&&(j=pe(j)),A.validateSchema=this.compile(j,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(A){return{anyOf:[A,X]}}})(Ut)),Ut}var Je={},He={},Ge={},Ar;function js(){if(Ar)return Ge;Ar=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ge.default=e,Ge}var be={},Mr;function Rs(){if(Mr)return be;Mr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.callRef=be.getValidate=void 0;const e=Mt(),t=ge(),r=G(),i=Se(),p=tr(),n=Y(),u={keyword:"$ref",schemaType:"string",code($){const{gen:b,schema:E,it:_}=$,{baseId:v,schemaEnv:w,validateName:y,opts:c,self:l}=_,{root:s}=w;if((E==="#"||E==="#/")&&v===s.baseId)return g();const d=p.resolveRef.call(l,s,v,E);if(d===void 0)throw new e.default(_.opts.uriResolver,v,E);if(d instanceof p.SchemaEnv)return a(d);return h(d);function g(){if(w===s)return f($,y,w,w.$async);const P=b.scopeValue("root",{ref:s});return f($,(0,r._)`${P}.validate`,s,s.$async)}function a(P){const O=o($,P);f($,O,P,P.$async)}function h(P){const O=b.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),T=b.name("valid"),z=$.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:O,errSchemaPath:E},T);$.mergeEvaluated(z),$.ok(T)}}};function o($,b){const{gen:E}=$;return b.validate?E.scopeValue("validate",{ref:b.validate}):(0,r._)`${E.scopeValue("wrapper",{ref:b})}.validate`}be.getValidate=o;function f($,b,E,_){const{gen:v,it:w}=$,{allErrors:y,schemaEnv:c,opts:l}=w,s=l.passContext?i.default.this:r.nil;_?d():g();function d(){if(!c.$async)throw new Error("async schema referenced by sync schema");const P=v.let("valid");v.try(()=>{v.code((0,r._)`await ${(0,t.callValidateCode)($,b,s)}`),h(b),y||v.assign(P,!0)},O=>{v.if((0,r._)`!(${O} instanceof ${w.ValidationError})`,()=>v.throw(O)),a(O),y||v.assign(P,!1)}),$.ok(P)}function g(){$.result((0,t.callValidateCode)($,b,s),()=>h(b),()=>a(b))}function a(P){const O=(0,r._)`${P}.errors`;v.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${O} : ${i.default.vErrors}.concat(${O})`),v.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function h(P){var O;if(!w.opts.unevaluated)return;const T=(O=E?.validate)===null||O===void 0?void 0:O.evaluated;if(w.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(w.props=n.mergeEvaluated.props(v,T.props,w.props));else{const z=v.var("props",(0,r._)`${P}.evaluated.props`);w.props=n.mergeEvaluated.props(v,z,w.props,r.Name)}if(w.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(w.items=n.mergeEvaluated.items(v,T.items,w.items));else{const z=v.var("items",(0,r._)`${P}.evaluated.items`);w.items=n.mergeEvaluated.items(v,z,w.items,r.Name)}}}return be.callRef=f,be.default=u,be}var Vr;function Is(){if(Vr)return He;Vr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=js(),t=Rs(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return He.default=r,He}var We={},Be={},zr;function Os(){if(zr)return Be;zr=1,Object.defineProperty(Be,"__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:n,schemaCode:u})=>(0,e.str)`must be ${r[n].okStr} ${u}`,params:({keyword:n,schemaCode:u})=>(0,e._)`{comparison: ${r[n].okStr}, limit: ${u}}`},p={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:i,code(n){const{keyword:u,data:o,schemaCode:f}=n;n.fail$data((0,e._)`${o} ${r[u].fail} ${f} || isNaN(${o})`)}};return Be.default=p,Be}var Ye={},Fr;function Ns(){if(Fr)return Ye;Fr=1,Object.defineProperty(Ye,"__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:p,data:n,schemaCode:u,it:o}=i,f=o.opts.multipleOfPrecision,$=p.let("res"),b=f?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${f}`:(0,e._)`${$} !== parseInt(${$})`;i.fail$data((0,e._)`(${u} === 0 || (${$} = ${n}/${u}, ${b}))`)}};return Ye.default=r,Ye}var xe={},Qe={},Ur;function Cs(){if(Ur)return Qe;Ur=1,Object.defineProperty(Qe,"__esModule",{value:!0});function e(t){const r=t.length;let i=0,p=0,n;for(;p<r;)i++,n=t.charCodeAt(p++),n>=55296&&n<=56319&&p<r&&(n=t.charCodeAt(p),(n&64512)===56320&&p++);return i}return Qe.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Qe}var Lr;function qs(){if(Lr)return xe;Lr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=G(),t=Y(),r=Cs(),p={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:u}){const o=n==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${u} characters`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:u,data:o,schemaCode:f,it:$}=n,b=u==="maxLength"?e.operators.GT:e.operators.LT,E=$.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(n.gen,r.default)}(${o})`;n.fail$data((0,e._)`${E} ${b} ${f}`)}};return xe.default=p,xe}var Ze={},Kr;function Ds(){if(Kr)return Ze;Kr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=ge(),t=G(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:p})=>(0,t.str)`must match pattern "${p}"`,params:({schemaCode:p})=>(0,t._)`{pattern: ${p}}`},code(p){const{data:n,$data:u,schema:o,schemaCode:f,it:$}=p,b=$.opts.unicodeRegExp?"u":"",E=u?(0,t._)`(new RegExp(${f}, ${b}))`:(0,e.usePattern)(p,o);p.fail$data((0,t._)`!${E}.test(${n})`)}};return Ze.default=i,Ze}var Xe={},Jr;function Ts(){if(Jr)return Xe;Jr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:p}){const n=i==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${p} properties`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:p,data:n,schemaCode:u}=i,o=p==="maxProperties"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`Object.keys(${n}).length ${o} ${u}`)}};return Xe.default=r,Xe}var et={},Hr;function As(){if(Hr)return et;Hr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=ge(),t=G(),r=Y(),p={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:n}})=>(0,t.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,t._)`{missingProperty: ${n}}`},code(n){const{gen:u,schema:o,schemaCode:f,data:$,$data:b,it:E}=n,{opts:_}=E;if(!b&&o.length===0)return;const v=o.length>=_.loopRequired;if(E.allErrors?w():y(),_.strictRequired){const s=n.parentSchema.properties,{definedProperties:d}=n.it;for(const g of o)if(s?.[g]===void 0&&!d.has(g)){const a=E.schemaEnv.baseId+E.errSchemaPath,h=`required property "${g}" is not defined at "${a}" (strictRequired)`;(0,r.checkStrictMode)(E,h,E.opts.strictRequired)}}function w(){if(v||b)n.block$data(t.nil,c);else for(const s of o)(0,e.checkReportMissingProp)(n,s)}function y(){const s=u.let("missing");if(v||b){const d=u.let("valid",!0);n.block$data(d,()=>l(s,d)),n.ok(d)}else u.if((0,e.checkMissingProp)(n,o,s)),(0,e.reportMissingProp)(n,s),u.else()}function c(){u.forOf("prop",f,s=>{n.setParams({missingProperty:s}),u.if((0,e.noPropertyInData)(u,$,s,_.ownProperties),()=>n.error())})}function l(s,d){n.setParams({missingProperty:s}),u.forOf(s,f,()=>{u.assign(d,(0,e.propertyInData)(u,$,s,_.ownProperties)),u.if((0,t.not)(d),()=>{n.error(),u.break()})},t.nil)}}};return et.default=p,et}var tt={},Gr;function Ms(){if(Gr)return tt;Gr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=G(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:p}){const n=i==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${p} items`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:p,data:n,schemaCode:u}=i,o=p==="maxItems"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`${n}.length ${o} ${u}`)}};return tt.default=r,tt}var rt={},nt={},Wr;function rr(){if(Wr)return nt;Wr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=Nn();return e.code='require("ajv/dist/runtime/equal").default',nt.default=e,nt}var Br;function Vs(){if(Br)return rt;Br=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=kt(),t=G(),r=Y(),i=rr(),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:u,j:o}})=>(0,t.str)`must NOT have duplicate items (items ## ${o} and ${u} are identical)`,params:({params:{i:u,j:o}})=>(0,t._)`{i: ${u}, j: ${o}}`},code(u){const{gen:o,data:f,$data:$,schema:b,parentSchema:E,schemaCode:_,it:v}=u;if(!$&&!b)return;const w=o.let("valid"),y=E.items?(0,e.getSchemaTypes)(E.items):[];u.block$data(w,c,(0,t._)`${_} === false`),u.ok(w);function c(){const g=o.let("i",(0,t._)`${f}.length`),a=o.let("j");u.setParams({i:g,j:a}),o.assign(w,!0),o.if((0,t._)`${g} > 1`,()=>(l()?s:d)(g,a))}function l(){return y.length>0&&!y.some(g=>g==="object"||g==="array")}function s(g,a){const h=o.name("item"),P=(0,e.checkDataTypes)(y,h,v.opts.strictNumbers,e.DataType.Wrong),O=o.const("indices",(0,t._)`{}`);o.for((0,t._)`;${g}--;`,()=>{o.let(h,(0,t._)`${f}[${g}]`),o.if(P,(0,t._)`continue`),y.length>1&&o.if((0,t._)`typeof ${h} == "string"`,(0,t._)`${h} += "_"`),o.if((0,t._)`typeof ${O}[${h}] == "number"`,()=>{o.assign(a,(0,t._)`${O}[${h}]`),u.error(),o.assign(w,!1).break()}).code((0,t._)`${O}[${h}] = ${g}`)})}function d(g,a){const h=(0,r.useFunc)(o,i.default),P=o.name("outer");o.label(P).for((0,t._)`;${g}--;`,()=>o.for((0,t._)`${a} = ${g}; ${a}--;`,()=>o.if((0,t._)`${h}(${f}[${g}], ${f}[${a}])`,()=>{u.error(),o.assign(w,!1).break(P)})))}}};return rt.default=n,rt}var st={},Yr;function zs(){if(Yr)return st;Yr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=G(),t=Y(),r=rr(),p={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:n})=>(0,e._)`{allowedValue: ${n}}`},code(n){const{gen:u,data:o,$data:f,schemaCode:$,schema:b}=n;f||b&&typeof b=="object"?n.fail$data((0,e._)`!${(0,t.useFunc)(u,r.default)}(${o}, ${$})`):n.fail((0,e._)`${b} !== ${o}`)}};return st.default=p,st}var it={},xr;function Fs(){if(xr)return it;xr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=G(),t=Y(),r=rr(),p={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,e._)`{allowedValues: ${n}}`},code(n){const{gen:u,data:o,$data:f,schema:$,schemaCode:b,it:E}=n;if(!f&&$.length===0)throw new Error("enum must have non-empty array");const _=$.length>=E.opts.loopEnum;let v;const w=()=>v??(v=(0,t.useFunc)(u,r.default));let y;if(_||f)y=u.let("valid"),n.block$data(y,c);else{if(!Array.isArray($))throw new Error("ajv implementation error");const s=u.const("vSchema",b);y=(0,e.or)(...$.map((d,g)=>l(s,g)))}n.pass(y);function c(){u.assign(y,!1),u.forOf("v",b,s=>u.if((0,e._)`${w()}(${o}, ${s})`,()=>u.assign(y,!0).break()))}function l(s,d){const g=$[d];return typeof g=="object"&&g!==null?(0,e._)`${w()}(${o}, ${s}[${d}])`:(0,e._)`${o} === ${g}`}}};return it.default=p,it}var Qr;function Us(){if(Qr)return We;Qr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=Os(),t=Ns(),r=qs(),i=Ds(),p=Ts(),n=As(),u=Ms(),o=Vs(),f=zs(),$=Fs(),b=[e.default,t.default,r.default,i.default,p.default,n.default,u.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,$.default];return We.default=b,We}var ot={},Ie={},Zr;function qn(){if(Zr)return Ie;Zr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateAdditionalItems=void 0;const e=G(),t=Y(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:n}})=>(0,e.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,e._)`{limit: ${n}}`},code(n){const{parentSchema:u,it:o}=n,{items:f}=u;if(!Array.isArray(f)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}p(n,f)}};function p(n,u){const{gen:o,schema:f,data:$,keyword:b,it:E}=n;E.items=!0;const _=o.const("len",(0,e._)`${$}.length`);if(f===!1)n.setParams({len:u.length}),n.pass((0,e._)`${_} <= ${u.length}`);else if(typeof f=="object"&&!(0,t.alwaysValidSchema)(E,f)){const w=o.var("valid",(0,e._)`${_} <= ${u.length}`);o.if((0,e.not)(w),()=>v(w)),n.ok(w)}function v(w){o.forRange("i",u.length,_,y=>{n.subschema({keyword:b,dataProp:y,dataPropType:t.Type.Num},w),E.allErrors||o.if((0,e.not)(w),()=>o.break())})}}return Ie.validateAdditionalItems=p,Ie.default=i,Ie}var at={},Oe={},Xr;function Dn(){if(Xr)return Oe;Xr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.validateTuple=void 0;const e=G(),t=Y(),r=ge(),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){const{schema:u,it:o}=n;if(Array.isArray(u))return p(n,"additionalItems",u);o.items=!0,!(0,t.alwaysValidSchema)(o,u)&&n.ok((0,r.validateArray)(n))}};function p(n,u,o=n.schema){const{gen:f,parentSchema:$,data:b,keyword:E,it:_}=n;y($),_.opts.unevaluated&&o.length&&_.items!==!0&&(_.items=t.mergeEvaluated.items(f,o.length,_.items));const v=f.name("valid"),w=f.const("len",(0,e._)`${b}.length`);o.forEach((c,l)=>{(0,t.alwaysValidSchema)(_,c)||(f.if((0,e._)`${w} > ${l}`,()=>n.subschema({keyword:E,schemaProp:l,dataProp:l},v)),n.ok(v))});function y(c){const{opts:l,errSchemaPath:s}=_,d=o.length,g=d===c.minItems&&(d===c.maxItems||c[u]===!1);if(l.strictTuples&&!g){const a=`"${E}" is ${d}-tuple, but minItems or maxItems/${u} are not specified or different at path "${s}"`;(0,t.checkStrictMode)(_,a,l.strictTuples)}}}return Oe.validateTuple=p,Oe.default=i,Oe}var en;function Ls(){if(en)return at;en=1,Object.defineProperty(at,"__esModule",{value:!0});const e=Dn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return at.default=t,at}var ct={},tn;function Ks(){if(tn)return ct;tn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=G(),t=Y(),r=ge(),i=qn(),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:u}})=>(0,e.str)`must NOT have more than ${u} items`,params:({params:{len:u}})=>(0,e._)`{limit: ${u}}`},code(u){const{schema:o,parentSchema:f,it:$}=u,{prefixItems:b}=f;$.items=!0,!(0,t.alwaysValidSchema)($,o)&&(b?(0,i.validateAdditionalItems)(u,b):u.ok((0,r.validateArray)(u)))}};return ct.default=n,ct}var dt={},rn;function Js(){if(rn)return dt;rn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=G(),t=Y(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:p,max:n}})=>n===void 0?(0,e.str)`must contain at least ${p} valid item(s)`:(0,e.str)`must contain at least ${p} and no more than ${n} valid item(s)`,params:({params:{min:p,max:n}})=>n===void 0?(0,e._)`{minContains: ${p}}`:(0,e._)`{minContains: ${p}, maxContains: ${n}}`},code(p){const{gen:n,schema:u,parentSchema:o,data:f,it:$}=p;let b,E;const{minContains:_,maxContains:v}=o;$.opts.next?(b=_===void 0?1:_,E=v):b=1;const w=n.const("len",(0,e._)`${f}.length`);if(p.setParams({min:b,max:E}),E===void 0&&b===0){(0,t.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&b>E){(0,t.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),p.fail();return}if((0,t.alwaysValidSchema)($,u)){let d=(0,e._)`${w} >= ${b}`;E!==void 0&&(d=(0,e._)`${d} && ${w} <= ${E}`),p.pass(d);return}$.items=!0;const y=n.name("valid");E===void 0&&b===1?l(y,()=>n.if(y,()=>n.break())):b===0?(n.let(y,!0),E!==void 0&&n.if((0,e._)`${f}.length > 0`,c)):(n.let(y,!1),c()),p.result(y,()=>p.reset());function c(){const d=n.name("_valid"),g=n.let("count",0);l(d,()=>n.if(d,()=>s(g)))}function l(d,g){n.forRange("i",0,w,a=>{p.subschema({keyword:"contains",dataProp:a,dataPropType:t.Type.Num,compositeRule:!0},d),g()})}function s(d){n.code((0,e._)`${d}++`),E===void 0?n.if((0,e._)`${d} >= ${b}`,()=>n.assign(y,!0).break()):(n.if((0,e._)`${d} > ${E}`,()=>n.assign(y,!1).break()),b===1?n.assign(y,!0):n.if((0,e._)`${d} >= ${b}`,()=>n.assign(y,!0)))}}};return dt.default=i,dt}var xt={},nn;function Hs(){return nn||(nn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),r=Y(),i=ge();e.error={message:({params:{property:f,depsCount:$,deps:b}})=>{const E=$===1?"property":"properties";return(0,t.str)`must have ${E} ${b} when property ${f} is present`},params:({params:{property:f,depsCount:$,deps:b,missingProperty:E}})=>(0,t._)`{property: ${f},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function In(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ze={exports:{}},Ut={},ve={},Se={},Lt={},Kt={},Jt={},dr;function Et(){return dr||(dr=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(i){if(super(),!e.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((u,y)=>`${u}${y}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((u,y)=>(y instanceof r&&(u[y.str]=(u[y.str]||0)+1),u),{})}}e._Code=n,e.nil=new n("");function c(p,...i){const u=[p[0]];let y=0;for(;y<i.length;)o(u,i[y]),u.push(p[++y]);return new n(u)}e._=c;const s=new n("+");function d(p,...i){const u=[g(p[0])];let y=0;for(;y<i.length;)u.push(s),o(u,i[y]),u.push(s,g(p[++y]));return l(u),new n(u)}e.str=d;function o(p,i){i instanceof n?p.push(...i._items):i instanceof r?p.push(i):p.push(E(i))}e.addCodeArg=o;function l(p){let i=1;for(;i<p.length-1;){if(p[i]===s){const u=$(p[i-1],p[i+1]);if(u!==void 0){p.splice(i-1,3,u);continue}p[i++]="+"}i++}}function $(p,i){if(i==='""')return p;if(p==='""')return i;if(typeof p=="string")return i instanceof r||p[p.length-1]!=='"'?void 0:typeof i!="string"?`${p.slice(0,-1)}${i}"`:i[0]==='"'?p.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(p instanceof r))return`"${p}${i.slice(1)}`}function _(p,i){return i.emptyStr()?p:p.emptyStr()?i:d`${p}${i}`}e.strConcat=_;function E(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:g(Array.isArray(p)?p.join(","):p)}function v(p){return new n(g(p))}e.stringify=v;function g(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function b(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):c`[${p}]`}e.getProperty=b;function w(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=w;function f(p){return new n(p.toString())}e.regexpCode=f})(Jt)),Jt}var Ht={},ur;function lr(){return ur||(ur=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Et();class r extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var n;(function(l){l[l.Started=0]="Started",l[l.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 c{constructor({prefixes:$,parent:_}={}){this._names={},this._prefixes=$,this._parent=_}toName($){return $ instanceof t.Name?$:this.name($)}name($){return new t.Name(this._newName($))}_newName($){const _=this._names[$]||this._nameGroup($);return`${$}${_.index++}`}_nameGroup($){var _,E;if(!((E=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||E===void 0)&&E.has($)||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}e.Scope=c;class s extends t.Name{constructor($,_){super(_),this.prefix=$}setValue($,{property:_,itemIndex:E}){this.value=$,this.scopePath=(0,t._)`.${new t.Name(_)}[${E}]`}}e.ValueScopeName=s;const d=(0,t._)`\n`;class o extends c{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?d:t.nil}}get(){return this._scope}name($){return new s($,this._newName($))}value($,_){var E;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName($),{prefix:g}=v,b=(E=_.key)!==null&&E!==void 0?E:_.ref;let w=this._values[g];if(w){const i=w.get(b);if(i)return i}else w=this._values[g]=new Map;w.set(b,v);const f=this._scope[g]||(this._scope[g]=[]),p=f.length;return f[p]=_.ref,v.setValue(_,{property:g,itemIndex:p}),v}getValue($,_){const E=this._values[$];if(E)return E.get(_)}scopeRefs($,_=this._values){return this._reduceValues(_,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${$}${E.scopePath}`})}scopeCode($=this._values,_,E){return this._reduceValues($,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},_,E)}_reduceValues($,_,E={},v){let g=t.nil;for(const b in $){const w=$[b];if(!w)continue;const f=E[b]=E[b]||new Map;w.forEach(p=>{if(f.has(p))return;f.set(p,n.Started);let i=_(p);if(i){const u=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${u} ${p} = ${i};${this.opts._n}`}else if(i=v?.(p))g=(0,t._)`${g}${i}${this.opts._n}`;else throw new r(p);f.set(p,n.Completed)})}return g}}e.ValueScope=o})(Ht)),Ht}var fr;function G(){return fr||(fr=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=Et(),r=lr();var n=Et();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 c=lr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return c.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return c.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return c.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return c.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(m,S){return this}}class d extends s{constructor(m,S,N){super(),this.varKind=m,this.name=S,this.rhs=N}render({es5:m,_n:S}){const N=m?r.varKinds.var:this.varKind,L=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${L};`+S}optimizeNames(m,S){if(m[this.name.str])return this.rhs&&(this.rhs=U(this.rhs,m,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends s{constructor(m,S,N){super(),this.lhs=m,this.rhs=S,this.sideEffects=N}render({_n:m}){return`${this.lhs} = ${this.rhs};`+m}optimizeNames(m,S){if(!(this.lhs instanceof t.Name&&!m[this.lhs.str]&&!this.sideEffects))return this.rhs=U(this.rhs,m,S),this}get names(){const m=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(m,this.rhs)}}class l extends o{constructor(m,S,N,L){super(m,N,L),this.op=S}render({_n:m}){return`${this.lhs} ${this.op}= ${this.rhs};`+m}}class $ extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`${this.label}:`+m}}class _ extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`break${this.label?` ${this.label}`:""};`+m}}class E extends s{constructor(m){super(),this.error=m}render({_n:m}){return`throw ${this.error};`+m}get names(){return this.error.names}}class v extends s{constructor(m){super(),this.code=m}render({_n:m}){return`${this.code};`+m}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(m,S){return this.code=U(this.code,m,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends s{constructor(m=[]){super(),this.nodes=m}render(m){return this.nodes.reduce((S,N)=>S+N.render(m),"")}optimizeNodes(){const{nodes:m}=this;let S=m.length;for(;S--;){const N=m[S].optimizeNodes();Array.isArray(N)?m.splice(S,1,...N):N?m[S]=N:m.splice(S,1)}return m.length>0?this:void 0}optimizeNames(m,S){const{nodes:N}=this;let L=N.length;for(;L--;){const J=N[L];J.optimizeNames(m,S)||(Q(m,J.names),N.splice(L,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((m,S)=>V(m,S.names),{})}}class b extends g{render(m){return"{"+m._n+super.render(m)+"}"+m._n}}class w extends g{}class f extends b{}f.kind="else";class p extends b{constructor(m,S){super(S),this.condition=m}render(m){let S=`if(${this.condition})`+super.render(m);return this.else&&(S+="else "+this.else.render(m)),S}optimizeNodes(){super.optimizeNodes();const m=this.condition;if(m===!0)return this.nodes;let S=this.else;if(S){const N=S.optimizeNodes();S=this.else=Array.isArray(N)?new f(N):N}if(S)return m===!1?S instanceof p?S:S.nodes:this.nodes.length?this:new p(ie(m),S instanceof p?[S]:S.nodes);if(!(m===!1||!this.nodes.length))return this}optimizeNames(m,S){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(m,S),!!(super.optimizeNames(m,S)||this.else))return this.condition=U(this.condition,m,S),this}get names(){const m=super.names;return F(m,this.condition),this.else&&V(m,this.else.names),m}}p.kind="if";class i extends b{}i.kind="for";class u extends i{constructor(m){super(),this.iteration=m}render(m){return`for(${this.iteration})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iteration=U(this.iteration,m,S),this}get names(){return V(super.names,this.iteration.names)}}class y extends i{constructor(m,S,N,L){super(),this.varKind=m,this.name=S,this.from=N,this.to=L}render(m){const S=m.es5?r.varKinds.var:this.varKind,{name:N,from:L,to:J}=this;return`for(${S} ${N}=${L}; ${N}<${J}; ${N}++)`+super.render(m)}get names(){const m=F(super.names,this.from);return F(m,this.to)}}class a extends i{constructor(m,S,N,L){super(),this.loop=m,this.varKind=S,this.name=N,this.iterable=L}render(m){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iterable=U(this.iterable,m,S),this}get names(){return V(super.names,this.iterable.names)}}class h extends b{constructor(m,S,N){super(),this.name=m,this.args=S,this.async=N}render(m){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(m)}}h.kind="func";class P extends g{render(m){return"return "+super.render(m)}}P.kind="return";class O extends b{render(m){let S="try"+super.render(m);return this.catch&&(S+=this.catch.render(m)),this.finally&&(S+=this.finally.render(m)),S}optimizeNodes(){var m,S;return super.optimizeNodes(),(m=this.catch)===null||m===void 0||m.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(m,S){var N,L;return super.optimizeNames(m,S),(N=this.catch)===null||N===void 0||N.optimizeNames(m,S),(L=this.finally)===null||L===void 0||L.optimizeNames(m,S),this}get names(){const m=super.names;return this.catch&&V(m,this.catch.names),this.finally&&V(m,this.finally.names),m}}class T extends b{constructor(m){super(),this.error=m}render(m){return`catch(${this.error})`+super.render(m)}}T.kind="catch";class z extends b{render(m){return"finally"+super.render(m)}}z.kind="finally";class C{constructor(m,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
|
|
2
|
+
`:""},this._extScope=m,this._scope=new r.Scope({parent:m}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(m){return this._scope.name(m)}scopeName(m){return this._extScope.name(m)}scopeValue(m,S){const N=this._extScope.value(m,S);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(m,S){return this._extScope.getValue(m,S)}scopeRefs(m){return this._extScope.scopeRefs(m,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(m,S,N,L){const J=this._scope.toName(S);return N!==void 0&&L&&(this._constants[J.str]=N),this._leafNode(new d(m,J,N)),J}const(m,S,N){return this._def(r.varKinds.const,m,S,N)}let(m,S,N){return this._def(r.varKinds.let,m,S,N)}var(m,S,N){return this._def(r.varKinds.var,m,S,N)}assign(m,S,N){return this._leafNode(new o(m,S,N))}add(m,S){return this._leafNode(new l(m,e.operators.ADD,S))}code(m){return typeof m=="function"?m():m!==t.nil&&this._leafNode(new v(m)),this}object(...m){const S=["{"];for(const[N,L]of m)S.length>1&&S.push(","),S.push(N),(N!==L||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,L));return S.push("}"),new t._Code(S)}if(m,S,N){if(this._blockNode(new p(m)),S&&N)this.code(S).else().code(N).endIf();else if(S)this.code(S).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(m){return this._elseNode(new p(m))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(p,f)}_for(m,S){return this._blockNode(m),S&&this.code(S).endFor(),this}for(m,S){return this._for(new u(m),S)}forRange(m,S,N,L,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const x=this._scope.toName(m);return this._for(new y(J,x,S,N),()=>L(x))}forOf(m,S,N,L=r.varKinds.const){const J=this._scope.toName(m);if(this.opts.es5){const x=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${x}.length`,B=>{this.var(J,(0,t._)`${x}[${B}]`),N(J)})}return this._for(new a("of",L,J,S),()=>N(J))}forIn(m,S,N,L=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(m,(0,t._)`Object.keys(${S})`,N);const J=this._scope.toName(m);return this._for(new a("in",L,J,S),()=>N(J))}endFor(){return this._endBlockNode(i)}label(m){return this._leafNode(new $(m))}break(m){return this._leafNode(new _(m))}return(m){const S=new P;if(this._blockNode(S),this.code(m),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(m,S,N){if(!S&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const L=new O;if(this._blockNode(L),this.code(m),S){const J=this.name("e");this._currNode=L.catch=new T(J),S(J)}return N&&(this._currNode=L.finally=new z,this.code(N)),this._endBlockNode(T,z)}throw(m){return this._leafNode(new E(m))}block(m,S){return this._blockStarts.push(this._nodes.length),m&&this.code(m).endBlock(S),this}endBlock(m){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-S;if(N<0||m!==void 0&&N!==m)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${m} expected`);return this._nodes.length=S,this}func(m,S=t.nil,N,L){return this._blockNode(new h(m,S,N)),L&&this.code(L).endFunc(),this}endFunc(){return this._endBlockNode(h)}optimize(m=1){for(;m-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(m){return this._currNode.nodes.push(m),this}_blockNode(m){this._currNode.nodes.push(m),this._nodes.push(m)}_endBlockNode(m,S){const N=this._currNode;if(N instanceof m||S&&N instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${m.kind}/${S.kind}`:m.kind}"`)}_elseNode(m){const S=this._currNode;if(!(S instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=m,this}get _root(){return this._nodes[0]}get _currNode(){const m=this._nodes;return m[m.length-1]}set _currNode(m){const S=this._nodes;S[S.length-1]=m}}e.CodeGen=C;function V(I,m){for(const S in m)I[S]=(I[S]||0)+(m[S]||0);return I}function F(I,m){return m instanceof t._CodeOrName?V(I,m.names):I}function U(I,m,S){if(I instanceof t.Name)return N(I);if(!L(I))return I;return new t._Code(I._items.reduce((J,x)=>(x instanceof t.Name&&(x=N(x)),x instanceof t._Code?J.push(...x._items):J.push(x),J),[]));function N(J){const x=S[J.str];return x===void 0||m[J.str]!==1?J:(delete m[J.str],x)}function L(J){return J instanceof t._Code&&J._items.some(x=>x instanceof t.Name&&m[x.str]===1&&S[x.str]!==void 0)}}function Q(I,m){for(const S in m)I[S]=(I[S]||0)-(m[S]||0)}function ie(I){return typeof I=="boolean"||typeof I=="number"||I===null?!I:(0,t._)`!${D(I)}`}e.not=ie;const oe=j(e.operators.AND);function X(...I){return I.reduce(oe)}e.and=X;const pe=j(e.operators.OR);function A(...I){return I.reduce(pe)}e.or=A;function j(I){return(m,S)=>m===t.nil?S:S===t.nil?m:(0,t._)`${D(m)} ${I} ${D(S)}`}function D(I){return I instanceof t.Name?I:(0,t._)`(${I})`}})(Kt)),Kt}var H={},pr;function Y(){if(pr)return H;pr=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=G(),t=Et();function r(a){const h={};for(const P of a)h[P]=!0;return h}H.toHash=r;function n(a,h){return typeof h=="boolean"?h:Object.keys(h).length===0?!0:(c(a,h),!s(h,a.self.RULES.all))}H.alwaysValidSchema=n;function c(a,h=a.schema){const{opts:P,self:O}=a;if(!P.strictSchema||typeof h=="boolean")return;const T=O.RULES.keywords;for(const z in h)T[z]||y(a,`unknown keyword: "${z}"`)}H.checkUnknownRules=c;function s(a,h){if(typeof a=="boolean")return!a;for(const P in a)if(h[P])return!0;return!1}H.schemaHasRules=s;function d(a,h){if(typeof a=="boolean")return!a;for(const P in a)if(P!=="$ref"&&h.all[P])return!0;return!1}H.schemaHasRulesButRef=d;function o({topSchemaRef:a,schemaPath:h},P,O,T){if(!T){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${a}${h}${(0,e.getProperty)(O)}`}H.schemaRefOrVal=o;function l(a){return E(decodeURIComponent(a))}H.unescapeFragment=l;function $(a){return encodeURIComponent(_(a))}H.escapeFragment=$;function _(a){return typeof a=="number"?`${a}`:a.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=_;function E(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=E;function v(a,h){if(Array.isArray(a))for(const P of a)h(P);else h(a)}H.eachItem=v;function g({mergeNames:a,mergeToName:h,mergeValues:P,resultToName:O}){return(T,z,C,V)=>{const F=C===void 0?z:C instanceof e.Name?(z instanceof e.Name?a(T,z,C):h(T,z,C),C):z instanceof e.Name?(h(T,C,z),z):P(z,C);return V===e.Name&&!(F instanceof e.Name)?O(T,F):F}}H.mergeEvaluated={props:g({mergeNames:(a,h,P)=>a.if((0,e._)`${P} !== true && ${h} !== undefined`,()=>{a.if((0,e._)`${h} === true`,()=>a.assign(P,!0),()=>a.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${h})`))}),mergeToName:(a,h,P)=>a.if((0,e._)`${P} !== true`,()=>{h===!0?a.assign(P,!0):(a.assign(P,(0,e._)`${P} || {}`),w(a,P,h))}),mergeValues:(a,h)=>a===!0?!0:{...a,...h},resultToName:b}),items:g({mergeNames:(a,h,P)=>a.if((0,e._)`${P} !== true && ${h} !== undefined`,()=>a.assign(P,(0,e._)`${h} === true ? true : ${P} > ${h} ? ${P} : ${h}`)),mergeToName:(a,h,P)=>a.if((0,e._)`${P} !== true`,()=>a.assign(P,h===!0?!0:(0,e._)`${P} > ${h} ? ${P} : ${h}`)),mergeValues:(a,h)=>a===!0?!0:Math.max(a,h),resultToName:(a,h)=>a.var("items",h)})};function b(a,h){if(h===!0)return a.var("props",!0);const P=a.var("props",(0,e._)`{}`);return h!==void 0&&w(a,P,h),P}H.evaluatedPropsToName=b;function w(a,h,P){Object.keys(P).forEach(O=>a.assign((0,e._)`${h}${(0,e.getProperty)(O)}`,!0))}H.setEvaluated=w;const f={};function p(a,h){return a.scopeValue("func",{ref:h,code:f[h.code]||(f[h.code]=new t._Code(h.code))})}H.useFunc=p;var i;(function(a){a[a.Num=0]="Num",a[a.Str=1]="Str"})(i||(H.Type=i={}));function u(a,h,P){if(a instanceof e.Name){const O=h===i.Num;return P?O?(0,e._)`"[" + ${a} + "]"`:(0,e._)`"['" + ${a} + "']"`:O?(0,e._)`"/" + ${a}`:(0,e._)`"/" + ${a}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(a).toString():"/"+_(a)}H.getErrorPath=u;function y(a,h,P=a.opts.strictSchema){if(P){if(h=`strict mode: ${h}`,P===!0)throw new Error(h);a.self.logger.warn(h)}}return H.checkStrictMode=y,H}var Fe={},mr;function Pe(){if(mr)return Fe;mr=1,Object.defineProperty(Fe,"__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 Fe.default=t,Fe}var hr;function Dt(){return hr||(hr=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=Y(),n=Pe();e.keywordError={message:({keyword:f})=>(0,t.str)`must pass "${f}" keyword validation`},e.keyword$DataError={message:({keyword:f,schemaType:p})=>p?(0,t.str)`"${f}" keyword must be ${p} ($data)`:(0,t.str)`"${f}" keyword is invalid ($data)`};function c(f,p=e.keywordError,i,u){const{it:y}=f,{gen:a,compositeRule:h,allErrors:P}=y,O=E(f,p,i);u??(h||P)?l(a,O):$(y,(0,t._)`[${O}]`)}e.reportError=c;function s(f,p=e.keywordError,i){const{it:u}=f,{gen:y,compositeRule:a,allErrors:h}=u,P=E(f,p,i);l(y,P),a||h||$(u,n.default.vErrors)}e.reportExtraError=s;function d(f,p){f.assign(n.default.errors,p),f.if((0,t._)`${n.default.vErrors} !== null`,()=>f.if(p,()=>f.assign((0,t._)`${n.default.vErrors}.length`,p),()=>f.assign(n.default.vErrors,null)))}e.resetErrorsCount=d;function o({gen:f,keyword:p,schemaValue:i,data:u,errsCount:y,it:a}){if(y===void 0)throw new Error("ajv implementation error");const h=f.name("err");f.forRange("i",y,n.default.errors,P=>{f.const(h,(0,t._)`${n.default.vErrors}[${P}]`),f.if((0,t._)`${h}.instancePath === undefined`,()=>f.assign((0,t._)`${h}.instancePath`,(0,t.strConcat)(n.default.instancePath,a.errorPath))),f.assign((0,t._)`${h}.schemaPath`,(0,t.str)`${a.errSchemaPath}/${p}`),a.opts.verbose&&(f.assign((0,t._)`${h}.schema`,i),f.assign((0,t._)`${h}.data`,u))})}e.extendErrors=o;function l(f,p){const i=f.const("err",p);f.if((0,t._)`${n.default.vErrors} === null`,()=>f.assign(n.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${n.default.vErrors}.push(${i})`),f.code((0,t._)`${n.default.errors}++`)}function $(f,p){const{gen:i,validateName:u,schemaEnv:y}=f;y.$async?i.throw((0,t._)`new ${f.ValidationError}(${p})`):(i.assign((0,t._)`${u}.errors`,p),i.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 E(f,p,i){const{createErrors:u}=f.it;return u===!1?(0,t._)`{}`:v(f,p,i)}function v(f,p,i={}){const{gen:u,it:y}=f,a=[g(y,i),b(f,i)];return w(f,p,a),u.object(...a)}function g({errorPath:f},{instancePath:p}){const i=p?(0,t.str)`${f}${(0,r.getErrorPath)(p,r.Type.Str)}`:f;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,i)]}function b({keyword:f,it:{errSchemaPath:p}},{schemaPath:i,parentSchema:u}){let y=u?p:(0,t.str)`${p}/${f}`;return i&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(i,r.Type.Str)}`),[_.schemaPath,y]}function w(f,{params:p,message:i},u){const{keyword:y,data:a,schemaValue:h,it:P}=f,{opts:O,propertyName:T,topSchemaRef:z,schemaPath:C}=P;u.push([_.keyword,y],[_.params,typeof p=="function"?p(f):p||(0,t._)`{}`]),O.messages&&u.push([_.message,typeof i=="function"?i(f):i]),O.verbose&&u.push([_.schema,h],[_.parentSchema,(0,t._)`${z}${C}`],[n.default.data,a]),T&&u.push([_.propertyName,T])}})(Lt)),Lt}var yr;function fs(){if(yr)return Se;yr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.boolOrEmptySchema=Se.topBoolOrEmptySchema=void 0;const e=Dt(),t=G(),r=Pe(),n={message:"boolean schema is false"};function c(o){const{gen:l,schema:$,validateName:_}=o;$===!1?d(o,!1):typeof $=="object"&&$.$async===!0?l.return(r.default.data):(l.assign((0,t._)`${_}.errors`,null),l.return(!0))}Se.topBoolOrEmptySchema=c;function s(o,l){const{gen:$,schema:_}=o;_===!1?($.var(l,!1),d(o)):$.var(l,!0)}Se.boolOrEmptySchema=s;function d(o,l){const{gen:$,data:_}=o,E={gen:$,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(E,n,void 0,l)}return Se}var se={},Ee={},gr;function On(){if(gr)return Ee;gr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.getRules=Ee.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(c){return typeof c=="string"&&t.has(c)}Ee.isJSONType=r;function n(){const c={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...c,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},c.number,c.string,c.array,c.object],post:{rules:[]},all:{},keywords:{}}}return Ee.getRules=n,Ee}var _e={},vr;function Nn(){if(vr)return _e;vr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:n,self:c},s){const d=c.RULES.types[s];return d&&d!==!0&&t(n,d)}_e.schemaHasRulesForType=e;function t(n,c){return c.rules.some(s=>r(n,s))}_e.shouldUseGroup=t;function r(n,c){var s;return n[c.keyword]!==void 0||((s=c.definition.implements)===null||s===void 0?void 0:s.some(d=>n[d]!==void 0))}return _e.shouldUseRule=r,_e}var _r;function kt(){if(_r)return se;_r=1,Object.defineProperty(se,"__esModule",{value:!0}),se.reportTypeError=se.checkDataTypes=se.checkDataType=se.coerceAndCheckDataType=se.getJSONTypes=se.getSchemaTypes=se.DataType=void 0;const e=On(),t=Nn(),r=Dt(),n=G(),c=Y();var s;(function(i){i[i.Correct=0]="Correct",i[i.Wrong=1]="Wrong"})(s||(se.DataType=s={}));function d(i){const u=o(i.type);if(u.includes("null")){if(i.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!u.length&&i.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');i.nullable===!0&&u.push("null")}return u}se.getSchemaTypes=d;function o(i){const u=Array.isArray(i)?i:i?[i]:[];if(u.every(e.isJSONType))return u;throw new Error("type must be JSONType or JSONType[]: "+u.join(","))}se.getJSONTypes=o;function l(i,u){const{gen:y,data:a,opts:h}=i,P=_(u,h.coerceTypes),O=u.length>0&&!(P.length===0&&u.length===1&&(0,t.schemaHasRulesForType)(i,u[0]));if(O){const T=b(u,a,h.strictNumbers,s.Wrong);y.if(T,()=>{P.length?E(i,u,P):f(i)})}return O}se.coerceAndCheckDataType=l;const $=new Set(["string","number","integer","boolean","null"]);function _(i,u){return u?i.filter(y=>$.has(y)||u==="array"&&y==="array"):[]}function E(i,u,y){const{gen:a,data:h,opts:P}=i,O=a.let("dataType",(0,n._)`typeof ${h}`),T=a.let("coerced",(0,n._)`undefined`);P.coerceTypes==="array"&&a.if((0,n._)`${O} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>a.assign(h,(0,n._)`${h}[0]`).assign(O,(0,n._)`typeof ${h}`).if(b(u,h,P.strictNumbers),()=>a.assign(T,h))),a.if((0,n._)`${T} !== undefined`);for(const C of y)($.has(C)||C==="array"&&P.coerceTypes==="array")&&z(C);a.else(),f(i),a.endIf(),a.if((0,n._)`${T} !== undefined`,()=>{a.assign(h,T),v(i,T)});function z(C){switch(C){case"string":a.elseIf((0,n._)`${O} == "number" || ${O} == "boolean"`).assign(T,(0,n._)`"" + ${h}`).elseIf((0,n._)`${h} === null`).assign(T,(0,n._)`""`);return;case"number":a.elseIf((0,n._)`${O} == "boolean" || ${h} === null
|
|
3
|
+
|| (${O} == "string" && ${h} && ${h} == +${h})`).assign(T,(0,n._)`+${h}`);return;case"integer":a.elseIf((0,n._)`${O} === "boolean" || ${h} === null
|
|
4
|
+
|| (${O} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(T,(0,n._)`+${h}`);return;case"boolean":a.elseIf((0,n._)`${h} === "false" || ${h} === 0 || ${h} === null`).assign(T,!1).elseIf((0,n._)`${h} === "true" || ${h} === 1`).assign(T,!0);return;case"null":a.elseIf((0,n._)`${h} === "" || ${h} === 0 || ${h} === false`),a.assign(T,null);return;case"array":a.elseIf((0,n._)`${O} === "string" || ${O} === "number"
|
|
5
|
+
|| ${O} === "boolean" || ${h} === null`).assign(T,(0,n._)`[${h}]`)}}}function v({gen:i,parentData:u,parentDataProperty:y},a){i.if((0,n._)`${u} !== undefined`,()=>i.assign((0,n._)`${u}[${y}]`,a))}function g(i,u,y,a=s.Correct){const h=a===s.Correct?n.operators.EQ:n.operators.NEQ;let P;switch(i){case"null":return(0,n._)`${u} ${h} null`;case"array":P=(0,n._)`Array.isArray(${u})`;break;case"object":P=(0,n._)`${u} && typeof ${u} == "object" && !Array.isArray(${u})`;break;case"integer":P=O((0,n._)`!(${u} % 1) && !isNaN(${u})`);break;case"number":P=O();break;default:return(0,n._)`typeof ${u} ${h} ${i}`}return a===s.Correct?P:(0,n.not)(P);function O(T=n.nil){return(0,n.and)((0,n._)`typeof ${u} == "number"`,T,y?(0,n._)`isFinite(${u})`:n.nil)}}se.checkDataType=g;function b(i,u,y,a){if(i.length===1)return g(i[0],u,y,a);let h;const P=(0,c.toHash)(i);if(P.array&&P.object){const O=(0,n._)`typeof ${u} != "object"`;h=P.null?O:(0,n._)`!${u} || ${O}`,delete P.null,delete P.array,delete P.object}else h=n.nil;P.number&&delete P.integer;for(const O in P)h=(0,n.and)(h,g(O,u,y,a));return h}se.checkDataTypes=b;const w={message:({schema:i})=>`must be ${i}`,params:({schema:i,schemaValue:u})=>typeof i=="string"?(0,n._)`{type: ${i}}`:(0,n._)`{type: ${u}}`};function f(i){const u=p(i);(0,r.reportError)(u,w)}se.reportTypeError=f;function p(i){const{gen:u,data:y,schema:a}=i,h=(0,c.schemaRefOrVal)(i,a,"type");return{gen:u,keyword:"type",data:y,schema:a.type,schemaCode:h,schemaValue:h,parentSchema:a,params:{},it:i}}return se}var Ce={},$r;function ps(){if($r)return Ce;$r=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.assignDefaults=void 0;const e=G(),t=Y();function r(c,s){const{properties:d,items:o}=c.schema;if(s==="object"&&d)for(const l in d)n(c,l,d[l].default);else s==="array"&&Array.isArray(o)&&o.forEach((l,$)=>n(c,$,l.default))}Ce.assignDefaults=r;function n(c,s,d){const{gen:o,compositeRule:l,data:$,opts:_}=c;if(d===void 0)return;const E=(0,e._)`${$}${(0,e.getProperty)(s)}`;if(l){(0,t.checkStrictMode)(c,`default is ignored for: ${E}`);return}let v=(0,e._)`${E} === undefined`;_.useDefaults==="empty"&&(v=(0,e._)`${v} || ${E} === null || ${E} === ""`),o.if(v,(0,e._)`${E} = ${(0,e.stringify)(d)}`)}return Ce}var he={},Z={},br;function ge(){if(br)return Z;br=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.validateUnion=Z.validateArray=Z.usePattern=Z.callValidateCode=Z.schemaProperties=Z.allSchemaProperties=Z.noPropertyInData=Z.propertyInData=Z.isOwnProperty=Z.hasPropFunc=Z.reportMissingProp=Z.checkMissingProp=Z.checkReportMissingProp=void 0;const e=G(),t=Y(),r=Pe(),n=Y();function c(i,u){const{gen:y,data:a,it:h}=i;y.if(_(y,a,u,h.opts.ownProperties),()=>{i.setParams({missingProperty:(0,e._)`${u}`},!0),i.error()})}Z.checkReportMissingProp=c;function s({gen:i,data:u,it:{opts:y}},a,h){return(0,e.or)(...a.map(P=>(0,e.and)(_(i,u,P,y.ownProperties),(0,e._)`${h} = ${P}`)))}Z.checkMissingProp=s;function d(i,u){i.setParams({missingProperty:u},!0),i.error()}Z.reportMissingProp=d;function o(i){return i.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Z.hasPropFunc=o;function l(i,u,y){return(0,e._)`${o(i)}.call(${u}, ${y})`}Z.isOwnProperty=l;function $(i,u,y,a){const h=(0,e._)`${u}${(0,e.getProperty)(y)} !== undefined`;return a?(0,e._)`${h} && ${l(i,u,y)}`:h}Z.propertyInData=$;function _(i,u,y,a){const h=(0,e._)`${u}${(0,e.getProperty)(y)} === undefined`;return a?(0,e.or)(h,(0,e.not)(l(i,u,y))):h}Z.noPropertyInData=_;function E(i){return i?Object.keys(i).filter(u=>u!=="__proto__"):[]}Z.allSchemaProperties=E;function v(i,u){return E(u).filter(y=>!(0,t.alwaysValidSchema)(i,u[y]))}Z.schemaProperties=v;function g({schemaCode:i,data:u,it:{gen:y,topSchemaRef:a,schemaPath:h,errorPath:P},it:O},T,z,C){const V=C?(0,e._)`${i}, ${u}, ${a}${h}`:u,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 U=(0,e._)`${V}, ${y.object(...F)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${U})`:(0,e._)`${T}(${U})`}Z.callValidateCode=g;const b=(0,e._)`new RegExp`;function w({gen:i,it:{opts:u}},y){const a=u.unicodeRegExp?"u":"",{regExp:h}=u.code,P=h(y,a);return i.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${h.code==="new RegExp"?b:(0,n.useFunc)(i,h)}(${y}, ${a})`})}Z.usePattern=w;function f(i){const{gen:u,data:y,keyword:a,it:h}=i,P=u.name("valid");if(h.allErrors){const T=u.let("valid",!0);return O(()=>u.assign(T,!1)),T}return u.var(P,!0),O(()=>u.break()),P;function O(T){const z=u.const("len",(0,e._)`${y}.length`);u.forRange("i",0,z,C=>{i.subschema({keyword:a,dataProp:C,dataPropType:t.Type.Num},P),u.if((0,e.not)(P),T)})}}Z.validateArray=f;function p(i){const{gen:u,schema:y,keyword:a,it:h}=i;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(h,z))&&!h.opts.unevaluated)return;const O=u.let("valid",!1),T=u.name("_valid");u.block(()=>y.forEach((z,C)=>{const V=i.subschema({keyword:a,schemaProp:C,compositeRule:!0},T);u.assign(O,(0,e._)`${O} || ${T}`),i.mergeValidEvaluated(V,T)||u.if((0,e.not)(O))})),i.result(O,()=>i.reset(),()=>i.error(!0))}return Z.validateUnion=p,Z}var wr;function ms(){if(wr)return he;wr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.validateKeywordUsage=he.validSchemaType=he.funcKeywordCode=he.macroKeywordCode=void 0;const e=G(),t=Pe(),r=ge(),n=Dt();function c(v,g){const{gen:b,keyword:w,schema:f,parentSchema:p,it:i}=v,u=g.macro.call(i.self,f,p,i),y=$(b,w,u);i.opts.validateSchema!==!1&&i.self.validateSchema(u,!0);const a=b.name("valid");v.subschema({schema:u,schemaPath:e.nil,errSchemaPath:`${i.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},a),v.pass(a,()=>v.error(!0))}he.macroKeywordCode=c;function s(v,g){var b;const{gen:w,keyword:f,schema:p,parentSchema:i,$data:u,it:y}=v;l(y,g);const a=!u&&g.compile?g.compile.call(y.self,p,i,y):g.validate,h=$(w,f,a),P=w.let("valid");v.block$data(P,O),v.ok((b=g.valid)!==null&&b!==void 0?b:P);function O(){if(g.errors===!1)C(),g.modifying&&d(v),V(()=>v.error());else{const F=g.async?T():z();g.modifying&&d(v),V(()=>o(v,F))}}function T(){const F=w.let("ruleErrs",null);return w.try(()=>C((0,e._)`await `),U=>w.assign(P,!1).if((0,e._)`${U} instanceof ${y.ValidationError}`,()=>w.assign(F,(0,e._)`${U}.errors`),()=>w.throw(U))),F}function z(){const F=(0,e._)`${h}.errors`;return w.assign(F,null),C(e.nil),F}function C(F=g.async?(0,e._)`await `:e.nil){const U=y.opts.passContext?t.default.this:t.default.self,Q=!("compile"in g&&!u||g.schema===!1);w.assign(P,(0,e._)`${F}${(0,r.callValidateCode)(v,h,U,Q)}`,g.modifying)}function V(F){var U;w.if((0,e.not)((U=g.valid)!==null&&U!==void 0?U:P),F)}}he.funcKeywordCode=s;function d(v){const{gen:g,data:b,it:w}=v;g.if(w.parentData,()=>g.assign(b,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function o(v,g){const{gen:b}=v;b.if((0,e._)`Array.isArray(${g})`,()=>{b.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)(v)},()=>v.error())}function l({schemaEnv:v},g){if(g.async&&!v.$async)throw new Error("async keyword in sync schema")}function $(v,g,b){if(b===void 0)throw new Error(`keyword "${g}" failed to compile`);return v.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function _(v,g,b=!1){return!g.length||g.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||b&&typeof v>"u")}he.validSchemaType=_;function E({schema:v,opts:g,self:b,errSchemaPath:w},f,p){if(Array.isArray(f.keyword)?!f.keyword.includes(p):f.keyword!==p)throw new Error("ajv implementation error");const i=f.dependencies;if(i?.some(u=>!Object.prototype.hasOwnProperty.call(v,u)))throw new Error(`parent schema must have dependencies of ${p}: ${i.join(",")}`);if(f.validateSchema&&!f.validateSchema(v[p])){const y=`keyword "${p}" value is invalid at path "${w}": `+b.errorsText(f.validateSchema.errors);if(g.validateSchema==="log")b.logger.error(y);else throw new Error(y)}}return he.validateKeywordUsage=E,he}var $e={},Pr;function hs(){if(Pr)return $e;Pr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=G(),t=Y();function r(s,{keyword:d,schemaProp:o,schema:l,schemaPath:$,errSchemaPath:_,topSchemaRef:E}){if(d!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(d!==void 0){const v=s.schema[d];return o===void 0?{schema:v,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(d)}`,errSchemaPath:`${s.errSchemaPath}/${d}`}:{schema:v[o],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(d)}${(0,e.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${d}/${(0,t.escapeFragment)(o)}`}}if(l!==void 0){if($===void 0||_===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:$,topSchemaRef:E,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function n(s,d,{dataProp:o,dataPropType:l,data:$,dataTypes:_,propertyName:E}){if($!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=d;if(o!==void 0){const{errorPath:b,dataPathArr:w,opts:f}=d,p=v.let("data",(0,e._)`${d.data}${(0,e.getProperty)(o)}`,!0);g(p),s.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(o,l,f.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${o}`,s.dataPathArr=[...w,s.parentDataProperty]}if($!==void 0){const b=$ instanceof e.Name?$:v.let("data",$,!0);g(b),E!==void 0&&(s.propertyName=E)}_&&(s.dataTypes=_);function g(b){s.data=b,s.dataLevel=d.dataLevel+1,s.dataTypes=[],d.definedProperties=new Set,s.parentData=d.data,s.dataNames=[...d.dataNames,b]}}$e.extendSubschemaData=n;function c(s,{jtdDiscriminator:d,jtdMetadata:o,compositeRule:l,createErrors:$,allErrors:_}){l!==void 0&&(s.compositeRule=l),$!==void 0&&(s.createErrors=$),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=d,s.jtdMetadata=o}return $e.extendSubschemaMode=c,$e}var ae={},Gt,Sr;function Cn(){return Sr||(Sr=1,Gt=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 n,c,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(c=n;c--!==0;)if(!e(t[c],r[c]))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),n=s.length,n!==Object.keys(r).length)return!1;for(c=n;c--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[c]))return!1;for(c=n;c--!==0;){var d=s[c];if(!e(t[d],r[d]))return!1}return!0}return t!==t&&r!==r}),Gt}var Wt={exports:{}},Er;function ys(){if(Er)return Wt.exports;Er=1;var e=Wt.exports=function(n,c,s){typeof c=="function"&&(s=c,c={}),s=c.cb||s;var d=typeof s=="function"?s:s.pre||function(){},o=s.post||function(){};t(c,d,o,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,c,s,d,o,l,$,_,E,v){if(d&&typeof d=="object"&&!Array.isArray(d)){c(d,o,l,$,_,E,v);for(var g in d){var b=d[g];if(Array.isArray(b)){if(g in e.arrayKeywords)for(var w=0;w<b.length;w++)t(n,c,s,b[w],o+"/"+g+"/"+w,l,o,g,d,w)}else if(g in e.propsKeywords){if(b&&typeof b=="object")for(var f in b)t(n,c,s,b[f],o+"/"+g+"/"+r(f),l,o,g,d,f)}else(g in e.keywords||n.allKeys&&!(g in e.skipKeywords))&&t(n,c,s,b,o+"/"+g,l,o,g,d)}s(d,o,l,$,_,E,v)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Wt.exports}var kr;function Tt(){if(kr)return ae;kr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Y(),t=Cn(),r=ys(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function c(w,f=!0){return typeof w=="boolean"?!0:f===!0?!d(w):f?o(w)<=f:!1}ae.inlineRef=c;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function d(w){for(const f in w){if(s.has(f))return!0;const p=w[f];if(Array.isArray(p)&&p.some(d)||typeof p=="object"&&d(p))return!0}return!1}function o(w){let f=0;for(const p in w){if(p==="$ref")return 1/0;if(f++,!n.has(p)&&(typeof w[p]=="object"&&(0,e.eachItem)(w[p],i=>f+=o(i)),f===1/0))return 1/0}return f}function l(w,f="",p){p!==!1&&(f=E(f));const i=w.parse(f);return $(w,i)}ae.getFullPath=l;function $(w,f){return w.serialize(f).split("#")[0]+"#"}ae._getFullPath=$;const _=/#\/?$/;function E(w){return w?w.replace(_,""):""}ae.normalizeId=E;function v(w,f,p){return p=E(p),w.resolve(f,p)}ae.resolveUrl=v;const g=/^[a-z_][-a-z0-9._]*$/i;function b(w,f){if(typeof w=="boolean")return{};const{schemaId:p,uriResolver:i}=this.opts,u=E(w[p]||f),y={"":u},a=l(i,u,!1),h={},P=new Set;return r(w,{allKeys:!0},(z,C,V,F)=>{if(F===void 0)return;const U=a+C;let Q=y[F];typeof z[p]=="string"&&(Q=ie.call(this,z[p])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),y[C]=Q;function ie(X){const pe=this.opts.uriResolver.resolve;if(X=E(Q?pe(Q,X):X),P.has(X))throw T(X);P.add(X);let A=this.refs[X];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?O(z,A.schema,X):X!==E(U)&&(X[0]==="#"?(O(z,h[X],X),h[X]=z):this.refs[X]=U),X}function oe(X){if(typeof X=="string"){if(!g.test(X))throw new Error(`invalid anchor "${X}"`);ie.call(this,`#${X}`)}}}),h;function O(z,C,V){if(C!==void 0&&!t(z,C))throw T(V)}function T(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ae.getSchemaRefs=b,ae}var jr;function At(){if(jr)return ve;jr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=fs(),t=kt(),r=Nn(),n=kt(),c=ps(),s=ms(),d=hs(),o=G(),l=Pe(),$=Tt(),_=Y(),E=Dt();function v(k){if(a(k)&&(P(k),y(k))){f(k);return}g(k,()=>(0,e.topBoolOrEmptySchema)(k))}ve.validateFunctionCode=v;function g({gen:k,validateName:R,schema:q,schemaEnv:M,opts:K},W){K.code.es5?k.func(R,(0,o._)`${l.default.data}, ${l.default.valCxt}`,M.$async,()=>{k.code((0,o._)`"use strict"; ${i(q,K)}`),w(k,K),k.code(W)}):k.func(R,(0,o._)`${l.default.data}, ${b(K)}`,M.$async,()=>k.code(i(q,K)).code(W))}function b(k){return(0,o._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${k.dynamicRef?(0,o._)`, ${l.default.dynamicAnchors}={}`:o.nil}}={}`}function w(k,R){k.if(l.default.valCxt,()=>{k.var(l.default.instancePath,(0,o._)`${l.default.valCxt}.${l.default.instancePath}`),k.var(l.default.parentData,(0,o._)`${l.default.valCxt}.${l.default.parentData}`),k.var(l.default.parentDataProperty,(0,o._)`${l.default.valCxt}.${l.default.parentDataProperty}`),k.var(l.default.rootData,(0,o._)`${l.default.valCxt}.${l.default.rootData}`),R.dynamicRef&&k.var(l.default.dynamicAnchors,(0,o._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{k.var(l.default.instancePath,(0,o._)`""`),k.var(l.default.parentData,(0,o._)`undefined`),k.var(l.default.parentDataProperty,(0,o._)`undefined`),k.var(l.default.rootData,l.default.data),R.dynamicRef&&k.var(l.default.dynamicAnchors,(0,o._)`{}`)})}function f(k){const{schema:R,opts:q,gen:M}=k;g(k,()=>{q.$comment&&R.$comment&&F(k),z(k),M.let(l.default.vErrors,null),M.let(l.default.errors,0),q.unevaluated&&p(k),O(k),U(k)})}function p(k){const{gen:R,validateName:q}=k;k.evaluated=R.const("evaluated",(0,o._)`${q}.evaluated`),R.if((0,o._)`${k.evaluated}.dynamicProps`,()=>R.assign((0,o._)`${k.evaluated}.props`,(0,o._)`undefined`)),R.if((0,o._)`${k.evaluated}.dynamicItems`,()=>R.assign((0,o._)`${k.evaluated}.items`,(0,o._)`undefined`))}function i(k,R){const q=typeof k=="object"&&k[R.schemaId];return q&&(R.code.source||R.code.process)?(0,o._)`/*# sourceURL=${q} */`:o.nil}function u(k,R){if(a(k)&&(P(k),y(k))){h(k,R);return}(0,e.boolOrEmptySchema)(k,R)}function y({schema:k,self:R}){if(typeof k=="boolean")return!k;for(const q in k)if(R.RULES.all[q])return!0;return!1}function a(k){return typeof k.schema!="boolean"}function h(k,R){const{schema:q,gen:M,opts:K}=k;K.$comment&&q.$comment&&F(k),C(k),V(k);const W=M.const("_errs",l.default.errors);O(k,W),M.var(R,(0,o._)`${W} === ${l.default.errors}`)}function P(k){(0,_.checkUnknownRules)(k),T(k)}function O(k,R){if(k.opts.jtd)return ie(k,[],!1,R);const q=(0,t.getSchemaTypes)(k.schema),M=(0,t.coerceAndCheckDataType)(k,q);ie(k,q,!M,R)}function T(k){const{schema:R,errSchemaPath:q,opts:M,self:K}=k;R.$ref&&M.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(R,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(k){const{schema:R,opts:q}=k;R.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(k,"default is ignored in the schema root")}function C(k){const R=k.schema[k.opts.schemaId];R&&(k.baseId=(0,$.resolveUrl)(k.opts.uriResolver,k.baseId,R))}function V(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:k,schemaEnv:R,schema:q,errSchemaPath:M,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,o._)`${l.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const re=(0,o.str)`${M}/$comment`,me=k.scopeValue("root",{ref:R.root});k.code((0,o._)`${l.default.self}.opts.$comment(${W}, ${re}, ${me}.schema)`)}}function U(k){const{gen:R,schemaEnv:q,validateName:M,ValidationError:K,opts:W}=k;q.$async?R.if((0,o._)`${l.default.errors} === 0`,()=>R.return(l.default.data),()=>R.throw((0,o._)`new ${K}(${l.default.vErrors})`)):(R.assign((0,o._)`${M}.errors`,l.default.vErrors),W.unevaluated&&Q(k),R.return((0,o._)`${l.default.errors} === 0`))}function Q({gen:k,evaluated:R,props:q,items:M}){q instanceof o.Name&&k.assign((0,o._)`${R}.props`,q),M instanceof o.Name&&k.assign((0,o._)`${R}.items`,M)}function ie(k,R,q,M){const{gen:K,schema:W,data:re,allErrors:me,opts:ce,self:de}=k,{RULES:ne}=de;if(W.$ref&&(ce.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,ne))){K.block(()=>L(k,"$ref",ne.all.$ref.definition));return}ce.jtd||X(k,R),K.block(()=>{for(const fe of ne.rules)Re(fe);Re(ne.post)});function Re(fe){(0,r.shouldUseGroup)(W,fe)&&(fe.type?(K.if((0,n.checkDataType)(fe.type,re,ce.strictNumbers)),oe(k,fe),R.length===1&&R[0]===fe.type&&q&&(K.else(),(0,n.reportTypeError)(k)),K.endIf()):oe(k,fe),me||K.if((0,o._)`${l.default.errors} === ${M||0}`))}}function oe(k,R){const{gen:q,schema:M,opts:{useDefaults:K}}=k;K&&(0,c.assignDefaults)(k,R.type),q.block(()=>{for(const W of R.rules)(0,r.shouldUseRule)(M,W)&&L(k,W.keyword,W.definition,R.type)})}function X(k,R){k.schemaEnv.meta||!k.opts.strictTypes||(pe(k,R),k.opts.allowUnionTypes||A(k,R),j(k,k.dataTypes))}function pe(k,R){if(R.length){if(!k.dataTypes.length){k.dataTypes=R;return}R.forEach(q=>{I(k.dataTypes,q)||S(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),m(k,R)}}function A(k,R){R.length>1&&!(R.length===2&&R.includes("null"))&&S(k,"use allowUnionTypes to allow union type keyword")}function j(k,R){const q=k.self.RULES.all;for(const M in q){const K=q[M];if(typeof K=="object"&&(0,r.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(re=>D(R,re))&&S(k,`missing type "${W.join(",")}" for keyword "${M}"`)}}}function D(k,R){return k.includes(R)||R==="number"&&k.includes("integer")}function I(k,R){return k.includes(R)||R==="integer"&&k.includes("number")}function m(k,R){const q=[];for(const M of k.dataTypes)I(R,M)?q.push(M):R.includes("integer")&&M==="number"&&q.push("integer");k.dataTypes=q}function S(k,R){const q=k.schemaEnv.baseId+k.errSchemaPath;R+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(k,R,k.opts.strictTypes)}class N{constructor(R,q,M){if((0,s.validateKeywordUsage)(R,q,M),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=M,this.data=R.data,this.schema=R.schema[M],this.$data=q.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(R,this.schema,M,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",B(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=R.gen.const("_errs",l.default.errors))}result(R,q,M){this.failResult((0,o.not)(R),q,M)}failResult(R,q,M){this.gen.if(R),M?M():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,o.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,o._)`${q} !== undefined && (${(0,o.or)(this.invalid$data(),R)})`)}error(R,q,M){if(q){this.setParams(q),this._error(R,M),this.setParams({});return}this._error(R,M)}_error(R,q){(R?E.reportExtraError:E.reportError)(this,this.def.error,q)}$dataError(){(0,E.reportError)(this,this.def.$dataError||E.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,E.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,M=o.nil){this.gen.block(()=>{this.check$data(R,M),q()})}check$data(R=o.nil,q=o.nil){if(!this.$data)return;const{gen:M,schemaCode:K,schemaType:W,def:re}=this;M.if((0,o.or)((0,o._)`${K} === undefined`,q)),R!==o.nil&&M.assign(R,!0),(W.length||re.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),R!==o.nil&&M.assign(R,!1)),M.else()}invalid$data(){const{gen:R,schemaCode:q,schemaType:M,def:K,it:W}=this;return(0,o.or)(re(),me());function re(){if(M.length){if(!(q instanceof o.Name))throw new Error("ajv implementation error");const ce=Array.isArray(M)?M:[M];return(0,o._)`${(0,n.checkDataTypes)(ce,q,W.opts.strictNumbers,n.DataType.Wrong)}`}return o.nil}function me(){if(K.validateSchema){const ce=R.scopeValue("validate$data",{ref:K.validateSchema});return(0,o._)`!${ce}(${q})`}return o.nil}}subschema(R,q){const M=(0,d.getSubschema)(this.it,R);(0,d.extendSubschemaData)(M,this.it,R),(0,d.extendSubschemaMode)(M,R);const K={...this.it,...M,items:void 0,props:void 0};return u(K,q),K}mergeEvaluated(R,q){const{it:M,gen:K}=this;M.opts.unevaluated&&(M.props!==!0&&R.props!==void 0&&(M.props=_.mergeEvaluated.props(K,R.props,M.props,q)),M.items!==!0&&R.items!==void 0&&(M.items=_.mergeEvaluated.items(K,R.items,M.items,q)))}mergeValidEvaluated(R,q){const{it:M,gen:K}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return K.if(q,()=>this.mergeEvaluated(R,o.Name)),!0}}ve.KeywordCxt=N;function L(k,R,q,M){const K=new N(k,q,R);"code"in q?q.code(K,M):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 J=/^\/(?:[^~]|~0|~1)*$/,x=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:R,dataNames:q,dataPathArr:M}){let K,W;if(k==="")return l.default.rootData;if(k[0]==="/"){if(!J.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);K=k,W=l.default.rootData}else{const de=x.exec(k);if(!de)throw new Error(`Invalid JSON-pointer: ${k}`);const ne=+de[1];if(K=de[2],K==="#"){if(ne>=R)throw new Error(ce("property/index",ne));return M[R-ne]}if(ne>R)throw new Error(ce("data",ne));if(W=q[R-ne],!K)return W}let re=W;const me=K.split("/");for(const de of me)de&&(W=(0,o._)`${W}${(0,o.getProperty)((0,_.unescapeJsonPointer)(de))}`,re=(0,o._)`${re} && ${W}`);return re;function ce(de,ne){return`Cannot access ${de} ${ne} levels up, current level is ${R}`}}return ve.getData=B,ve}var Ue={},Rr;function er(){if(Rr)return Ue;Rr=1,Object.defineProperty(Ue,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ue.default=e,Ue}var Le={},Ir;function Mt(){if(Ir)return Le;Ir=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=Tt();class t extends Error{constructor(n,c,s,d){super(d||`can't resolve reference ${s} from id ${c}`),this.missingRef=(0,e.resolveUrl)(n,c,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Le.default=t,Le}var le={},Or;function tr(){if(Or)return le;Or=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=G(),t=er(),r=Pe(),n=Tt(),c=Y(),s=At();class d{constructor(p){var i;this.refs={},this.dynamicAnchors={};let u;typeof p.schema=="object"&&(u=p.schema),this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(i=p.baseId)!==null&&i!==void 0?i:(0,n.normalizeId)(u?.[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=u?.$async,this.refs={}}}le.SchemaEnv=d;function o(f){const p=_.call(this,f);if(p)return p;const i=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:u,lines:y}=this.opts.code,{ownProperties:a}=this.opts,h=new e.CodeGen(this.scope,{es5:u,lines:y,ownProperties:a});let P;f.$async&&(P=h.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const O=h.scopeName("validate");f.validateName=O;const T={gen:h,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:h.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,e.stringify)(f.schema)}:{ref:f.schema}),validateName:O,ValidationError:P,schema:f.schema,schemaEnv:f,rootId:i,baseId:f.baseId||i,schemaPath:e.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(f),(0,s.validateFunctionCode)(T),h.optimize(this.opts.code.optimize);const C=h.toString();z=`${h.scopeRefs(r.default.scope)}return ${C}`,this.opts.code.process&&(z=this.opts.code.process(z,f));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=f.schema,F.schemaEnv=f,f.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:O,validateCode:C,scopeValues:h._values}),this.opts.unevaluated){const{props:U,items:Q}=T;F.evaluated={props:U instanceof e.Name?void 0:U,items:Q instanceof e.Name?void 0:Q,dynamicProps:U instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return f.validate=F,f}catch(C){throw delete f.validate,delete f.validateName,z&&this.logger.error("Error compiling schema, function code:",z),C}finally{this._compilations.delete(f)}}le.compileSchema=o;function l(f,p,i){var u;i=(0,n.resolveUrl)(this.opts.uriResolver,p,i);const y=f.refs[i];if(y)return y;let a=v.call(this,f,i);if(a===void 0){const h=(u=f.localRefs)===null||u===void 0?void 0:u[i],{schemaId:P}=this.opts;h&&(a=new d({schema:h,schemaId:P,root:f,baseId:p}))}if(a!==void 0)return f.refs[i]=$.call(this,a)}le.resolveRef=l;function $(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:o.call(this,f)}function _(f){for(const p of this._compilations)if(E(p,f))return p}le.getCompilingSchema=_;function E(f,p){return f.schema===p.schema&&f.root===p.root&&f.baseId===p.baseId}function v(f,p){let i;for(;typeof(i=this.refs[p])=="string";)p=i;return i||this.schemas[p]||g.call(this,f,p)}function g(f,p){const i=this.opts.uriResolver.parse(p),u=(0,n._getFullPath)(this.opts.uriResolver,i);let y=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&u===y)return w.call(this,i,f);const a=(0,n.normalizeId)(u),h=this.refs[a]||this.schemas[a];if(typeof h=="string"){const P=g.call(this,f,h);return typeof P?.schema!="object"?void 0:w.call(this,i,P)}if(typeof h?.schema=="object"){if(h.validate||o.call(this,h),a===(0,n.normalizeId)(p)){const{schema:P}=h,{schemaId:O}=this.opts,T=P[O];return T&&(y=(0,n.resolveUrl)(this.opts.uriResolver,y,T)),new d({schema:P,schemaId:O,root:f,baseId:y})}return w.call(this,i,h)}}le.resolveSchema=g;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(f,{baseId:p,schema:i,root:u}){var y;if(((y=f.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of f.fragment.slice(1).split("/")){if(typeof i=="boolean")return;const O=i[(0,c.unescapeFragment)(P)];if(O===void 0)return;i=O;const T=typeof i=="object"&&i[this.opts.schemaId];!b.has(P)&&T&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,T))}let a;if(typeof i!="boolean"&&i.$ref&&!(0,c.schemaHasRulesButRef)(i,this.RULES)){const P=(0,n.resolveUrl)(this.opts.uriResolver,p,i.$ref);a=g.call(this,u,P)}const{schemaId:h}=this.opts;if(a=a||new d({schema:i,schemaId:h,root:u,baseId:p}),a.schema!==a.root.schema)return a}return le}const gs="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",vs="Meta-schema for $data reference (JSON AnySchema extension proposal)",_s="object",$s=["$data"],bs={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ws=!1,Ps={$id:gs,description:vs,type:_s,required:$s,properties:bs,additionalProperties:ws};var Ke={},qe={exports:{}},Bt,Nr;function qn(){if(Nr)return Bt;Nr=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(v){let g="",b=0,w=0;for(w=0;w<v.length;w++)if(b=v[w].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";g+=v[w];break}for(w+=1;w<v.length;w++){if(b=v[w].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";g+=v[w]}return g}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function c(v){return v.length=0,!0}function s(v,g,b){if(v.length){const w=r(v);if(w!=="")g.push(w);else return b.error=!0,!1;v.length=0}return!0}function d(v){let g=0;const b={error:!1,address:"",zone:""},w=[],f=[];let p=!1,i=!1,u=s;for(let y=0;y<v.length;y++){const a=v[y];if(!(a==="["||a==="]"))if(a===":"){if(p===!0&&(i=!0),!u(f,w,b))break;if(++g>7){b.error=!0;break}y>0&&v[y-1]===":"&&(p=!0),w.push(":");continue}else if(a==="%"){if(!u(f,w,b))break;u=c}else{f.push(a);continue}}return f.length&&(u===c?b.zone=f.join(""):i?w.push(f.join("")):w.push(r(f))),b.address=w.join(""),b}function o(v){if(l(v,":")<2)return{host:v,isIPV6:!1};const g=d(v);if(g.error)return{host:v,isIPV6:!1};{let b=g.address,w=g.address;return g.zone&&(b+="%"+g.zone,w+="%25"+g.zone),{host:b,isIPV6:!0,escapedHost:w}}}function l(v,g){let b=0;for(let w=0;w<v.length;w++)v[w]===g&&b++;return b}function $(v){let g=v;const b=[];let w=-1,f=0;for(;f=g.length;){if(f===1){if(g===".")break;if(g==="/"){b.push("/");break}else{b.push(g);break}}else if(f===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){b.push("/");break}}else if(f===3&&g==="/.."){b.length!==0&&b.pop(),b.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),b.length!==0&&b.pop();continue}}if((w=g.indexOf("/",1))===-1){b.push(g);break}else b.push(g.slice(0,w)),g=g.slice(w)}return b.join("")}function _(v,g){const b=g!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=b(v.scheme)),v.userinfo!==void 0&&(v.userinfo=b(v.userinfo)),v.host!==void 0&&(v.host=b(v.host)),v.path!==void 0&&(v.path=b(v.path)),v.query!==void 0&&(v.query=b(v.query)),v.fragment!==void 0&&(v.fragment=b(v.fragment)),v}function E(v){const g=[];if(v.userinfo!==void 0&&(g.push(v.userinfo),g.push("@")),v.host!==void 0){let b=unescape(v.host);if(!t(b)){const w=o(b);w.isIPV6===!0?b=`[${w.escapedHost}]`:b=v.host}g.push(b)}return(typeof v.port=="number"||typeof v.port=="string")&&(g.push(":"),g.push(String(v.port))),g.length?g.join(""):void 0}return Bt={nonSimpleDomain:n,recomposeAuthority:E,normalizeComponentEncoding:_,removeDotSegments:$,isIPv4:t,isUUID:e,normalizeIPv6:o,stringArrayToHexStripped:r},Bt}var Yt,Cr;function Ss(){if(Cr)return Yt;Cr=1;const{isUUID:e}=qn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(a){return r.indexOf(a)!==-1}function c(a){return a.secure===!0?!0:a.secure===!1?!1:a.scheme?a.scheme.length===3&&(a.scheme[0]==="w"||a.scheme[0]==="W")&&(a.scheme[1]==="s"||a.scheme[1]==="S")&&(a.scheme[2]==="s"||a.scheme[2]==="S"):!1}function s(a){return a.host||(a.error=a.error||"HTTP URIs must have a host."),a}function d(a){const h=String(a.scheme).toLowerCase()==="https";return(a.port===(h?443:80)||a.port==="")&&(a.port=void 0),a.path||(a.path="/"),a}function o(a){return a.secure=c(a),a.resourceName=(a.path||"/")+(a.query?"?"+a.query:""),a.path=void 0,a.query=void 0,a}function l(a){if((a.port===(c(a)?443:80)||a.port==="")&&(a.port=void 0),typeof a.secure=="boolean"&&(a.scheme=a.secure?"wss":"ws",a.secure=void 0),a.resourceName){const[h,P]=a.resourceName.split("?");a.path=h&&h!=="/"?h:void 0,a.query=P,a.resourceName=void 0}return a.fragment=void 0,a}function $(a,h){if(!a.path)return a.error="URN can not be parsed",a;const P=a.path.match(t);if(P){const O=h.scheme||a.scheme||"urn";a.nid=P[1].toLowerCase(),a.nss=P[2];const T=`${O}:${h.nid||a.nid}`,z=y(T);a.path=void 0,z&&(a=z.parse(a,h))}else a.error=a.error||"URN can not be parsed.";return a}function _(a,h){if(a.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=h.scheme||a.scheme||"urn",O=a.nid.toLowerCase(),T=`${P}:${h.nid||O}`,z=y(T);z&&(a=z.serialize(a,h));const C=a,V=a.nss;return C.path=`${O||h.nid}:${V}`,h.skipEscape=!0,C}function E(a,h){const P=a;return P.uuid=P.nss,P.nss=void 0,!h.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function v(a){const h=a;return h.nss=(a.uuid||"").toLowerCase(),h}const g={scheme:"http",domainHost:!0,parse:s,serialize:d},b={scheme:"https",domainHost:g.domainHost,parse:s,serialize:d},w={scheme:"ws",domainHost:!0,parse:o,serialize:l},f={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},u={http:g,https:b,ws:w,wss:f,urn:{scheme:"urn",parse:$,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(u,null);function y(a){return a&&(u[a]||u[a.toLowerCase()])||void 0}return Yt={wsIsSecure:c,SCHEMES:u,isValidSchemeName:n,getSchemeHandler:y},Yt}var qr;function Es(){if(qr)return qe.exports;qr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:c,nonSimpleDomain:s}=qn(),{SCHEMES:d,getSchemeHandler:o}=Ss();function l(f,p){return typeof f=="string"?f=v(b(f,p),p):typeof f=="object"&&(f=b(v(f,p),p)),f}function $(f,p,i){const u=i?Object.assign({scheme:"null"},i):{scheme:"null"},y=_(b(f,u),b(p,u),u,!0);return u.skipEscape=!0,v(y,u)}function _(f,p,i,u){const y={};return u||(f=b(v(f,i),i),p=b(v(p,i),i)),i=i||{},!i.tolerant&&p.scheme?(y.scheme=p.scheme,y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=t(p.path||""),y.query=p.query):(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0?(y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=t(p.path||""),y.query=p.query):(p.path?(p.path[0]==="/"?y.path=t(p.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?y.path="/"+p.path:f.path?y.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+p.path:y.path=p.path,y.path=t(y.path)),y.query=p.query):(y.path=f.path,p.query!==void 0?y.query=p.query:y.query=f.query),y.userinfo=f.userinfo,y.host=f.host,y.port=f.port),y.scheme=f.scheme),y.fragment=p.fragment,y}function E(f,p,i){return typeof f=="string"?(f=unescape(f),f=v(n(b(f,i),!0),{...i,skipEscape:!0})):typeof f=="object"&&(f=v(n(f,!0),{...i,skipEscape:!0})),typeof p=="string"?(p=unescape(p),p=v(n(b(p,i),!0),{...i,skipEscape:!0})):typeof p=="object"&&(p=v(n(p,!0),{...i,skipEscape:!0})),f.toLowerCase()===p.toLowerCase()}function v(f,p){const i={host:f.host,scheme:f.scheme,userinfo:f.userinfo,port:f.port,path:f.path,query:f.query,nid:f.nid,nss:f.nss,uuid:f.uuid,fragment:f.fragment,reference:f.reference,resourceName:f.resourceName,secure:f.secure,error:""},u=Object.assign({},p),y=[],a=o(u.scheme||i.scheme);a&&a.serialize&&a.serialize(i,u),i.path!==void 0&&(u.skipEscape?i.path=unescape(i.path):(i.path=escape(i.path),i.scheme!==void 0&&(i.path=i.path.split("%3A").join(":")))),u.reference!=="suffix"&&i.scheme&&y.push(i.scheme,":");const h=r(i);if(h!==void 0&&(u.reference!=="suffix"&&y.push("//"),y.push(h),i.path&&i.path[0]!=="/"&&y.push("/")),i.path!==void 0){let P=i.path;!u.absolutePath&&(!a||!a.absolutePath)&&(P=t(P)),h===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return i.query!==void 0&&y.push("?",i.query),i.fragment!==void 0&&y.push("#",i.fragment),y.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(f,p){const i=Object.assign({},p),u={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;i.reference==="suffix"&&(i.scheme?f=i.scheme+":"+f:f="//"+f);const a=f.match(g);if(a){if(u.scheme=a[1],u.userinfo=a[3],u.host=a[4],u.port=parseInt(a[5],10),u.path=a[6]||"",u.query=a[7],u.fragment=a[8],isNaN(u.port)&&(u.port=a[5]),u.host)if(c(u.host)===!1){const O=e(u.host);u.host=O.host.toLowerCase(),y=O.isIPV6}else y=!0;u.scheme===void 0&&u.userinfo===void 0&&u.host===void 0&&u.port===void 0&&u.query===void 0&&!u.path?u.reference="same-document":u.scheme===void 0?u.reference="relative":u.fragment===void 0?u.reference="absolute":u.reference="uri",i.reference&&i.reference!=="suffix"&&i.reference!==u.reference&&(u.error=u.error||"URI is not a "+i.reference+" reference.");const h=o(i.scheme||u.scheme);if(!i.unicodeSupport&&(!h||!h.unicodeSupport)&&u.host&&(i.domainHost||h&&h.domainHost)&&y===!1&&s(u.host))try{u.host=URL.domainToASCII(u.host.toLowerCase())}catch(P){u.error=u.error||"Host's domain name can not be converted to ASCII: "+P}(!h||h&&!h.skipNormalize)&&(f.indexOf("%")!==-1&&(u.scheme!==void 0&&(u.scheme=unescape(u.scheme)),u.host!==void 0&&(u.host=unescape(u.host))),u.path&&(u.path=escape(unescape(u.path))),u.fragment&&(u.fragment=encodeURI(decodeURIComponent(u.fragment)))),h&&h.parse&&h.parse(u,i)}else u.error=u.error||"URI can not be parsed.";return u}const w={SCHEMES:d,normalize:l,resolve:$,resolveComponent:_,equal:E,serialize:v,parse:b};return qe.exports=w,qe.exports.default=w,qe.exports.fastUri=w,qe.exports}var Dr;function ks(){if(Dr)return Ke;Dr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=Es();return e.code='require("ajv/dist/runtime/uri").default',Ke.default=e,Ke}var Tr;function js(){return Tr||(Tr=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=At();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 n=er(),c=Mt(),s=On(),d=tr(),o=G(),l=Tt(),$=kt(),_=Y(),E=Ps,v=ks(),g=(A,j)=>new RegExp(A,j);g.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={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."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},i=200;function u(A){var j,D,I,m,S,N,L,J,x,B,k,R,q,M,K,W,re,me,ce,de,ne,Re,fe,Vt,zt;const Ne=A.strict,Ft=(j=A.code)===null||j===void 0?void 0:j.optimize,ar=Ft===!0||Ft===void 0?1:Ft||0,cr=(I=(D=A.code)===null||D===void 0?void 0:D.regExp)!==null&&I!==void 0?I:g,ls=(m=A.uriResolver)!==null&&m!==void 0?m:v.default;return{strictSchema:(N=(S=A.strictSchema)!==null&&S!==void 0?S:Ne)!==null&&N!==void 0?N:!0,strictNumbers:(J=(L=A.strictNumbers)!==null&&L!==void 0?L:Ne)!==null&&J!==void 0?J:!0,strictTypes:(B=(x=A.strictTypes)!==null&&x!==void 0?x:Ne)!==null&&B!==void 0?B:"log",strictTuples:(R=(k=A.strictTuples)!==null&&k!==void 0?k:Ne)!==null&&R!==void 0?R:"log",strictRequired:(M=(q=A.strictRequired)!==null&&q!==void 0?q:Ne)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:ar,regExp:cr}:{optimize:ar,regExp:cr},loopRequired:(K=A.loopRequired)!==null&&K!==void 0?K:i,loopEnum:(W=A.loopEnum)!==null&&W!==void 0?W:i,meta:(re=A.meta)!==null&&re!==void 0?re:!0,messages:(me=A.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ce=A.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(de=A.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(ne=A.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(Re=A.validateSchema)!==null&&Re!==void 0?Re:!0,validateFormats:(fe=A.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(Vt=A.unicodeRegExp)!==null&&Vt!==void 0?Vt:!0,int32range:(zt=A.int32range)!==null&&zt!==void 0?zt:!0,uriResolver:ls}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...u(j)};const{es5:D,lines:I}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:w,es5:D,lines:I}),this.logger=V(j.logger);const m=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),a.call(this,f,j,"NOT SUPPORTED"),a.call(this,p,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&T.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=m}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:I}=this.opts;let m=E;I==="id"&&(m={...E},m.id=m.$id,delete m.$id),D&&j&&this.addMetaSchema(m,m[I],!1)}defaultMeta(){const{meta:j,schemaId:D}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[D]||j:void 0}validate(j,D){let I;if(typeof j=="string"){if(I=this.getSchema(j),!I)throw new Error(`no schema with key or ref "${j}"`)}else I=this.compile(j);const m=I(D);return"$async"in I||(this.errors=I.errors),m}compile(j,D){const I=this._addSchema(j,D);return I.validate||this._compileSchemaEnv(I)}compileAsync(j,D){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:I}=this.opts;return m.call(this,j,D);async function m(B,k){await S.call(this,B.$schema);const R=this._addSchema(B,k);return R.validate||N.call(this,R)}async function S(B){B&&!this.getSchema(B)&&await m.call(this,{$ref:B},!0)}async function N(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof c.default))throw k;return L.call(this,k),await J.call(this,k.missingSchema),N.call(this,B)}}function L({missingSchema:B,missingRef:k}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${k} cannot be resolved`)}async function J(B){const k=await x.call(this,B);this.refs[B]||await S.call(this,k.$schema),this.refs[B]||this.addSchema(k,B,D)}async function x(B){const k=this._loading[B];if(k)return k;try{return await(this._loading[B]=I(B))}finally{delete this._loading[B]}}}addSchema(j,D,I,m=this.opts.validateSchema){if(Array.isArray(j)){for(const N of j)this.addSchema(N,void 0,I,m);return this}let S;if(typeof j=="object"){const{schemaId:N}=this.opts;if(S=j[N],S!==void 0&&typeof S!="string")throw new Error(`schema ${N} must be string`)}return D=(0,l.normalizeId)(D||S),this._checkUnique(D),this.schemas[D]=this._addSchema(j,I,D,m,!0),this}addMetaSchema(j,D,I=this.opts.validateSchema){return this.addSchema(j,D,!0,I),this}validateSchema(j,D){if(typeof j=="boolean")return!0;let I;if(I=j.$schema,I!==void 0&&typeof I!="string")throw new Error("$schema must be a string");if(I=I||this.opts.defaultMeta||this.defaultMeta(),!I)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const m=this.validate(I,j);if(!m&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return m}getSchema(j){let D;for(;typeof(D=h.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:I}=this.opts,m=new d.SchemaEnv({schema:{},schemaId:I});if(D=d.resolveSchema.call(this,m,j),!D)return;this.refs[j]=D}return D.validate||this._compileSchemaEnv(D)}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 D=h.call(this,j);return typeof D=="object"&&this._cache.delete(D.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const D=j;this._cache.delete(D);let I=j[this.opts.schemaId];return I&&(I=(0,l.normalizeId)(I),delete this.schemas[I],delete this.refs[I]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const D of j)this.addKeyword(D);return this}addKeyword(j,D){let I;if(typeof j=="string")I=j,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=I);else if(typeof j=="object"&&D===void 0){if(D=j,I=D.keyword,Array.isArray(I)&&!I.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(U.call(this,I,D),!D)return(0,_.eachItem)(I,S=>Q.call(this,S)),this;oe.call(this,D);const m={...D,type:(0,$.getJSONTypes)(D.type),schemaType:(0,$.getJSONTypes)(D.schemaType)};return(0,_.eachItem)(I,m.type.length===0?S=>Q.call(this,S,m):S=>m.type.forEach(N=>Q.call(this,S,m,N))),this}getKeyword(j){const D=this.RULES.all[j];return typeof D=="object"?D.definition:!!D}removeKeyword(j){const{RULES:D}=this;delete D.keywords[j],delete D.all[j];for(const I of D.rules){const m=I.rules.findIndex(S=>S.keyword===j);m>=0&&I.rules.splice(m,1)}return this}addFormat(j,D){return typeof D=="string"&&(D=new RegExp(D)),this.formats[j]=D,this}errorsText(j=this.errors,{separator:D=", ",dataVar:I="data"}={}){return!j||j.length===0?"No errors":j.map(m=>`${I}${m.instancePath} ${m.message}`).reduce((m,S)=>m+D+S)}$dataMetaSchema(j,D){const I=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const m of D){const S=m.split("/").slice(1);let N=j;for(const L of S)N=N[L];for(const L in I){const J=I[L];if(typeof J!="object")continue;const{$data:x}=J.definition,B=N[L];x&&B&&(N[L]=pe(B))}}return j}_removeAllSchemas(j,D){for(const I in j){const m=j[I];(!D||D.test(I))&&(typeof m=="string"?delete j[I]:m&&!m.meta&&(this._cache.delete(m.schema),delete j[I]))}}_addSchema(j,D,I,m=this.opts.validateSchema,S=this.opts.addUsedSchema){let N;const{schemaId:L}=this.opts;if(typeof j=="object")N=j[L];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 J=this._cache.get(j);if(J!==void 0)return J;I=(0,l.normalizeId)(N||I);const x=l.getSchemaRefs.call(this,j,I);return J=new d.SchemaEnv({schema:j,schemaId:L,meta:D,baseId:I,localRefs:x}),this._cache.set(J.schema,J),S&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=J),m&&this.validateSchema(j,!0),J}_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):d.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const D=this.opts;this.opts=this._metaOpts;try{d.compileSchema.call(this,j)}finally{this.opts=D}}}y.ValidationError=n.default,y.MissingRefError=c.default,e.default=y;function a(A,j,D,I="error"){for(const m in A){const S=m;S in j&&this.logger[I](`${D}: option ${m}. ${A[S]}`)}}function h(A){return A=(0,l.normalizeId)(A),this.schemas[A]||this.refs[A]}function P(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const j in A)this.addSchema(A[j],j)}function O(){for(const A in this.opts.formats){const j=this.opts.formats[A];j&&this.addFormat(A,j)}}function T(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in A){const D=A[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const A={...this.opts};for(const j of b)delete A[j];return A}const C={log(){},warn(){},error(){}};function V(A){if(A===!1)return C;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function U(A,j){const{RULES:D}=this;if((0,_.eachItem)(A,I=>{if(D.keywords[I])throw new Error(`Keyword ${I} is already defined`);if(!F.test(I))throw new Error(`Keyword ${I} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function Q(A,j,D){var I;const m=j?.post;if(D&&m)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let N=m?S.post:S.rules.find(({type:J})=>J===D);if(N||(N={type:D,rules:[]},S.rules.push(N)),S.keywords[A]=!0,!j)return;const L={keyword:A,definition:{...j,type:(0,$.getJSONTypes)(j.type),schemaType:(0,$.getJSONTypes)(j.schemaType)}};j.before?ie.call(this,N,L,j.before):N.rules.push(L),S.all[A]=L,(I=j.implements)===null||I===void 0||I.forEach(J=>this.addKeyword(J))}function ie(A,j,D){const I=A.rules.findIndex(m=>m.keyword===D);I>=0?A.rules.splice(I,0,j):(A.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function oe(A){let{metaSchema:j}=A;j!==void 0&&(A.$data&&this.opts.$data&&(j=pe(j)),A.validateSchema=this.compile(j,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(A){return{anyOf:[A,X]}}})(Ut)),Ut}var Je={},He={},Ge={},Ar;function Rs(){if(Ar)return Ge;Ar=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ge.default=e,Ge}var be={},Mr;function Is(){if(Mr)return be;Mr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.callRef=be.getValidate=void 0;const e=Mt(),t=ge(),r=G(),n=Pe(),c=tr(),s=Y(),d={keyword:"$ref",schemaType:"string",code($){const{gen:_,schema:E,it:v}=$,{baseId:g,schemaEnv:b,validateName:w,opts:f,self:p}=v,{root:i}=b;if((E==="#"||E==="#/")&&g===i.baseId)return y();const u=c.resolveRef.call(p,i,g,E);if(u===void 0)throw new e.default(v.opts.uriResolver,g,E);if(u instanceof c.SchemaEnv)return a(u);return h(u);function y(){if(b===i)return l($,w,b,b.$async);const P=_.scopeValue("root",{ref:i});return l($,(0,r._)`${P}.validate`,i,i.$async)}function a(P){const O=o($,P);l($,O,P,P.$async)}function h(P){const O=_.scopeValue("schema",f.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),T=_.name("valid"),z=$.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:O,errSchemaPath:E},T);$.mergeEvaluated(z),$.ok(T)}}};function o($,_){const{gen:E}=$;return _.validate?E.scopeValue("validate",{ref:_.validate}):(0,r._)`${E.scopeValue("wrapper",{ref:_})}.validate`}be.getValidate=o;function l($,_,E,v){const{gen:g,it:b}=$,{allErrors:w,schemaEnv:f,opts:p}=b,i=p.passContext?n.default.this:r.nil;v?u():y();function u(){if(!f.$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)($,_,i)}`),h(_),w||g.assign(P,!0)},O=>{g.if((0,r._)`!(${O} instanceof ${b.ValidationError})`,()=>g.throw(O)),a(O),w||g.assign(P,!1)}),$.ok(P)}function y(){$.result((0,t.callValidateCode)($,_,i),()=>h(_),()=>a(_))}function a(P){const O=(0,r._)`${P}.errors`;g.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${O} : ${n.default.vErrors}.concat(${O})`),g.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function h(P){var O;if(!b.opts.unevaluated)return;const T=(O=E?.validate)===null||O===void 0?void 0:O.evaluated;if(b.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(b.props=s.mergeEvaluated.props(g,T.props,b.props));else{const z=g.var("props",(0,r._)`${P}.evaluated.props`);b.props=s.mergeEvaluated.props(g,z,b.props,r.Name)}if(b.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(b.items=s.mergeEvaluated.items(g,T.items,b.items));else{const z=g.var("items",(0,r._)`${P}.evaluated.items`);b.items=s.mergeEvaluated.items(g,z,b.items,r.Name)}}}return be.callRef=l,be.default=d,be}var Vr;function Os(){if(Vr)return He;Vr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=Rs(),t=Is(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return He.default=r,He}var We={},Be={},zr;function Ns(){if(zr)return Be;zr=1,Object.defineProperty(Be,"__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}},n={message:({keyword:s,schemaCode:d})=>(0,e.str)`must be ${r[s].okStr} ${d}`,params:({keyword:s,schemaCode:d})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${d}}`},c={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:d,data:o,schemaCode:l}=s;s.fail$data((0,e._)`${o} ${r[d].fail} ${l} || isNaN(${o})`)}};return Be.default=c,Be}var Ye={},Fr;function Cs(){if(Fr)return Ye;Fr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=G(),r={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:c,data:s,schemaCode:d,it:o}=n,l=o.opts.multipleOfPrecision,$=c.let("res"),_=l?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${l}`:(0,e._)`${$} !== parseInt(${$})`;n.fail$data((0,e._)`(${d} === 0 || (${$} = ${s}/${d}, ${_}))`)}};return Ye.default=r,Ye}var xe={},Qe={},Ur;function qs(){if(Ur)return Qe;Ur=1,Object.defineProperty(Qe,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,c=0,s;for(;c<r;)n++,s=t.charCodeAt(c++),s>=55296&&s<=56319&&c<r&&(s=t.charCodeAt(c),(s&64512)===56320&&c++);return n}return Qe.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Qe}var Lr;function Ds(){if(Lr)return xe;Lr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=G(),t=Y(),r=qs(),c={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:d}){const o=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${d} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:d,data:o,schemaCode:l,it:$}=s,_=d==="maxLength"?e.operators.GT:e.operators.LT,E=$.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${o})`;s.fail$data((0,e._)`${E} ${_} ${l}`)}};return xe.default=c,xe}var Ze={},Kr;function Ts(){if(Kr)return Ze;Kr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=ge(),t=G(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:c})=>(0,t.str)`must match pattern "${c}"`,params:({schemaCode:c})=>(0,t._)`{pattern: ${c}}`},code(c){const{data:s,$data:d,schema:o,schemaCode:l,it:$}=c,_=$.opts.unicodeRegExp?"u":"",E=d?(0,t._)`(new RegExp(${l}, ${_}))`:(0,e.usePattern)(c,o);c.fail$data((0,t._)`!${E}.test(${s})`)}};return Ze.default=n,Ze}var Xe={},Jr;function As(){if(Jr)return Xe;Jr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:c}){const s=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${c} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:c,data:s,schemaCode:d}=n,o=c==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${o} ${d}`)}};return Xe.default=r,Xe}var et={},Hr;function Ms(){if(Hr)return et;Hr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=ge(),t=G(),r=Y(),c={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:d,schema:o,schemaCode:l,data:$,$data:_,it:E}=s,{opts:v}=E;if(!_&&o.length===0)return;const g=o.length>=v.loopRequired;if(E.allErrors?b():w(),v.strictRequired){const i=s.parentSchema.properties,{definedProperties:u}=s.it;for(const y of o)if(i?.[y]===void 0&&!u.has(y)){const a=E.schemaEnv.baseId+E.errSchemaPath,h=`required property "${y}" is not defined at "${a}" (strictRequired)`;(0,r.checkStrictMode)(E,h,E.opts.strictRequired)}}function b(){if(g||_)s.block$data(t.nil,f);else for(const i of o)(0,e.checkReportMissingProp)(s,i)}function w(){const i=d.let("missing");if(g||_){const u=d.let("valid",!0);s.block$data(u,()=>p(i,u)),s.ok(u)}else d.if((0,e.checkMissingProp)(s,o,i)),(0,e.reportMissingProp)(s,i),d.else()}function f(){d.forOf("prop",l,i=>{s.setParams({missingProperty:i}),d.if((0,e.noPropertyInData)(d,$,i,v.ownProperties),()=>s.error())})}function p(i,u){s.setParams({missingProperty:i}),d.forOf(i,l,()=>{d.assign(u,(0,e.propertyInData)(d,$,i,v.ownProperties)),d.if((0,t.not)(u),()=>{s.error(),d.break()})},t.nil)}}};return et.default=c,et}var tt={},Gr;function Vs(){if(Gr)return tt;Gr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=G(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:c}){const s=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${c} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:c,data:s,schemaCode:d}=n,o=c==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${s}.length ${o} ${d}`)}};return tt.default=r,tt}var rt={},nt={},Wr;function rr(){if(Wr)return nt;Wr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=Cn();return e.code='require("ajv/dist/runtime/equal").default',nt.default=e,nt}var Br;function zs(){if(Br)return rt;Br=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=kt(),t=G(),r=Y(),n=rr(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:d,j:o}})=>(0,t.str)`must NOT have duplicate items (items ## ${o} and ${d} are identical)`,params:({params:{i:d,j:o}})=>(0,t._)`{i: ${d}, j: ${o}}`},code(d){const{gen:o,data:l,$data:$,schema:_,parentSchema:E,schemaCode:v,it:g}=d;if(!$&&!_)return;const b=o.let("valid"),w=E.items?(0,e.getSchemaTypes)(E.items):[];d.block$data(b,f,(0,t._)`${v} === false`),d.ok(b);function f(){const y=o.let("i",(0,t._)`${l}.length`),a=o.let("j");d.setParams({i:y,j:a}),o.assign(b,!0),o.if((0,t._)`${y} > 1`,()=>(p()?i:u)(y,a))}function p(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function i(y,a){const h=o.name("item"),P=(0,e.checkDataTypes)(w,h,g.opts.strictNumbers,e.DataType.Wrong),O=o.const("indices",(0,t._)`{}`);o.for((0,t._)`;${y}--;`,()=>{o.let(h,(0,t._)`${l}[${y}]`),o.if(P,(0,t._)`continue`),w.length>1&&o.if((0,t._)`typeof ${h} == "string"`,(0,t._)`${h} += "_"`),o.if((0,t._)`typeof ${O}[${h}] == "number"`,()=>{o.assign(a,(0,t._)`${O}[${h}]`),d.error(),o.assign(b,!1).break()}).code((0,t._)`${O}[${h}] = ${y}`)})}function u(y,a){const h=(0,r.useFunc)(o,n.default),P=o.name("outer");o.label(P).for((0,t._)`;${y}--;`,()=>o.for((0,t._)`${a} = ${y}; ${a}--;`,()=>o.if((0,t._)`${h}(${l}[${y}], ${l}[${a}])`,()=>{d.error(),o.assign(b,!1).break(P)})))}}};return rt.default=s,rt}var st={},Yr;function Fs(){if(Yr)return st;Yr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=G(),t=Y(),r=rr(),c={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:d,data:o,$data:l,schemaCode:$,schema:_}=s;l||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(d,r.default)}(${o}, ${$})`):s.fail((0,e._)`${_} !== ${o}`)}};return st.default=c,st}var it={},xr;function Us(){if(xr)return it;xr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=G(),t=Y(),r=rr(),c={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:d,data:o,$data:l,schema:$,schemaCode:_,it:E}=s;if(!l&&$.length===0)throw new Error("enum must have non-empty array");const v=$.length>=E.opts.loopEnum;let g;const b=()=>g??(g=(0,t.useFunc)(d,r.default));let w;if(v||l)w=d.let("valid"),s.block$data(w,f);else{if(!Array.isArray($))throw new Error("ajv implementation error");const i=d.const("vSchema",_);w=(0,e.or)(...$.map((u,y)=>p(i,y)))}s.pass(w);function f(){d.assign(w,!1),d.forOf("v",_,i=>d.if((0,e._)`${b()}(${o}, ${i})`,()=>d.assign(w,!0).break()))}function p(i,u){const y=$[u];return typeof y=="object"&&y!==null?(0,e._)`${b()}(${o}, ${i}[${u}])`:(0,e._)`${o} === ${y}`}}};return it.default=c,it}var Qr;function Ls(){if(Qr)return We;Qr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=Ns(),t=Cs(),r=Ds(),n=Ts(),c=As(),s=Ms(),d=Vs(),o=zs(),l=Fs(),$=Us(),_=[e.default,t.default,r.default,n.default,c.default,s.default,d.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,$.default];return We.default=_,We}var ot={},Ie={},Zr;function Dn(){if(Zr)return Ie;Zr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateAdditionalItems=void 0;const e=G(),t=Y(),n={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:d,it:o}=s,{items:l}=d;if(!Array.isArray(l)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}c(s,l)}};function c(s,d){const{gen:o,schema:l,data:$,keyword:_,it:E}=s;E.items=!0;const v=o.const("len",(0,e._)`${$}.length`);if(l===!1)s.setParams({len:d.length}),s.pass((0,e._)`${v} <= ${d.length}`);else if(typeof l=="object"&&!(0,t.alwaysValidSchema)(E,l)){const b=o.var("valid",(0,e._)`${v} <= ${d.length}`);o.if((0,e.not)(b),()=>g(b)),s.ok(b)}function g(b){o.forRange("i",d.length,v,w=>{s.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},b),E.allErrors||o.if((0,e.not)(b),()=>o.break())})}}return Ie.validateAdditionalItems=c,Ie.default=n,Ie}var at={},Oe={},Xr;function Tn(){if(Xr)return Oe;Xr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.validateTuple=void 0;const e=G(),t=Y(),r=ge(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:d,it:o}=s;if(Array.isArray(d))return c(s,"additionalItems",d);o.items=!0,!(0,t.alwaysValidSchema)(o,d)&&s.ok((0,r.validateArray)(s))}};function c(s,d,o=s.schema){const{gen:l,parentSchema:$,data:_,keyword:E,it:v}=s;w($),v.opts.unevaluated&&o.length&&v.items!==!0&&(v.items=t.mergeEvaluated.items(l,o.length,v.items));const g=l.name("valid"),b=l.const("len",(0,e._)`${_}.length`);o.forEach((f,p)=>{(0,t.alwaysValidSchema)(v,f)||(l.if((0,e._)`${b} > ${p}`,()=>s.subschema({keyword:E,schemaProp:p,dataProp:p},g)),s.ok(g))});function w(f){const{opts:p,errSchemaPath:i}=v,u=o.length,y=u===f.minItems&&(u===f.maxItems||f[d]===!1);if(p.strictTuples&&!y){const a=`"${E}" is ${u}-tuple, but minItems or maxItems/${d} are not specified or different at path "${i}"`;(0,t.checkStrictMode)(v,a,p.strictTuples)}}}return Oe.validateTuple=c,Oe.default=n,Oe}var en;function Ks(){if(en)return at;en=1,Object.defineProperty(at,"__esModule",{value:!0});const e=Tn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return at.default=t,at}var ct={},tn;function Js(){if(tn)return ct;tn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=G(),t=Y(),r=ge(),n=Dn(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:d}})=>(0,e.str)`must NOT have more than ${d} items`,params:({params:{len:d}})=>(0,e._)`{limit: ${d}}`},code(d){const{schema:o,parentSchema:l,it:$}=d,{prefixItems:_}=l;$.items=!0,!(0,t.alwaysValidSchema)($,o)&&(_?(0,n.validateAdditionalItems)(d,_):d.ok((0,r.validateArray)(d)))}};return ct.default=s,ct}var dt={},rn;function Hs(){if(rn)return dt;rn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:c,max:s}})=>s===void 0?(0,e.str)`must contain at least ${c} valid item(s)`:(0,e.str)`must contain at least ${c} and no more than ${s} valid item(s)`,params:({params:{min:c,max:s}})=>s===void 0?(0,e._)`{minContains: ${c}}`:(0,e._)`{minContains: ${c}, maxContains: ${s}}`},code(c){const{gen:s,schema:d,parentSchema:o,data:l,it:$}=c;let _,E;const{minContains:v,maxContains:g}=o;$.opts.next?(_=v===void 0?1:v,E=g):_=1;const b=s.const("len",(0,e._)`${l}.length`);if(c.setParams({min:_,max:E}),E===void 0&&_===0){(0,t.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&_>E){(0,t.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),c.fail();return}if((0,t.alwaysValidSchema)($,d)){let u=(0,e._)`${b} >= ${_}`;E!==void 0&&(u=(0,e._)`${u} && ${b} <= ${E}`),c.pass(u);return}$.items=!0;const w=s.name("valid");E===void 0&&_===1?p(w,()=>s.if(w,()=>s.break())):_===0?(s.let(w,!0),E!==void 0&&s.if((0,e._)`${l}.length > 0`,f)):(s.let(w,!1),f()),c.result(w,()=>c.reset());function f(){const u=s.name("_valid"),y=s.let("count",0);p(u,()=>s.if(u,()=>i(y)))}function p(u,y){s.forRange("i",0,b,a=>{c.subschema({keyword:"contains",dataProp:a,dataPropType:t.Type.Num,compositeRule:!0},u),y()})}function i(u){s.code((0,e._)`${u}++`),E===void 0?s.if((0,e._)`${u} >= ${_}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${u} > ${E}`,()=>s.assign(w,!1).break()),_===1?s.assign(w,!0):s.if((0,e._)`${u} >= ${_}`,()=>s.assign(w,!0)))}}};return dt.default=n,dt}var xt={},nn;function Gs(){return nn||(nn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),r=Y(),n=ge();e.error={message:({params:{property:l,depsCount:$,deps:_}})=>{const E=$===1?"property":"properties";return(0,t.str)`must have ${E} ${_} when property ${l} is present`},params:({params:{property:l,depsCount:$,deps:_,missingProperty:E}})=>(0,t._)`{property: ${l},
|
|
6
6
|
missingProperty: ${E},
|
|
7
7
|
depsCount: ${$},
|
|
8
|
-
deps: ${b}}`};const p={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(f){const[$,b]=n(f);u(f,$),o(f,b)}};function n({schema:f}){const $={},b={};for(const E in f){if(E==="__proto__")continue;const _=Array.isArray(f[E])?$:b;_[E]=f[E]}return[$,b]}function u(f,$=f.schema){const{gen:b,data:E,it:_}=f;if(Object.keys($).length===0)return;const v=b.let("missing");for(const w in $){const y=$[w];if(y.length===0)continue;const c=(0,i.propertyInData)(b,E,w,_.opts.ownProperties);f.setParams({property:w,depsCount:y.length,deps:y.join(", ")}),_.allErrors?b.if(c,()=>{for(const l of y)(0,i.checkReportMissingProp)(f,l)}):(b.if((0,t._)`${c} && (${(0,i.checkMissingProp)(f,y,v)})`),(0,i.reportMissingProp)(f,v),b.else())}}e.validatePropertyDeps=u;function o(f,$=f.schema){const{gen:b,data:E,keyword:_,it:v}=f,w=b.name("valid");for(const y in $)(0,r.alwaysValidSchema)(v,$[y])||(b.if((0,i.propertyInData)(b,E,y,v.opts.ownProperties),()=>{const c=f.subschema({keyword:_,schemaProp:y},w);f.mergeValidEvaluated(c,w)},()=>b.var(w,!0)),f.ok(w))}e.validateSchemaDeps=o,e.default=p})(xt)),xt}var ut={},sn;function Gs(){if(sn)return ut;sn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=G(),t=Y(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:p})=>(0,e._)`{propertyName: ${p.propertyName}}`},code(p){const{gen:n,schema:u,data:o,it:f}=p;if((0,t.alwaysValidSchema)(f,u))return;const $=n.name("valid");n.forIn("key",o,b=>{p.setParams({propertyName:b}),p.subschema({keyword:"propertyNames",data:b,dataTypes:["string"],propertyName:b,compositeRule:!0},$),n.if((0,e.not)($),()=>{p.error(!0),f.allErrors||n.break()})}),p.ok($)}};return ut.default=i,ut}var lt={},on;function Tn(){if(on)return lt;on=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=ge(),t=G(),r=Se(),i=Y(),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:u})=>(0,t._)`{additionalProperty: ${u.additionalProperty}}`},code(u){const{gen:o,schema:f,parentSchema:$,data:b,errsCount:E,it:_}=u;if(!E)throw new Error("ajv implementation error");const{allErrors:v,opts:w}=_;if(_.props=!0,w.removeAdditional!=="all"&&(0,i.alwaysValidSchema)(_,f))return;const y=(0,e.allSchemaProperties)($.properties),c=(0,e.allSchemaProperties)($.patternProperties);l(),u.ok((0,t._)`${E} === ${r.default.errors}`);function l(){o.forIn("key",b,h=>{!y.length&&!c.length?g(h):o.if(s(h),()=>g(h))})}function s(h){let P;if(y.length>8){const O=(0,i.schemaRefOrVal)(_,$.properties,"properties");P=(0,e.isOwnProperty)(o,O,h)}else y.length?P=(0,t.or)(...y.map(O=>(0,t._)`${h} === ${O}`)):P=t.nil;return c.length&&(P=(0,t.or)(P,...c.map(O=>(0,t._)`${(0,e.usePattern)(u,O)}.test(${h})`))),(0,t.not)(P)}function d(h){o.code((0,t._)`delete ${b}[${h}]`)}function g(h){if(w.removeAdditional==="all"||w.removeAdditional&&f===!1){d(h);return}if(f===!1){u.setParams({additionalProperty:h}),u.error(),v||o.break();return}if(typeof f=="object"&&!(0,i.alwaysValidSchema)(_,f)){const P=o.name("valid");w.removeAdditional==="failing"?(a(h,P,!1),o.if((0,t.not)(P),()=>{u.reset(),d(h)})):(a(h,P),v||o.if((0,t.not)(P),()=>o.break()))}}function a(h,P,O){const T={keyword:"additionalProperties",dataProp:h,dataPropType:i.Type.Str};O===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),u.subschema(T,P)}}};return lt.default=n,lt}var ft={},an;function Ws(){if(an)return ft;an=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=At(),t=ge(),r=Y(),i=Tn(),p={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:u,schema:o,parentSchema:f,data:$,it:b}=n;b.opts.removeAdditional==="all"&&f.additionalProperties===void 0&&i.default.code(new e.KeywordCxt(b,i.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(o);for(const c of E)b.definedProperties.add(c);b.opts.unevaluated&&E.length&&b.props!==!0&&(b.props=r.mergeEvaluated.props(u,(0,r.toHash)(E),b.props));const _=E.filter(c=>!(0,r.alwaysValidSchema)(b,o[c]));if(_.length===0)return;const v=u.name("valid");for(const c of _)w(c)?y(c):(u.if((0,t.propertyInData)(u,$,c,b.opts.ownProperties)),y(c),b.allErrors||u.else().var(v,!0),u.endIf()),n.it.definedProperties.add(c),n.ok(v);function w(c){return b.opts.useDefaults&&!b.compositeRule&&o[c].default!==void 0}function y(c){n.subschema({keyword:"properties",schemaProp:c,dataProp:c},v)}}};return ft.default=p,ft}var pt={},cn;function Bs(){if(cn)return pt;cn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=ge(),t=G(),r=Y(),i=Y(),p={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:u,schema:o,data:f,parentSchema:$,it:b}=n,{opts:E}=b,_=(0,e.allSchemaProperties)(o),v=_.filter(g=>(0,r.alwaysValidSchema)(b,o[g]));if(_.length===0||v.length===_.length&&(!b.opts.unevaluated||b.props===!0))return;const w=E.strictSchema&&!E.allowMatchingProperties&&$.properties,y=u.name("valid");b.props!==!0&&!(b.props instanceof t.Name)&&(b.props=(0,i.evaluatedPropsToName)(u,b.props));const{props:c}=b;l();function l(){for(const g of _)w&&s(g),b.allErrors?d(g):(u.var(y,!0),d(g),u.if(y))}function s(g){for(const a in w)new RegExp(g).test(a)&&(0,r.checkStrictMode)(b,`property ${a} matches pattern ${g} (use allowMatchingProperties)`)}function d(g){u.forIn("key",f,a=>{u.if((0,t._)`${(0,e.usePattern)(n,g)}.test(${a})`,()=>{const h=v.includes(g);h||n.subschema({keyword:"patternProperties",schemaProp:g,dataProp:a,dataPropType:i.Type.Str},y),b.opts.unevaluated&&c!==!0?u.assign((0,t._)`${c}[${a}]`,!0):!h&&!b.allErrors&&u.if((0,t.not)(y),()=>u.break())})})}}};return pt.default=p,pt}var mt={},dn;function Ys(){if(dn)return mt;dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:i,schema:p,it:n}=r;if((0,e.alwaysValidSchema)(n,p)){r.fail();return}const u=i.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},u),r.failResult(u,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return mt.default=t,mt}var ht={},un;function xs(){if(un)return ht;un=1,Object.defineProperty(ht,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ge().validateUnion,error:{message:"must match a schema in anyOf"}};return ht.default=t,ht}var yt={},ln;function Qs(){if(ln)return yt;ln=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=G(),t=Y(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:p})=>(0,e._)`{passingSchemas: ${p.passing}}`},code(p){const{gen:n,schema:u,parentSchema:o,it:f}=p;if(!Array.isArray(u))throw new Error("ajv implementation error");if(f.opts.discriminator&&o.discriminator)return;const $=u,b=n.let("valid",!1),E=n.let("passing",null),_=n.name("_valid");p.setParams({passing:E}),n.block(v),p.result(b,()=>p.reset(),()=>p.error(!0));function v(){$.forEach((w,y)=>{let c;(0,t.alwaysValidSchema)(f,w)?n.var(_,!0):c=p.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},_),y>0&&n.if((0,e._)`${_} && ${b}`).assign(b,!1).assign(E,(0,e._)`[${E}, ${y}]`).else(),n.if(_,()=>{n.assign(b,!0),n.assign(E,y),c&&p.mergeEvaluated(c,e.Name)})})}}};return yt.default=i,yt}var gt={},fn;function Zs(){if(fn)return gt;fn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:i,schema:p,it:n}=r;if(!Array.isArray(p))throw new Error("ajv implementation error");const u=i.name("valid");p.forEach((o,f)=>{if((0,e.alwaysValidSchema)(n,o))return;const $=r.subschema({keyword:"allOf",schemaProp:f},u);r.ok(u),r.mergeEvaluated($)})}};return gt.default=t,gt}var vt={},pn;function Xs(){if(pn)return vt;pn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=G(),t=Y(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:n})=>(0,e.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,e._)`{failingKeyword: ${n.ifClause}}`},code(n){const{gen:u,parentSchema:o,it:f}=n;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(f,'"if" without "then" and "else" is ignored');const $=p(f,"then"),b=p(f,"else");if(!$&&!b)return;const E=u.let("valid",!0),_=u.name("_valid");if(v(),n.reset(),$&&b){const y=u.let("ifClause");n.setParams({ifClause:y}),u.if(_,w("then",y),w("else",y))}else $?u.if(_,w("then")):u.if((0,e.not)(_),w("else"));n.pass(E,()=>n.error(!0));function v(){const y=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);n.mergeEvaluated(y)}function w(y,c){return()=>{const l=n.subschema({keyword:y},_);u.assign(E,_),n.mergeValidEvaluated(l,E),c?u.assign(c,(0,e._)`${y}`):n.setParams({ifClause:y})}}}};function p(n,u){const o=n.schema[u];return o!==void 0&&!(0,t.alwaysValidSchema)(n,o)}return vt.default=i,vt}var _t={},mn;function ei(){if(mn)return _t;mn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:i,it:p}){i.if===void 0&&(0,e.checkStrictMode)(p,`"${r}" without "if" is ignored`)}};return _t.default=t,_t}var hn;function ti(){if(hn)return ot;hn=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=qn(),t=Ls(),r=Dn(),i=Ks(),p=Js(),n=Hs(),u=Gs(),o=Tn(),f=Ws(),$=Bs(),b=Ys(),E=xs(),_=Qs(),v=Zs(),w=Xs(),y=ei();function c(l=!1){const s=[b.default,E.default,_.default,v.default,w.default,y.default,u.default,o.default,n.default,f.default,$.default];return l?s.push(t.default,i.default):s.push(e.default,r.default),s.push(p.default),s}return ot.default=c,ot}var $t={},bt={},yn;function ri(){if(yn)return bt;yn=1,Object.defineProperty(bt,"__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,p){const{gen:n,data:u,$data:o,schema:f,schemaCode:$,it:b}=i,{opts:E,errSchemaPath:_,schemaEnv:v,self:w}=b;if(!E.validateFormats)return;o?y():c();function y(){const l=n.scopeValue("formats",{ref:w.formats,code:E.code.formats}),s=n.const("fDef",(0,e._)`${l}[${$}]`),d=n.let("fType"),g=n.let("format");n.if((0,e._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>n.assign(d,(0,e._)`${s}.type || "string"`).assign(g,(0,e._)`${s}.validate`),()=>n.assign(d,(0,e._)`"string"`).assign(g,s)),i.fail$data((0,e.or)(a(),h()));function a(){return E.strictSchema===!1?e.nil:(0,e._)`${$} && !${g}`}function h(){const P=v.$async?(0,e._)`(${s}.async ? await ${g}(${u}) : ${g}(${u}))`:(0,e._)`${g}(${u})`,O=(0,e._)`(typeof ${g} == "function" ? ${P} : ${g}.test(${u}))`;return(0,e._)`${g} && ${g} !== true && ${d} === ${p} && !${O}`}}function c(){const l=w.formats[f];if(!l){a();return}if(l===!0)return;const[s,d,g]=h(l);s===p&&i.pass(P());function a(){if(E.strictSchema===!1){w.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${f}" ignored in schema at path "${_}"`}}function h(O){const T=O instanceof RegExp?(0,e.regexpCode)(O):E.code.formats?(0,e._)`${E.code.formats}${(0,e.getProperty)(f)}`:void 0,z=n.scopeValue("formats",{key:f,ref:O,code:T});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,e._)`${z}.validate`]:["string",O,z]}function P(){if(typeof l=="object"&&!(l instanceof RegExp)&&l.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${g}(${u})`}return typeof d=="function"?(0,e._)`${g}(${u})`:(0,e._)`${g}.test(${u})`}}}};return bt.default=r,bt}var gn;function ni(){if(gn)return $t;gn=1,Object.defineProperty($t,"__esModule",{value:!0});const t=[ri().default];return $t.default=t,$t}var je={},vn;function si(){return vn||(vn=1,Object.defineProperty(je,"__esModule",{value:!0}),je.contentVocabulary=je.metadataVocabulary=void 0,je.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],je.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),je}var _n;function ii(){if(_n)return Je;_n=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=Is(),t=Us(),r=ti(),i=ni(),p=si(),n=[e.default,t.default,(0,r.default)(),i.default,p.metadataVocabulary,p.contentVocabulary];return Je.default=n,Je}var wt={},Te={},$n;function oi(){if($n)return Te;$n=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Te.DiscrError=e={})),Te}var bn;function ai(){if(bn)return wt;bn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=G(),t=oi(),r=tr(),i=Mt(),p=Y(),u={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:o,tagName:f}})=>o===t.DiscrError.Tag?`tag "${f}" must be string`:`value of tag "${f}" must be in oneOf`,params:({params:{discrError:o,tag:f,tagName:$}})=>(0,e._)`{error: ${o}, tag: ${$}, tagValue: ${f}}`},code(o){const{gen:f,data:$,schema:b,parentSchema:E,it:_}=o,{oneOf:v}=E;if(!_.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=b.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(b.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const y=f.let("valid",!1),c=f.const("tag",(0,e._)`${$}${(0,e.getProperty)(w)}`);f.if((0,e._)`typeof ${c} == "string"`,()=>l(),()=>o.error(!1,{discrError:t.DiscrError.Tag,tag:c,tagName:w})),o.ok(y);function l(){const g=d();f.if(!1);for(const a in g)f.elseIf((0,e._)`${c} === ${a}`),f.assign(y,s(g[a]));f.else(),o.error(!1,{discrError:t.DiscrError.Mapping,tag:c,tagName:w}),f.endIf()}function s(g){const a=f.name("valid"),h=o.subschema({keyword:"oneOf",schemaProp:g},a);return o.mergeEvaluated(h,e.Name),a}function d(){var g;const a={},h=O(E);let P=!0;for(let C=0;C<v.length;C++){let V=v[C];if(V?.$ref&&!(0,p.schemaHasRulesButRef)(V,_.self.RULES)){const U=V.$ref;if(V=r.resolveRef.call(_.self,_.schemaEnv.root,_.baseId,U),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new i.default(_.opts.uriResolver,_.baseId,U)}const F=(g=V?.properties)===null||g===void 0?void 0:g[w];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${w}"`);P=P&&(h||O(V)),T(F,C)}if(!P)throw new Error(`discriminator: "${w}" must be required`);return a;function O({required:C}){return Array.isArray(C)&&C.includes(w)}function T(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/${w}" must have "const" or "enum"`)}function z(C,V){if(typeof C!="string"||C in a)throw new Error(`discriminator: "${w}" values must be unique strings`);a[C]=V}}}};return wt.default=u,wt}const ci="http://json-schema.org/draft-07/schema#",di="http://json-schema.org/draft-07/schema#",ui="Core schema meta-schema",li={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:[]}},fi=["object","boolean"],pi={$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:"#"}},mi={$schema:ci,$id:di,title:ui,definitions:li,type:fi,properties:pi,default:!0};var wn;function An(){return wn||(wn=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=ks(),i=ii(),p=ai(),n=mi,u=["/properties"],o="http://json-schema.org/draft-07/schema";class f extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(p.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(n,u):n;this.addMetaSchema(w,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv=f,e.exports=t=f,e.exports.Ajv=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var $=At();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var b=G();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return b._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return b.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return b.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return b.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return b.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return b.CodeGen}});var E=er();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var _=Mt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(ze,ze.exports)),ze.exports}var hi=An();const yi=Rn(hi);var Pt={exports:{}},Qt={},Pn;function gi(){return Pn||(Pn=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(n,u),time:t(f(!0),$),"date-time":t(_(!0),v),"iso-time":t(f(),b),"iso-date-time":t(_(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:l,"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:d,int32:{type:"number",validate:h},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$/,u),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$),"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,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,b),"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,w),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)$/,p=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n(C){const V=i.exec(C);if(!V)return!1;const F=+V[1],U=+V[2],Q=+V[3];return U>=1&&U<=12&&Q>=1&&Q<=(U===2&&r(F)?29:p[U])}function u(C,V){if(C&&V)return C>V?1:C<V?-1:0}const o=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function f(C){return function(F){const U=o.exec(F);if(!U)return!1;const Q=+U[1],ie=+U[2],oe=+U[3],X=U[4],pe=U[5]==="-"?-1:1,A=+(U[6]||0),j=+(U[7]||0);if(A>23||j>59||C&&!X)return!1;if(Q<=23&&ie<=59&&oe<60)return!0;const D=ie-j*pe,I=Q-A*pe-(D<0?1:0);return(I===23||I===-1)&&(D===59||D===-1)&&oe<61}}function $(C,V){if(!(C&&V))return;const F=new Date("2020-01-01T"+C).valueOf(),U=new Date("2020-01-01T"+V).valueOf();if(F&&U)return F-U}function b(C,V){if(!(C&&V))return;const F=o.exec(C),U=o.exec(V);if(F&&U)return C=F[1]+F[2]+F[3],V=U[1]+U[2]+U[3],C>V?1:C<V?-1:0}const E=/t|\s/i;function _(C){const V=f(C);return function(U){const Q=U.split(E);return Q.length===2&&n(Q[0])&&V(Q[1])}}function v(C,V){if(!(C&&V))return;const F=new Date(C).valueOf(),U=new Date(V).valueOf();if(F&&U)return F-U}function w(C,V){if(!(C&&V))return;const[F,U]=C.split(E),[Q,ie]=V.split(E),oe=u(F,Q);if(oe!==void 0)return oe||$(U,ie)}const y=/\/|:/,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 l(C){return y.test(C)&&c.test(C)}const s=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function d(C){return s.lastIndex=0,s.test(C)}const g=-2147483648,a=2**31-1;function h(C){return Number.isInteger(C)&&C<=a&&C>=g}function P(C){return Number.isInteger(C)}function O(){return!0}const T=/[^\\]\\Z/;function z(C){if(T.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(Qt)),Qt}var Zt={},Sn;function vi(){return Sn||(Sn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=An(),r=G(),i=r.operators,p={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}},n={message:({keyword:o,schemaCode:f})=>(0,r.str)`should be ${p[o].okStr} ${f}`,params:({keyword:o,schemaCode:f})=>(0,r._)`{comparison: ${p[o].okStr}, limit: ${f}}`};e.formatLimitDefinition={keyword:Object.keys(p),type:"string",schemaType:"string",$data:!0,error:n,code(o){const{gen:f,data:$,schemaCode:b,keyword:E,it:_}=o,{opts:v,self:w}=_;if(!v.validateFormats)return;const y=new t.KeywordCxt(_,w.RULES.all.format.definition,"format");y.$data?c():l();function c(){const d=f.scopeValue("formats",{ref:w.formats,code:v.code.formats}),g=f.const("fmt",(0,r._)`${d}[${y.schemaCode}]`);o.fail$data((0,r.or)((0,r._)`typeof ${g} != "object"`,(0,r._)`${g} instanceof RegExp`,(0,r._)`typeof ${g}.compare != "function"`,s(g)))}function l(){const d=y.schema,g=w.formats[d];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${E}": format "${d}" does not define "compare" function`);const a=f.scopeValue("formats",{key:d,ref:g,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(d)}`:void 0});o.fail$data(s(a))}function s(d){return(0,r._)`${d}.compare(${$}, ${b}) ${p[E].fail} 0`}},dependencies:["format"]};const u=o=>(o.addKeyword(e.formatLimitDefinition),o);e.default=u})(Zt)),Zt}var En;function _i(){return En||(En=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=gi(),i=vi(),p=G(),n=new p.Name("fullFormats"),u=new p.Name("fastFormats"),o=($,b={keywords:!0})=>{if(Array.isArray(b))return f($,b,r.fullFormats,n),$;const[E,_]=b.mode==="fast"?[r.fastFormats,u]:[r.fullFormats,n],v=b.formats||r.formatNames;return f($,v,E,_),b.keywords&&(0,i.default)($),$};o.get=($,b="full")=>{const _=(b==="fast"?r.fastFormats:r.fullFormats)[$];if(!_)throw new Error(`Unknown format "${$}"`);return _};function f($,b,E,_){var v,w;(v=(w=$.opts.code).formats)!==null&&v!==void 0||(w.formats=(0,p._)`require("ajv-formats/dist/formats").${_}`);for(const y of b)$.addFormat(y,E[y])}e.exports=t=o,Object.defineProperty(t,"__esModule",{value:!0}),t.default=o})(Pt,Pt.exports)),Pt.exports}var $i=_i();const bi=Rn($i),wi="http://json-schema.org/draft-07/schema#",Pi="#/definitions/CICConfig",Si=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","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":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}}},"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":"其他"}}'),Ve={$schema:wi,$ref:Pi,definitions:Si},ue={REQUIRED:"required",TYPE:"type",ENUM:"enum",CONST:"const",ADDITIONAL:"additionalProperties",ANY_OF:"anyOf"},we={TYPE:"/type",VALUE:"/value",DEFAULT:"/default",ARGS:"/args"},Ne={missing:e=>`缺少必填字段:${e}`,type:e=>`类型必须为:${e}`,enum:e=>`取值必须为枚举之一:${e.join(", ")}`,constOne:e=>`取值必须为:${JSON.stringify(e)}`,additionalProp:e=>`不允许额外字段:${e}`},Ei=[{rootPattern:/(\/|^)components\/\d+/,discriminator:"role",keepRequired:["role","id"]},{rootPattern:/(\/|^)global\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)page\/[^\/]+\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)component\/[^\/]+\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)dataSources\/\d+/,discriminator:"type",keepRequired:["type","id"]}],Ae=e=>typeof e=="number"&&Number.isFinite(e)&&e>0,nr=()=>{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.slice(0,4).join("")}-${r.slice(4,6).join("")}-${r.slice(6,8).join("")}-${r.slice(8,10).join("")}-${r.slice(10).join("")}`}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)})},ee=e=>{if(!Array.isArray(e))return[];const t=y=>{const c=y.instancePath||y.path||"",l=y.keyword,s=y.params||{};let d=y.message||"";switch(l){case ue.REQUIRED:s.missingProperty&&(d=Ne.missing(s.missingProperty));break;case ue.TYPE:y.schema&&(d=Ne.type(y.schema));break;case ue.ENUM:Array.isArray(s.allowedValues)&&(d=Ne.enum(s.allowedValues));break;case ue.CONST:d=s.allowedValue!==void 0?Ne.constOne(s.allowedValue):"必须等于常量";break;case ue.ADDITIONAL:s.additionalProperty&&(d=Ne.additionalProp(s.additionalProperty));break}return{path:c,message:d,keyword:l,params:s}},r=e.map(t),i=[],p=new Map,n=new Set;for(const y of r)if(y.keyword===ue.CONST&&y.path.endsWith(we.TYPE)){const c=y.path,l=p.get(c)||{path:y.path,values:[]},s=y.params?.allowedValue;s!==void 0&&!l.values.includes(s)&&l.values.push(s),p.set(c,l)}else i.push(y);for(const[,y]of p)if(y.values.length<=1)y.values.length===1&&i.push({path:y.path,keyword:ue.CONST,params:{allowedValue:y.values[0]},message:Ne.constOne(y.values[0])});else{const c=y.path.replace(new RegExp(`${we.TYPE}$`),"");n.add(c)}const u=i,o=new Set,f=[];for(const y of u){const c=`${y.keyword}|${y.path}|${JSON.stringify(y.params??{})}`;o.has(c)||(o.add(c),f.push(y))}const $=new Map,b=y=>{if(!y)return"";const c=y.match(new RegExp(`^(.*?)(?:${we.TYPE}|${we.VALUE}|${we.DEFAULT}|${we.ARGS})(?:$|\\/)`));return c?c[1]:y};for(const y of f){const c=b(y.path),l=$.get(c)||[];l.push(y),$.set(c,l)}const E=[];for(const[y,c]of $.entries()){const l=Ei.find(d=>d.rootPattern.test(y));if(l&&c.some(g=>g.keyword===ue.REQUIRED&&g.params?.missingProperty===l.discriminator)){for(const g of c)g.keyword===ue.REQUIRED&&l.keepRequired.includes(g.params?.missingProperty)&&E.push(g);continue}if(!n.has(y)){E.push(...c);continue}for(const d of c){const g=d.keyword===ue.TYPE&&(d.path===`${y}${we.VALUE}`||d.path===`${y}${we.DEFAULT}`),a=d.keyword===ue.ADDITIONAL&&d.path===y;g||a||E.push(d)}}const v=E.some(y=>y.keyword!==ue.ANY_OF)?E.filter(y=>y.keyword!==ue.ANY_OF):E,w=y=>{if(y.keyword===ue.REQUIRED){const c=y.params?.missingProperty;return c==="type"||c==="role"?0:c==="id"?1:2}return 3};return v.sort((y,c)=>w(y)-w(c))},ye=(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},Pe=(e,t)=>t?.length?t.map(r=>({...r,path:`${e}${r.path?`.${r.path}`:""}`})):[],Xt=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",keyword:"type",message:`JSON 解析失败:${t?.message??String(t)}`}]}}},ki=e=>e.map(t=>({path:"",keyword:"required",params:{missingProperty:t},message:`缺少必填字段:${t}`})),Mn=({input:e,normalize:t,base:r,branches:i,key:p,missingKeys:n,onSuccess:u})=>{const o=t?t(e):e,f=o;if(f&&typeof f=="object"&&typeof f[p]=="string"){const $=i[f[p]];if($)return $(f)?u(f):{ok:!1,errors:ee($.errors)}}return r(o)?u(o):!f||typeof f[p]!="string"?{ok:!1,errors:ki(n)}:{ok:!1,errors:ee(r.errors)}},sr=(e,t,r,i)=>Mn({input:e,base:t,branches:r,key:i,missingKeys:[i,"id"],onSuccess:()=>({ok:!0,value:null})}),ir=(e,t,r,i,p,n,u=[n,"id"])=>Mn({input:e,normalize:o=>r(o,t),base:i,branches:p,key:n,missingKeys:u,onSuccess:o=>({ok:!0,value:o})});let St=null;const Vn=()=>(St||(St=new yi({allErrors:!0,strict:!1}),bi(St)),St),kn=new Map,ji=JSON.stringify(Ve),Ri={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"],ViewComponentInstance:["#/definitions/ViewComponentInstance","#/$defs/ViewComponentInstance"],ContainerComponentInstance:["#/definitions/ContainerComponentInstance","#/$defs/ContainerComponentInstance"],LogicComponentInstanceRef:["#/definitions/LogicComponentInstanceRef","#/$defs/LogicComponentInstanceRef"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],DataSourceRest:["#/definitions/DataSourceRest","#/$defs/DataSourceRest"],DataSourceWebSocket:["#/definitions/DataSourceWebSocket","#/$defs/DataSourceWebSocket"],DataSourceStatic:["#/definitions/DataSourceStatic","#/$defs/DataSourceStatic"],DataSourceFunction:["#/definitions/DataSourceFunction","#/$defs/DataSourceFunction"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],JSDependency:["#/definitions/JSDependency","#/$defs/JSDependency"],CSSDependency:["#/definitions/CSSDependency","#/$defs/CSSDependency"],FontDependency:["#/definitions/FontDependency","#/$defs/FontDependency"],ImageDependency:["#/definitions/ImageDependency","#/$defs/ImageDependency"],JSONDependency:["#/definitions/JSONDependency","#/$defs/JSONDependency"],WasmDependency:["#/definitions/WasmDependency","#/$defs/WasmDependency"],OtherDependency:["#/definitions/OtherDependency","#/$defs/OtherDependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Ii=(e,t)=>e.compile({$ref:t,definitions:Ve.definitions,properties:Ve.properties}),te=e=>{const t=Vn(),r=`type:${e}::${ji}`,i=kn.get(r);if(i)return i;const p=Ri[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const n of p)try{const u=Ii(t,n);return kn.set(r,u),u}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},zn=te("DataSourceItem"),Fn=te("DataSourceRest"),Un=te("DataSourceWebSocket"),Ln=te("DataSourceStatic"),Kn=te("DataSourceFunction"),Oi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=nr()),r.type&&(r.type==="rest"?(t?.strict||("pollInterval"in r&&Ae(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&Ae(r.timeout)&&(r.timeout=Math.round(r.timeout))),ye(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&Ae(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&Ae(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),ye(r,t?.defaults)):r.type==="static"?t?.strict||ye(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&Ae(r.timeout)&&(r.timeout=Math.round(r.timeout)),t?.strict||ye(r,t?.defaults))),r},Ni=e=>sr(e,zn,{rest:Fn,websocket:Un,static:Ln,function:Kn},"type"),Jn=(e,t)=>ir(e,t,Oi,zn,{rest:Fn,websocket:Un,static:Ln,function:Kn},"type",["type","id"]),Hn=te("ComponentInstance"),Gn=te("ViewComponentInstance"),Wn=te("ContainerComponentInstance"),Bn=te("LogicComponentInstanceRef"),Ci=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=nr()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),ye(r,t?.defaults),r},qi=e=>sr(e,Hn,{view:Gn,container:Wn,logic:Bn},"role"),Yn=(e,t)=>ir(e,t,Ci,Hn,{view:Gn,container:Wn,logic:Bn},"role",["role","id"]),jt=te("CICPage"),Di=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=nr()),t?.strict||ye(r,t?.defaults),r},Ti=e=>jt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(jt.errors||[])},xn=(e,t)=>{const r=Di(e,t);return jt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(jt.errors||[])}},Rt=te("Meta"),It=te("Layout"),Ai=e=>Rt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Rt.errors||[])},Mi=e=>It(e)?{ok:!0,value:null}:{ok:!1,errors:ee(It.errors||[])},Qn=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Rt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Rt.errors||[])}},Zn=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return It(r)?{ok:!0,value:r}:{ok:!1,errors:ee(It.errors||[])}},Ot=te("Variables"),Vi=e=>Ot(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Ot.errors||[])},Xn=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Ot(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Ot.errors||[])}},es=te("Dependency"),ts=te("JSDependency"),rs=te("CSSDependency"),ns=te("FontDependency"),ss=te("ImageDependency"),is=te("JSONDependency"),os=te("WasmDependency"),as=te("OtherDependency"),zi=e=>sr(e,es,{js:ts,css:rs,font:ns,image:ss,json:is,wasm:os,other:as},"type"),cs=(e,t)=>ir(e,t,(i,p)=>p?.strict?i:ye(i,p?.defaults),es,{js:ts,css:rs,font:ns,image:ss,json:is,wasm:os,other:as},"type",["type","id"]),Nt=te("RegistryComponents"),Fi=e=>Nt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Nt.errors||[])},ds=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Nt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Nt.errors||[])}},Ui=e=>typeof e=="number"?`[${e}]`:`/${e}`,Li=()=>{const e=new Map,t=[],r=(...n)=>n.reduce((u,o,f)=>{const $=Ui(o);return f===0&&typeof o=="string"&&!o.startsWith("/")?`/${o}`:`${u}${$}`},"");return{pathJoin:r,ensureUnique:(n,u)=>{const o=e.get(n)||new Set;return o.has(u)?(e.set(n,o),!0):(o.add(u),e.set(n,o),!1)},pushError:(n,u,o,f="error")=>{const $={path:r(...n),message:u,ruleId:o,level:f};return t.push($),$},errors:t}},Ki=(e,t)=>{const r=Li();for(const i of t){const p=i.validate(e,r);Array.isArray(p)&&p.length&&r.errors.push(...p)}return{ok:r.errors.length===0,errors:r.errors}},Ji={id:"components.id.unique",scope:"component",path:"pages[].components[].id",title:"组件 id 必须唯一",description:"组件 id 不允许重复",example:"comp_01",level:"error",validate:(e,t)=>{const r=[],i=Array.isArray(e.pages)?e.pages:[];for(let p=0;p<i.length;p++){const n=Array.isArray(i[p]?.components)?i[p].components:[];for(let u=0;u<n.length;u++){const o=n[u]?.id;if(typeof o!="string")continue;if(t.ensureUnique("components.id",o.trim())){const $=t.pushError(["pages",p,"components",u,"id"],`组件 id 重复:"${o.trim()}"`,"components.id.unique","error");r.push($)}}}return r}},Hi={id:"datasources.id.unique",scope:"dataSource",path:"pages[].dataSources[].id",title:"数据源 id 必须唯一",description:"数据源 id 不允许重复",example:"ds_user_list",level:"error",validate:(e,t)=>{const r=[],i=Array.isArray(e.pages)?e.pages:[];for(let p=0;p<i.length;p++){const n=Array.isArray(i[p]?.dataSources)?i[p].dataSources:[];for(let u=0;u<n.length;u++){const o=n[u]?.id;if(typeof o!="string")continue;if(t.ensureUnique("dataSources.id",o.trim())){const $=t.pushError(["pages",p,"dataSources",u,"id"],`数据源 id 重复:"${o.trim()}"`,"datasources.id.unique","error");r.push($)}}}return r}},Gi={id:"pages.name.unique",scope:"page",path:"pages[].name",title:"页面 name 必须唯一",description:"页面 name 不允许重复",example:"首页",level:"error",validate:(e,t)=>{const r=[],i=Array.isArray(e.pages)?e.pages:[];for(let p=0;p<i.length;p++){const n=i[p]?.name;if(typeof n!="string")continue;const u=n.trim();if(!u)continue;if(t.ensureUnique("pages.name",u)){const f=t.pushError(["pages",p,"name"],`页面name重复:"${u}"`,"pages.name.unique","error");r.push(f)}}return r}},Wi={id:"pages.path.unique",scope:"page",path:"pages[].path",title:"页面 path 必须唯一",description:"页面 path 不允许重复",example:"/home",level:"error",validate:(e,t)=>{const r=[],i=Array.isArray(e.pages)?e.pages:[];for(let p=0;p<i.length;p++){const n=i[p]?.path;if(typeof n!="string")continue;const u=n.trim();if(!u)continue;if(t.ensureUnique("pages.path",u)){const f=t.pushError(["pages",p,"path"],`页面path重复:"${u}"`,"pages.path.unique","error");r.push(f)}}return r}},Bi=[Gi,Wi,Ji,Hi];let Ct,jn;const Yi=()=>{const e=Vn(),t=JSON.stringify(Ve);(!Ct||jn!==t)&&(Ct=e.compile(Ve),jn=t)},qt=e=>{try{if(Yi(),!Ct(e))return{ok:!1,errors:ee(Ct.errors||[])};let t=[];const r=Ki(e,Bi);return r.ok?{ok:!0,value:null}:(t=(r.errors||[]).map(i=>({path:i.path,message:i.message,keyword:"anyOf",params:{}})),{ok:!1,errors:ee(t)})}catch(t){return{ok:!1,errors:ee([{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}])}}},xi=(e,t)=>{if(e&&typeof e=="object")return Me(e,t);const r=(e||"").trim();if(!(r.startsWith("{")||r.startsWith("[")))return{ok:!1,errors:ee([{path:"",message:"非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入",keyword:"type",params:{}}])};const p=Xt(r);return p.ok?Me(p.value,t):{ok:!1,errors:p.errors}},Qi=async(e,t)=>{if(e&&typeof e=="object")return Me(e,t);const r=(e||"").trim();if(r.startsWith("{")||r.startsWith("[")){const n=Xt(r);return n.ok?Me(n.value,t):{ok:!1,errors:n.errors}}if(!(typeof globalThis.fetch=="function"))return{ok:!1,errors:ee([{path:"",message:"当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象",keyword:"type",params:{}}])};if(/^file:\/\//i.test(r))return{ok:!1,errors:ee([{path:"",message:"不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)",keyword:"type",params:{}}])};try{const n=await globalThis.fetch(r);if(!n||!n.ok){const f=[{path:"",message:`网络或资源错误:${n?.status} ${n?.statusText||""}`.trim(),keyword:"type",params:{}}];return{ok:!1,errors:ee(f)}}const u=await n.text(),o=Xt(u);return o.ok?Me(o.value,t):{ok:!1,errors:o.errors}}catch(n){const u=[{path:"",message:`请求失败:${n?.message||n}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(u)}}},Zi=e=>{const t=qt(e);if(!t.ok)return{ok:!1,errors:t.errors};const r={version:e.version,meta:e.meta,pages:e.pages,registry:e.registry,variables:e.variables,deps:e.deps,extensions:e.extensions};return{ok:!0,value:JSON.stringify(r,null,2)}},Me=(e,t)=>{const r=typeof e=="object"?{...e}:e,i=[];if(!r||typeof r!="object")return i.push({path:"",message:"配置必须为对象",keyword:"type",params:{schema:"object"}}),{ok:!1,errors:ee(i)};if(r.version||i.push({path:"/version",message:"缺少必填字段:version",keyword:"required",params:{missingProperty:"version"}}),r.meta||i.push({path:"/meta",message:"缺少必填字段:meta",keyword:"required",params:{missingProperty:"meta"}}),r.pages||i.push({path:"/pages",message:"缺少必填字段:pages",keyword:"required",params:{missingProperty:"pages"}}),i.length)return{ok:!1,errors:ee(i)};const p=Qn(r.meta,t?.meta);if(p.ok||i.push(...Pe("/meta",p.errors)),r.meta?.layout){const u=Zn(r.meta.layout,t?.layout);u.ok?r.meta.layout=u.value:i.push(...Pe("/meta/layout",u.errors))}if(p.ok&&(r.meta=p.value),r.variables){const u=Xn(r.variables,t?.variables);u.ok?r.variables=u.value:i.push(...Pe("/variables",u.errors))}if(r.registry?.components){const u=[];for(let o=0;o<r.registry.components.length;o++){const f=ds(r.registry.components[o],t?.registry);f.ok?u.push(f.value):i.push(...Pe(`/registry/components[${o}]`,f.errors))}r.registry.components=u}if(r.deps){const u=[];for(let o=0;o<r.deps.length;o++){const f=cs(r.deps[o],t?.dependency);f.ok?u.push(f.value):i.push(...Pe(`/deps[${o}]`,f.errors))}r.deps=u}if(Array.isArray(r.pages)){const u=[];for(let o=0;o<r.pages.length;o++){const f=r.pages[o],$=xn(f,t?.page);if(!$.ok){i.push(...Pe(`/pages[${o}]`,$.errors));continue}const b=$.value;if(Array.isArray(f.components)){const E=[];for(let _=0;_<f.components.length;_++){const v=Yn(f.components[_],t?.component);v.ok?E.push(v.value):i.push(...Pe(`/pages[${o}]/components[${_}]`,v.errors))}b.components=E}if(Array.isArray(f.dataSources)){const E=[];for(let _=0;_<f.dataSources.length;_++){const v=Jn(f.dataSources[_],t?.dataSource);v.ok?E.push(v.value):i.push(...Pe(`/pages[${o}]/dataSources[${_}]`,v.errors))}b.dataSources=E}u.push(b)}r.pages=u}if(i.length)return{ok:!1,errors:ee(i)};const n=qt(r);return n.ok?{ok:!0,value:r}:{ok:!1,errors:n.errors}};class or{config;constructor(t){const r=qt(t);if(!r.ok)throw new Error(`Invalid CIC Configuration: ${JSON.stringify(r.errors)}`);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,p)=>i.id===t?(r=p,!1):!0),r}getVariable(t,r){const i=this.config.variables;if(i){if(t.componentId&&i.component&&i.component[t.componentId]){const p=i.component[t.componentId][r];if(p)return p.value??p.default}if(t.pageId&&i.page&&i.page[t.pageId]){const p=i.page[t.pageId][r];if(p)return p.value??p.default}if(i.global&&i.global[r]){const p=i.global[r];return p.value??p.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,i,p,n]=r;if(i==="global")return this.getVariable({},n);if(i==="page")return this.getVariable({pageId:p},n);if(i==="component")return this.getVariable({componentId:p},n)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const i=[];for(const n of r.components||[])i.push({node:n});let p=!1;for(;i.length>0&&!p;){const{node:n,parent:u}=i.pop();if(t(n,r,u)===!1){p=!0;break}if(n.children&&n.children.length>0)for(let f=n.children.length-1;f>=0;f--)i.push({node:n.children[f],parent:n})}if(p)break}}static getValueByPath(t,r,i){if(t==null||!r)return i;const p=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(u=>{u.trim()&&p.push(u.trim())});let n=t;for(const u of p){if(n==null)return i;n=n[u]}return n===void 0?i:n}static traverseTree(t,r,i){const p=Array.isArray(t)?t:[t];for(const n of p)r(n,i)!==!1&&n.children&&n.children.length>0&&or.traverseTree(n.children,r,n)}static createDataSource=Jn;static validateDataSource=Ni;static createComponent=Yn;static validateComponent=qi;static createPage=xn;static validatePage=Ti;static createMeta=Qn;static createLayout=Zn;static validateMeta=Ai;static validateLayout=Mi;static createVariables=Xn;static validateVariables=Vi;static createDependency=cs;static validateDependency=zi;static createRegistryComponent=ds;static validateRegistryComponent=Fi;static importCIC=xi;static exportCIC=Zi;static validateCIC=qt;static importCICAsync=Qi}exports.CICSDK=or;
|
|
8
|
+
deps: ${_}}`};const c={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[$,_]=s(l);d(l,$),o(l,_)}};function s({schema:l}){const $={},_={};for(const E in l){if(E==="__proto__")continue;const v=Array.isArray(l[E])?$:_;v[E]=l[E]}return[$,_]}function d(l,$=l.schema){const{gen:_,data:E,it:v}=l;if(Object.keys($).length===0)return;const g=_.let("missing");for(const b in $){const w=$[b];if(w.length===0)continue;const f=(0,n.propertyInData)(_,E,b,v.opts.ownProperties);l.setParams({property:b,depsCount:w.length,deps:w.join(", ")}),v.allErrors?_.if(f,()=>{for(const p of w)(0,n.checkReportMissingProp)(l,p)}):(_.if((0,t._)`${f} && (${(0,n.checkMissingProp)(l,w,g)})`),(0,n.reportMissingProp)(l,g),_.else())}}e.validatePropertyDeps=d;function o(l,$=l.schema){const{gen:_,data:E,keyword:v,it:g}=l,b=_.name("valid");for(const w in $)(0,r.alwaysValidSchema)(g,$[w])||(_.if((0,n.propertyInData)(_,E,w,g.opts.ownProperties),()=>{const f=l.subschema({keyword:v,schemaProp:w},b);l.mergeValidEvaluated(f,b)},()=>_.var(b,!0)),l.ok(b))}e.validateSchemaDeps=o,e.default=c})(xt)),xt}var ut={},sn;function Ws(){if(sn)return ut;sn=1,Object.defineProperty(ut,"__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:c})=>(0,e._)`{propertyName: ${c.propertyName}}`},code(c){const{gen:s,schema:d,data:o,it:l}=c;if((0,t.alwaysValidSchema)(l,d))return;const $=s.name("valid");s.forIn("key",o,_=>{c.setParams({propertyName:_}),c.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},$),s.if((0,e.not)($),()=>{c.error(!0),l.allErrors||s.break()})}),c.ok($)}};return ut.default=n,ut}var lt={},on;function An(){if(on)return lt;on=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=ge(),t=G(),r=Pe(),n=Y(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:d})=>(0,t._)`{additionalProperty: ${d.additionalProperty}}`},code(d){const{gen:o,schema:l,parentSchema:$,data:_,errsCount:E,it:v}=d;if(!E)throw new Error("ajv implementation error");const{allErrors:g,opts:b}=v;if(v.props=!0,b.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(v,l))return;const w=(0,e.allSchemaProperties)($.properties),f=(0,e.allSchemaProperties)($.patternProperties);p(),d.ok((0,t._)`${E} === ${r.default.errors}`);function p(){o.forIn("key",_,h=>{!w.length&&!f.length?y(h):o.if(i(h),()=>y(h))})}function i(h){let P;if(w.length>8){const O=(0,n.schemaRefOrVal)(v,$.properties,"properties");P=(0,e.isOwnProperty)(o,O,h)}else w.length?P=(0,t.or)(...w.map(O=>(0,t._)`${h} === ${O}`)):P=t.nil;return f.length&&(P=(0,t.or)(P,...f.map(O=>(0,t._)`${(0,e.usePattern)(d,O)}.test(${h})`))),(0,t.not)(P)}function u(h){o.code((0,t._)`delete ${_}[${h}]`)}function y(h){if(b.removeAdditional==="all"||b.removeAdditional&&l===!1){u(h);return}if(l===!1){d.setParams({additionalProperty:h}),d.error(),g||o.break();return}if(typeof l=="object"&&!(0,n.alwaysValidSchema)(v,l)){const P=o.name("valid");b.removeAdditional==="failing"?(a(h,P,!1),o.if((0,t.not)(P),()=>{d.reset(),u(h)})):(a(h,P),g||o.if((0,t.not)(P),()=>o.break()))}}function a(h,P,O){const T={keyword:"additionalProperties",dataProp:h,dataPropType:n.Type.Str};O===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),d.subschema(T,P)}}};return lt.default=s,lt}var ft={},an;function Bs(){if(an)return ft;an=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=At(),t=ge(),r=Y(),n=An(),c={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:d,schema:o,parentSchema:l,data:$,it:_}=s;_.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(_,n.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(o);for(const f of E)_.definedProperties.add(f);_.opts.unevaluated&&E.length&&_.props!==!0&&(_.props=r.mergeEvaluated.props(d,(0,r.toHash)(E),_.props));const v=E.filter(f=>!(0,r.alwaysValidSchema)(_,o[f]));if(v.length===0)return;const g=d.name("valid");for(const f of v)b(f)?w(f):(d.if((0,t.propertyInData)(d,$,f,_.opts.ownProperties)),w(f),_.allErrors||d.else().var(g,!0),d.endIf()),s.it.definedProperties.add(f),s.ok(g);function b(f){return _.opts.useDefaults&&!_.compositeRule&&o[f].default!==void 0}function w(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},g)}}};return ft.default=c,ft}var pt={},cn;function Ys(){if(cn)return pt;cn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=ge(),t=G(),r=Y(),n=Y(),c={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:d,schema:o,data:l,parentSchema:$,it:_}=s,{opts:E}=_,v=(0,e.allSchemaProperties)(o),g=v.filter(y=>(0,r.alwaysValidSchema)(_,o[y]));if(v.length===0||g.length===v.length&&(!_.opts.unevaluated||_.props===!0))return;const b=E.strictSchema&&!E.allowMatchingProperties&&$.properties,w=d.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,n.evaluatedPropsToName)(d,_.props));const{props:f}=_;p();function p(){for(const y of v)b&&i(y),_.allErrors?u(y):(d.var(w,!0),u(y),d.if(w))}function i(y){for(const a in b)new RegExp(y).test(a)&&(0,r.checkStrictMode)(_,`property ${a} matches pattern ${y} (use allowMatchingProperties)`)}function u(y){d.forIn("key",l,a=>{d.if((0,t._)`${(0,e.usePattern)(s,y)}.test(${a})`,()=>{const h=g.includes(y);h||s.subschema({keyword:"patternProperties",schemaProp:y,dataProp:a,dataPropType:n.Type.Str},w),_.opts.unevaluated&&f!==!0?d.assign((0,t._)`${f}[${a}]`,!0):!h&&!_.allErrors&&d.if((0,t.not)(w),()=>d.break())})})}}};return pt.default=c,pt}var mt={},dn;function xs(){if(dn)return mt;dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:c,it:s}=r;if((0,e.alwaysValidSchema)(s,c)){r.fail();return}const d=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),r.failResult(d,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return mt.default=t,mt}var ht={},un;function Qs(){if(un)return ht;un=1,Object.defineProperty(ht,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ge().validateUnion,error:{message:"must match a schema in anyOf"}};return ht.default=t,ht}var yt={},ln;function Zs(){if(ln)return yt;ln=1,Object.defineProperty(yt,"__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:c})=>(0,e._)`{passingSchemas: ${c.passing}}`},code(c){const{gen:s,schema:d,parentSchema:o,it:l}=c;if(!Array.isArray(d))throw new Error("ajv implementation error");if(l.opts.discriminator&&o.discriminator)return;const $=d,_=s.let("valid",!1),E=s.let("passing",null),v=s.name("_valid");c.setParams({passing:E}),s.block(g),c.result(_,()=>c.reset(),()=>c.error(!0));function g(){$.forEach((b,w)=>{let f;(0,t.alwaysValidSchema)(l,b)?s.var(v,!0):f=c.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&s.if((0,e._)`${v} && ${_}`).assign(_,!1).assign(E,(0,e._)`[${E}, ${w}]`).else(),s.if(v,()=>{s.assign(_,!0),s.assign(E,w),f&&c.mergeEvaluated(f,e.Name)})})}}};return yt.default=n,yt}var gt={},fn;function Xs(){if(fn)return gt;fn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:c,it:s}=r;if(!Array.isArray(c))throw new Error("ajv implementation error");const d=n.name("valid");c.forEach((o,l)=>{if((0,e.alwaysValidSchema)(s,o))return;const $=r.subschema({keyword:"allOf",schemaProp:l},d);r.ok(d),r.mergeEvaluated($)})}};return gt.default=t,gt}var vt={},pn;function ei(){if(pn)return vt;pn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=G(),t=Y(),n={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:d,parentSchema:o,it:l}=s;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(l,'"if" without "then" and "else" is ignored');const $=c(l,"then"),_=c(l,"else");if(!$&&!_)return;const E=d.let("valid",!0),v=d.name("_valid");if(g(),s.reset(),$&&_){const w=d.let("ifClause");s.setParams({ifClause:w}),d.if(v,b("then",w),b("else",w))}else $?d.if(v,b("then")):d.if((0,e.not)(v),b("else"));s.pass(E,()=>s.error(!0));function g(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);s.mergeEvaluated(w)}function b(w,f){return()=>{const p=s.subschema({keyword:w},v);d.assign(E,v),s.mergeValidEvaluated(p,E),f?d.assign(f,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function c(s,d){const o=s.schema[d];return o!==void 0&&!(0,t.alwaysValidSchema)(s,o)}return vt.default=n,vt}var _t={},mn;function ti(){if(mn)return _t;mn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:c}){n.if===void 0&&(0,e.checkStrictMode)(c,`"${r}" without "if" is ignored`)}};return _t.default=t,_t}var hn;function ri(){if(hn)return ot;hn=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=Dn(),t=Ks(),r=Tn(),n=Js(),c=Hs(),s=Gs(),d=Ws(),o=An(),l=Bs(),$=Ys(),_=xs(),E=Qs(),v=Zs(),g=Xs(),b=ei(),w=ti();function f(p=!1){const i=[_.default,E.default,v.default,g.default,b.default,w.default,d.default,o.default,s.default,l.default,$.default];return p?i.push(t.default,n.default):i.push(e.default,r.default),i.push(c.default),i}return ot.default=f,ot}var $t={},bt={},yn;function ni(){if(yn)return bt;yn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=G(),r={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,c){const{gen:s,data:d,$data:o,schema:l,schemaCode:$,it:_}=n,{opts:E,errSchemaPath:v,schemaEnv:g,self:b}=_;if(!E.validateFormats)return;o?w():f();function w(){const p=s.scopeValue("formats",{ref:b.formats,code:E.code.formats}),i=s.const("fDef",(0,e._)`${p}[${$}]`),u=s.let("fType"),y=s.let("format");s.if((0,e._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>s.assign(u,(0,e._)`${i}.type || "string"`).assign(y,(0,e._)`${i}.validate`),()=>s.assign(u,(0,e._)`"string"`).assign(y,i)),n.fail$data((0,e.or)(a(),h()));function a(){return E.strictSchema===!1?e.nil:(0,e._)`${$} && !${y}`}function h(){const P=g.$async?(0,e._)`(${i}.async ? await ${y}(${d}) : ${y}(${d}))`:(0,e._)`${y}(${d})`,O=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${d}))`;return(0,e._)`${y} && ${y} !== true && ${u} === ${c} && !${O}`}}function f(){const p=b.formats[l];if(!p){a();return}if(p===!0)return;const[i,u,y]=h(p);i===c&&n.pass(P());function a(){if(E.strictSchema===!1){b.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${l}" ignored in schema at path "${v}"`}}function h(O){const T=O instanceof RegExp?(0,e.regexpCode)(O):E.code.formats?(0,e._)`${E.code.formats}${(0,e.getProperty)(l)}`:void 0,z=s.scopeValue("formats",{key:l,ref:O,code:T});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,e._)`${z}.validate`]:["string",O,z]}function P(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${d})`}return typeof u=="function"?(0,e._)`${y}(${d})`:(0,e._)`${y}.test(${d})`}}}};return bt.default=r,bt}var gn;function si(){if(gn)return $t;gn=1,Object.defineProperty($t,"__esModule",{value:!0});const t=[ni().default];return $t.default=t,$t}var ke={},vn;function ii(){return vn||(vn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.contentVocabulary=ke.metadataVocabulary=void 0,ke.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],ke.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),ke}var _n;function oi(){if(_n)return Je;_n=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=Os(),t=Ls(),r=ri(),n=si(),c=ii(),s=[e.default,t.default,(0,r.default)(),n.default,c.metadataVocabulary,c.contentVocabulary];return Je.default=s,Je}var wt={},De={},$n;function ai(){if($n)return De;$n=1,Object.defineProperty(De,"__esModule",{value:!0}),De.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(De.DiscrError=e={})),De}var bn;function ci(){if(bn)return wt;bn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=G(),t=ai(),r=tr(),n=Mt(),c=Y(),d={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:o,tagName:l}})=>o===t.DiscrError.Tag?`tag "${l}" must be string`:`value of tag "${l}" must be in oneOf`,params:({params:{discrError:o,tag:l,tagName:$}})=>(0,e._)`{error: ${o}, tag: ${$}, tagValue: ${l}}`},code(o){const{gen:l,data:$,schema:_,parentSchema:E,it:v}=o,{oneOf:g}=E;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=_.propertyName;if(typeof b!="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=l.let("valid",!1),f=l.const("tag",(0,e._)`${$}${(0,e.getProperty)(b)}`);l.if((0,e._)`typeof ${f} == "string"`,()=>p(),()=>o.error(!1,{discrError:t.DiscrError.Tag,tag:f,tagName:b})),o.ok(w);function p(){const y=u();l.if(!1);for(const a in y)l.elseIf((0,e._)`${f} === ${a}`),l.assign(w,i(y[a]));l.else(),o.error(!1,{discrError:t.DiscrError.Mapping,tag:f,tagName:b}),l.endIf()}function i(y){const a=l.name("valid"),h=o.subschema({keyword:"oneOf",schemaProp:y},a);return o.mergeEvaluated(h,e.Name),a}function u(){var y;const a={},h=O(E);let P=!0;for(let C=0;C<g.length;C++){let V=g[C];if(V?.$ref&&!(0,c.schemaHasRulesButRef)(V,v.self.RULES)){const U=V.$ref;if(V=r.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,U),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default(v.opts.uriResolver,v.baseId,U)}const F=(y=V?.properties)===null||y===void 0?void 0:y[b];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);P=P&&(h||O(V)),T(F,C)}if(!P)throw new Error(`discriminator: "${b}" must be required`);return a;function O({required:C}){return Array.isArray(C)&&C.includes(b)}function T(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/${b}" must have "const" or "enum"`)}function z(C,V){if(typeof C!="string"||C in a)throw new Error(`discriminator: "${b}" values must be unique strings`);a[C]=V}}}};return wt.default=d,wt}const di="http://json-schema.org/draft-07/schema#",ui="http://json-schema.org/draft-07/schema#",li="Core schema meta-schema",fi={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:[]}},pi=["object","boolean"],mi={$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:"#"}},hi={$schema:di,$id:ui,title:li,definitions:fi,type:pi,properties:mi,default:!0};var wn;function Mn(){return wn||(wn=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=js(),n=oi(),c=ci(),s=hi,d=["/properties"],o="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(c.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(s,d):s;this.addMetaSchema(b,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var $=At();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.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 E=er();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var v=Mt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(ze,ze.exports)),ze.exports}var yi=Mn();const gi=In(yi);var Pt={exports:{}},Qt={},Pn;function vi(){return Pn||(Pn=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,d),time:t(l(!0),$),"date-time":t(v(!0),g),"iso-time":t(l(),_),"iso-date-time":t(v(),b),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"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:u,int32:{type:"number",validate:h},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$/,d),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$),"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,b),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 n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,c=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const V=n.exec(C);if(!V)return!1;const F=+V[1],U=+V[2],Q=+V[3];return U>=1&&U<=12&&Q>=1&&Q<=(U===2&&r(F)?29:c[U])}function d(C,V){if(C&&V)return C>V?1:C<V?-1:0}const o=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(C){return function(F){const U=o.exec(F);if(!U)return!1;const Q=+U[1],ie=+U[2],oe=+U[3],X=U[4],pe=U[5]==="-"?-1:1,A=+(U[6]||0),j=+(U[7]||0);if(A>23||j>59||C&&!X)return!1;if(Q<=23&&ie<=59&&oe<60)return!0;const D=ie-j*pe,I=Q-A*pe-(D<0?1:0);return(I===23||I===-1)&&(D===59||D===-1)&&oe<61}}function $(C,V){if(!(C&&V))return;const F=new Date("2020-01-01T"+C).valueOf(),U=new Date("2020-01-01T"+V).valueOf();if(F&&U)return F-U}function _(C,V){if(!(C&&V))return;const F=o.exec(C),U=o.exec(V);if(F&&U)return C=F[1]+F[2]+F[3],V=U[1]+U[2]+U[3],C>V?1:C<V?-1:0}const E=/t|\s/i;function v(C){const V=l(C);return function(U){const Q=U.split(E);return Q.length===2&&s(Q[0])&&V(Q[1])}}function g(C,V){if(!(C&&V))return;const F=new Date(C).valueOf(),U=new Date(V).valueOf();if(F&&U)return F-U}function b(C,V){if(!(C&&V))return;const[F,U]=C.split(E),[Q,ie]=V.split(E),oe=d(F,Q);if(oe!==void 0)return oe||$(U,ie)}const w=/\/|:/,f=/^(?:[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 p(C){return w.test(C)&&f.test(C)}const i=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function u(C){return i.lastIndex=0,i.test(C)}const y=-2147483648,a=2**31-1;function h(C){return Number.isInteger(C)&&C<=a&&C>=y}function P(C){return Number.isInteger(C)}function O(){return!0}const T=/[^\\]\\Z/;function z(C){if(T.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(Qt)),Qt}var Zt={},Sn;function _i(){return Sn||(Sn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Mn(),r=G(),n=r.operators,c={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}},s={message:({keyword:o,schemaCode:l})=>(0,r.str)`should be ${c[o].okStr} ${l}`,params:({keyword:o,schemaCode:l})=>(0,r._)`{comparison: ${c[o].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(c),type:"string",schemaType:"string",$data:!0,error:s,code(o){const{gen:l,data:$,schemaCode:_,keyword:E,it:v}=o,{opts:g,self:b}=v;if(!g.validateFormats)return;const w=new t.KeywordCxt(v,b.RULES.all.format.definition,"format");w.$data?f():p();function f(){const u=l.scopeValue("formats",{ref:b.formats,code:g.code.formats}),y=l.const("fmt",(0,r._)`${u}[${w.schemaCode}]`);o.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,i(y)))}function p(){const u=w.schema,y=b.formats[u];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${E}": format "${u}" does not define "compare" function`);const a=l.scopeValue("formats",{key:u,ref:y,code:g.code.formats?(0,r._)`${g.code.formats}${(0,r.getProperty)(u)}`:void 0});o.fail$data(i(a))}function i(u){return(0,r._)`${u}.compare(${$}, ${_}) ${c[E].fail} 0`}},dependencies:["format"]};const d=o=>(o.addKeyword(e.formatLimitDefinition),o);e.default=d})(Zt)),Zt}var En;function $i(){return En||(En=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=vi(),n=_i(),c=G(),s=new c.Name("fullFormats"),d=new c.Name("fastFormats"),o=($,_={keywords:!0})=>{if(Array.isArray(_))return l($,_,r.fullFormats,s),$;const[E,v]=_.mode==="fast"?[r.fastFormats,d]:[r.fullFormats,s],g=_.formats||r.formatNames;return l($,g,E,v),_.keywords&&(0,n.default)($),$};o.get=($,_="full")=>{const v=(_==="fast"?r.fastFormats:r.fullFormats)[$];if(!v)throw new Error(`Unknown format "${$}"`);return v};function l($,_,E,v){var g,b;(g=(b=$.opts.code).formats)!==null&&g!==void 0||(b.formats=(0,c._)`require("ajv-formats/dist/formats").${v}`);for(const w of _)$.addFormat(w,E[w])}e.exports=t=o,Object.defineProperty(t,"__esModule",{value:!0}),t.default=o})(Pt,Pt.exports)),Pt.exports}var bi=$i();const wi=In(bi),Pi="http://json-schema.org/draft-07/schema#",Si="#/definitions/CICConfig",Ei=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","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":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}}},"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":"其他"}}'),Me={$schema:Pi,$ref:Si,definitions:Ei},ue={REQUIRED:"required",TYPE:"type",ENUM:"enum",CONST:"const",ADDITIONAL:"additionalProperties",ANY_OF:"anyOf"},Ve={TYPE:"/type",VALUE:"/value",DEFAULT:"/default",ARGS:"/args"},je={missing:e=>`缺少必填字段:${e}`,type:e=>`类型必须为:${e}`,enum:e=>`取值必须为枚举之一:${e.join(", ")}`,const:e=>`取值必须为:${JSON.stringify(e)}`,additionalProp:e=>`不允许额外字段:${e}`,constDefault:"必须等于常量"},ki=[{rootPattern:/(\/|^)components\/\d+/,discriminator:"role",keepRequired:["role","id"]},{rootPattern:/(\/|^)global\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)page\/[^\/]+\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)component\/[^\/]+\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)dataSources\/\d+/,discriminator:"type",keepRequired:["type","id"]}];function ji(e){const t=e.instancePath||e.path||"",r=e.keyword,n=e.params||{};let c=e.message||"";switch(r){case ue.REQUIRED:n.missingProperty&&(c=je.missing(n.missingProperty));break;case ue.TYPE:e.schema&&(c=je.type(e.schema));break;case ue.ENUM:Array.isArray(n.allowedValues)&&(c=je.enum(n.allowedValues));break;case ue.CONST:c=n.allowedValue!==void 0?je.const(n.allowedValue):je.constDefault;break;case ue.ADDITIONAL:n.additionalProperty&&(c=je.additionalProp(n.additionalProperty));break}return{path:t,message:c,keyword:r,params:n}}function Ri(e){return e.map(ji)}function Ii(e){const t=[],r=new Map,n=new Set;for(const c of e)if(c.keyword===ue.CONST&&c.path.endsWith(Ve.TYPE)){const d=c.path,o=r.get(d)||{path:c.path,values:[]},l=c.params?.allowedValue;l!==void 0&&!o.values.includes(l)&&o.values.push(l),r.set(d,o)}else t.push(c);for(const[,c]of r)if(c.values.length!==0)if(c.values.length===1)t.push({path:c.path,keyword:ue.CONST,params:{allowedValue:c.values[0]},message:je.const(c.values[0])});else{const s=c.path.replace(new RegExp(`${Ve.TYPE}$`),"");n.add(s)}return{merged:t,multiConstRoots:n}}function Oi(e){return`${e.keyword}|${e.path}|${JSON.stringify(e.params??{})}`}function Ni(e){const t=new Set,r=[];for(const n of e){const c=Oi(n);t.has(c)||(t.add(c),r.push(n))}return r}function Ci(e){if(!e)return"";const t=Object.values(Ve).join("|"),r=new RegExp(`^(.*?)(?:${t})(?:$|\\/)`),n=e.match(r);return n?n[1]:e}function qi(e){const t=new Map;for(const r of e){const n=Ci(r.path),c=t.get(n)||[];c.push(r),t.set(n,c)}return t}function Di(e,t){return e.keyword===ue.REQUIRED&&t.keepRequired.includes(e.params?.missingProperty)}function Ti(e,t){const r=e.keyword===ue.TYPE,n=e.path===`${t}${Ve.VALUE}`||e.path===`${t}${Ve.DEFAULT}`;return r&&n}function Ai(e,t){return e.keyword===ue.ADDITIONAL&&e.path===t}function Mi(e,t){const r=[];for(const[n,c]of e.entries()){const s=ki.find(o=>o.rootPattern.test(n));if(s&&c.some(l=>l.keyword===ue.REQUIRED&&l.params?.missingProperty===s.discriminator)){for(const l of c)Di(l,s)&&r.push(l);continue}if(!t.has(n)){r.push(...c);continue}for(const o of c)Ti(o,n)||Ai(o,n)||r.push(o)}return r}function Vi(e){return e.some(r=>r.keyword!==ue.ANY_OF)?e.filter(r=>r.keyword!==ue.ANY_OF):e}function kn(e){if(e.keyword===ue.REQUIRED){const t=e.params?.missingProperty;return t==="type"||t==="role"?0:t==="id"?1:2}return 3}function zi(e){return e.sort((t,r)=>kn(t)-kn(r))}function ee(e){if(!Array.isArray(e)||e.length===0)return[];const t=Ri(e),{merged:r,multiConstRoots:n}=Ii(t),c=Ni(r),s=qi(c),d=Mi(s,n),o=Vi(d);return zi(o)}function we(e,t){return t?.length?t.map(r=>({...r,path:`${e}${r.path?`.${r.path}`:""}`})):[]}let St=null;const Vn=()=>(St||(St=new gi({allErrors:!0,strict:!1}),wi(St)),St),jn=new Map,Fi=JSON.stringify(Me),Ui={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"],ViewComponentInstance:["#/definitions/ViewComponentInstance","#/$defs/ViewComponentInstance"],ContainerComponentInstance:["#/definitions/ContainerComponentInstance","#/$defs/ContainerComponentInstance"],LogicComponentInstanceRef:["#/definitions/LogicComponentInstanceRef","#/$defs/LogicComponentInstanceRef"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],DataSourceRest:["#/definitions/DataSourceRest","#/$defs/DataSourceRest"],DataSourceWebSocket:["#/definitions/DataSourceWebSocket","#/$defs/DataSourceWebSocket"],DataSourceStatic:["#/definitions/DataSourceStatic","#/$defs/DataSourceStatic"],DataSourceFunction:["#/definitions/DataSourceFunction","#/$defs/DataSourceFunction"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],JSDependency:["#/definitions/JSDependency","#/$defs/JSDependency"],CSSDependency:["#/definitions/CSSDependency","#/$defs/CSSDependency"],FontDependency:["#/definitions/FontDependency","#/$defs/FontDependency"],ImageDependency:["#/definitions/ImageDependency","#/$defs/ImageDependency"],JSONDependency:["#/definitions/JSONDependency","#/$defs/JSONDependency"],WasmDependency:["#/definitions/WasmDependency","#/$defs/WasmDependency"],OtherDependency:["#/definitions/OtherDependency","#/$defs/OtherDependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Li=(e,t)=>e.compile({$ref:t,definitions:Me.definitions,properties:Me.properties}),te=e=>{const t=Vn(),r=`type:${e}::${Fi}`,n=jn.get(r);if(n)return n;const c=Ui[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of c)try{const d=Li(t,s);return jn.set(r,d),d}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Te=e=>typeof e=="number"&&Number.isFinite(e)&&e>0,nr=()=>{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,n=>n.toString(16).padStart(2,"0"));return`${r.slice(0,4).join("")}-${r.slice(4,6).join("")}-${r.slice(6,8).join("")}-${r.slice(8,10).join("")}-${r.slice(10).join("")}`}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)})},ye=(e,t)=>{if(!t||typeof t!="object")return e;const r=e??{};for(const n of Object.keys(t))(!(n in r)||r[n]===void 0)&&(r[n]=t[n]);return r},Xt=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",keyword:"type",message:`JSON 解析失败:${t?.message??String(t)}`}]}}},Ki=e=>e.map(t=>({path:"",keyword:"required",params:{missingProperty:t},message:`缺少必填字段:${t}`})),zn=({input:e,normalize:t,base:r,branches:n,key:c,missingKeys:s,onSuccess:d})=>{const o=t?t(e):e,l=o;if(l&&typeof l=="object"&&typeof l[c]=="string"){const $=n[l[c]];if($)return $(l)?d(l):{ok:!1,errors:ee($.errors)}}return r(o)?d(o):!l||typeof l[c]!="string"?{ok:!1,errors:Ki(s)}:{ok:!1,errors:ee(r.errors)}},sr=(e,t,r,n)=>zn({input:e,base:t,branches:r,key:n,missingKeys:[n,"id"],onSuccess:()=>({ok:!0,value:null})}),ir=(e,t,r,n,c,s,d=[s,"id"])=>zn({input:e,normalize:o=>r(o,t),base:n,branches:c,key:s,missingKeys:d,onSuccess:o=>({ok:!0,value:o})}),Fn=te("DataSourceItem"),Un=te("DataSourceRest"),Ln=te("DataSourceWebSocket"),Kn=te("DataSourceStatic"),Jn=te("DataSourceFunction"),Ji=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=nr()),r.type&&(r.type==="rest"?(t?.strict||("pollInterval"in r&&Te(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&Te(r.timeout)&&(r.timeout=Math.round(r.timeout))),ye(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&Te(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&Te(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),ye(r,t?.defaults)):r.type==="static"?t?.strict||ye(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&Te(r.timeout)&&(r.timeout=Math.round(r.timeout)),t?.strict||ye(r,t?.defaults))),r},Hi=e=>sr(e,Fn,{rest:Un,websocket:Ln,static:Kn,function:Jn},"type"),Hn=(e,t)=>ir(e,t,Ji,Fn,{rest:Un,websocket:Ln,static:Kn,function:Jn},"type",["type","id"]),Gn=te("ComponentInstance"),Wn=te("ViewComponentInstance"),Bn=te("ContainerComponentInstance"),Yn=te("LogicComponentInstanceRef"),Gi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=nr()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),ye(r,t?.defaults),r},Wi=e=>sr(e,Gn,{view:Wn,container:Bn,logic:Yn},"role"),xn=(e,t)=>ir(e,t,Gi,Gn,{view:Wn,container:Bn,logic:Yn},"role",["role","id"]),jt=te("CICPage"),Bi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=nr()),t?.strict||ye(r,t?.defaults),r},Yi=e=>jt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(jt.errors||[])},Qn=(e,t)=>{const r=Bi(e,t);return jt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(jt.errors||[])}},Rt=te("Meta"),It=te("Layout"),xi=e=>Rt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Rt.errors||[])},Qi=e=>It(e)?{ok:!0,value:null}:{ok:!1,errors:ee(It.errors||[])},Zn=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Rt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Rt.errors||[])}},Xn=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return It(r)?{ok:!0,value:r}:{ok:!1,errors:ee(It.errors||[])}},Ot=te("Variables"),Zi=e=>Ot(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Ot.errors||[])},es=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Ot(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Ot.errors||[])}},ts=te("Dependency"),rs=te("JSDependency"),ns=te("CSSDependency"),ss=te("FontDependency"),is=te("ImageDependency"),os=te("JSONDependency"),as=te("WasmDependency"),cs=te("OtherDependency"),Xi=e=>sr(e,ts,{js:rs,css:ns,font:ss,image:is,json:os,wasm:as,other:cs},"type"),ds=(e,t)=>ir(e,t,(n,c)=>c?.strict?n:ye(n,c?.defaults),ts,{js:rs,css:ns,font:ss,image:is,json:os,wasm:as,other:cs},"type",["type","id"]),Nt=te("RegistryComponents"),eo=e=>Nt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Nt.errors||[])},us=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Nt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Nt.errors||[])}},to=e=>typeof e=="number"?`[${e}]`:`/${e}`,ro=()=>{const e=new Map,t=[],r=(...s)=>s.reduce((d,o,l)=>{const $=to(o);return l===0&&typeof o=="string"&&!o.startsWith("/")?`/${o}`:`${d}${$}`},"");return{pathJoin:r,ensureUnique:(s,d)=>{const o=e.get(s)||new Set;return o.has(d)?(e.set(s,o),!0):(o.add(d),e.set(s,o),!1)},pushError:(s,d,o,l="error")=>{const $={path:r(...s),message:d,keyword:"rule",params:{ruleId:o,level:l}};return t.push($),$},errors:t}},no=(e,t)=>{const r=ro();for(const n of t){const c=n.validate(e,r);Array.isArray(c)&&c.length&&r.errors.push(...c)}return{ok:r.errors.length===0,errors:r.errors}},so=(e,t)=>{const r=no(e,t);return r.ok?{ok:!0,value:null}:{ok:!1,errors:ee(r.errors)}},io={id:"components.id.unique",scope:"component",path:"pages[].components[].id",title:"组件 id 必须唯一",description:"组件 id 不允许重复",example:"comp_01",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let c=0;c<n.length;c++){const s=Array.isArray(n[c]?.components)?n[c].components:[];for(let d=0;d<s.length;d++){const o=s[d]?.id;if(typeof o!="string")continue;if(t.ensureUnique("components.id",o.trim())){const $=t.pushError(["pages",c,"components",d,"id"],`组件 id 重复:"${o.trim()}"`,"components.id.unique","error");r.push($)}}}return r}},oo={id:"datasources.id.unique",scope:"dataSource",path:"pages[].dataSources[].id",title:"数据源 id 必须唯一",description:"数据源 id 不允许重复",example:"ds_user_list",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let c=0;c<n.length;c++){const s=Array.isArray(n[c]?.dataSources)?n[c].dataSources:[];for(let d=0;d<s.length;d++){const o=s[d]?.id;if(typeof o!="string")continue;if(t.ensureUnique("dataSources.id",o.trim())){const $=t.pushError(["pages",c,"dataSources",d,"id"],`数据源 id 重复:"${o.trim()}"`,"datasources.id.unique","error");r.push($)}}}return r}},ao={id:"pages.name.unique",scope:"page",path:"pages[].name",title:"页面 name 必须唯一",description:"页面 name 不允许重复",example:"首页",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let c=0;c<n.length;c++){const s=n[c]?.name;if(typeof s!="string")continue;const d=s.trim();if(!d)continue;if(t.ensureUnique("pages.name",d)){const l=t.pushError(["pages",c,"name"],`页面name重复:"${d}"`,"pages.name.unique","error");r.push(l)}}return r}},co={id:"pages.path.unique",scope:"page",path:"pages[].path",title:"页面 path 必须唯一",description:"页面 path 不允许重复",example:"/home",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let c=0;c<n.length;c++){const s=n[c]?.path;if(typeof s!="string")continue;const d=s.trim();if(!d)continue;if(t.ensureUnique("pages.path",d)){const l=t.pushError(["pages",c,"path"],`页面path重复:"${d}"`,"pages.path.unique","error");r.push(l)}}return r}},uo=[ao,co,io,oo];let Ct,Rn;const lo=()=>{const e=Vn(),t=JSON.stringify(Me);(!Ct||Rn!==t)&&(Ct=e.compile(Me),Rn=t)},qt=e=>{try{return lo(),Ct(e)?so(e,uo):{ok:!1,errors:ee(Ct.errors||[])}}catch(t){return{ok:!1,errors:ee([{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}])}}},fo=(e,t)=>{if(e&&typeof e=="object")return Ae(e,t);const r=(e||"").trim();if(!(r.startsWith("{")||r.startsWith("[")))return{ok:!1,errors:ee([{path:"",message:"非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入",keyword:"type",params:{}}])};const c=Xt(r);return c.ok?Ae(c.value,t):{ok:!1,errors:c.errors}},po=async(e,t)=>{if(e&&typeof e=="object")return Ae(e,t);const r=(e||"").trim();if(r.startsWith("{")||r.startsWith("[")){const s=Xt(r);return s.ok?Ae(s.value,t):{ok:!1,errors:s.errors}}if(!(typeof globalThis.fetch=="function"))return{ok:!1,errors:ee([{path:"",message:"当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象",keyword:"type",params:{}}])};if(/^file:\/\//i.test(r))return{ok:!1,errors:ee([{path:"",message:"不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)",keyword:"type",params:{}}])};try{const s=await globalThis.fetch(r);if(!s||!s.ok){const l=[{path:"",message:`网络或资源错误:${s?.status} ${s?.statusText||""}`.trim(),keyword:"type",params:{}}];return{ok:!1,errors:ee(l)}}const d=await s.text(),o=Xt(d);return o.ok?Ae(o.value,t):{ok:!1,errors:o.errors}}catch(s){const d=[{path:"",message:`请求失败:${s?.message||s}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(d)}}},mo=e=>{const t=qt(e);if(!t.ok)return{ok:!1,errors:t.errors};const r={version:e.version,meta:e.meta,pages:e.pages,registry:e.registry,variables:e.variables,deps:e.deps,extensions:e.extensions};return{ok:!0,value:JSON.stringify(r,null,2)}},Ae=(e,t)=>{const r=typeof e=="object"?{...e}:e,n=[];if(!r||typeof r!="object")return n.push({path:"",message:"配置必须为对象",keyword:"type",params:{schema:"object"}}),{ok:!1,errors:ee(n)};if(r.version||n.push({path:"/version",message:"缺少必填字段:version",keyword:"required",params:{missingProperty:"version"}}),r.meta||n.push({path:"/meta",message:"缺少必填字段:meta",keyword:"required",params:{missingProperty:"meta"}}),r.pages||n.push({path:"/pages",message:"缺少必填字段:pages",keyword:"required",params:{missingProperty:"pages"}}),n.length)return{ok:!1,errors:ee(n)};const c=Zn(r.meta,t?.meta);if(c.ok||n.push(...we("/meta",c.errors)),r.meta?.layout){const d=Xn(r.meta.layout,t?.layout);d.ok?r.meta.layout=d.value:n.push(...we("/meta/layout",d.errors))}if(c.ok&&(r.meta=c.value),r.variables){const d=es(r.variables,t?.variables);d.ok?r.variables=d.value:n.push(...we("/variables",d.errors))}if(r.registry?.components){const d=[];for(let o=0;o<r.registry.components.length;o++){const l=us(r.registry.components[o],t?.registry);l.ok?d.push(l.value):n.push(...we(`/registry/components[${o}]`,l.errors))}r.registry.components=d}if(r.deps){const d=[];for(let o=0;o<r.deps.length;o++){const l=ds(r.deps[o],t?.dependency);l.ok?d.push(l.value):n.push(...we(`/deps[${o}]`,l.errors))}r.deps=d}if(Array.isArray(r.pages)){const d=[];for(let o=0;o<r.pages.length;o++){const l=r.pages[o],$=Qn(l,t?.page);if(!$.ok){n.push(...we(`/pages[${o}]`,$.errors));continue}const _=$.value;if(Array.isArray(l.components)){const E=[];for(let v=0;v<l.components.length;v++){const g=xn(l.components[v],t?.component);g.ok?E.push(g.value):n.push(...we(`/pages[${o}]/components[${v}]`,g.errors))}_.components=E}if(Array.isArray(l.dataSources)){const E=[];for(let v=0;v<l.dataSources.length;v++){const g=Hn(l.dataSources[v],t?.dataSource);g.ok?E.push(g.value):n.push(...we(`/pages[${o}]/dataSources[${v}]`,g.errors))}_.dataSources=E}d.push(_)}r.pages=d}if(n.length)return{ok:!1,errors:ee(n)};const s=qt(r);return s.ok?{ok:!0,value:r}:{ok:!1,errors:s.errors}};class or{config;constructor(t){const r=qt(t);if(!r.ok)throw new Error(`Invalid CIC Configuration: ${JSON.stringify(r.errors)}`);this.config=t}getConfig(){return this.config}findComponent(t){let r;return this.walkComponents(n=>n.id===t?(r=n,!1):!0),r}findPageByComponent(t){let r;return this.walkComponents((n,c)=>n.id===t?(r=c,!1):!0),r}getVariable(t,r){const n=this.config.variables;if(n){if(t.componentId&&n.component&&n.component[t.componentId]){const c=n.component[t.componentId][r];if(c)return c.value??c.default}if(t.pageId&&n.page&&n.page[t.pageId]){const c=n.page[t.pageId][r];if(c)return c.value??c.default}if(n.global&&n.global[r]){const c=n.global[r];return c.value??c.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,n,c,s]=r;if(n==="global")return this.getVariable({},s);if(n==="page")return this.getVariable({pageId:c},s);if(n==="component")return this.getVariable({componentId:c},s)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const n=[];for(const s of r.components||[])n.push({node:s});let c=!1;for(;n.length>0&&!c;){const{node:s,parent:d}=n.pop();if(t(s,r,d)===!1){c=!0;break}if(s.children&&s.children.length>0)for(let l=s.children.length-1;l>=0;l--)n.push({node:s.children[l],parent:s})}if(c)break}}static getValueByPath(t,r,n){if(t==null||!r)return n;const c=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(d=>{d.trim()&&c.push(d.trim())});let s=t;for(const d of c){if(s==null)return n;s=s[d]}return s===void 0?n:s}static traverseTree(t,r,n){const c=Array.isArray(t)?t:[t];for(const s of c)r(s,n)!==!1&&s.children&&s.children.length>0&&or.traverseTree(s.children,r,s)}static createDataSource=Hn;static validateDataSource=Hi;static createComponent=xn;static validateComponent=Wi;static createPage=Qn;static validatePage=Yi;static createMeta=Zn;static createLayout=Xn;static validateMeta=xi;static validateLayout=Qi;static createVariables=es;static validateVariables=Zi;static createDependency=ds;static validateDependency=Xi;static createRegistryComponent=us;static validateRegistryComponent=eo;static importCIC=fo;static exportCIC=mo;static validateCIC=qt;static importCICAsync=po}exports.CICSDK=or;
|