@anov/cic-standard-sdk 0.0.11 → 0.0.13
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 +7 -7
- package/dist/cic-sdk.es.js +2513 -2404
- package/dist/cic-sdk.umd.js +7 -7
- package/dist/sdk/generators/common.d.ts +65 -20
- package/dist/types/variables.d.ts +10 -12
- package/package.json +2 -2
package/dist/cic-sdk.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(ke,je){typeof exports=="object"&&typeof module<"u"?je(exports):typeof define=="function"&&define.amd?define(["exports"],je):(ke=typeof globalThis<"u"?globalThis:ke||self,je(ke.CICSDK={}))})(this,(function(ke){"use strict";function je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ve={exports:{}},Vt={},ge={},Pe={},zt={},Ft={},Lt={},or;function ze(){return or||(or=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 o 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((c,y)=>`${c}${y}`,"")}get names(){var s;return(s=this._names)!==null&&s!==void 0?s:this._names=this._items.reduce((c,y)=>(y instanceof r&&(c[y.str]=(c[y.str]||0)+1),c),{})}}e._Code=o,e.nil=new o("");function h(l,...s){const c=[l[0]];let y=0;for(;y<s.length;)i(c,s[y]),c.push(l[++y]);return new o(c)}e._=h;const n=new o("+");function u(l,...s){const c=[_(l[0])];let y=0;for(;y<s.length;)c.push(n),i(c,s[y]),c.push(n,_(l[++y]));return f(c),new o(c)}e.str=u;function i(l,s){s instanceof o?l.push(...s._items):s instanceof r?l.push(s):l.push(E(s))}e.addCodeArg=i;function f(l){let s=1;for(;s<l.length-1;){if(l[s]===n){const c=$(l[s-1],l[s+1]);if(c!==void 0){l.splice(s-1,3,c);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 g(l,s){return s.emptyStr()?l:l.emptyStr()?s:u`${l}${s}`}e.strConcat=g;function E(l){return typeof l=="number"||typeof l=="boolean"||l===null?l:_(Array.isArray(l)?l.join(","):l)}function v(l){return new o(_(l))}e.stringify=v;function _(l){return JSON.stringify(l).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=_;function b(l){return typeof l=="string"&&e.IDENTIFIER.test(l)?new o(`.${l}`):h`[${l}]`}e.getProperty=b;function w(l){if(typeof l=="string"&&e.IDENTIFIER.test(l))return new o(`${l}`);throw new Error(`CodeGen: invalid export name: ${l}, use explicit $id name mapping`)}e.getEsmExportName=w;function d(l){return new o(l.toString())}e.regexpCode=d})(Lt)),Lt}var Ut={},ar;function cr(){return ar||(ar=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=ze();class r extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var o;(function(f){f[f.Started=0]="Started",f[f.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class h{constructor({prefixes:$,parent:g}={}){this._names={},this._prefixes=$,this._parent=g}toName($){return $ instanceof t.Name?$:this.name($)}name($){return new t.Name(this._newName($))}_newName($){const g=this._names[$]||this._nameGroup($);return`${$}${g.index++}`}_nameGroup($){var g,E;if(!((E=(g=this._parent)===null||g===void 0?void 0:g._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=h;class n extends t.Name{constructor($,g){super(g),this.prefix=$}setValue($,{property:g,itemIndex:E}){this.value=$,this.scopePath=(0,t._)`.${new t.Name(g)}[${E}]`}}e.ValueScopeName=n;const u=(0,t._)`\n`;class i extends h{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($,g){var E;if(g.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName($),{prefix:_}=v,b=(E=g.key)!==null&&E!==void 0?E:g.ref;let w=this._values[_];if(w){const s=w.get(b);if(s)return s}else w=this._values[_]=new Map;w.set(b,v);const d=this._scope[_]||(this._scope[_]=[]),l=d.length;return d[l]=g.ref,v.setValue(g,{property:_,itemIndex:l}),v}getValue($,g){const E=this._values[$];if(E)return E.get(g)}scopeRefs($,g=this._values){return this._reduceValues(g,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${$}${E.scopePath}`})}scopeCode($=this._values,g,E){return this._reduceValues($,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},g,E)}_reduceValues($,g,E={},v){let _=t.nil;for(const b in $){const w=$[b];if(!w)continue;const d=E[b]=E[b]||new Map;w.forEach(l=>{if(d.has(l))return;d.set(l,o.Started);let s=g(l);if(s){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;_=(0,t._)`${_}${c} ${l} = ${s};${this.opts._n}`}else if(s=v?.(l))_=(0,t._)`${_}${s}${this.opts._n}`;else throw new r(l);d.set(l,o.Completed)})}return _}}e.ValueScope=i})(Ut)),Ut}var dr;function H(){return dr||(dr=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=ze(),r=cr();var o=ze();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var h=cr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return h.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return h.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return h.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return h.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(p,S){return this}}class u extends n{constructor(p,S,C){super(),this.varKind=p,this.name=S,this.rhs=C}render({es5:p,_n:S}){const C=p?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${U};`+S}optimizeNames(p,S){if(p[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,p,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends n{constructor(p,S,C){super(),this.lhs=p,this.rhs=S,this.sideEffects=C}render({_n:p}){return`${this.lhs} = ${this.rhs};`+p}optimizeNames(p,S){if(!(this.lhs instanceof t.Name&&!p[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,p,S),this}get names(){const p=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(p,this.rhs)}}class f extends i{constructor(p,S,C,U){super(p,C,U),this.op=S}render({_n:p}){return`${this.lhs} ${this.op}= ${this.rhs};`+p}}class $ extends n{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`${this.label}:`+p}}class g extends n{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`break${this.label?` ${this.label}`:""};`+p}}class E extends n{constructor(p){super(),this.error=p}render({_n:p}){return`throw ${this.error};`+p}get names(){return this.error.names}}class v extends n{constructor(p){super(),this.code=p}render({_n:p}){return`${this.code};`+p}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(p,S){return this.code=L(this.code,p,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class _ extends n{constructor(p=[]){super(),this.nodes=p}render(p){return this.nodes.reduce((S,C)=>S+C.render(p),"")}optimizeNodes(){const{nodes:p}=this;let S=p.length;for(;S--;){const C=p[S].optimizeNodes();Array.isArray(C)?p.splice(S,1,...C):C?p[S]=C:p.splice(S,1)}return p.length>0?this:void 0}optimizeNames(p,S){const{nodes:C}=this;let U=C.length;for(;U--;){const J=C[U];J.optimizeNames(p,S)||(Q(p,J.names),C.splice(U,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((p,S)=>V(p,S.names),{})}}class b extends _{render(p){return"{"+p._n+super.render(p)+"}"+p._n}}class w extends _{}class d extends b{}d.kind="else";class l extends b{constructor(p,S){super(S),this.condition=p}render(p){let S=`if(${this.condition})`+super.render(p);return this.else&&(S+="else "+this.else.render(p)),S}optimizeNodes(){super.optimizeNodes();const p=this.condition;if(p===!0)return this.nodes;let S=this.else;if(S){const C=S.optimizeNodes();S=this.else=Array.isArray(C)?new d(C):C}if(S)return p===!1?S instanceof l?S:S.nodes:this.nodes.length?this:new l(oe(p),S instanceof l?[S]:S.nodes);if(!(p===!1||!this.nodes.length))return this}optimizeNames(p,S){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(p,S),!!(super.optimizeNames(p,S)||this.else))return this.condition=L(this.condition,p,S),this}get names(){const p=super.names;return F(p,this.condition),this.else&&V(p,this.else.names),p}}l.kind="if";class s extends b{}s.kind="for";class c extends s{constructor(p){super(),this.iteration=p}render(p){return`for(${this.iteration})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iteration=L(this.iteration,p,S),this}get names(){return V(super.names,this.iteration.names)}}class y extends s{constructor(p,S,C,U){super(),this.varKind=p,this.name=S,this.from=C,this.to=U}render(p){const S=p.es5?r.varKinds.var:this.varKind,{name:C,from:U,to:J}=this;return`for(${S} ${C}=${U}; ${C}<${J}; ${C}++)`+super.render(p)}get names(){const p=F(super.names,this.from);return F(p,this.to)}}class a extends s{constructor(p,S,C,U){super(),this.loop=p,this.varKind=S,this.name=C,this.iterable=U}render(p){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iterable=L(this.iterable,p,S),this}get names(){return V(super.names,this.iterable.names)}}class m extends b{constructor(p,S,C){super(),this.name=p,this.args=S,this.async=C}render(p){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(p)}}m.kind="func";class P extends _{render(p){return"return "+super.render(p)}}P.kind="return";class R extends b{render(p){let S="try"+super.render(p);return this.catch&&(S+=this.catch.render(p)),this.finally&&(S+=this.finally.render(p)),S}optimizeNodes(){var p,S;return super.optimizeNodes(),(p=this.catch)===null||p===void 0||p.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(p,S){var C,U;return super.optimizeNames(p,S),(C=this.catch)===null||C===void 0||C.optimizeNames(p,S),(U=this.finally)===null||U===void 0||U.optimizeNames(p,S),this}get names(){const p=super.names;return this.catch&&V(p,this.catch.names),this.finally&&V(p,this.finally.names),p}}class T extends b{constructor(p){super(),this.error=p}render(p){return`catch(${this.error})`+super.render(p)}}T.kind="catch";class z extends b{render(p){return"finally"+super.render(p)}}z.kind="finally";class N{constructor(p,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
|
|
2
|
-
`:""},this._extScope=p,this._scope=new r.Scope({parent:p}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(p){return this._scope.name(p)}scopeName(p){return this._extScope.name(p)}scopeValue(p,S){const C=this._extScope.value(p,S);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(p,S){return this._extScope.getValue(p,S)}scopeRefs(p){return this._extScope.scopeRefs(p,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(p,S,C,U){const J=this._scope.toName(S);return C!==void 0&&U&&(this._constants[J.str]=C),this._leafNode(new u(p,J,C)),J}const(p,S,C){return this._def(r.varKinds.const,p,S,C)}let(p,S,C){return this._def(r.varKinds.let,p,S,C)}var(p,S,C){return this._def(r.varKinds.var,p,S,C)}assign(p,S,C){return this._leafNode(new i(p,S,C))}add(p,S){return this._leafNode(new f(p,e.operators.ADD,S))}code(p){return typeof p=="function"?p():p!==t.nil&&this._leafNode(new v(p)),this}object(...p){const S=["{"];for(const[C,U]of p)S.length>1&&S.push(","),S.push(C),(C!==U||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,U));return S.push("}"),new t._Code(S)}if(p,S,C){if(this._blockNode(new l(p)),S&&C)this.code(S).else().code(C).endIf();else if(S)this.code(S).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(p){return this._elseNode(new l(p))}else(){return this._elseNode(new d)}endIf(){return this._endBlockNode(l,d)}_for(p,S){return this._blockNode(p),S&&this.code(S).endFor(),this}for(p,S){return this._for(new c(p),S)}forRange(p,S,C,U,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const Z=this._scope.toName(p);return this._for(new y(J,Z,S,C),()=>U(Z))}forOf(p,S,C,U=r.varKinds.const){const J=this._scope.toName(p);if(this.opts.es5){const Z=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${Z}.length`,B=>{this.var(J,(0,t._)`${Z}[${B}]`),C(J)})}return this._for(new a("of",U,J,S),()=>C(J))}forIn(p,S,C,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(p,(0,t._)`Object.keys(${S})`,C);const J=this._scope.toName(p);return this._for(new a("in",U,J,S),()=>C(J))}endFor(){return this._endBlockNode(s)}label(p){return this._leafNode(new $(p))}break(p){return this._leafNode(new g(p))}return(p){const S=new P;if(this._blockNode(S),this.code(p),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(p,S,C){if(!S&&!C)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new R;if(this._blockNode(U),this.code(p),S){const J=this.name("e");this._currNode=U.catch=new T(J),S(J)}return C&&(this._currNode=U.finally=new z,this.code(C)),this._endBlockNode(T,z)}throw(p){return this._leafNode(new E(p))}block(p,S){return this._blockStarts.push(this._nodes.length),p&&this.code(p).endBlock(S),this}endBlock(p){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-S;if(C<0||p!==void 0&&C!==p)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${p} expected`);return this._nodes.length=S,this}func(p,S=t.nil,C,U){return this._blockNode(new m(p,S,C)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(m)}optimize(p=1){for(;p-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(p){return this._currNode.nodes.push(p),this}_blockNode(p){this._currNode.nodes.push(p),this._nodes.push(p)}_endBlockNode(p,S){const C=this._currNode;if(C instanceof p||S&&C instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${p.kind}/${S.kind}`:p.kind}"`)}_elseNode(p){const S=this._currNode;if(!(S instanceof l))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=p,this}get _root(){return this._nodes[0]}get _currNode(){const p=this._nodes;return p[p.length-1]}set _currNode(p){const S=this._nodes;S[S.length-1]=p}}e.CodeGen=N;function V(O,p){for(const S in p)O[S]=(O[S]||0)+(p[S]||0);return O}function F(O,p){return p instanceof t._CodeOrName?V(O,p.names):O}function L(O,p,S){if(O instanceof t.Name)return C(O);if(!U(O))return O;return new t._Code(O._items.reduce((J,Z)=>(Z instanceof t.Name&&(Z=C(Z)),Z instanceof t._Code?J.push(...Z._items):J.push(Z),J),[]));function C(J){const Z=S[J.str];return Z===void 0||p[J.str]!==1?J:(delete p[J.str],Z)}function U(J){return J instanceof t._Code&&J._items.some(Z=>Z instanceof t.Name&&p[Z.str]===1&&S[Z.str]!==void 0)}}function Q(O,p){for(const S in p)O[S]=(O[S]||0)-(p[S]||0)}function oe(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,t._)`!${D(O)}`}e.not=oe;const ae=j(e.operators.AND);function X(...O){return O.reduce(ae)}e.and=X;const he=j(e.operators.OR);function M(...O){return O.reduce(he)}e.or=M;function j(O){return(p,S)=>p===t.nil?S:S===t.nil?p:(0,t._)`${D(p)} ${O} ${D(S)}`}function D(O){return O instanceof t.Name?O:(0,t._)`(${O})`}})(Ft)),Ft}var G={},ur;function Y(){if(ur)return G;ur=1,Object.defineProperty(G,"__esModule",{value:!0}),G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;const e=H(),t=ze();function r(a){const m={};for(const P of a)m[P]=!0;return m}G.toHash=r;function o(a,m){return typeof m=="boolean"?m:Object.keys(m).length===0?!0:(h(a,m),!n(m,a.self.RULES.all))}G.alwaysValidSchema=o;function h(a,m=a.schema){const{opts:P,self:R}=a;if(!P.strictSchema||typeof m=="boolean")return;const T=R.RULES.keywords;for(const z in m)T[z]||y(a,`unknown keyword: "${z}"`)}G.checkUnknownRules=h;function n(a,m){if(typeof a=="boolean")return!a;for(const P in a)if(m[P])return!0;return!1}G.schemaHasRules=n;function u(a,m){if(typeof a=="boolean")return!a;for(const P in a)if(P!=="$ref"&&m.all[P])return!0;return!1}G.schemaHasRulesButRef=u;function i({topSchemaRef:a,schemaPath:m},P,R,T){if(!T){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${a}${m}${(0,e.getProperty)(R)}`}G.schemaRefOrVal=i;function f(a){return E(decodeURIComponent(a))}G.unescapeFragment=f;function $(a){return encodeURIComponent(g(a))}G.escapeFragment=$;function g(a){return typeof a=="number"?`${a}`:a.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=g;function E(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=E;function v(a,m){if(Array.isArray(a))for(const P of a)m(P);else m(a)}G.eachItem=v;function _({mergeNames:a,mergeToName:m,mergeValues:P,resultToName:R}){return(T,z,N,V)=>{const F=N===void 0?z:N instanceof e.Name?(z instanceof e.Name?a(T,z,N):m(T,z,N),N):z instanceof e.Name?(m(T,N,z),z):P(z,N);return V===e.Name&&!(F instanceof e.Name)?R(T,F):F}}G.mergeEvaluated={props:_({mergeNames:(a,m,P)=>a.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>{a.if((0,e._)`${m} === true`,()=>a.assign(P,!0),()=>a.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${m})`))}),mergeToName:(a,m,P)=>a.if((0,e._)`${P} !== true`,()=>{m===!0?a.assign(P,!0):(a.assign(P,(0,e._)`${P} || {}`),w(a,P,m))}),mergeValues:(a,m)=>a===!0?!0:{...a,...m},resultToName:b}),items:_({mergeNames:(a,m,P)=>a.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>a.assign(P,(0,e._)`${m} === true ? true : ${P} > ${m} ? ${P} : ${m}`)),mergeToName:(a,m,P)=>a.if((0,e._)`${P} !== true`,()=>a.assign(P,m===!0?!0:(0,e._)`${P} > ${m} ? ${P} : ${m}`)),mergeValues:(a,m)=>a===!0?!0:Math.max(a,m),resultToName:(a,m)=>a.var("items",m)})};function b(a,m){if(m===!0)return a.var("props",!0);const P=a.var("props",(0,e._)`{}`);return m!==void 0&&w(a,P,m),P}G.evaluatedPropsToName=b;function w(a,m,P){Object.keys(P).forEach(R=>a.assign((0,e._)`${m}${(0,e.getProperty)(R)}`,!0))}G.setEvaluated=w;const d={};function l(a,m){return a.scopeValue("func",{ref:m,code:d[m.code]||(d[m.code]=new t._Code(m.code))})}G.useFunc=l;var s;(function(a){a[a.Num=0]="Num",a[a.Str=1]="Str"})(s||(G.Type=s={}));function c(a,m,P){if(a instanceof e.Name){const R=m===s.Num;return P?R?(0,e._)`"[" + ${a} + "]"`:(0,e._)`"['" + ${a} + "']"`:R?(0,e._)`"/" + ${a}`:(0,e._)`"/" + ${a}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(a).toString():"/"+g(a)}G.getErrorPath=c;function y(a,m,P=a.opts.strictSchema){if(P){if(m=`strict mode: ${m}`,P===!0)throw new Error(m);a.self.logger.warn(m)}}return G.checkStrictMode=y,G}var Fe={},lr;function $e(){if(lr)return Fe;lr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=H(),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 fr;function Le(){return fr||(fr=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=H(),r=Y(),o=$e();e.keywordError={message:({keyword:d})=>(0,t.str)`must pass "${d}" keyword validation`},e.keyword$DataError={message:({keyword:d,schemaType:l})=>l?(0,t.str)`"${d}" keyword must be ${l} ($data)`:(0,t.str)`"${d}" keyword is invalid ($data)`};function h(d,l=e.keywordError,s,c){const{it:y}=d,{gen:a,compositeRule:m,allErrors:P}=y,R=E(d,l,s);c??(m||P)?f(a,R):$(y,(0,t._)`[${R}]`)}e.reportError=h;function n(d,l=e.keywordError,s){const{it:c}=d,{gen:y,compositeRule:a,allErrors:m}=c,P=E(d,l,s);f(y,P),a||m||$(c,o.default.vErrors)}e.reportExtraError=n;function u(d,l){d.assign(o.default.errors,l),d.if((0,t._)`${o.default.vErrors} !== null`,()=>d.if(l,()=>d.assign((0,t._)`${o.default.vErrors}.length`,l),()=>d.assign(o.default.vErrors,null)))}e.resetErrorsCount=u;function i({gen:d,keyword:l,schemaValue:s,data:c,errsCount:y,it:a}){if(y===void 0)throw new Error("ajv implementation error");const m=d.name("err");d.forRange("i",y,o.default.errors,P=>{d.const(m,(0,t._)`${o.default.vErrors}[${P}]`),d.if((0,t._)`${m}.instancePath === undefined`,()=>d.assign((0,t._)`${m}.instancePath`,(0,t.strConcat)(o.default.instancePath,a.errorPath))),d.assign((0,t._)`${m}.schemaPath`,(0,t.str)`${a.errSchemaPath}/${l}`),a.opts.verbose&&(d.assign((0,t._)`${m}.schema`,s),d.assign((0,t._)`${m}.data`,c))})}e.extendErrors=i;function f(d,l){const s=d.const("err",l);d.if((0,t._)`${o.default.vErrors} === null`,()=>d.assign(o.default.vErrors,(0,t._)`[${s}]`),(0,t._)`${o.default.vErrors}.push(${s})`),d.code((0,t._)`${o.default.errors}++`)}function $(d,l){const{gen:s,validateName:c,schemaEnv:y}=d;y.$async?s.throw((0,t._)`new ${d.ValidationError}(${l})`):(s.assign((0,t._)`${c}.errors`,l),s.return(!1))}const g={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(d,l,s){const{createErrors:c}=d.it;return c===!1?(0,t._)`{}`:v(d,l,s)}function v(d,l,s={}){const{gen:c,it:y}=d,a=[_(y,s),b(d,s)];return w(d,l,a),c.object(...a)}function _({errorPath:d},{instancePath:l}){const s=l?(0,t.str)`${d}${(0,r.getErrorPath)(l,r.Type.Str)}`:d;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,s)]}function b({keyword:d,it:{errSchemaPath:l}},{schemaPath:s,parentSchema:c}){let y=c?l:(0,t.str)`${l}/${d}`;return s&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(s,r.Type.Str)}`),[g.schemaPath,y]}function w(d,{params:l,message:s},c){const{keyword:y,data:a,schemaValue:m,it:P}=d,{opts:R,propertyName:T,topSchemaRef:z,schemaPath:N}=P;c.push([g.keyword,y],[g.params,typeof l=="function"?l(d):l||(0,t._)`{}`]),R.messages&&c.push([g.message,typeof s=="function"?s(d):s]),R.verbose&&c.push([g.schema,m],[g.parentSchema,(0,t._)`${z}${N}`],[o.default.data,a]),T&&c.push([g.propertyName,T])}})(zt)),zt}var pr;function cs(){if(pr)return Pe;pr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.boolOrEmptySchema=Pe.topBoolOrEmptySchema=void 0;const e=Le(),t=H(),r=$e(),o={message:"boolean schema is false"};function h(i){const{gen:f,schema:$,validateName:g}=i;$===!1?u(i,!1):typeof $=="object"&&$.$async===!0?f.return(r.default.data):(f.assign((0,t._)`${g}.errors`,null),f.return(!0))}Pe.topBoolOrEmptySchema=h;function n(i,f){const{gen:$,schema:g}=i;g===!1?($.var(f,!1),u(i)):$.var(f,!0)}Pe.boolOrEmptySchema=n;function u(i,f){const{gen:$,data:g}=i,E={gen:$,keyword:"false schema",data:g,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,e.reportError)(E,o,void 0,f)}return Pe}var re={},Se={},mr;function hr(){if(mr)return Se;mr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.getRules=Se.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(h){return typeof h=="string"&&t.has(h)}Se.isJSONType=r;function o(){const h={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...h,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},h.number,h.string,h.array,h.object],post:{rules:[]},all:{},keywords:{}}}return Se.getRules=o,Se}var ve={},yr;function gr(){if(yr)return ve;yr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.shouldUseRule=ve.shouldUseGroup=ve.schemaHasRulesForType=void 0;function e({schema:o,self:h},n){const u=h.RULES.types[n];return u&&u!==!0&&t(o,u)}ve.schemaHasRulesForType=e;function t(o,h){return h.rules.some(n=>r(o,n))}ve.shouldUseGroup=t;function r(o,h){var n;return o[h.keyword]!==void 0||((n=h.definition.implements)===null||n===void 0?void 0:n.some(u=>o[u]!==void 0))}return ve.shouldUseRule=r,ve}var vr;function Ue(){if(vr)return re;vr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=hr(),t=gr(),r=Le(),o=H(),h=Y();var n;(function(s){s[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong"})(n||(re.DataType=n={}));function u(s){const c=i(s.type);if(c.includes("null")){if(s.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!c.length&&s.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');s.nullable===!0&&c.push("null")}return c}re.getSchemaTypes=u;function i(s){const c=Array.isArray(s)?s:s?[s]:[];if(c.every(e.isJSONType))return c;throw new Error("type must be JSONType or JSONType[]: "+c.join(","))}re.getJSONTypes=i;function f(s,c){const{gen:y,data:a,opts:m}=s,P=g(c,m.coerceTypes),R=c.length>0&&!(P.length===0&&c.length===1&&(0,t.schemaHasRulesForType)(s,c[0]));if(R){const T=b(c,a,m.strictNumbers,n.Wrong);y.if(T,()=>{P.length?E(s,c,P):d(s)})}return R}re.coerceAndCheckDataType=f;const $=new Set(["string","number","integer","boolean","null"]);function g(s,c){return c?s.filter(y=>$.has(y)||c==="array"&&y==="array"):[]}function E(s,c,y){const{gen:a,data:m,opts:P}=s,R=a.let("dataType",(0,o._)`typeof ${m}`),T=a.let("coerced",(0,o._)`undefined`);P.coerceTypes==="array"&&a.if((0,o._)`${R} == 'object' && Array.isArray(${m}) && ${m}.length == 1`,()=>a.assign(m,(0,o._)`${m}[0]`).assign(R,(0,o._)`typeof ${m}`).if(b(c,m,P.strictNumbers),()=>a.assign(T,m))),a.if((0,o._)`${T} !== undefined`);for(const N of y)($.has(N)||N==="array"&&P.coerceTypes==="array")&&z(N);a.else(),d(s),a.endIf(),a.if((0,o._)`${T} !== undefined`,()=>{a.assign(m,T),v(s,T)});function z(N){switch(N){case"string":a.elseIf((0,o._)`${R} == "number" || ${R} == "boolean"`).assign(T,(0,o._)`"" + ${m}`).elseIf((0,o._)`${m} === null`).assign(T,(0,o._)`""`);return;case"number":a.elseIf((0,o._)`${R} == "boolean" || ${m} === null
|
|
3
|
-
|| (${
|
|
4
|
-
|| (${
|
|
5
|
-
|| ${R} === "boolean" || ${m} === null`).assign(T,(0,o._)`[${m}]`)}}}function v({gen:s,parentData:c,parentDataProperty:y},a){s.if((0,o._)`${c} !== undefined`,()=>s.assign((0,o._)`${c}[${y}]`,a))}function _(s,c,y,a=n.Correct){const m=a===n.Correct?o.operators.EQ:o.operators.NEQ;let P;switch(s){case"null":return(0,o._)`${c} ${m} null`;case"array":P=(0,o._)`Array.isArray(${c})`;break;case"object":P=(0,o._)`${c} && typeof ${c} == "object" && !Array.isArray(${c})`;break;case"integer":P=R((0,o._)`!(${c} % 1) && !isNaN(${c})`);break;case"number":P=R();break;default:return(0,o._)`typeof ${c} ${m} ${s}`}return a===n.Correct?P:(0,o.not)(P);function R(T=o.nil){return(0,o.and)((0,o._)`typeof ${c} == "number"`,T,y?(0,o._)`isFinite(${c})`:o.nil)}}re.checkDataType=_;function b(s,c,y,a){if(s.length===1)return _(s[0],c,y,a);let m;const P=(0,h.toHash)(s);if(P.array&&P.object){const R=(0,o._)`typeof ${c} != "object"`;m=P.null?R:(0,o._)`!${c} || ${R}`,delete P.null,delete P.array,delete P.object}else m=o.nil;P.number&&delete P.integer;for(const R in P)m=(0,o.and)(m,_(R,c,y,a));return m}re.checkDataTypes=b;const w={message:({schema:s})=>`must be ${s}`,params:({schema:s,schemaValue:c})=>typeof s=="string"?(0,o._)`{type: ${s}}`:(0,o._)`{type: ${c}}`};function d(s){const c=l(s);(0,r.reportError)(c,w)}re.reportTypeError=d;function l(s){const{gen:c,data:y,schema:a}=s,m=(0,h.schemaRefOrVal)(s,a,"type");return{gen:c,keyword:"type",data:y,schema:a.type,schemaCode:m,schemaValue:m,parentSchema:a,params:{},it:s}}return re}var Ce={},_r;function ds(){if(_r)return Ce;_r=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.assignDefaults=void 0;const e=H(),t=Y();function r(h,n){const{properties:u,items:i}=h.schema;if(n==="object"&&u)for(const f in u)o(h,f,u[f].default);else n==="array"&&Array.isArray(i)&&i.forEach((f,$)=>o(h,$,f.default))}Ce.assignDefaults=r;function o(h,n,u){const{gen:i,compositeRule:f,data:$,opts:g}=h;if(u===void 0)return;const E=(0,e._)`${$}${(0,e.getProperty)(n)}`;if(f){(0,t.checkStrictMode)(h,`default is ignored for: ${E}`);return}let v=(0,e._)`${E} === undefined`;g.useDefaults==="empty"&&(v=(0,e._)`${v} || ${E} === null || ${E} === ""`),i.if(v,(0,e._)`${E} = ${(0,e.stringify)(u)}`)}return Ce}var fe={},x={},$r;function pe(){if($r)return x;$r=1,Object.defineProperty(x,"__esModule",{value:!0}),x.validateUnion=x.validateArray=x.usePattern=x.callValidateCode=x.schemaProperties=x.allSchemaProperties=x.noPropertyInData=x.propertyInData=x.isOwnProperty=x.hasPropFunc=x.reportMissingProp=x.checkMissingProp=x.checkReportMissingProp=void 0;const e=H(),t=Y(),r=$e(),o=Y();function h(s,c){const{gen:y,data:a,it:m}=s;y.if(g(y,a,c,m.opts.ownProperties),()=>{s.setParams({missingProperty:(0,e._)`${c}`},!0),s.error()})}x.checkReportMissingProp=h;function n({gen:s,data:c,it:{opts:y}},a,m){return(0,e.or)(...a.map(P=>(0,e.and)(g(s,c,P,y.ownProperties),(0,e._)`${m} = ${P}`)))}x.checkMissingProp=n;function u(s,c){s.setParams({missingProperty:c},!0),s.error()}x.reportMissingProp=u;function i(s){return s.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}x.hasPropFunc=i;function f(s,c,y){return(0,e._)`${i(s)}.call(${c}, ${y})`}x.isOwnProperty=f;function $(s,c,y,a){const m=(0,e._)`${c}${(0,e.getProperty)(y)} !== undefined`;return a?(0,e._)`${m} && ${f(s,c,y)}`:m}x.propertyInData=$;function g(s,c,y,a){const m=(0,e._)`${c}${(0,e.getProperty)(y)} === undefined`;return a?(0,e.or)(m,(0,e.not)(f(s,c,y))):m}x.noPropertyInData=g;function E(s){return s?Object.keys(s).filter(c=>c!=="__proto__"):[]}x.allSchemaProperties=E;function v(s,c){return E(c).filter(y=>!(0,t.alwaysValidSchema)(s,c[y]))}x.schemaProperties=v;function _({schemaCode:s,data:c,it:{gen:y,topSchemaRef:a,schemaPath:m,errorPath:P},it:R},T,z,N){const V=N?(0,e._)`${s}, ${c}, ${a}${m}`:c,F=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,R.parentData],[r.default.parentDataProperty,R.parentDataProperty],[r.default.rootData,r.default.rootData]];R.opts.dynamicRef&&F.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const L=(0,e._)`${V}, ${y.object(...F)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${L})`:(0,e._)`${T}(${L})`}x.callValidateCode=_;const b=(0,e._)`new RegExp`;function w({gen:s,it:{opts:c}},y){const a=c.unicodeRegExp?"u":"",{regExp:m}=c.code,P=m(y,a);return s.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${m.code==="new RegExp"?b:(0,o.useFunc)(s,m)}(${y}, ${a})`})}x.usePattern=w;function d(s){const{gen:c,data:y,keyword:a,it:m}=s,P=c.name("valid");if(m.allErrors){const T=c.let("valid",!0);return R(()=>c.assign(T,!1)),T}return c.var(P,!0),R(()=>c.break()),P;function R(T){const z=c.const("len",(0,e._)`${y}.length`);c.forRange("i",0,z,N=>{s.subschema({keyword:a,dataProp:N,dataPropType:t.Type.Num},P),c.if((0,e.not)(P),T)})}}x.validateArray=d;function l(s){const{gen:c,schema:y,keyword:a,it:m}=s;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(m,z))&&!m.opts.unevaluated)return;const R=c.let("valid",!1),T=c.name("_valid");c.block(()=>y.forEach((z,N)=>{const V=s.subschema({keyword:a,schemaProp:N,compositeRule:!0},T);c.assign(R,(0,e._)`${R} || ${T}`),s.mergeValidEvaluated(V,T)||c.if((0,e.not)(R))})),s.result(R,()=>s.reset(),()=>s.error(!0))}return x.validateUnion=l,x}var br;function us(){if(br)return fe;br=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.validateKeywordUsage=fe.validSchemaType=fe.funcKeywordCode=fe.macroKeywordCode=void 0;const e=H(),t=$e(),r=pe(),o=Le();function h(v,_){const{gen:b,keyword:w,schema:d,parentSchema:l,it:s}=v,c=_.macro.call(s.self,d,l,s),y=$(b,w,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);const a=b.name("valid");v.subschema({schema:c,schemaPath:e.nil,errSchemaPath:`${s.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},a),v.pass(a,()=>v.error(!0))}fe.macroKeywordCode=h;function n(v,_){var b;const{gen:w,keyword:d,schema:l,parentSchema:s,$data:c,it:y}=v;f(y,_);const a=!c&&_.compile?_.compile.call(y.self,l,s,y):_.validate,m=$(w,d,a),P=w.let("valid");v.block$data(P,R),v.ok((b=_.valid)!==null&&b!==void 0?b:P);function R(){if(_.errors===!1)N(),_.modifying&&u(v),V(()=>v.error());else{const F=_.async?T():z();_.modifying&&u(v),V(()=>i(v,F))}}function T(){const F=w.let("ruleErrs",null);return w.try(()=>N((0,e._)`await `),L=>w.assign(P,!1).if((0,e._)`${L} instanceof ${y.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${m}.errors`;return w.assign(F,null),N(e.nil),F}function N(F=_.async?(0,e._)`await `:e.nil){const L=y.opts.passContext?t.default.this:t.default.self,Q=!("compile"in _&&!c||_.schema===!1);w.assign(P,(0,e._)`${F}${(0,r.callValidateCode)(v,m,L,Q)}`,_.modifying)}function V(F){var L;w.if((0,e.not)((L=_.valid)!==null&&L!==void 0?L:P),F)}}fe.funcKeywordCode=n;function u(v){const{gen:_,data:b,it:w}=v;_.if(w.parentData,()=>_.assign(b,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function i(v,_){const{gen:b}=v;b.if((0,e._)`Array.isArray(${_})`,()=>{b.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${_} : ${t.default.vErrors}.concat(${_})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,o.extendErrors)(v)},()=>v.error())}function f({schemaEnv:v},_){if(_.async&&!v.$async)throw new Error("async keyword in sync schema")}function $(v,_,b){if(b===void 0)throw new Error(`keyword "${_}" failed to compile`);return v.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function g(v,_,b=!1){return!_.length||_.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||b&&typeof v>"u")}fe.validSchemaType=g;function E({schema:v,opts:_,self:b,errSchemaPath:w},d,l){if(Array.isArray(d.keyword)?!d.keyword.includes(l):d.keyword!==l)throw new Error("ajv implementation error");const s=d.dependencies;if(s?.some(c=>!Object.prototype.hasOwnProperty.call(v,c)))throw new Error(`parent schema must have dependencies of ${l}: ${s.join(",")}`);if(d.validateSchema&&!d.validateSchema(v[l])){const y=`keyword "${l}" value is invalid at path "${w}": `+b.errorsText(d.validateSchema.errors);if(_.validateSchema==="log")b.logger.error(y);else throw new Error(y)}}return fe.validateKeywordUsage=E,fe}var _e={},wr;function ls(){if(wr)return _e;wr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.extendSubschemaMode=_e.extendSubschemaData=_e.getSubschema=void 0;const e=H(),t=Y();function r(n,{keyword:u,schemaProp:i,schema:f,schemaPath:$,errSchemaPath:g,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 v=n.schema[u];return i===void 0?{schema:v,schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(u)}`,errSchemaPath:`${n.errSchemaPath}/${u}`}:{schema:v[i],schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(u)}${(0,e.getProperty)(i)}`,errSchemaPath:`${n.errSchemaPath}/${u}/${(0,t.escapeFragment)(i)}`}}if(f!==void 0){if($===void 0||g===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:f,schemaPath:$,topSchemaRef:E,errSchemaPath:g}}throw new Error('either "keyword" or "schema" must be passed')}_e.getSubschema=r;function o(n,u,{dataProp:i,dataPropType:f,data:$,dataTypes:g,propertyName:E}){if($!==void 0&&i!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=u;if(i!==void 0){const{errorPath:b,dataPathArr:w,opts:d}=u,l=v.let("data",(0,e._)`${u.data}${(0,e.getProperty)(i)}`,!0);_(l),n.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(i,f,d.jsPropertySyntax)}`,n.parentDataProperty=(0,e._)`${i}`,n.dataPathArr=[...w,n.parentDataProperty]}if($!==void 0){const b=$ instanceof e.Name?$:v.let("data",$,!0);_(b),E!==void 0&&(n.propertyName=E)}g&&(n.dataTypes=g);function _(b){n.data=b,n.dataLevel=u.dataLevel+1,n.dataTypes=[],u.definedProperties=new Set,n.parentData=u.data,n.dataNames=[...u.dataNames,b]}}_e.extendSubschemaData=o;function h(n,{jtdDiscriminator:u,jtdMetadata:i,compositeRule:f,createErrors:$,allErrors:g}){f!==void 0&&(n.compositeRule=f),$!==void 0&&(n.createErrors=$),g!==void 0&&(n.allErrors=g),n.jtdDiscriminator=u,n.jtdMetadata=i}return _e.extendSubschemaMode=h,_e}var ie={},Kt,Pr;function Sr(){return Pr||(Pr=1,Kt=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 o,h,n;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(h=o;h--!==0;)if(!e(t[h],r[h]))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),o=n.length,o!==Object.keys(r).length)return!1;for(h=o;h--!==0;)if(!Object.prototype.hasOwnProperty.call(r,n[h]))return!1;for(h=o;h--!==0;){var u=n[h];if(!e(t[u],r[u]))return!1}return!0}return t!==t&&r!==r}),Kt}var Jt={exports:{}},Er;function fs(){if(Er)return Jt.exports;Er=1;var e=Jt.exports=function(o,h,n){typeof h=="function"&&(n=h,h={}),n=h.cb||n;var u=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};t(h,u,i,o,"",o)};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(o,h,n,u,i,f,$,g,E,v){if(u&&typeof u=="object"&&!Array.isArray(u)){h(u,i,f,$,g,E,v);for(var _ in u){var b=u[_];if(Array.isArray(b)){if(_ in e.arrayKeywords)for(var w=0;w<b.length;w++)t(o,h,n,b[w],i+"/"+_+"/"+w,f,i,_,u,w)}else if(_ in e.propsKeywords){if(b&&typeof b=="object")for(var d in b)t(o,h,n,b[d],i+"/"+_+"/"+r(d),f,i,_,u,d)}else(_ in e.keywords||o.allKeys&&!(_ in e.skipKeywords))&&t(o,h,n,b,i+"/"+_,f,i,_,u)}n(u,i,f,$,g,E,v)}}function r(o){return o.replace(/~/g,"~0").replace(/\//g,"~1")}return Jt.exports}var kr;function Ke(){if(kr)return ie;kr=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.getSchemaRefs=ie.resolveUrl=ie.normalizeId=ie._getFullPath=ie.getFullPath=ie.inlineRef=void 0;const e=Y(),t=Sr(),r=fs(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function h(w,d=!0){return typeof w=="boolean"?!0:d===!0?!u(w):d?i(w)<=d:!1}ie.inlineRef=h;const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(w){for(const d in w){if(n.has(d))return!0;const l=w[d];if(Array.isArray(l)&&l.some(u)||typeof l=="object"&&u(l))return!0}return!1}function i(w){let d=0;for(const l in w){if(l==="$ref")return 1/0;if(d++,!o.has(l)&&(typeof w[l]=="object"&&(0,e.eachItem)(w[l],s=>d+=i(s)),d===1/0))return 1/0}return d}function f(w,d="",l){l!==!1&&(d=E(d));const s=w.parse(d);return $(w,s)}ie.getFullPath=f;function $(w,d){return w.serialize(d).split("#")[0]+"#"}ie._getFullPath=$;const g=/#\/?$/;function E(w){return w?w.replace(g,""):""}ie.normalizeId=E;function v(w,d,l){return l=E(l),w.resolve(d,l)}ie.resolveUrl=v;const _=/^[a-z_][-a-z0-9._]*$/i;function b(w,d){if(typeof w=="boolean")return{};const{schemaId:l,uriResolver:s}=this.opts,c=E(w[l]||d),y={"":c},a=f(s,c,!1),m={},P=new Set;return r(w,{allKeys:!0},(z,N,V,F)=>{if(F===void 0)return;const L=a+N;let Q=y[F];typeof z[l]=="string"&&(Q=oe.call(this,z[l])),ae.call(this,z.$anchor),ae.call(this,z.$dynamicAnchor),y[N]=Q;function oe(X){const he=this.opts.uriResolver.resolve;if(X=E(Q?he(Q,X):X),P.has(X))throw T(X);P.add(X);let M=this.refs[X];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?R(z,M.schema,X):X!==E(L)&&(X[0]==="#"?(R(z,m[X],X),m[X]=z):this.refs[X]=L),X}function ae(X){if(typeof X=="string"){if(!_.test(X))throw new Error(`invalid anchor "${X}"`);oe.call(this,`#${X}`)}}}),m;function R(z,N,V){if(N!==void 0&&!t(z,N))throw T(V)}function T(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ie.getSchemaRefs=b,ie}var jr;function Je(){if(jr)return ge;jr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.getData=ge.KeywordCxt=ge.validateFunctionCode=void 0;const e=cs(),t=Ue(),r=gr(),o=Ue(),h=ds(),n=us(),u=ls(),i=H(),f=$e(),$=Ke(),g=Y(),E=Le();function v(k){if(a(k)&&(P(k),y(k))){d(k);return}_(k,()=>(0,e.topBoolOrEmptySchema)(k))}ge.validateFunctionCode=v;function _({gen:k,validateName:I,schema:q,schemaEnv:A,opts:K},W){K.code.es5?k.func(I,(0,i._)`${f.default.data}, ${f.default.valCxt}`,A.$async,()=>{k.code((0,i._)`"use strict"; ${s(q,K)}`),w(k,K),k.code(W)}):k.func(I,(0,i._)`${f.default.data}, ${b(K)}`,A.$async,()=>k.code(s(q,K)).code(W))}function b(k){return(0,i._)`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${k.dynamicRef?(0,i._)`, ${f.default.dynamicAnchors}={}`:i.nil}}={}`}function w(k,I){k.if(f.default.valCxt,()=>{k.var(f.default.instancePath,(0,i._)`${f.default.valCxt}.${f.default.instancePath}`),k.var(f.default.parentData,(0,i._)`${f.default.valCxt}.${f.default.parentData}`),k.var(f.default.parentDataProperty,(0,i._)`${f.default.valCxt}.${f.default.parentDataProperty}`),k.var(f.default.rootData,(0,i._)`${f.default.valCxt}.${f.default.rootData}`),I.dynamicRef&&k.var(f.default.dynamicAnchors,(0,i._)`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{k.var(f.default.instancePath,(0,i._)`""`),k.var(f.default.parentData,(0,i._)`undefined`),k.var(f.default.parentDataProperty,(0,i._)`undefined`),k.var(f.default.rootData,f.default.data),I.dynamicRef&&k.var(f.default.dynamicAnchors,(0,i._)`{}`)})}function d(k){const{schema:I,opts:q,gen:A}=k;_(k,()=>{q.$comment&&I.$comment&&F(k),z(k),A.let(f.default.vErrors,null),A.let(f.default.errors,0),q.unevaluated&&l(k),R(k),L(k)})}function l(k){const{gen:I,validateName:q}=k;k.evaluated=I.const("evaluated",(0,i._)`${q}.evaluated`),I.if((0,i._)`${k.evaluated}.dynamicProps`,()=>I.assign((0,i._)`${k.evaluated}.props`,(0,i._)`undefined`)),I.if((0,i._)`${k.evaluated}.dynamicItems`,()=>I.assign((0,i._)`${k.evaluated}.items`,(0,i._)`undefined`))}function s(k,I){const q=typeof k=="object"&&k[I.schemaId];return q&&(I.code.source||I.code.process)?(0,i._)`/*# sourceURL=${q} */`:i.nil}function c(k,I){if(a(k)&&(P(k),y(k))){m(k,I);return}(0,e.boolOrEmptySchema)(k,I)}function y({schema:k,self:I}){if(typeof k=="boolean")return!k;for(const q in k)if(I.RULES.all[q])return!0;return!1}function a(k){return typeof k.schema!="boolean"}function m(k,I){const{schema:q,gen:A,opts:K}=k;K.$comment&&q.$comment&&F(k),N(k),V(k);const W=A.const("_errs",f.default.errors);R(k,W),A.var(I,(0,i._)`${W} === ${f.default.errors}`)}function P(k){(0,g.checkUnknownRules)(k),T(k)}function R(k,I){if(k.opts.jtd)return oe(k,[],!1,I);const q=(0,t.getSchemaTypes)(k.schema),A=(0,t.coerceAndCheckDataType)(k,q);oe(k,q,!A,I)}function T(k){const{schema:I,errSchemaPath:q,opts:A,self:K}=k;I.$ref&&A.ignoreKeywordsWithRef&&(0,g.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(k){const{schema:I,opts:q}=k;I.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,g.checkStrictMode)(k,"default is ignored in the schema root")}function N(k){const I=k.schema[k.opts.schemaId];I&&(k.baseId=(0,$.resolveUrl)(k.opts.uriResolver,k.baseId,I))}function V(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:k,schemaEnv:I,schema:q,errSchemaPath:A,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,i._)`${f.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const ne=(0,i.str)`${A}/$comment`,ye=k.scopeValue("root",{ref:I.root});k.code((0,i._)`${f.default.self}.opts.$comment(${W}, ${ne}, ${ye}.schema)`)}}function L(k){const{gen:I,schemaEnv:q,validateName:A,ValidationError:K,opts:W}=k;q.$async?I.if((0,i._)`${f.default.errors} === 0`,()=>I.return(f.default.data),()=>I.throw((0,i._)`new ${K}(${f.default.vErrors})`)):(I.assign((0,i._)`${A}.errors`,f.default.vErrors),W.unevaluated&&Q(k),I.return((0,i._)`${f.default.errors} === 0`))}function Q({gen:k,evaluated:I,props:q,items:A}){q instanceof i.Name&&k.assign((0,i._)`${I}.props`,q),A instanceof i.Name&&k.assign((0,i._)`${I}.items`,A)}function oe(k,I,q,A){const{gen:K,schema:W,data:ne,allErrors:ye,opts:ce,self:de}=k,{RULES:se}=de;if(W.$ref&&(ce.ignoreKeywordsWithRef||!(0,g.schemaHasRulesButRef)(W,se))){K.block(()=>U(k,"$ref",se.all.$ref.definition));return}ce.jtd||X(k,I),K.block(()=>{for(const le of se.rules)Re(le);Re(se.post)});function Re(le){(0,r.shouldUseGroup)(W,le)&&(le.type?(K.if((0,o.checkDataType)(le.type,ne,ce.strictNumbers)),ae(k,le),I.length===1&&I[0]===le.type&&q&&(K.else(),(0,o.reportTypeError)(k)),K.endIf()):ae(k,le),ye||K.if((0,i._)`${f.default.errors} === ${A||0}`))}}function ae(k,I){const{gen:q,schema:A,opts:{useDefaults:K}}=k;K&&(0,h.assignDefaults)(k,I.type),q.block(()=>{for(const W of I.rules)(0,r.shouldUseRule)(A,W)&&U(k,W.keyword,W.definition,I.type)})}function X(k,I){k.schemaEnv.meta||!k.opts.strictTypes||(he(k,I),k.opts.allowUnionTypes||M(k,I),j(k,k.dataTypes))}function he(k,I){if(I.length){if(!k.dataTypes.length){k.dataTypes=I;return}I.forEach(q=>{O(k.dataTypes,q)||S(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),p(k,I)}}function M(k,I){I.length>1&&!(I.length===2&&I.includes("null"))&&S(k,"use allowUnionTypes to allow union type keyword")}function j(k,I){const q=k.self.RULES.all;for(const A in q){const K=q[A];if(typeof K=="object"&&(0,r.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(ne=>D(I,ne))&&S(k,`missing type "${W.join(",")}" for keyword "${A}"`)}}}function D(k,I){return k.includes(I)||I==="number"&&k.includes("integer")}function O(k,I){return k.includes(I)||I==="integer"&&k.includes("number")}function p(k,I){const q=[];for(const A of k.dataTypes)O(I,A)?q.push(A):I.includes("integer")&&A==="number"&&q.push("integer");k.dataTypes=q}function S(k,I){const q=k.schemaEnv.baseId+k.errSchemaPath;I+=` at "${q}" (strictTypes)`,(0,g.checkStrictMode)(k,I,k.opts.strictTypes)}class C{constructor(I,q,A){if((0,n.validateKeywordUsage)(I,q,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=q.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,g.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=q.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=q,this.$data)this.schemaCode=I.gen.const("vSchema",B(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,n.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=I.gen.const("_errs",f.default.errors))}result(I,q,A){this.failResult((0,i.not)(I),q,A)}failResult(I,q,A){this.gen.if(I),A?A():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,q){this.failResult((0,i.not)(I),void 0,q)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:q}=this;this.fail((0,i._)`${q} !== undefined && (${(0,i.or)(this.invalid$data(),I)})`)}error(I,q,A){if(q){this.setParams(q),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,q){(I?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(I){this.allErrors||this.gen.if(I)}setParams(I,q){q?Object.assign(this.params,I):this.params=I}block$data(I,q,A=i.nil){this.gen.block(()=>{this.check$data(I,A),q()})}check$data(I=i.nil,q=i.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:ne}=this;A.if((0,i.or)((0,i._)`${K} === undefined`,q)),I!==i.nil&&A.assign(I,!0),(W.length||ne.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==i.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:q,schemaType:A,def:K,it:W}=this;return(0,i.or)(ne(),ye());function ne(){if(A.length){if(!(q instanceof i.Name))throw new Error("ajv implementation error");const ce=Array.isArray(A)?A:[A];return(0,i._)`${(0,o.checkDataTypes)(ce,q,W.opts.strictNumbers,o.DataType.Wrong)}`}return i.nil}function ye(){if(K.validateSchema){const ce=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,i._)`!${ce}(${q})`}return i.nil}}subschema(I,q){const A=(0,u.getSubschema)(this.it,I);(0,u.extendSubschemaData)(A,this.it,I),(0,u.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return c(K,q),K}mergeEvaluated(I,q){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=g.mergeEvaluated.props(K,I.props,A.props,q)),A.items!==!0&&I.items!==void 0&&(A.items=g.mergeEvaluated.items(K,I.items,A.items,q)))}mergeValidEvaluated(I,q){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(q,()=>this.mergeEvaluated(I,i.Name)),!0}}ge.KeywordCxt=C;function U(k,I,q,A){const K=new C(k,q,I);"code"in q?q.code(K,A):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)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:I,dataNames:q,dataPathArr:A}){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=Z.exec(k);if(!de)throw new Error(`Invalid JSON-pointer: ${k}`);const se=+de[1];if(K=de[2],K==="#"){if(se>=I)throw new Error(ce("property/index",se));return A[I-se]}if(se>I)throw new Error(ce("data",se));if(W=q[I-se],!K)return W}let ne=W;const ye=K.split("/");for(const de of ye)de&&(W=(0,i._)`${W}${(0,i.getProperty)((0,g.unescapeJsonPointer)(de))}`,ne=(0,i._)`${ne} && ${W}`);return ne;function ce(de,se){return`Cannot access ${de} ${se} levels up, current level is ${I}`}}return ge.getData=B,ge}var He={},Ir;function Ht(){if(Ir)return He;Ir=1,Object.defineProperty(He,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return He.default=e,He}var Ge={},Or;function We(){if(Or)return Ge;Or=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=Ke();class t extends Error{constructor(o,h,n,u){super(u||`can't resolve reference ${n} from id ${h}`),this.missingRef=(0,e.resolveUrl)(o,h,n),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}return Ge.default=t,Ge}var ue={},Rr;function Gt(){if(Rr)return ue;Rr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.resolveSchema=ue.getCompilingSchema=ue.resolveRef=ue.compileSchema=ue.SchemaEnv=void 0;const e=H(),t=Ht(),r=$e(),o=Ke(),h=Y(),n=Je();class u{constructor(l){var s;this.refs={},this.dynamicAnchors={};let c;typeof l.schema=="object"&&(c=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,o.normalizeId)(c?.[l.schemaId||"$id"]),this.schemaPath=l.schemaPath,this.localRefs=l.localRefs,this.meta=l.meta,this.$async=c?.$async,this.refs={}}}ue.SchemaEnv=u;function i(d){const l=g.call(this,d);if(l)return l;const s=(0,o.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:c,lines:y}=this.opts.code,{ownProperties:a}=this.opts,m=new e.CodeGen(this.scope,{es5:c,lines:y,ownProperties:a});let P;d.$async&&(P=m.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const R=m.scopeName("validate");d.validateName=R;const T={gen:m,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:m.scopeValue("schema",this.opts.code.source===!0?{ref:d.schema,code:(0,e.stringify)(d.schema)}:{ref:d.schema}),validateName:R,ValidationError:P,schema:d.schema,schemaEnv:d,rootId:s,baseId:d.baseId||s,schemaPath:e.nil,errSchemaPath:d.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(d),(0,n.validateFunctionCode)(T),m.optimize(this.opts.code.optimize);const N=m.toString();z=`${m.scopeRefs(r.default.scope)}return ${N}`,this.opts.code.process&&(z=this.opts.code.process(z,d));const F=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(R,{ref:F}),F.errors=null,F.schema=d.schema,F.schemaEnv=d,d.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:R,validateCode:N,scopeValues:m._values}),this.opts.unevaluated){const{props:L,items:Q}=T;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return d.validate=F,d}catch(N){throw delete d.validate,delete d.validateName,z&&this.logger.error("Error compiling schema, function code:",z),N}finally{this._compilations.delete(d)}}ue.compileSchema=i;function f(d,l,s){var c;s=(0,o.resolveUrl)(this.opts.uriResolver,l,s);const y=d.refs[s];if(y)return y;let a=v.call(this,d,s);if(a===void 0){const m=(c=d.localRefs)===null||c===void 0?void 0:c[s],{schemaId:P}=this.opts;m&&(a=new u({schema:m,schemaId:P,root:d,baseId:l}))}if(a!==void 0)return d.refs[s]=$.call(this,a)}ue.resolveRef=f;function $(d){return(0,o.inlineRef)(d.schema,this.opts.inlineRefs)?d.schema:d.validate?d:i.call(this,d)}function g(d){for(const l of this._compilations)if(E(l,d))return l}ue.getCompilingSchema=g;function E(d,l){return d.schema===l.schema&&d.root===l.root&&d.baseId===l.baseId}function v(d,l){let s;for(;typeof(s=this.refs[l])=="string";)l=s;return s||this.schemas[l]||_.call(this,d,l)}function _(d,l){const s=this.opts.uriResolver.parse(l),c=(0,o._getFullPath)(this.opts.uriResolver,s);let y=(0,o.getFullPath)(this.opts.uriResolver,d.baseId,void 0);if(Object.keys(d.schema).length>0&&c===y)return w.call(this,s,d);const a=(0,o.normalizeId)(c),m=this.refs[a]||this.schemas[a];if(typeof m=="string"){const P=_.call(this,d,m);return typeof P?.schema!="object"?void 0:w.call(this,s,P)}if(typeof m?.schema=="object"){if(m.validate||i.call(this,m),a===(0,o.normalizeId)(l)){const{schema:P}=m,{schemaId:R}=this.opts,T=P[R];return T&&(y=(0,o.resolveUrl)(this.opts.uriResolver,y,T)),new u({schema:P,schemaId:R,root:d,baseId:y})}return w.call(this,s,m)}}ue.resolveSchema=_;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(d,{baseId:l,schema:s,root:c}){var y;if(((y=d.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of d.fragment.slice(1).split("/")){if(typeof s=="boolean")return;const R=s[(0,h.unescapeFragment)(P)];if(R===void 0)return;s=R;const T=typeof s=="object"&&s[this.opts.schemaId];!b.has(P)&&T&&(l=(0,o.resolveUrl)(this.opts.uriResolver,l,T))}let a;if(typeof s!="boolean"&&s.$ref&&!(0,h.schemaHasRulesButRef)(s,this.RULES)){const P=(0,o.resolveUrl)(this.opts.uriResolver,l,s.$ref);a=_.call(this,c,P)}const{schemaId:m}=this.opts;if(a=a||new u({schema:s,schemaId:m,root:c,baseId:l}),a.schema!==a.root.schema)return a}return ue}const ps={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var Be={},Ne={exports:{}},Wt,Cr;function Nr(){if(Cr)return Wt;Cr=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 _="",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"";_+=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"";_+=v[w]}return _}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function h(v){return v.length=0,!0}function n(v,_,b){if(v.length){const w=r(v);if(w!=="")_.push(w);else return b.error=!0,!1;v.length=0}return!0}function u(v){let _=0;const b={error:!1,address:"",zone:""},w=[],d=[];let l=!1,s=!1,c=n;for(let y=0;y<v.length;y++){const a=v[y];if(!(a==="["||a==="]"))if(a===":"){if(l===!0&&(s=!0),!c(d,w,b))break;if(++_>7){b.error=!0;break}y>0&&v[y-1]===":"&&(l=!0),w.push(":");continue}else if(a==="%"){if(!c(d,w,b))break;c=h}else{d.push(a);continue}}return d.length&&(c===h?b.zone=d.join(""):s?w.push(d.join("")):w.push(r(d))),b.address=w.join(""),b}function i(v){if(f(v,":")<2)return{host:v,isIPV6:!1};const _=u(v);if(_.error)return{host:v,isIPV6:!1};{let b=_.address,w=_.address;return _.zone&&(b+="%"+_.zone,w+="%25"+_.zone),{host:b,isIPV6:!0,escapedHost:w}}}function f(v,_){let b=0;for(let w=0;w<v.length;w++)v[w]===_&&b++;return b}function $(v){let _=v;const b=[];let w=-1,d=0;for(;d=_.length;){if(d===1){if(_===".")break;if(_==="/"){b.push("/");break}else{b.push(_);break}}else if(d===2){if(_[0]==="."){if(_[1]===".")break;if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&(_[1]==="."||_[1]==="/")){b.push("/");break}}else if(d===3&&_==="/.."){b.length!==0&&b.pop(),b.push("/");break}if(_[0]==="."){if(_[1]==="."){if(_[2]==="/"){_=_.slice(3);continue}}else if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&_[1]==="."){if(_[2]==="/"){_=_.slice(2);continue}else if(_[2]==="."&&_[3]==="/"){_=_.slice(3),b.length!==0&&b.pop();continue}}if((w=_.indexOf("/",1))===-1){b.push(_);break}else b.push(_.slice(0,w)),_=_.slice(w)}return b.join("")}function g(v,_){const b=_!==!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 _=[];if(v.userinfo!==void 0&&(_.push(v.userinfo),_.push("@")),v.host!==void 0){let b=unescape(v.host);if(!t(b)){const w=i(b);w.isIPV6===!0?b=`[${w.escapedHost}]`:b=v.host}_.push(b)}return(typeof v.port=="number"||typeof v.port=="string")&&(_.push(":"),_.push(String(v.port))),_.length?_.join(""):void 0}return Wt={nonSimpleDomain:o,recomposeAuthority:E,normalizeComponentEncoding:g,removeDotSegments:$,isIPv4:t,isUUID:e,normalizeIPv6:i,stringArrayToHexStripped:r},Wt}var Bt,qr;function ms(){if(qr)return Bt;qr=1;const{isUUID:e}=Nr(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function o(a){return r.indexOf(a)!==-1}function h(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 m=String(a.scheme).toLowerCase()==="https";return(a.port===(m?443:80)||a.port==="")&&(a.port=void 0),a.path||(a.path="/"),a}function i(a){return a.secure=h(a),a.resourceName=(a.path||"/")+(a.query?"?"+a.query:""),a.path=void 0,a.query=void 0,a}function f(a){if((a.port===(h(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[m,P]=a.resourceName.split("?");a.path=m&&m!=="/"?m:void 0,a.query=P,a.resourceName=void 0}return a.fragment=void 0,a}function $(a,m){if(!a.path)return a.error="URN can not be parsed",a;const P=a.path.match(t);if(P){const R=m.scheme||a.scheme||"urn";a.nid=P[1].toLowerCase(),a.nss=P[2];const T=`${R}:${m.nid||a.nid}`,z=y(T);a.path=void 0,z&&(a=z.parse(a,m))}else a.error=a.error||"URN can not be parsed.";return a}function g(a,m){if(a.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=m.scheme||a.scheme||"urn",R=a.nid.toLowerCase(),T=`${P}:${m.nid||R}`,z=y(T);z&&(a=z.serialize(a,m));const N=a,V=a.nss;return N.path=`${R||m.nid}:${V}`,m.skipEscape=!0,N}function E(a,m){const P=a;return P.uuid=P.nss,P.nss=void 0,!m.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function v(a){const m=a;return m.nss=(a.uuid||"").toLowerCase(),m}const _={scheme:"http",domainHost:!0,parse:n,serialize:u},b={scheme:"https",domainHost:_.domainHost,parse:n,serialize:u},w={scheme:"ws",domainHost:!0,parse:i,serialize:f},d={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},c={http:_,https:b,ws:w,wss:d,urn:{scheme:"urn",parse:$,serialize:g,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(c,null);function y(a){return a&&(c[a]||c[a.toLowerCase()])||void 0}return Bt={wsIsSecure:h,SCHEMES:c,isValidSchemeName:o,getSchemeHandler:y},Bt}var Dr;function hs(){if(Dr)return Ne.exports;Dr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:o,isIPv4:h,nonSimpleDomain:n}=Nr(),{SCHEMES:u,getSchemeHandler:i}=ms();function f(d,l){return typeof d=="string"?d=v(b(d,l),l):typeof d=="object"&&(d=b(v(d,l),l)),d}function $(d,l,s){const c=s?Object.assign({scheme:"null"},s):{scheme:"null"},y=g(b(d,c),b(l,c),c,!0);return c.skipEscape=!0,v(y,c)}function g(d,l,s,c){const y={};return c||(d=b(v(d,s),s),l=b(v(l,s),s)),s=s||{},!s.tolerant&&l.scheme?(y.scheme=l.scheme,y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=t(l.path||""),y.query=l.query):(l.userinfo!==void 0||l.host!==void 0||l.port!==void 0?(y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=t(l.path||""),y.query=l.query):(l.path?(l.path[0]==="/"?y.path=t(l.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?y.path="/"+l.path:d.path?y.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+l.path:y.path=l.path,y.path=t(y.path)),y.query=l.query):(y.path=d.path,l.query!==void 0?y.query=l.query:y.query=d.query),y.userinfo=d.userinfo,y.host=d.host,y.port=d.port),y.scheme=d.scheme),y.fragment=l.fragment,y}function E(d,l,s){return typeof d=="string"?(d=unescape(d),d=v(o(b(d,s),!0),{...s,skipEscape:!0})):typeof d=="object"&&(d=v(o(d,!0),{...s,skipEscape:!0})),typeof l=="string"?(l=unescape(l),l=v(o(b(l,s),!0),{...s,skipEscape:!0})):typeof l=="object"&&(l=v(o(l,!0),{...s,skipEscape:!0})),d.toLowerCase()===l.toLowerCase()}function v(d,l){const s={host:d.host,scheme:d.scheme,userinfo:d.userinfo,port:d.port,path:d.path,query:d.query,nid:d.nid,nss:d.nss,uuid:d.uuid,fragment:d.fragment,reference:d.reference,resourceName:d.resourceName,secure:d.secure,error:""},c=Object.assign({},l),y=[],a=i(c.scheme||s.scheme);a&&a.serialize&&a.serialize(s,c),s.path!==void 0&&(c.skipEscape?s.path=unescape(s.path):(s.path=escape(s.path),s.scheme!==void 0&&(s.path=s.path.split("%3A").join(":")))),c.reference!=="suffix"&&s.scheme&&y.push(s.scheme,":");const m=r(s);if(m!==void 0&&(c.reference!=="suffix"&&y.push("//"),y.push(m),s.path&&s.path[0]!=="/"&&y.push("/")),s.path!==void 0){let P=s.path;!c.absolutePath&&(!a||!a.absolutePath)&&(P=t(P)),m===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return s.query!==void 0&&y.push("?",s.query),s.fragment!==void 0&&y.push("#",s.fragment),y.join("")}const _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(d,l){const s=Object.assign({},l),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;s.reference==="suffix"&&(s.scheme?d=s.scheme+":"+d:d="//"+d);const a=d.match(_);if(a){if(c.scheme=a[1],c.userinfo=a[3],c.host=a[4],c.port=parseInt(a[5],10),c.path=a[6]||"",c.query=a[7],c.fragment=a[8],isNaN(c.port)&&(c.port=a[5]),c.host)if(h(c.host)===!1){const R=e(c.host);c.host=R.host.toLowerCase(),y=R.isIPV6}else y=!0;c.scheme===void 0&&c.userinfo===void 0&&c.host===void 0&&c.port===void 0&&c.query===void 0&&!c.path?c.reference="same-document":c.scheme===void 0?c.reference="relative":c.fragment===void 0?c.reference="absolute":c.reference="uri",s.reference&&s.reference!=="suffix"&&s.reference!==c.reference&&(c.error=c.error||"URI is not a "+s.reference+" reference.");const m=i(s.scheme||c.scheme);if(!s.unicodeSupport&&(!m||!m.unicodeSupport)&&c.host&&(s.domainHost||m&&m.domainHost)&&y===!1&&n(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(P){c.error=c.error||"Host's domain name can not be converted to ASCII: "+P}(!m||m&&!m.skipNormalize)&&(d.indexOf("%")!==-1&&(c.scheme!==void 0&&(c.scheme=unescape(c.scheme)),c.host!==void 0&&(c.host=unescape(c.host))),c.path&&(c.path=escape(unescape(c.path))),c.fragment&&(c.fragment=encodeURI(decodeURIComponent(c.fragment)))),m&&m.parse&&m.parse(c,s)}else c.error=c.error||"URI can not be parsed.";return c}const w={SCHEMES:u,normalize:f,resolve:$,resolveComponent:g,equal:E,serialize:v,parse:b};return Ne.exports=w,Ne.exports.default=w,Ne.exports.fastUri=w,Ne.exports}var Tr;function ys(){if(Tr)return Be;Tr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=hs();return e.code='require("ajv/dist/runtime/uri").default',Be.default=e,Be}var Mr;function gs(){return Mr||(Mr=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=Je();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=H();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 o=Ht(),h=We(),n=hr(),u=Gt(),i=H(),f=Ke(),$=Ue(),g=Y(),E=ps,v=ys(),_=(M,j)=>new RegExp(M,j);_.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"]),d={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 c(M){var j,D,O,p,S,C,U,J,Z,B,k,I,q,A,K,W,ne,ye,ce,de,se,Re,le,nr,sr;const Ae=M.strict,ir=(j=M.code)===null||j===void 0?void 0:j.optimize,os=ir===!0||ir===void 0?1:ir||0,as=(O=(D=M.code)===null||D===void 0?void 0:D.regExp)!==null&&O!==void 0?O:_,Ei=(p=M.uriResolver)!==null&&p!==void 0?p:v.default;return{strictSchema:(C=(S=M.strictSchema)!==null&&S!==void 0?S:Ae)!==null&&C!==void 0?C:!0,strictNumbers:(J=(U=M.strictNumbers)!==null&&U!==void 0?U:Ae)!==null&&J!==void 0?J:!0,strictTypes:(B=(Z=M.strictTypes)!==null&&Z!==void 0?Z:Ae)!==null&&B!==void 0?B:"log",strictTuples:(I=(k=M.strictTuples)!==null&&k!==void 0?k:Ae)!==null&&I!==void 0?I:"log",strictRequired:(A=(q=M.strictRequired)!==null&&q!==void 0?q:Ae)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:os,regExp:as}:{optimize:os,regExp:as},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:s,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:s,meta:(ne=M.meta)!==null&&ne!==void 0?ne:!0,messages:(ye=M.messages)!==null&&ye!==void 0?ye:!0,inlineRefs:(ce=M.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(de=M.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(se=M.addUsedSchema)!==null&&se!==void 0?se:!0,validateSchema:(Re=M.validateSchema)!==null&&Re!==void 0?Re:!0,validateFormats:(le=M.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(nr=M.unicodeRegExp)!==null&&nr!==void 0?nr:!0,int32range:(sr=M.int32range)!==null&&sr!==void 0?sr:!0,uriResolver:Ei}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...c(j)};const{es5:D,lines:O}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:w,es5:D,lines:O}),this.logger=V(j.logger);const p=j.validateFormats;j.validateFormats=!1,this.RULES=(0,n.getRules)(),a.call(this,d,j,"NOT SUPPORTED"),a.call(this,l,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&R.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=p}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:O}=this.opts;let p=E;O==="id"&&(p={...E},p.id=p.$id,delete p.$id),D&&j&&this.addMetaSchema(p,p[O],!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 O;if(typeof j=="string"){if(O=this.getSchema(j),!O)throw new Error(`no schema with key or ref "${j}"`)}else O=this.compile(j);const p=O(D);return"$async"in O||(this.errors=O.errors),p}compile(j,D){const O=this._addSchema(j,D);return O.validate||this._compileSchemaEnv(O)}compileAsync(j,D){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return p.call(this,j,D);async function p(B,k){await S.call(this,B.$schema);const I=this._addSchema(B,k);return I.validate||C.call(this,I)}async function S(B){B&&!this.getSchema(B)&&await p.call(this,{$ref:B},!0)}async function C(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof h.default))throw k;return U.call(this,k),await J.call(this,k.missingSchema),C.call(this,B)}}function U({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 Z.call(this,B);this.refs[B]||await S.call(this,k.$schema),this.refs[B]||this.addSchema(k,B,D)}async function Z(B){const k=this._loading[B];if(k)return k;try{return await(this._loading[B]=O(B))}finally{delete this._loading[B]}}}addSchema(j,D,O,p=this.opts.validateSchema){if(Array.isArray(j)){for(const C of j)this.addSchema(C,void 0,O,p);return this}let S;if(typeof j=="object"){const{schemaId:C}=this.opts;if(S=j[C],S!==void 0&&typeof S!="string")throw new Error(`schema ${C} must be string`)}return D=(0,f.normalizeId)(D||S),this._checkUnique(D),this.schemas[D]=this._addSchema(j,O,D,p,!0),this}addMetaSchema(j,D,O=this.opts.validateSchema){return this.addSchema(j,D,!0,O),this}validateSchema(j,D){if(typeof j=="boolean")return!0;let O;if(O=j.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const p=this.validate(O,j);if(!p&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return p}getSchema(j){let D;for(;typeof(D=m.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:O}=this.opts,p=new u.SchemaEnv({schema:{},schemaId:O});if(D=u.resolveSchema.call(this,p,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=m.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 O=j[this.opts.schemaId];return O&&(O=(0,f.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),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 O;if(typeof j=="string")O=j,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=O);else if(typeof j=="object"&&D===void 0){if(D=j,O=D.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,O,D),!D)return(0,g.eachItem)(O,S=>Q.call(this,S)),this;ae.call(this,D);const p={...D,type:(0,$.getJSONTypes)(D.type),schemaType:(0,$.getJSONTypes)(D.schemaType)};return(0,g.eachItem)(O,p.type.length===0?S=>Q.call(this,S,p):S=>p.type.forEach(C=>Q.call(this,S,p,C))),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 O of D.rules){const p=O.rules.findIndex(S=>S.keyword===j);p>=0&&O.rules.splice(p,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:O="data"}={}){return!j||j.length===0?"No errors":j.map(p=>`${O}${p.instancePath} ${p.message}`).reduce((p,S)=>p+D+S)}$dataMetaSchema(j,D){const O=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const p of D){const S=p.split("/").slice(1);let C=j;for(const U of S)C=C[U];for(const U in O){const J=O[U];if(typeof J!="object")continue;const{$data:Z}=J.definition,B=C[U];Z&&B&&(C[U]=he(B))}}return j}_removeAllSchemas(j,D){for(const O in j){const p=j[O];(!D||D.test(O))&&(typeof p=="string"?delete j[O]:p&&!p.meta&&(this._cache.delete(p.schema),delete j[O]))}}_addSchema(j,D,O,p=this.opts.validateSchema,S=this.opts.addUsedSchema){let C;const{schemaId:U}=this.opts;if(typeof j=="object")C=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(j);if(J!==void 0)return J;O=(0,f.normalizeId)(C||O);const Z=f.getSchemaRefs.call(this,j,O);return J=new u.SchemaEnv({schema:j,schemaId:U,meta:D,baseId:O,localRefs:Z}),this._cache.set(J.schema,J),S&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=J),p&&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}}}y.ValidationError=o.default,y.MissingRefError=h.default,e.default=y;function a(M,j,D,O="error"){for(const p in M){const S=p;S in j&&this.logger[O](`${D}: option ${p}. ${M[S]}`)}}function m(M){return M=(0,f.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const j in M)this.addSchema(M[j],j)}function R(){for(const M in this.opts.formats){const j=this.opts.formats[M];j&&this.addFormat(M,j)}}function T(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in M){const D=M[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const M={...this.opts};for(const j of b)delete M[j];return M}const N={log(){},warn(){},error(){}};function V(M){if(M===!1)return N;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,j){const{RULES:D}=this;if((0,g.eachItem)(M,O=>{if(D.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!F.test(O))throw new Error(`Keyword ${O} 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(M,j,D){var O;const p=j?.post;if(D&&p)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let C=p?S.post:S.rules.find(({type:J})=>J===D);if(C||(C={type:D,rules:[]},S.rules.push(C)),S.keywords[M]=!0,!j)return;const U={keyword:M,definition:{...j,type:(0,$.getJSONTypes)(j.type),schemaType:(0,$.getJSONTypes)(j.schemaType)}};j.before?oe.call(this,C,U,j.before):C.rules.push(U),S.all[M]=U,(O=j.implements)===null||O===void 0||O.forEach(J=>this.addKeyword(J))}function oe(M,j,D){const O=M.rules.findIndex(p=>p.keyword===D);O>=0?M.rules.splice(O,0,j):(M.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function ae(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=he(j)),M.validateSchema=this.compile(j,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(M){return{anyOf:[M,X]}}})(Vt)),Vt}var Ye={},Ze={},Qe={},Ar;function vs(){if(Ar)return Qe;Ar=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Qe.default=e,Qe}var be={},Vr;function _s(){if(Vr)return be;Vr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.callRef=be.getValidate=void 0;const e=We(),t=pe(),r=H(),o=$e(),h=Gt(),n=Y(),u={keyword:"$ref",schemaType:"string",code($){const{gen:g,schema:E,it:v}=$,{baseId:_,schemaEnv:b,validateName:w,opts:d,self:l}=v,{root:s}=b;if((E==="#"||E==="#/")&&_===s.baseId)return y();const c=h.resolveRef.call(l,s,_,E);if(c===void 0)throw new e.default(v.opts.uriResolver,_,E);if(c instanceof h.SchemaEnv)return a(c);return m(c);function y(){if(b===s)return f($,w,b,b.$async);const P=g.scopeValue("root",{ref:s});return f($,(0,r._)`${P}.validate`,s,s.$async)}function a(P){const R=i($,P);f($,R,P,P.$async)}function m(P){const R=g.scopeValue("schema",d.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),T=g.name("valid"),z=$.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:R,errSchemaPath:E},T);$.mergeEvaluated(z),$.ok(T)}}};function i($,g){const{gen:E}=$;return g.validate?E.scopeValue("validate",{ref:g.validate}):(0,r._)`${E.scopeValue("wrapper",{ref:g})}.validate`}be.getValidate=i;function f($,g,E,v){const{gen:_,it:b}=$,{allErrors:w,schemaEnv:d,opts:l}=b,s=l.passContext?o.default.this:r.nil;v?c():y();function c(){if(!d.$async)throw new Error("async schema referenced by sync schema");const P=_.let("valid");_.try(()=>{_.code((0,r._)`await ${(0,t.callValidateCode)($,g,s)}`),m(g),w||_.assign(P,!0)},R=>{_.if((0,r._)`!(${R} instanceof ${b.ValidationError})`,()=>_.throw(R)),a(R),w||_.assign(P,!1)}),$.ok(P)}function y(){$.result((0,t.callValidateCode)($,g,s),()=>m(g),()=>a(g))}function a(P){const R=(0,r._)`${P}.errors`;_.assign(o.default.vErrors,(0,r._)`${o.default.vErrors} === null ? ${R} : ${o.default.vErrors}.concat(${R})`),_.assign(o.default.errors,(0,r._)`${o.default.vErrors}.length`)}function m(P){var R;if(!b.opts.unevaluated)return;const T=(R=E?.validate)===null||R===void 0?void 0:R.evaluated;if(b.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(b.props=n.mergeEvaluated.props(_,T.props,b.props));else{const z=_.var("props",(0,r._)`${P}.evaluated.props`);b.props=n.mergeEvaluated.props(_,z,b.props,r.Name)}if(b.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(b.items=n.mergeEvaluated.items(_,T.items,b.items));else{const z=_.var("items",(0,r._)`${P}.evaluated.items`);b.items=n.mergeEvaluated.items(_,z,b.items,r.Name)}}}return be.callRef=f,be.default=u,be}var zr;function $s(){if(zr)return Ze;zr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=vs(),t=_s(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ze.default=r,Ze}var xe={},Xe={},Fr;function bs(){if(Fr)return Xe;Fr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=H(),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}},o={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}}`},h={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(n){const{keyword:u,data:i,schemaCode:f}=n;n.fail$data((0,e._)`${i} ${r[u].fail} ${f} || isNaN(${i})`)}};return Xe.default=h,Xe}var et={},Lr;function ws(){if(Lr)return et;Lr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=H(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,e.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,e._)`{multipleOf: ${o}}`},code(o){const{gen:h,data:n,schemaCode:u,it:i}=o,f=i.opts.multipleOfPrecision,$=h.let("res"),g=f?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${f}`:(0,e._)`${$} !== parseInt(${$})`;o.fail$data((0,e._)`(${u} === 0 || (${$} = ${n}/${u}, ${g}))`)}};return et.default=r,et}var tt={},rt={},Ur;function Ps(){if(Ur)return rt;Ur=1,Object.defineProperty(rt,"__esModule",{value:!0});function e(t){const r=t.length;let o=0,h=0,n;for(;h<r;)o++,n=t.charCodeAt(h++),n>=55296&&n<=56319&&h<r&&(n=t.charCodeAt(h),(n&64512)===56320&&h++);return o}return rt.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',rt}var Kr;function Ss(){if(Kr)return tt;Kr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=H(),t=Y(),r=Ps(),h={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:u}){const i=n==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${u} characters`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:u,data:i,schemaCode:f,it:$}=n,g=u==="maxLength"?e.operators.GT:e.operators.LT,E=$.opts.unicode===!1?(0,e._)`${i}.length`:(0,e._)`${(0,t.useFunc)(n.gen,r.default)}(${i})`;n.fail$data((0,e._)`${E} ${g} ${f}`)}};return tt.default=h,tt}var nt={},Jr;function Es(){if(Jr)return nt;Jr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=pe(),t=H(),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:h})=>(0,t.str)`must match pattern "${h}"`,params:({schemaCode:h})=>(0,t._)`{pattern: ${h}}`},code(h){const{data:n,$data:u,schema:i,schemaCode:f,it:$}=h,g=$.opts.unicodeRegExp?"u":"",E=u?(0,t._)`(new RegExp(${f}, ${g}))`:(0,e.usePattern)(h,i);h.fail$data((0,t._)`!${E}.test(${n})`)}};return nt.default=o,nt}var st={},Hr;function ks(){if(Hr)return st;Hr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=H(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:h}){const n=o==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${h} properties`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:h,data:n,schemaCode:u}=o,i=h==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data((0,e._)`Object.keys(${n}).length ${i} ${u}`)}};return st.default=r,st}var it={},Gr;function js(){if(Gr)return it;Gr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=pe(),t=H(),r=Y(),h={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:i,schemaCode:f,data:$,$data:g,it:E}=n,{opts:v}=E;if(!g&&i.length===0)return;const _=i.length>=v.loopRequired;if(E.allErrors?b():w(),v.strictRequired){const s=n.parentSchema.properties,{definedProperties:c}=n.it;for(const y of i)if(s?.[y]===void 0&&!c.has(y)){const a=E.schemaEnv.baseId+E.errSchemaPath,m=`required property "${y}" is not defined at "${a}" (strictRequired)`;(0,r.checkStrictMode)(E,m,E.opts.strictRequired)}}function b(){if(_||g)n.block$data(t.nil,d);else for(const s of i)(0,e.checkReportMissingProp)(n,s)}function w(){const s=u.let("missing");if(_||g){const c=u.let("valid",!0);n.block$data(c,()=>l(s,c)),n.ok(c)}else u.if((0,e.checkMissingProp)(n,i,s)),(0,e.reportMissingProp)(n,s),u.else()}function d(){u.forOf("prop",f,s=>{n.setParams({missingProperty:s}),u.if((0,e.noPropertyInData)(u,$,s,v.ownProperties),()=>n.error())})}function l(s,c){n.setParams({missingProperty:s}),u.forOf(s,f,()=>{u.assign(c,(0,e.propertyInData)(u,$,s,v.ownProperties)),u.if((0,t.not)(c),()=>{n.error(),u.break()})},t.nil)}}};return it.default=h,it}var ot={},Wr;function Is(){if(Wr)return ot;Wr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=H(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:h}){const n=o==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${h} items`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:h,data:n,schemaCode:u}=o,i=h==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data((0,e._)`${n}.length ${i} ${u}`)}};return ot.default=r,ot}var at={},ct={},Br;function Yt(){if(Br)return ct;Br=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Sr();return e.code='require("ajv/dist/runtime/equal").default',ct.default=e,ct}var Yr;function Os(){if(Yr)return at;Yr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=Ue(),t=H(),r=Y(),o=Yt(),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:u,j:i}})=>(0,t.str)`must NOT have duplicate items (items ## ${i} and ${u} are identical)`,params:({params:{i:u,j:i}})=>(0,t._)`{i: ${u}, j: ${i}}`},code(u){const{gen:i,data:f,$data:$,schema:g,parentSchema:E,schemaCode:v,it:_}=u;if(!$&&!g)return;const b=i.let("valid"),w=E.items?(0,e.getSchemaTypes)(E.items):[];u.block$data(b,d,(0,t._)`${v} === false`),u.ok(b);function d(){const y=i.let("i",(0,t._)`${f}.length`),a=i.let("j");u.setParams({i:y,j:a}),i.assign(b,!0),i.if((0,t._)`${y} > 1`,()=>(l()?s:c)(y,a))}function l(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function s(y,a){const m=i.name("item"),P=(0,e.checkDataTypes)(w,m,_.opts.strictNumbers,e.DataType.Wrong),R=i.const("indices",(0,t._)`{}`);i.for((0,t._)`;${y}--;`,()=>{i.let(m,(0,t._)`${f}[${y}]`),i.if(P,(0,t._)`continue`),w.length>1&&i.if((0,t._)`typeof ${m} == "string"`,(0,t._)`${m} += "_"`),i.if((0,t._)`typeof ${R}[${m}] == "number"`,()=>{i.assign(a,(0,t._)`${R}[${m}]`),u.error(),i.assign(b,!1).break()}).code((0,t._)`${R}[${m}] = ${y}`)})}function c(y,a){const m=(0,r.useFunc)(i,o.default),P=i.name("outer");i.label(P).for((0,t._)`;${y}--;`,()=>i.for((0,t._)`${a} = ${y}; ${a}--;`,()=>i.if((0,t._)`${m}(${f}[${y}], ${f}[${a}])`,()=>{u.error(),i.assign(b,!1).break(P)})))}}};return at.default=n,at}var dt={},Zr;function Rs(){if(Zr)return dt;Zr=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=H(),t=Y(),r=Yt(),h={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:n})=>(0,e._)`{allowedValue: ${n}}`},code(n){const{gen:u,data:i,$data:f,schemaCode:$,schema:g}=n;f||g&&typeof g=="object"?n.fail$data((0,e._)`!${(0,t.useFunc)(u,r.default)}(${i}, ${$})`):n.fail((0,e._)`${g} !== ${i}`)}};return dt.default=h,dt}var ut={},Qr;function Cs(){if(Qr)return ut;Qr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=H(),t=Y(),r=Yt(),h={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:i,$data:f,schema:$,schemaCode:g,it:E}=n;if(!f&&$.length===0)throw new Error("enum must have non-empty array");const v=$.length>=E.opts.loopEnum;let _;const b=()=>_??(_=(0,t.useFunc)(u,r.default));let w;if(v||f)w=u.let("valid"),n.block$data(w,d);else{if(!Array.isArray($))throw new Error("ajv implementation error");const s=u.const("vSchema",g);w=(0,e.or)(...$.map((c,y)=>l(s,y)))}n.pass(w);function d(){u.assign(w,!1),u.forOf("v",g,s=>u.if((0,e._)`${b()}(${i}, ${s})`,()=>u.assign(w,!0).break()))}function l(s,c){const y=$[c];return typeof y=="object"&&y!==null?(0,e._)`${b()}(${i}, ${s}[${c}])`:(0,e._)`${i} === ${y}`}}};return ut.default=h,ut}var xr;function Ns(){if(xr)return xe;xr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=bs(),t=ws(),r=Ss(),o=Es(),h=ks(),n=js(),u=Is(),i=Os(),f=Rs(),$=Cs(),g=[e.default,t.default,r.default,o.default,h.default,n.default,u.default,i.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,$.default];return xe.default=g,xe}var lt={},Ie={},Xr;function en(){if(Xr)return Ie;Xr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateAdditionalItems=void 0;const e=H(),t=Y(),o={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:i}=n,{items:f}=u;if(!Array.isArray(f)){(0,t.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}h(n,f)}};function h(n,u){const{gen:i,schema:f,data:$,keyword:g,it:E}=n;E.items=!0;const v=i.const("len",(0,e._)`${$}.length`);if(f===!1)n.setParams({len:u.length}),n.pass((0,e._)`${v} <= ${u.length}`);else if(typeof f=="object"&&!(0,t.alwaysValidSchema)(E,f)){const b=i.var("valid",(0,e._)`${v} <= ${u.length}`);i.if((0,e.not)(b),()=>_(b)),n.ok(b)}function _(b){i.forRange("i",u.length,v,w=>{n.subschema({keyword:g,dataProp:w,dataPropType:t.Type.Num},b),E.allErrors||i.if((0,e.not)(b),()=>i.break())})}}return Ie.validateAdditionalItems=h,Ie.default=o,Ie}var ft={},Oe={},tn;function rn(){if(tn)return Oe;tn=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.validateTuple=void 0;const e=H(),t=Y(),r=pe(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){const{schema:u,it:i}=n;if(Array.isArray(u))return h(n,"additionalItems",u);i.items=!0,!(0,t.alwaysValidSchema)(i,u)&&n.ok((0,r.validateArray)(n))}};function h(n,u,i=n.schema){const{gen:f,parentSchema:$,data:g,keyword:E,it:v}=n;w($),v.opts.unevaluated&&i.length&&v.items!==!0&&(v.items=t.mergeEvaluated.items(f,i.length,v.items));const _=f.name("valid"),b=f.const("len",(0,e._)`${g}.length`);i.forEach((d,l)=>{(0,t.alwaysValidSchema)(v,d)||(f.if((0,e._)`${b} > ${l}`,()=>n.subschema({keyword:E,schemaProp:l,dataProp:l},_)),n.ok(_))});function w(d){const{opts:l,errSchemaPath:s}=v,c=i.length,y=c===d.minItems&&(c===d.maxItems||d[u]===!1);if(l.strictTuples&&!y){const a=`"${E}" is ${c}-tuple, but minItems or maxItems/${u} are not specified or different at path "${s}"`;(0,t.checkStrictMode)(v,a,l.strictTuples)}}}return Oe.validateTuple=h,Oe.default=o,Oe}var nn;function qs(){if(nn)return ft;nn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=rn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return ft.default=t,ft}var pt={},sn;function Ds(){if(sn)return pt;sn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=H(),t=Y(),r=pe(),o=en(),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:i,parentSchema:f,it:$}=u,{prefixItems:g}=f;$.items=!0,!(0,t.alwaysValidSchema)($,i)&&(g?(0,o.validateAdditionalItems)(u,g):u.ok((0,r.validateArray)(u)))}};return pt.default=n,pt}var mt={},on;function Ts(){if(on)return mt;on=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=H(),t=Y(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:h,max:n}})=>n===void 0?(0,e.str)`must contain at least ${h} valid item(s)`:(0,e.str)`must contain at least ${h} and no more than ${n} valid item(s)`,params:({params:{min:h,max:n}})=>n===void 0?(0,e._)`{minContains: ${h}}`:(0,e._)`{minContains: ${h}, maxContains: ${n}}`},code(h){const{gen:n,schema:u,parentSchema:i,data:f,it:$}=h;let g,E;const{minContains:v,maxContains:_}=i;$.opts.next?(g=v===void 0?1:v,E=_):g=1;const b=n.const("len",(0,e._)`${f}.length`);if(h.setParams({min:g,max:E}),E===void 0&&g===0){(0,t.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&g>E){(0,t.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),h.fail();return}if((0,t.alwaysValidSchema)($,u)){let c=(0,e._)`${b} >= ${g}`;E!==void 0&&(c=(0,e._)`${c} && ${b} <= ${E}`),h.pass(c);return}$.items=!0;const w=n.name("valid");E===void 0&&g===1?l(w,()=>n.if(w,()=>n.break())):g===0?(n.let(w,!0),E!==void 0&&n.if((0,e._)`${f}.length > 0`,d)):(n.let(w,!1),d()),h.result(w,()=>h.reset());function d(){const c=n.name("_valid"),y=n.let("count",0);l(c,()=>n.if(c,()=>s(y)))}function l(c,y){n.forRange("i",0,b,a=>{h.subschema({keyword:"contains",dataProp:a,dataPropType:t.Type.Num,compositeRule:!0},c),y()})}function s(c){n.code((0,e._)`${c}++`),E===void 0?n.if((0,e._)`${c} >= ${g}`,()=>n.assign(w,!0).break()):(n.if((0,e._)`${c} > ${E}`,()=>n.assign(w,!1).break()),g===1?n.assign(w,!0):n.if((0,e._)`${c} >= ${g}`,()=>n.assign(w,!0)))}}};return mt.default=o,mt}var Zt={},an;function Ms(){return an||(an=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=H(),r=Y(),o=pe();e.error={message:({params:{property:f,depsCount:$,deps:g}})=>{const E=$===1?"property":"properties";return(0,t.str)`must have ${E} ${g} when property ${f} is present`},params:({params:{property:f,depsCount:$,deps:g,missingProperty:E}})=>(0,t._)`{property: ${f},
|
|
1
|
+
(function(Re,Ie){typeof exports=="object"&&typeof module<"u"?Ie(exports):typeof define=="function"&&define.amd?define(["exports"],Ie):(Re=typeof globalThis<"u"?globalThis:Re||self,Ie(Re.CICSDK={}))})(this,(function(Re){"use strict";function Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Le={exports:{}},Ft={},ve={},Ee={},Lt={},Ut={},Kt={},dr;function Ue(){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(n){if(super(),!e.IDENTIFIER.test(n))throw new Error("CodeGen: name must be a valid identifier");this.str=n}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class i extends t{constructor(n){super(),this._items=typeof n=="string"?[n]:n}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const n=this._items[0];return n===""||n==='""'}get str(){var n;return(n=this._str)!==null&&n!==void 0?n:this._str=this._items.reduce((c,y)=>`${c}${y}`,"")}get names(){var n;return(n=this._names)!==null&&n!==void 0?n:this._names=this._items.reduce((c,y)=>(y instanceof r&&(c[y.str]=(c[y.str]||0)+1),c),{})}}e._Code=i,e.nil=new i("");function g(u,...n){const c=[u[0]];let y=0;for(;y<n.length;)d(c,n[y]),c.push(u[++y]);return new i(c)}e._=g;const s=new i("+");function l(u,...n){const c=[v(u[0])];let y=0;for(;y<n.length;)c.push(s),d(c,n[y]),c.push(s,v(u[++y]));return f(c),new i(c)}e.str=l;function d(u,n){n instanceof i?u.push(...n._items):n instanceof r?u.push(n):u.push(E(n))}e.addCodeArg=d;function f(u){let n=1;for(;n<u.length-1;){if(u[n]===s){const c=w(u[n-1],u[n+1]);if(c!==void 0){u.splice(n-1,3,c);continue}u[n++]="+"}n++}}function w(u,n){if(n==='""')return u;if(u==='""')return n;if(typeof u=="string")return n instanceof r||u[u.length-1]!=='"'?void 0:typeof n!="string"?`${u.slice(0,-1)}${n}"`:n[0]==='"'?u.slice(0,-1)+n.slice(1):void 0;if(typeof n=="string"&&n[0]==='"'&&!(u instanceof r))return`"${u}${n.slice(1)}`}function $(u,n){return n.emptyStr()?u:u.emptyStr()?n:l`${u}${n}`}e.strConcat=$;function E(u){return typeof u=="number"||typeof u=="boolean"||u===null?u:v(Array.isArray(u)?u.join(","):u)}function _(u){return new i(v(u))}e.stringify=_;function v(u){return JSON.stringify(u).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function b(u){return typeof u=="string"&&e.IDENTIFIER.test(u)?new i(`.${u}`):g`[${u}]`}e.getProperty=b;function h(u){if(typeof u=="string"&&e.IDENTIFIER.test(u))return new i(`${u}`);throw new Error(`CodeGen: invalid export name: ${u}, use explicit $id name mapping`)}e.getEsmExportName=h;function a(u){return new i(u.toString())}e.regexpCode=a})(Kt)),Kt}var Jt={},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=Ue();class r extends Error{constructor(w){super(`CodeGen: "code" for ${w} not defined`),this.value=w.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 g{constructor({prefixes:w,parent:$}={}){this._names={},this._prefixes=w,this._parent=$}toName(w){return w instanceof t.Name?w:this.name(w)}name(w){return new t.Name(this._newName(w))}_newName(w){const $=this._names[w]||this._nameGroup(w);return`${w}${$.index++}`}_nameGroup(w){var $,E;if(!((E=($=this._parent)===null||$===void 0?void 0:$._prefixes)===null||E===void 0)&&E.has(w)||this._prefixes&&!this._prefixes.has(w))throw new Error(`CodeGen: prefix "${w}" is not allowed in this scope`);return this._names[w]={prefix:w,index:0}}}e.Scope=g;class s extends t.Name{constructor(w,$){super($),this.prefix=w}setValue(w,{property:$,itemIndex:E}){this.value=w,this.scopePath=(0,t._)`.${new t.Name($)}[${E}]`}}e.ValueScopeName=s;const l=(0,t._)`\n`;class d extends g{constructor(w){super(w),this._values={},this._scope=w.scope,this.opts={...w,_n:w.lines?l:t.nil}}get(){return this._scope}name(w){return new s(w,this._newName(w))}value(w,$){var E;if($.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName(w),{prefix:v}=_,b=(E=$.key)!==null&&E!==void 0?E:$.ref;let h=this._values[v];if(h){const n=h.get(b);if(n)return n}else h=this._values[v]=new Map;h.set(b,_);const a=this._scope[v]||(this._scope[v]=[]),u=a.length;return a[u]=$.ref,_.setValue($,{property:v,itemIndex:u}),_}getValue(w,$){const E=this._values[w];if(E)return E.get($)}scopeRefs(w,$=this._values){return this._reduceValues($,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${w}${E.scopePath}`})}scopeCode(w=this._values,$,E){return this._reduceValues(w,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},$,E)}_reduceValues(w,$,E={},_){let v=t.nil;for(const b in w){const h=w[b];if(!h)continue;const a=E[b]=E[b]||new Map;h.forEach(u=>{if(a.has(u))return;a.set(u,i.Started);let n=$(u);if(n){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${c} ${u} = ${n};${this.opts._n}`}else if(n=_?.(u))v=(0,t._)`${v}${n}${this.opts._n}`;else throw new r(u);a.set(u,i.Completed)})}return v}}e.ValueScope=d})(Jt)),Jt}var fr;function H(){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=Ue(),r=lr();var i=Ue();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 g=lr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return g.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return g.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return g.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return g.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(p,S){return this}}class l extends s{constructor(p,S,N){super(),this.varKind=p,this.name=S,this.rhs=N}render({es5:p,_n:S}){const N=p?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${U};`+S}optimizeNames(p,S){if(p[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,p,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class d extends s{constructor(p,S,N){super(),this.lhs=p,this.rhs=S,this.sideEffects=N}render({_n:p}){return`${this.lhs} = ${this.rhs};`+p}optimizeNames(p,S){if(!(this.lhs instanceof t.Name&&!p[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,p,S),this}get names(){const p=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(p,this.rhs)}}class f extends d{constructor(p,S,N,U){super(p,N,U),this.op=S}render({_n:p}){return`${this.lhs} ${this.op}= ${this.rhs};`+p}}class w extends s{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`${this.label}:`+p}}class $ extends s{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`break${this.label?` ${this.label}`:""};`+p}}class E extends s{constructor(p){super(),this.error=p}render({_n:p}){return`throw ${this.error};`+p}get names(){return this.error.names}}class _ extends s{constructor(p){super(),this.code=p}render({_n:p}){return`${this.code};`+p}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(p,S){return this.code=L(this.code,p,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends s{constructor(p=[]){super(),this.nodes=p}render(p){return this.nodes.reduce((S,N)=>S+N.render(p),"")}optimizeNodes(){const{nodes:p}=this;let S=p.length;for(;S--;){const N=p[S].optimizeNodes();Array.isArray(N)?p.splice(S,1,...N):N?p[S]=N:p.splice(S,1)}return p.length>0?this:void 0}optimizeNames(p,S){const{nodes:N}=this;let U=N.length;for(;U--;){const J=N[U];J.optimizeNames(p,S)||(Q(p,J.names),N.splice(U,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((p,S)=>V(p,S.names),{})}}class b extends v{render(p){return"{"+p._n+super.render(p)+"}"+p._n}}class h extends v{}class a extends b{}a.kind="else";class u extends b{constructor(p,S){super(S),this.condition=p}render(p){let S=`if(${this.condition})`+super.render(p);return this.else&&(S+="else "+this.else.render(p)),S}optimizeNodes(){super.optimizeNodes();const p=this.condition;if(p===!0)return this.nodes;let S=this.else;if(S){const N=S.optimizeNodes();S=this.else=Array.isArray(N)?new a(N):N}if(S)return p===!1?S instanceof u?S:S.nodes:this.nodes.length?this:new u(oe(p),S instanceof u?[S]:S.nodes);if(!(p===!1||!this.nodes.length))return this}optimizeNames(p,S){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(p,S),!!(super.optimizeNames(p,S)||this.else))return this.condition=L(this.condition,p,S),this}get names(){const p=super.names;return F(p,this.condition),this.else&&V(p,this.else.names),p}}u.kind="if";class n extends b{}n.kind="for";class c extends n{constructor(p){super(),this.iteration=p}render(p){return`for(${this.iteration})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iteration=L(this.iteration,p,S),this}get names(){return V(super.names,this.iteration.names)}}class y extends n{constructor(p,S,N,U){super(),this.varKind=p,this.name=S,this.from=N,this.to=U}render(p){const S=p.es5?r.varKinds.var:this.varKind,{name:N,from:U,to:J}=this;return`for(${S} ${N}=${U}; ${N}<${J}; ${N}++)`+super.render(p)}get names(){const p=F(super.names,this.from);return F(p,this.to)}}class o extends n{constructor(p,S,N,U){super(),this.loop=p,this.varKind=S,this.name=N,this.iterable=U}render(p){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iterable=L(this.iterable,p,S),this}get names(){return V(super.names,this.iterable.names)}}class m extends b{constructor(p,S,N){super(),this.name=p,this.args=S,this.async=N}render(p){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(p)}}m.kind="func";class P extends v{render(p){return"return "+super.render(p)}}P.kind="return";class O extends b{render(p){let S="try"+super.render(p);return this.catch&&(S+=this.catch.render(p)),this.finally&&(S+=this.finally.render(p)),S}optimizeNodes(){var p,S;return super.optimizeNodes(),(p=this.catch)===null||p===void 0||p.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(p,S){var N,U;return super.optimizeNames(p,S),(N=this.catch)===null||N===void 0||N.optimizeNames(p,S),(U=this.finally)===null||U===void 0||U.optimizeNames(p,S),this}get names(){const p=super.names;return this.catch&&V(p,this.catch.names),this.finally&&V(p,this.finally.names),p}}class T extends b{constructor(p){super(),this.error=p}render(p){return`catch(${this.error})`+super.render(p)}}T.kind="catch";class z extends b{render(p){return"finally"+super.render(p)}}z.kind="finally";class C{constructor(p,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
|
|
2
|
+
`:""},this._extScope=p,this._scope=new r.Scope({parent:p}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(p){return this._scope.name(p)}scopeName(p){return this._extScope.name(p)}scopeValue(p,S){const N=this._extScope.value(p,S);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(p,S){return this._extScope.getValue(p,S)}scopeRefs(p){return this._extScope.scopeRefs(p,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(p,S,N,U){const J=this._scope.toName(S);return N!==void 0&&U&&(this._constants[J.str]=N),this._leafNode(new l(p,J,N)),J}const(p,S,N){return this._def(r.varKinds.const,p,S,N)}let(p,S,N){return this._def(r.varKinds.let,p,S,N)}var(p,S,N){return this._def(r.varKinds.var,p,S,N)}assign(p,S,N){return this._leafNode(new d(p,S,N))}add(p,S){return this._leafNode(new f(p,e.operators.ADD,S))}code(p){return typeof p=="function"?p():p!==t.nil&&this._leafNode(new _(p)),this}object(...p){const S=["{"];for(const[N,U]of p)S.length>1&&S.push(","),S.push(N),(N!==U||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,U));return S.push("}"),new t._Code(S)}if(p,S,N){if(this._blockNode(new u(p)),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(p){return this._elseNode(new u(p))}else(){return this._elseNode(new a)}endIf(){return this._endBlockNode(u,a)}_for(p,S){return this._blockNode(p),S&&this.code(S).endFor(),this}for(p,S){return this._for(new c(p),S)}forRange(p,S,N,U,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const x=this._scope.toName(p);return this._for(new y(J,x,S,N),()=>U(x))}forOf(p,S,N,U=r.varKinds.const){const J=this._scope.toName(p);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 o("of",U,J,S),()=>N(J))}forIn(p,S,N,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(p,(0,t._)`Object.keys(${S})`,N);const J=this._scope.toName(p);return this._for(new o("in",U,J,S),()=>N(J))}endFor(){return this._endBlockNode(n)}label(p){return this._leafNode(new w(p))}break(p){return this._leafNode(new $(p))}return(p){const S=new P;if(this._blockNode(S),this.code(p),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(p,S,N){if(!S&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new O;if(this._blockNode(U),this.code(p),S){const J=this.name("e");this._currNode=U.catch=new T(J),S(J)}return N&&(this._currNode=U.finally=new z,this.code(N)),this._endBlockNode(T,z)}throw(p){return this._leafNode(new E(p))}block(p,S){return this._blockStarts.push(this._nodes.length),p&&this.code(p).endBlock(S),this}endBlock(p){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||p!==void 0&&N!==p)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${p} expected`);return this._nodes.length=S,this}func(p,S=t.nil,N,U){return this._blockNode(new m(p,S,N)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(m)}optimize(p=1){for(;p-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(p){return this._currNode.nodes.push(p),this}_blockNode(p){this._currNode.nodes.push(p),this._nodes.push(p)}_endBlockNode(p,S){const N=this._currNode;if(N instanceof p||S&&N instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${p.kind}/${S.kind}`:p.kind}"`)}_elseNode(p){const S=this._currNode;if(!(S instanceof u))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=p,this}get _root(){return this._nodes[0]}get _currNode(){const p=this._nodes;return p[p.length-1]}set _currNode(p){const S=this._nodes;S[S.length-1]=p}}e.CodeGen=C;function V(I,p){for(const S in p)I[S]=(I[S]||0)+(p[S]||0);return I}function F(I,p){return p instanceof t._CodeOrName?V(I,p.names):I}function L(I,p,S){if(I instanceof t.Name)return N(I);if(!U(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||p[J.str]!==1?J:(delete p[J.str],x)}function U(J){return J instanceof t._Code&&J._items.some(x=>x instanceof t.Name&&p[x.str]===1&&S[x.str]!==void 0)}}function Q(I,p){for(const S in p)I[S]=(I[S]||0)-(p[S]||0)}function oe(I){return typeof I=="boolean"||typeof I=="number"||I===null?!I:(0,t._)`!${D(I)}`}e.not=oe;const ae=j(e.operators.AND);function X(...I){return I.reduce(ae)}e.and=X;const ye=j(e.operators.OR);function M(...I){return I.reduce(ye)}e.or=M;function j(I){return(p,S)=>p===t.nil?S:S===t.nil?p:(0,t._)`${D(p)} ${I} ${D(S)}`}function D(I){return I instanceof t.Name?I:(0,t._)`(${I})`}})(Ut)),Ut}var G={},pr;function Y(){if(pr)return G;pr=1,Object.defineProperty(G,"__esModule",{value:!0}),G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;const e=H(),t=Ue();function r(o){const m={};for(const P of o)m[P]=!0;return m}G.toHash=r;function i(o,m){return typeof m=="boolean"?m:Object.keys(m).length===0?!0:(g(o,m),!s(m,o.self.RULES.all))}G.alwaysValidSchema=i;function g(o,m=o.schema){const{opts:P,self:O}=o;if(!P.strictSchema||typeof m=="boolean")return;const T=O.RULES.keywords;for(const z in m)T[z]||y(o,`unknown keyword: "${z}"`)}G.checkUnknownRules=g;function s(o,m){if(typeof o=="boolean")return!o;for(const P in o)if(m[P])return!0;return!1}G.schemaHasRules=s;function l(o,m){if(typeof o=="boolean")return!o;for(const P in o)if(P!=="$ref"&&m.all[P])return!0;return!1}G.schemaHasRulesButRef=l;function d({topSchemaRef:o,schemaPath:m},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._)`${o}${m}${(0,e.getProperty)(O)}`}G.schemaRefOrVal=d;function f(o){return E(decodeURIComponent(o))}G.unescapeFragment=f;function w(o){return encodeURIComponent($(o))}G.escapeFragment=w;function $(o){return typeof o=="number"?`${o}`:o.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=$;function E(o){return o.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=E;function _(o,m){if(Array.isArray(o))for(const P of o)m(P);else m(o)}G.eachItem=_;function v({mergeNames:o,mergeToName:m,mergeValues:P,resultToName:O}){return(T,z,C,V)=>{const F=C===void 0?z:C instanceof e.Name?(z instanceof e.Name?o(T,z,C):m(T,z,C),C):z instanceof e.Name?(m(T,C,z),z):P(z,C);return V===e.Name&&!(F instanceof e.Name)?O(T,F):F}}G.mergeEvaluated={props:v({mergeNames:(o,m,P)=>o.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>{o.if((0,e._)`${m} === true`,()=>o.assign(P,!0),()=>o.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${m})`))}),mergeToName:(o,m,P)=>o.if((0,e._)`${P} !== true`,()=>{m===!0?o.assign(P,!0):(o.assign(P,(0,e._)`${P} || {}`),h(o,P,m))}),mergeValues:(o,m)=>o===!0?!0:{...o,...m},resultToName:b}),items:v({mergeNames:(o,m,P)=>o.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>o.assign(P,(0,e._)`${m} === true ? true : ${P} > ${m} ? ${P} : ${m}`)),mergeToName:(o,m,P)=>o.if((0,e._)`${P} !== true`,()=>o.assign(P,m===!0?!0:(0,e._)`${P} > ${m} ? ${P} : ${m}`)),mergeValues:(o,m)=>o===!0?!0:Math.max(o,m),resultToName:(o,m)=>o.var("items",m)})};function b(o,m){if(m===!0)return o.var("props",!0);const P=o.var("props",(0,e._)`{}`);return m!==void 0&&h(o,P,m),P}G.evaluatedPropsToName=b;function h(o,m,P){Object.keys(P).forEach(O=>o.assign((0,e._)`${m}${(0,e.getProperty)(O)}`,!0))}G.setEvaluated=h;const a={};function u(o,m){return o.scopeValue("func",{ref:m,code:a[m.code]||(a[m.code]=new t._Code(m.code))})}G.useFunc=u;var n;(function(o){o[o.Num=0]="Num",o[o.Str=1]="Str"})(n||(G.Type=n={}));function c(o,m,P){if(o instanceof e.Name){const O=m===n.Num;return P?O?(0,e._)`"[" + ${o} + "]"`:(0,e._)`"['" + ${o} + "']"`:O?(0,e._)`"/" + ${o}`:(0,e._)`"/" + ${o}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(o).toString():"/"+$(o)}G.getErrorPath=c;function y(o,m,P=o.opts.strictSchema){if(P){if(m=`strict mode: ${m}`,P===!0)throw new Error(m);o.self.logger.warn(m)}}return G.checkStrictMode=y,G}var Ke={},mr;function be(){if(mr)return Ke;mr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=H(),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 Ke.default=t,Ke}var hr;function Je(){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=H(),r=Y(),i=be();e.keywordError={message:({keyword:a})=>(0,t.str)`must pass "${a}" keyword validation`},e.keyword$DataError={message:({keyword:a,schemaType:u})=>u?(0,t.str)`"${a}" keyword must be ${u} ($data)`:(0,t.str)`"${a}" keyword is invalid ($data)`};function g(a,u=e.keywordError,n,c){const{it:y}=a,{gen:o,compositeRule:m,allErrors:P}=y,O=E(a,u,n);c??(m||P)?f(o,O):w(y,(0,t._)`[${O}]`)}e.reportError=g;function s(a,u=e.keywordError,n){const{it:c}=a,{gen:y,compositeRule:o,allErrors:m}=c,P=E(a,u,n);f(y,P),o||m||w(c,i.default.vErrors)}e.reportExtraError=s;function l(a,u){a.assign(i.default.errors,u),a.if((0,t._)`${i.default.vErrors} !== null`,()=>a.if(u,()=>a.assign((0,t._)`${i.default.vErrors}.length`,u),()=>a.assign(i.default.vErrors,null)))}e.resetErrorsCount=l;function d({gen:a,keyword:u,schemaValue:n,data:c,errsCount:y,it:o}){if(y===void 0)throw new Error("ajv implementation error");const m=a.name("err");a.forRange("i",y,i.default.errors,P=>{a.const(m,(0,t._)`${i.default.vErrors}[${P}]`),a.if((0,t._)`${m}.instancePath === undefined`,()=>a.assign((0,t._)`${m}.instancePath`,(0,t.strConcat)(i.default.instancePath,o.errorPath))),a.assign((0,t._)`${m}.schemaPath`,(0,t.str)`${o.errSchemaPath}/${u}`),o.opts.verbose&&(a.assign((0,t._)`${m}.schema`,n),a.assign((0,t._)`${m}.data`,c))})}e.extendErrors=d;function f(a,u){const n=a.const("err",u);a.if((0,t._)`${i.default.vErrors} === null`,()=>a.assign(i.default.vErrors,(0,t._)`[${n}]`),(0,t._)`${i.default.vErrors}.push(${n})`),a.code((0,t._)`${i.default.errors}++`)}function w(a,u){const{gen:n,validateName:c,schemaEnv:y}=a;y.$async?n.throw((0,t._)`new ${a.ValidationError}(${u})`):(n.assign((0,t._)`${c}.errors`,u),n.return(!1))}const $={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function E(a,u,n){const{createErrors:c}=a.it;return c===!1?(0,t._)`{}`:_(a,u,n)}function _(a,u,n={}){const{gen:c,it:y}=a,o=[v(y,n),b(a,n)];return h(a,u,o),c.object(...o)}function v({errorPath:a},{instancePath:u}){const n=u?(0,t.str)`${a}${(0,r.getErrorPath)(u,r.Type.Str)}`:a;return[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,n)]}function b({keyword:a,it:{errSchemaPath:u}},{schemaPath:n,parentSchema:c}){let y=c?u:(0,t.str)`${u}/${a}`;return n&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(n,r.Type.Str)}`),[$.schemaPath,y]}function h(a,{params:u,message:n},c){const{keyword:y,data:o,schemaValue:m,it:P}=a,{opts:O,propertyName:T,topSchemaRef:z,schemaPath:C}=P;c.push([$.keyword,y],[$.params,typeof u=="function"?u(a):u||(0,t._)`{}`]),O.messages&&c.push([$.message,typeof n=="function"?n(a):n]),O.verbose&&c.push([$.schema,m],[$.parentSchema,(0,t._)`${z}${C}`],[i.default.data,o]),T&&c.push([$.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=Je(),t=H(),r=be(),i={message:"boolean schema is false"};function g(d){const{gen:f,schema:w,validateName:$}=d;w===!1?l(d,!1):typeof w=="object"&&w.$async===!0?f.return(r.default.data):(f.assign((0,t._)`${$}.errors`,null),f.return(!0))}Ee.topBoolOrEmptySchema=g;function s(d,f){const{gen:w,schema:$}=d;$===!1?(w.var(f,!1),l(d)):w.var(f,!0)}Ee.boolOrEmptySchema=s;function l(d,f){const{gen:w,data:$}=d,E={gen:w,keyword:"false schema",data:$,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:d};(0,e.reportError)(E,i,void 0,f)}return Ee}var re={},ke={},gr;function vr(){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(g){return typeof g=="string"&&t.has(g)}ke.isJSONType=r;function i(){const g={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...g,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},g.number,g.string,g.array,g.object],post:{rules:[]},all:{},keywords:{}}}return ke.getRules=i,ke}var _e={},_r;function $r(){if(_r)return _e;_r=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:i,self:g},s){const l=g.RULES.types[s];return l&&l!==!0&&t(i,l)}_e.schemaHasRulesForType=e;function t(i,g){return g.rules.some(s=>r(i,s))}_e.shouldUseGroup=t;function r(i,g){var s;return i[g.keyword]!==void 0||((s=g.definition.implements)===null||s===void 0?void 0:s.some(l=>i[l]!==void 0))}return _e.shouldUseRule=r,_e}var br;function He(){if(br)return re;br=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=vr(),t=$r(),r=Je(),i=H(),g=Y();var s;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(s||(re.DataType=s={}));function l(n){const c=d(n.type);if(c.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!c.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&c.push("null")}return c}re.getSchemaTypes=l;function d(n){const c=Array.isArray(n)?n:n?[n]:[];if(c.every(e.isJSONType))return c;throw new Error("type must be JSONType or JSONType[]: "+c.join(","))}re.getJSONTypes=d;function f(n,c){const{gen:y,data:o,opts:m}=n,P=$(c,m.coerceTypes),O=c.length>0&&!(P.length===0&&c.length===1&&(0,t.schemaHasRulesForType)(n,c[0]));if(O){const T=b(c,o,m.strictNumbers,s.Wrong);y.if(T,()=>{P.length?E(n,c,P):a(n)})}return O}re.coerceAndCheckDataType=f;const w=new Set(["string","number","integer","boolean","null"]);function $(n,c){return c?n.filter(y=>w.has(y)||c==="array"&&y==="array"):[]}function E(n,c,y){const{gen:o,data:m,opts:P}=n,O=o.let("dataType",(0,i._)`typeof ${m}`),T=o.let("coerced",(0,i._)`undefined`);P.coerceTypes==="array"&&o.if((0,i._)`${O} == 'object' && Array.isArray(${m}) && ${m}.length == 1`,()=>o.assign(m,(0,i._)`${m}[0]`).assign(O,(0,i._)`typeof ${m}`).if(b(c,m,P.strictNumbers),()=>o.assign(T,m))),o.if((0,i._)`${T} !== undefined`);for(const C of y)(w.has(C)||C==="array"&&P.coerceTypes==="array")&&z(C);o.else(),a(n),o.endIf(),o.if((0,i._)`${T} !== undefined`,()=>{o.assign(m,T),_(n,T)});function z(C){switch(C){case"string":o.elseIf((0,i._)`${O} == "number" || ${O} == "boolean"`).assign(T,(0,i._)`"" + ${m}`).elseIf((0,i._)`${m} === null`).assign(T,(0,i._)`""`);return;case"number":o.elseIf((0,i._)`${O} == "boolean" || ${m} === null
|
|
3
|
+
|| (${O} == "string" && ${m} && ${m} == +${m})`).assign(T,(0,i._)`+${m}`);return;case"integer":o.elseIf((0,i._)`${O} === "boolean" || ${m} === null
|
|
4
|
+
|| (${O} === "string" && ${m} && ${m} == +${m} && !(${m} % 1))`).assign(T,(0,i._)`+${m}`);return;case"boolean":o.elseIf((0,i._)`${m} === "false" || ${m} === 0 || ${m} === null`).assign(T,!1).elseIf((0,i._)`${m} === "true" || ${m} === 1`).assign(T,!0);return;case"null":o.elseIf((0,i._)`${m} === "" || ${m} === 0 || ${m} === false`),o.assign(T,null);return;case"array":o.elseIf((0,i._)`${O} === "string" || ${O} === "number"
|
|
5
|
+
|| ${O} === "boolean" || ${m} === null`).assign(T,(0,i._)`[${m}]`)}}}function _({gen:n,parentData:c,parentDataProperty:y},o){n.if((0,i._)`${c} !== undefined`,()=>n.assign((0,i._)`${c}[${y}]`,o))}function v(n,c,y,o=s.Correct){const m=o===s.Correct?i.operators.EQ:i.operators.NEQ;let P;switch(n){case"null":return(0,i._)`${c} ${m} null`;case"array":P=(0,i._)`Array.isArray(${c})`;break;case"object":P=(0,i._)`${c} && typeof ${c} == "object" && !Array.isArray(${c})`;break;case"integer":P=O((0,i._)`!(${c} % 1) && !isNaN(${c})`);break;case"number":P=O();break;default:return(0,i._)`typeof ${c} ${m} ${n}`}return o===s.Correct?P:(0,i.not)(P);function O(T=i.nil){return(0,i.and)((0,i._)`typeof ${c} == "number"`,T,y?(0,i._)`isFinite(${c})`:i.nil)}}re.checkDataType=v;function b(n,c,y,o){if(n.length===1)return v(n[0],c,y,o);let m;const P=(0,g.toHash)(n);if(P.array&&P.object){const O=(0,i._)`typeof ${c} != "object"`;m=P.null?O:(0,i._)`!${c} || ${O}`,delete P.null,delete P.array,delete P.object}else m=i.nil;P.number&&delete P.integer;for(const O in P)m=(0,i.and)(m,v(O,c,y,o));return m}re.checkDataTypes=b;const h={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:c})=>typeof n=="string"?(0,i._)`{type: ${n}}`:(0,i._)`{type: ${c}}`};function a(n){const c=u(n);(0,r.reportError)(c,h)}re.reportTypeError=a;function u(n){const{gen:c,data:y,schema:o}=n,m=(0,g.schemaRefOrVal)(n,o,"type");return{gen:c,keyword:"type",data:y,schema:o.type,schemaCode:m,schemaValue:m,parentSchema:o,params:{},it:n}}return re}var De={},wr;function fs(){if(wr)return De;wr=1,Object.defineProperty(De,"__esModule",{value:!0}),De.assignDefaults=void 0;const e=H(),t=Y();function r(g,s){const{properties:l,items:d}=g.schema;if(s==="object"&&l)for(const f in l)i(g,f,l[f].default);else s==="array"&&Array.isArray(d)&&d.forEach((f,w)=>i(g,w,f.default))}De.assignDefaults=r;function i(g,s,l){const{gen:d,compositeRule:f,data:w,opts:$}=g;if(l===void 0)return;const E=(0,e._)`${w}${(0,e.getProperty)(s)}`;if(f){(0,t.checkStrictMode)(g,`default is ignored for: ${E}`);return}let _=(0,e._)`${E} === undefined`;$.useDefaults==="empty"&&(_=(0,e._)`${_} || ${E} === null || ${E} === ""`),d.if(_,(0,e._)`${E} = ${(0,e.stringify)(l)}`)}return De}var pe={},Z={},Pr;function me(){if(Pr)return Z;Pr=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=H(),t=Y(),r=be(),i=Y();function g(n,c){const{gen:y,data:o,it:m}=n;y.if($(y,o,c,m.opts.ownProperties),()=>{n.setParams({missingProperty:(0,e._)`${c}`},!0),n.error()})}Z.checkReportMissingProp=g;function s({gen:n,data:c,it:{opts:y}},o,m){return(0,e.or)(...o.map(P=>(0,e.and)($(n,c,P,y.ownProperties),(0,e._)`${m} = ${P}`)))}Z.checkMissingProp=s;function l(n,c){n.setParams({missingProperty:c},!0),n.error()}Z.reportMissingProp=l;function d(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Z.hasPropFunc=d;function f(n,c,y){return(0,e._)`${d(n)}.call(${c}, ${y})`}Z.isOwnProperty=f;function w(n,c,y,o){const m=(0,e._)`${c}${(0,e.getProperty)(y)} !== undefined`;return o?(0,e._)`${m} && ${f(n,c,y)}`:m}Z.propertyInData=w;function $(n,c,y,o){const m=(0,e._)`${c}${(0,e.getProperty)(y)} === undefined`;return o?(0,e.or)(m,(0,e.not)(f(n,c,y))):m}Z.noPropertyInData=$;function E(n){return n?Object.keys(n).filter(c=>c!=="__proto__"):[]}Z.allSchemaProperties=E;function _(n,c){return E(c).filter(y=>!(0,t.alwaysValidSchema)(n,c[y]))}Z.schemaProperties=_;function v({schemaCode:n,data:c,it:{gen:y,topSchemaRef:o,schemaPath:m,errorPath:P},it:O},T,z,C){const V=C?(0,e._)`${n}, ${c}, ${o}${m}`:c,F=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,O.parentData],[r.default.parentDataProperty,O.parentDataProperty],[r.default.rootData,r.default.rootData]];O.opts.dynamicRef&&F.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const L=(0,e._)`${V}, ${y.object(...F)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${L})`:(0,e._)`${T}(${L})`}Z.callValidateCode=v;const b=(0,e._)`new RegExp`;function h({gen:n,it:{opts:c}},y){const o=c.unicodeRegExp?"u":"",{regExp:m}=c.code,P=m(y,o);return n.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${m.code==="new RegExp"?b:(0,i.useFunc)(n,m)}(${y}, ${o})`})}Z.usePattern=h;function a(n){const{gen:c,data:y,keyword:o,it:m}=n,P=c.name("valid");if(m.allErrors){const T=c.let("valid",!0);return O(()=>c.assign(T,!1)),T}return c.var(P,!0),O(()=>c.break()),P;function O(T){const z=c.const("len",(0,e._)`${y}.length`);c.forRange("i",0,z,C=>{n.subschema({keyword:o,dataProp:C,dataPropType:t.Type.Num},P),c.if((0,e.not)(P),T)})}}Z.validateArray=a;function u(n){const{gen:c,schema:y,keyword:o,it:m}=n;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(m,z))&&!m.opts.unevaluated)return;const O=c.let("valid",!1),T=c.name("_valid");c.block(()=>y.forEach((z,C)=>{const V=n.subschema({keyword:o,schemaProp:C,compositeRule:!0},T);c.assign(O,(0,e._)`${O} || ${T}`),n.mergeValidEvaluated(V,T)||c.if((0,e.not)(O))})),n.result(O,()=>n.reset(),()=>n.error(!0))}return Z.validateUnion=u,Z}var Sr;function ps(){if(Sr)return pe;Sr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateKeywordUsage=pe.validSchemaType=pe.funcKeywordCode=pe.macroKeywordCode=void 0;const e=H(),t=be(),r=me(),i=Je();function g(_,v){const{gen:b,keyword:h,schema:a,parentSchema:u,it:n}=_,c=v.macro.call(n.self,a,u,n),y=w(b,h,c);n.opts.validateSchema!==!1&&n.self.validateSchema(c,!0);const o=b.name("valid");_.subschema({schema:c,schemaPath:e.nil,errSchemaPath:`${n.errSchemaPath}/${h}`,topSchemaRef:y,compositeRule:!0},o),_.pass(o,()=>_.error(!0))}pe.macroKeywordCode=g;function s(_,v){var b;const{gen:h,keyword:a,schema:u,parentSchema:n,$data:c,it:y}=_;f(y,v);const o=!c&&v.compile?v.compile.call(y.self,u,n,y):v.validate,m=w(h,a,o),P=h.let("valid");_.block$data(P,O),_.ok((b=v.valid)!==null&&b!==void 0?b:P);function O(){if(v.errors===!1)C(),v.modifying&&l(_),V(()=>_.error());else{const F=v.async?T():z();v.modifying&&l(_),V(()=>d(_,F))}}function T(){const F=h.let("ruleErrs",null);return h.try(()=>C((0,e._)`await `),L=>h.assign(P,!1).if((0,e._)`${L} instanceof ${y.ValidationError}`,()=>h.assign(F,(0,e._)`${L}.errors`),()=>h.throw(L))),F}function z(){const F=(0,e._)`${m}.errors`;return h.assign(F,null),C(e.nil),F}function C(F=v.async?(0,e._)`await `:e.nil){const L=y.opts.passContext?t.default.this:t.default.self,Q=!("compile"in v&&!c||v.schema===!1);h.assign(P,(0,e._)`${F}${(0,r.callValidateCode)(_,m,L,Q)}`,v.modifying)}function V(F){var L;h.if((0,e.not)((L=v.valid)!==null&&L!==void 0?L:P),F)}}pe.funcKeywordCode=s;function l(_){const{gen:v,data:b,it:h}=_;v.if(h.parentData,()=>v.assign(b,(0,e._)`${h.parentData}[${h.parentDataProperty}]`))}function d(_,v){const{gen:b}=_;b.if((0,e._)`Array.isArray(${v})`,()=>{b.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 w(_,v,b){if(b===void 0)throw new Error(`keyword "${v}" failed to compile`);return _.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function $(_,v,b=!1){return!v.length||v.some(h=>h==="array"?Array.isArray(_):h==="object"?_&&typeof _=="object"&&!Array.isArray(_):typeof _==h||b&&typeof _>"u")}pe.validSchemaType=$;function E({schema:_,opts:v,self:b,errSchemaPath:h},a,u){if(Array.isArray(a.keyword)?!a.keyword.includes(u):a.keyword!==u)throw new Error("ajv implementation error");const n=a.dependencies;if(n?.some(c=>!Object.prototype.hasOwnProperty.call(_,c)))throw new Error(`parent schema must have dependencies of ${u}: ${n.join(",")}`);if(a.validateSchema&&!a.validateSchema(_[u])){const y=`keyword "${u}" value is invalid at path "${h}": `+b.errorsText(a.validateSchema.errors);if(v.validateSchema==="log")b.logger.error(y);else throw new Error(y)}}return pe.validateKeywordUsage=E,pe}var $e={},Er;function ms(){if(Er)return $e;Er=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=H(),t=Y();function r(s,{keyword:l,schemaProp:d,schema:f,schemaPath:w,errSchemaPath:$,topSchemaRef:E}){if(l!==void 0&&f!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){const _=s.schema[l];return d===void 0?{schema:_,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${s.errSchemaPath}/${l}`}:{schema:_[d],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(d)}`,errSchemaPath:`${s.errSchemaPath}/${l}/${(0,t.escapeFragment)(d)}`}}if(f!==void 0){if(w===void 0||$===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:f,schemaPath:w,topSchemaRef:E,errSchemaPath:$}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function i(s,l,{dataProp:d,dataPropType:f,data:w,dataTypes:$,propertyName:E}){if(w!==void 0&&d!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:_}=l;if(d!==void 0){const{errorPath:b,dataPathArr:h,opts:a}=l,u=_.let("data",(0,e._)`${l.data}${(0,e.getProperty)(d)}`,!0);v(u),s.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(d,f,a.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${d}`,s.dataPathArr=[...h,s.parentDataProperty]}if(w!==void 0){const b=w instanceof e.Name?w:_.let("data",w,!0);v(b),E!==void 0&&(s.propertyName=E)}$&&(s.dataTypes=$);function v(b){s.data=b,s.dataLevel=l.dataLevel+1,s.dataTypes=[],l.definedProperties=new Set,s.parentData=l.data,s.dataNames=[...l.dataNames,b]}}$e.extendSubschemaData=i;function g(s,{jtdDiscriminator:l,jtdMetadata:d,compositeRule:f,createErrors:w,allErrors:$}){f!==void 0&&(s.compositeRule=f),w!==void 0&&(s.createErrors=w),$!==void 0&&(s.allErrors=$),s.jtdDiscriminator=l,s.jtdMetadata=d}return $e.extendSubschemaMode=g,$e}var ie={},Ht,kr;function jr(){return kr||(kr=1,Ht=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,g,s;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(g=i;g--!==0;)if(!e(t[g],r[g]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(r).length)return!1;for(g=i;g--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[g]))return!1;for(g=i;g--!==0;){var l=s[g];if(!e(t[l],r[l]))return!1}return!0}return t!==t&&r!==r}),Ht}var Gt={exports:{}},Rr;function hs(){if(Rr)return Gt.exports;Rr=1;var e=Gt.exports=function(i,g,s){typeof g=="function"&&(s=g,g={}),s=g.cb||s;var l=typeof s=="function"?s:s.pre||function(){},d=s.post||function(){};t(g,l,d,i,"",i)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(i,g,s,l,d,f,w,$,E,_){if(l&&typeof l=="object"&&!Array.isArray(l)){g(l,d,f,w,$,E,_);for(var v in l){var b=l[v];if(Array.isArray(b)){if(v in e.arrayKeywords)for(var h=0;h<b.length;h++)t(i,g,s,b[h],d+"/"+v+"/"+h,f,d,v,l,h)}else if(v in e.propsKeywords){if(b&&typeof b=="object")for(var a in b)t(i,g,s,b[a],d+"/"+v+"/"+r(a),f,d,v,l,a)}else(v in e.keywords||i.allKeys&&!(v in e.skipKeywords))&&t(i,g,s,b,d+"/"+v,f,d,v,l)}s(l,d,f,w,$,E,_)}}function r(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}return Gt.exports}var Ir;function Ge(){if(Ir)return ie;Ir=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.getSchemaRefs=ie.resolveUrl=ie.normalizeId=ie._getFullPath=ie.getFullPath=ie.inlineRef=void 0;const e=Y(),t=jr(),r=hs(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function g(h,a=!0){return typeof h=="boolean"?!0:a===!0?!l(h):a?d(h)<=a:!1}ie.inlineRef=g;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(h){for(const a in h){if(s.has(a))return!0;const u=h[a];if(Array.isArray(u)&&u.some(l)||typeof u=="object"&&l(u))return!0}return!1}function d(h){let a=0;for(const u in h){if(u==="$ref")return 1/0;if(a++,!i.has(u)&&(typeof h[u]=="object"&&(0,e.eachItem)(h[u],n=>a+=d(n)),a===1/0))return 1/0}return a}function f(h,a="",u){u!==!1&&(a=E(a));const n=h.parse(a);return w(h,n)}ie.getFullPath=f;function w(h,a){return h.serialize(a).split("#")[0]+"#"}ie._getFullPath=w;const $=/#\/?$/;function E(h){return h?h.replace($,""):""}ie.normalizeId=E;function _(h,a,u){return u=E(u),h.resolve(a,u)}ie.resolveUrl=_;const v=/^[a-z_][-a-z0-9._]*$/i;function b(h,a){if(typeof h=="boolean")return{};const{schemaId:u,uriResolver:n}=this.opts,c=E(h[u]||a),y={"":c},o=f(n,c,!1),m={},P=new Set;return r(h,{allKeys:!0},(z,C,V,F)=>{if(F===void 0)return;const L=o+C;let Q=y[F];typeof z[u]=="string"&&(Q=oe.call(this,z[u])),ae.call(this,z.$anchor),ae.call(this,z.$dynamicAnchor),y[C]=Q;function oe(X){const ye=this.opts.uriResolver.resolve;if(X=E(Q?ye(Q,X):X),P.has(X))throw T(X);P.add(X);let M=this.refs[X];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?O(z,M.schema,X):X!==E(L)&&(X[0]==="#"?(O(z,m[X],X),m[X]=z):this.refs[X]=L),X}function ae(X){if(typeof X=="string"){if(!v.test(X))throw new Error(`invalid anchor "${X}"`);oe.call(this,`#${X}`)}}}),m;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 ie.getSchemaRefs=b,ie}var Or;function We(){if(Or)return ve;Or=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=ls(),t=He(),r=$r(),i=He(),g=fs(),s=ps(),l=ms(),d=H(),f=be(),w=Ge(),$=Y(),E=Je();function _(k){if(o(k)&&(P(k),y(k))){a(k);return}v(k,()=>(0,e.topBoolOrEmptySchema)(k))}ve.validateFunctionCode=_;function v({gen:k,validateName:R,schema:q,schemaEnv:A,opts:K},W){K.code.es5?k.func(R,(0,d._)`${f.default.data}, ${f.default.valCxt}`,A.$async,()=>{k.code((0,d._)`"use strict"; ${n(q,K)}`),h(k,K),k.code(W)}):k.func(R,(0,d._)`${f.default.data}, ${b(K)}`,A.$async,()=>k.code(n(q,K)).code(W))}function b(k){return(0,d._)`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${k.dynamicRef?(0,d._)`, ${f.default.dynamicAnchors}={}`:d.nil}}={}`}function h(k,R){k.if(f.default.valCxt,()=>{k.var(f.default.instancePath,(0,d._)`${f.default.valCxt}.${f.default.instancePath}`),k.var(f.default.parentData,(0,d._)`${f.default.valCxt}.${f.default.parentData}`),k.var(f.default.parentDataProperty,(0,d._)`${f.default.valCxt}.${f.default.parentDataProperty}`),k.var(f.default.rootData,(0,d._)`${f.default.valCxt}.${f.default.rootData}`),R.dynamicRef&&k.var(f.default.dynamicAnchors,(0,d._)`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{k.var(f.default.instancePath,(0,d._)`""`),k.var(f.default.parentData,(0,d._)`undefined`),k.var(f.default.parentDataProperty,(0,d._)`undefined`),k.var(f.default.rootData,f.default.data),R.dynamicRef&&k.var(f.default.dynamicAnchors,(0,d._)`{}`)})}function a(k){const{schema:R,opts:q,gen:A}=k;v(k,()=>{q.$comment&&R.$comment&&F(k),z(k),A.let(f.default.vErrors,null),A.let(f.default.errors,0),q.unevaluated&&u(k),O(k),L(k)})}function u(k){const{gen:R,validateName:q}=k;k.evaluated=R.const("evaluated",(0,d._)`${q}.evaluated`),R.if((0,d._)`${k.evaluated}.dynamicProps`,()=>R.assign((0,d._)`${k.evaluated}.props`,(0,d._)`undefined`)),R.if((0,d._)`${k.evaluated}.dynamicItems`,()=>R.assign((0,d._)`${k.evaluated}.items`,(0,d._)`undefined`))}function n(k,R){const q=typeof k=="object"&&k[R.schemaId];return q&&(R.code.source||R.code.process)?(0,d._)`/*# sourceURL=${q} */`:d.nil}function c(k,R){if(o(k)&&(P(k),y(k))){m(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 o(k){return typeof k.schema!="boolean"}function m(k,R){const{schema:q,gen:A,opts:K}=k;K.$comment&&q.$comment&&F(k),C(k),V(k);const W=A.const("_errs",f.default.errors);O(k,W),A.var(R,(0,d._)`${W} === ${f.default.errors}`)}function P(k){(0,$.checkUnknownRules)(k),T(k)}function O(k,R){if(k.opts.jtd)return oe(k,[],!1,R);const q=(0,t.getSchemaTypes)(k.schema),A=(0,t.coerceAndCheckDataType)(k,q);oe(k,q,!A,R)}function T(k){const{schema:R,errSchemaPath:q,opts:A,self:K}=k;R.$ref&&A.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,w.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:A,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,d._)`${f.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const ne=(0,d.str)`${A}/$comment`,ge=k.scopeValue("root",{ref:R.root});k.code((0,d._)`${f.default.self}.opts.$comment(${W}, ${ne}, ${ge}.schema)`)}}function L(k){const{gen:R,schemaEnv:q,validateName:A,ValidationError:K,opts:W}=k;q.$async?R.if((0,d._)`${f.default.errors} === 0`,()=>R.return(f.default.data),()=>R.throw((0,d._)`new ${K}(${f.default.vErrors})`)):(R.assign((0,d._)`${A}.errors`,f.default.vErrors),W.unevaluated&&Q(k),R.return((0,d._)`${f.default.errors} === 0`))}function Q({gen:k,evaluated:R,props:q,items:A}){q instanceof d.Name&&k.assign((0,d._)`${R}.props`,q),A instanceof d.Name&&k.assign((0,d._)`${R}.items`,A)}function oe(k,R,q,A){const{gen:K,schema:W,data:ne,allErrors:ge,opts:de,self:ue}=k,{RULES:se}=ue;if(W.$ref&&(de.ignoreKeywordsWithRef||!(0,$.schemaHasRulesButRef)(W,se))){K.block(()=>U(k,"$ref",se.all.$ref.definition));return}de.jtd||X(k,R),K.block(()=>{for(const fe of se.rules)qe(fe);qe(se.post)});function qe(fe){(0,r.shouldUseGroup)(W,fe)&&(fe.type?(K.if((0,i.checkDataType)(fe.type,ne,de.strictNumbers)),ae(k,fe),R.length===1&&R[0]===fe.type&&q&&(K.else(),(0,i.reportTypeError)(k)),K.endIf()):ae(k,fe),ge||K.if((0,d._)`${f.default.errors} === ${A||0}`))}}function ae(k,R){const{gen:q,schema:A,opts:{useDefaults:K}}=k;K&&(0,g.assignDefaults)(k,R.type),q.block(()=>{for(const W of R.rules)(0,r.shouldUseRule)(A,W)&&U(k,W.keyword,W.definition,R.type)})}function X(k,R){k.schemaEnv.meta||!k.opts.strictTypes||(ye(k,R),k.opts.allowUnionTypes||M(k,R),j(k,k.dataTypes))}function ye(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(",")}"`)}),p(k,R)}}function M(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 A in q){const K=q[A];if(typeof K=="object"&&(0,r.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(ne=>D(R,ne))&&S(k,`missing type "${W.join(",")}" for keyword "${A}"`)}}}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 p(k,R){const q=[];for(const A of k.dataTypes)I(R,A)?q.push(A):R.includes("integer")&&A==="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,A){if((0,s.validateKeywordUsage)(R,q,A),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=A,this.data=R.data,this.schema=R.schema[A],this.$data=q.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,$.schemaRefOrVal)(R,this.schema,A,this.$data),this.schemaType=q.schemaType,this.parentSchema=R.schema,this.params={},this.it=R,this.def=q,this.$data)this.schemaCode=R.gen.const("vSchema",B(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=R.gen.const("_errs",f.default.errors))}result(R,q,A){this.failResult((0,d.not)(R),q,A)}failResult(R,q,A){this.gen.if(R),A?A():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(R,q){this.failResult((0,d.not)(R),void 0,q)}fail(R){if(R===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(R),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(R){if(!this.$data)return this.fail(R);const{schemaCode:q}=this;this.fail((0,d._)`${q} !== undefined && (${(0,d.or)(this.invalid$data(),R)})`)}error(R,q,A){if(q){this.setParams(q),this._error(R,A),this.setParams({});return}this._error(R,A)}_error(R,q){(R?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,A=d.nil){this.gen.block(()=>{this.check$data(R,A),q()})}check$data(R=d.nil,q=d.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:ne}=this;A.if((0,d.or)((0,d._)`${K} === undefined`,q)),R!==d.nil&&A.assign(R,!0),(W.length||ne.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),R!==d.nil&&A.assign(R,!1)),A.else()}invalid$data(){const{gen:R,schemaCode:q,schemaType:A,def:K,it:W}=this;return(0,d.or)(ne(),ge());function ne(){if(A.length){if(!(q instanceof d.Name))throw new Error("ajv implementation error");const de=Array.isArray(A)?A:[A];return(0,d._)`${(0,i.checkDataTypes)(de,q,W.opts.strictNumbers,i.DataType.Wrong)}`}return d.nil}function ge(){if(K.validateSchema){const de=R.scopeValue("validate$data",{ref:K.validateSchema});return(0,d._)`!${de}(${q})`}return d.nil}}subschema(R,q){const A=(0,l.getSubschema)(this.it,R);(0,l.extendSubschemaData)(A,this.it,R),(0,l.extendSubschemaMode)(A,R);const K={...this.it,...A,items:void 0,props:void 0};return c(K,q),K}mergeEvaluated(R,q){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&R.props!==void 0&&(A.props=$.mergeEvaluated.props(K,R.props,A.props,q)),A.items!==!0&&R.items!==void 0&&(A.items=$.mergeEvaluated.items(K,R.items,A.items,q)))}mergeValidEvaluated(R,q){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(q,()=>this.mergeEvaluated(R,d.Name)),!0}}ve.KeywordCxt=N;function U(k,R,q,A){const K=new N(k,q,R);"code"in q?q.code(K,A):K.$data&&q.validate?(0,s.funcKeywordCode)(K,q):"macro"in q?(0,s.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(K,q)}const J=/^\/(?:[^~]|~0|~1)*$/,x=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:R,dataNames:q,dataPathArr:A}){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 ue=x.exec(k);if(!ue)throw new Error(`Invalid JSON-pointer: ${k}`);const se=+ue[1];if(K=ue[2],K==="#"){if(se>=R)throw new Error(de("property/index",se));return A[R-se]}if(se>R)throw new Error(de("data",se));if(W=q[R-se],!K)return W}let ne=W;const ge=K.split("/");for(const ue of ge)ue&&(W=(0,d._)`${W}${(0,d.getProperty)((0,$.unescapeJsonPointer)(ue))}`,ne=(0,d._)`${ne} && ${W}`);return ne;function de(ue,se){return`Cannot access ${ue} ${se} levels up, current level is ${R}`}}return ve.getData=B,ve}var Be={},Nr;function Wt(){if(Nr)return Be;Nr=1,Object.defineProperty(Be,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Be.default=e,Be}var Ye={},Cr;function xe(){if(Cr)return Ye;Cr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=Ge();class t extends Error{constructor(i,g,s,l){super(l||`can't resolve reference ${s} from id ${g}`),this.missingRef=(0,e.resolveUrl)(i,g,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(i,this.missingRef))}}return Ye.default=t,Ye}var le={},qr;function Bt(){if(qr)return le;qr=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=H(),t=Wt(),r=be(),i=Ge(),g=Y(),s=We();class l{constructor(u){var n;this.refs={},this.dynamicAnchors={};let c;typeof u.schema=="object"&&(c=u.schema),this.schema=u.schema,this.schemaId=u.schemaId,this.root=u.root||this,this.baseId=(n=u.baseId)!==null&&n!==void 0?n:(0,i.normalizeId)(c?.[u.schemaId||"$id"]),this.schemaPath=u.schemaPath,this.localRefs=u.localRefs,this.meta=u.meta,this.$async=c?.$async,this.refs={}}}le.SchemaEnv=l;function d(a){const u=$.call(this,a);if(u)return u;const n=(0,i.getFullPath)(this.opts.uriResolver,a.root.baseId),{es5:c,lines:y}=this.opts.code,{ownProperties:o}=this.opts,m=new e.CodeGen(this.scope,{es5:c,lines:y,ownProperties:o});let P;a.$async&&(P=m.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const O=m.scopeName("validate");a.validateName=O;const T={gen:m,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:m.scopeValue("schema",this.opts.code.source===!0?{ref:a.schema,code:(0,e.stringify)(a.schema)}:{ref:a.schema}),validateName:O,ValidationError:P,schema:a.schema,schemaEnv:a,rootId:n,baseId:a.baseId||n,schemaPath:e.nil,errSchemaPath:a.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(a),(0,s.validateFunctionCode)(T),m.optimize(this.opts.code.optimize);const C=m.toString();z=`${m.scopeRefs(r.default.scope)}return ${C}`,this.opts.code.process&&(z=this.opts.code.process(z,a));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=a.schema,F.schemaEnv=a,a.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:O,validateCode:C,scopeValues:m._values}),this.opts.unevaluated){const{props:L,items:Q}=T;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return a.validate=F,a}catch(C){throw delete a.validate,delete a.validateName,z&&this.logger.error("Error compiling schema, function code:",z),C}finally{this._compilations.delete(a)}}le.compileSchema=d;function f(a,u,n){var c;n=(0,i.resolveUrl)(this.opts.uriResolver,u,n);const y=a.refs[n];if(y)return y;let o=_.call(this,a,n);if(o===void 0){const m=(c=a.localRefs)===null||c===void 0?void 0:c[n],{schemaId:P}=this.opts;m&&(o=new l({schema:m,schemaId:P,root:a,baseId:u}))}if(o!==void 0)return a.refs[n]=w.call(this,o)}le.resolveRef=f;function w(a){return(0,i.inlineRef)(a.schema,this.opts.inlineRefs)?a.schema:a.validate?a:d.call(this,a)}function $(a){for(const u of this._compilations)if(E(u,a))return u}le.getCompilingSchema=$;function E(a,u){return a.schema===u.schema&&a.root===u.root&&a.baseId===u.baseId}function _(a,u){let n;for(;typeof(n=this.refs[u])=="string";)u=n;return n||this.schemas[u]||v.call(this,a,u)}function v(a,u){const n=this.opts.uriResolver.parse(u),c=(0,i._getFullPath)(this.opts.uriResolver,n);let y=(0,i.getFullPath)(this.opts.uriResolver,a.baseId,void 0);if(Object.keys(a.schema).length>0&&c===y)return h.call(this,n,a);const o=(0,i.normalizeId)(c),m=this.refs[o]||this.schemas[o];if(typeof m=="string"){const P=v.call(this,a,m);return typeof P?.schema!="object"?void 0:h.call(this,n,P)}if(typeof m?.schema=="object"){if(m.validate||d.call(this,m),o===(0,i.normalizeId)(u)){const{schema:P}=m,{schemaId:O}=this.opts,T=P[O];return T&&(y=(0,i.resolveUrl)(this.opts.uriResolver,y,T)),new l({schema:P,schemaId:O,root:a,baseId:y})}return h.call(this,n,m)}}le.resolveSchema=v;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(a,{baseId:u,schema:n,root:c}){var y;if(((y=a.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of a.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const O=n[(0,g.unescapeFragment)(P)];if(O===void 0)return;n=O;const T=typeof n=="object"&&n[this.opts.schemaId];!b.has(P)&&T&&(u=(0,i.resolveUrl)(this.opts.uriResolver,u,T))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,g.schemaHasRulesButRef)(n,this.RULES)){const P=(0,i.resolveUrl)(this.opts.uriResolver,u,n.$ref);o=v.call(this,c,P)}const{schemaId:m}=this.opts;if(o=o||new l({schema:n,schemaId:m,root:c,baseId:u}),o.schema!==o.root.schema)return o}return le}const ys={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var Qe={},Te={exports:{}},Yt,Dr;function Tr(){if(Dr)return Yt;Dr=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="",b=0,h=0;for(h=0;h<_.length;h++)if(b=_[h].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";v+=_[h];break}for(h+=1;h<_.length;h++){if(b=_[h].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";v+=_[h]}return v}const i=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function g(_){return _.length=0,!0}function s(_,v,b){if(_.length){const h=r(_);if(h!=="")v.push(h);else return b.error=!0,!1;_.length=0}return!0}function l(_){let v=0;const b={error:!1,address:"",zone:""},h=[],a=[];let u=!1,n=!1,c=s;for(let y=0;y<_.length;y++){const o=_[y];if(!(o==="["||o==="]"))if(o===":"){if(u===!0&&(n=!0),!c(a,h,b))break;if(++v>7){b.error=!0;break}y>0&&_[y-1]===":"&&(u=!0),h.push(":");continue}else if(o==="%"){if(!c(a,h,b))break;c=g}else{a.push(o);continue}}return a.length&&(c===g?b.zone=a.join(""):n?h.push(a.join("")):h.push(r(a))),b.address=h.join(""),b}function d(_){if(f(_,":")<2)return{host:_,isIPV6:!1};const v=l(_);if(v.error)return{host:_,isIPV6:!1};{let b=v.address,h=v.address;return v.zone&&(b+="%"+v.zone,h+="%25"+v.zone),{host:b,isIPV6:!0,escapedHost:h}}}function f(_,v){let b=0;for(let h=0;h<_.length;h++)_[h]===v&&b++;return b}function w(_){let v=_;const b=[];let h=-1,a=0;for(;a=v.length;){if(a===1){if(v===".")break;if(v==="/"){b.push("/");break}else{b.push(v);break}}else if(a===2){if(v[0]==="."){if(v[1]===".")break;if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&(v[1]==="."||v[1]==="/")){b.push("/");break}}else if(a===3&&v==="/.."){b.length!==0&&b.pop(),b.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),b.length!==0&&b.pop();continue}}if((h=v.indexOf("/",1))===-1){b.push(v);break}else b.push(v.slice(0,h)),v=v.slice(h)}return b.join("")}function $(_,v){const b=v!==!0?escape:unescape;return _.scheme!==void 0&&(_.scheme=b(_.scheme)),_.userinfo!==void 0&&(_.userinfo=b(_.userinfo)),_.host!==void 0&&(_.host=b(_.host)),_.path!==void 0&&(_.path=b(_.path)),_.query!==void 0&&(_.query=b(_.query)),_.fragment!==void 0&&(_.fragment=b(_.fragment)),_}function E(_){const v=[];if(_.userinfo!==void 0&&(v.push(_.userinfo),v.push("@")),_.host!==void 0){let b=unescape(_.host);if(!t(b)){const h=d(b);h.isIPV6===!0?b=`[${h.escapedHost}]`:b=_.host}v.push(b)}return(typeof _.port=="number"||typeof _.port=="string")&&(v.push(":"),v.push(String(_.port))),v.length?v.join(""):void 0}return Yt={nonSimpleDomain:i,recomposeAuthority:E,normalizeComponentEncoding:$,removeDotSegments:w,isIPv4:t,isUUID:e,normalizeIPv6:d,stringArrayToHexStripped:r},Yt}var xt,Mr;function gs(){if(Mr)return xt;Mr=1;const{isUUID:e}=Tr(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function i(o){return r.indexOf(o)!==-1}function g(o){return o.secure===!0?!0:o.secure===!1?!1:o.scheme?o.scheme.length===3&&(o.scheme[0]==="w"||o.scheme[0]==="W")&&(o.scheme[1]==="s"||o.scheme[1]==="S")&&(o.scheme[2]==="s"||o.scheme[2]==="S"):!1}function s(o){return o.host||(o.error=o.error||"HTTP URIs must have a host."),o}function l(o){const m=String(o.scheme).toLowerCase()==="https";return(o.port===(m?443:80)||o.port==="")&&(o.port=void 0),o.path||(o.path="/"),o}function d(o){return o.secure=g(o),o.resourceName=(o.path||"/")+(o.query?"?"+o.query:""),o.path=void 0,o.query=void 0,o}function f(o){if((o.port===(g(o)?443:80)||o.port==="")&&(o.port=void 0),typeof o.secure=="boolean"&&(o.scheme=o.secure?"wss":"ws",o.secure=void 0),o.resourceName){const[m,P]=o.resourceName.split("?");o.path=m&&m!=="/"?m:void 0,o.query=P,o.resourceName=void 0}return o.fragment=void 0,o}function w(o,m){if(!o.path)return o.error="URN can not be parsed",o;const P=o.path.match(t);if(P){const O=m.scheme||o.scheme||"urn";o.nid=P[1].toLowerCase(),o.nss=P[2];const T=`${O}:${m.nid||o.nid}`,z=y(T);o.path=void 0,z&&(o=z.parse(o,m))}else o.error=o.error||"URN can not be parsed.";return o}function $(o,m){if(o.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=m.scheme||o.scheme||"urn",O=o.nid.toLowerCase(),T=`${P}:${m.nid||O}`,z=y(T);z&&(o=z.serialize(o,m));const C=o,V=o.nss;return C.path=`${O||m.nid}:${V}`,m.skipEscape=!0,C}function E(o,m){const P=o;return P.uuid=P.nss,P.nss=void 0,!m.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function _(o){const m=o;return m.nss=(o.uuid||"").toLowerCase(),m}const v={scheme:"http",domainHost:!0,parse:s,serialize:l},b={scheme:"https",domainHost:v.domainHost,parse:s,serialize:l},h={scheme:"ws",domainHost:!0,parse:d,serialize:f},a={scheme:"wss",domainHost:h.domainHost,parse:h.parse,serialize:h.serialize},c={http:v,https:b,ws:h,wss:a,urn:{scheme:"urn",parse:w,serialize:$,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(c,null);function y(o){return o&&(c[o]||c[o.toLowerCase()])||void 0}return xt={wsIsSecure:g,SCHEMES:c,isValidSchemeName:i,getSchemeHandler:y},xt}var Ar;function vs(){if(Ar)return Te.exports;Ar=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:i,isIPv4:g,nonSimpleDomain:s}=Tr(),{SCHEMES:l,getSchemeHandler:d}=gs();function f(a,u){return typeof a=="string"?a=_(b(a,u),u):typeof a=="object"&&(a=b(_(a,u),u)),a}function w(a,u,n){const c=n?Object.assign({scheme:"null"},n):{scheme:"null"},y=$(b(a,c),b(u,c),c,!0);return c.skipEscape=!0,_(y,c)}function $(a,u,n,c){const y={};return c||(a=b(_(a,n),n),u=b(_(u,n),n)),n=n||{},!n.tolerant&&u.scheme?(y.scheme=u.scheme,y.userinfo=u.userinfo,y.host=u.host,y.port=u.port,y.path=t(u.path||""),y.query=u.query):(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0?(y.userinfo=u.userinfo,y.host=u.host,y.port=u.port,y.path=t(u.path||""),y.query=u.query):(u.path?(u.path[0]==="/"?y.path=t(u.path):((a.userinfo!==void 0||a.host!==void 0||a.port!==void 0)&&!a.path?y.path="/"+u.path:a.path?y.path=a.path.slice(0,a.path.lastIndexOf("/")+1)+u.path:y.path=u.path,y.path=t(y.path)),y.query=u.query):(y.path=a.path,u.query!==void 0?y.query=u.query:y.query=a.query),y.userinfo=a.userinfo,y.host=a.host,y.port=a.port),y.scheme=a.scheme),y.fragment=u.fragment,y}function E(a,u,n){return typeof a=="string"?(a=unescape(a),a=_(i(b(a,n),!0),{...n,skipEscape:!0})):typeof a=="object"&&(a=_(i(a,!0),{...n,skipEscape:!0})),typeof u=="string"?(u=unescape(u),u=_(i(b(u,n),!0),{...n,skipEscape:!0})):typeof u=="object"&&(u=_(i(u,!0),{...n,skipEscape:!0})),a.toLowerCase()===u.toLowerCase()}function _(a,u){const n={host:a.host,scheme:a.scheme,userinfo:a.userinfo,port:a.port,path:a.path,query:a.query,nid:a.nid,nss:a.nss,uuid:a.uuid,fragment:a.fragment,reference:a.reference,resourceName:a.resourceName,secure:a.secure,error:""},c=Object.assign({},u),y=[],o=d(c.scheme||n.scheme);o&&o.serialize&&o.serialize(n,c),n.path!==void 0&&(c.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),c.reference!=="suffix"&&n.scheme&&y.push(n.scheme,":");const m=r(n);if(m!==void 0&&(c.reference!=="suffix"&&y.push("//"),y.push(m),n.path&&n.path[0]!=="/"&&y.push("/")),n.path!==void 0){let P=n.path;!c.absolutePath&&(!o||!o.absolutePath)&&(P=t(P)),m===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return n.query!==void 0&&y.push("?",n.query),n.fragment!==void 0&&y.push("#",n.fragment),y.join("")}const v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(a,u){const n=Object.assign({},u),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;n.reference==="suffix"&&(n.scheme?a=n.scheme+":"+a:a="//"+a);const o=a.match(v);if(o){if(c.scheme=o[1],c.userinfo=o[3],c.host=o[4],c.port=parseInt(o[5],10),c.path=o[6]||"",c.query=o[7],c.fragment=o[8],isNaN(c.port)&&(c.port=o[5]),c.host)if(g(c.host)===!1){const O=e(c.host);c.host=O.host.toLowerCase(),y=O.isIPV6}else y=!0;c.scheme===void 0&&c.userinfo===void 0&&c.host===void 0&&c.port===void 0&&c.query===void 0&&!c.path?c.reference="same-document":c.scheme===void 0?c.reference="relative":c.fragment===void 0?c.reference="absolute":c.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==c.reference&&(c.error=c.error||"URI is not a "+n.reference+" reference.");const m=d(n.scheme||c.scheme);if(!n.unicodeSupport&&(!m||!m.unicodeSupport)&&c.host&&(n.domainHost||m&&m.domainHost)&&y===!1&&s(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(P){c.error=c.error||"Host's domain name can not be converted to ASCII: "+P}(!m||m&&!m.skipNormalize)&&(a.indexOf("%")!==-1&&(c.scheme!==void 0&&(c.scheme=unescape(c.scheme)),c.host!==void 0&&(c.host=unescape(c.host))),c.path&&(c.path=escape(unescape(c.path))),c.fragment&&(c.fragment=encodeURI(decodeURIComponent(c.fragment)))),m&&m.parse&&m.parse(c,n)}else c.error=c.error||"URI can not be parsed.";return c}const h={SCHEMES:l,normalize:f,resolve:w,resolveComponent:$,equal:E,serialize:_,parse:b};return Te.exports=h,Te.exports.default=h,Te.exports.fastUri=h,Te.exports}var Vr;function _s(){if(Vr)return Qe;Vr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=vs();return e.code='require("ajv/dist/runtime/uri").default',Qe.default=e,Qe}var zr;function $s(){return zr||(zr=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=We();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=H();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=Wt(),g=xe(),s=vr(),l=Bt(),d=H(),f=Ge(),w=He(),$=Y(),E=ys,_=_s(),v=(M,j)=>new RegExp(M,j);v.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],h=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),a={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},u={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},n=200;function c(M){var j,D,I,p,S,N,U,J,x,B,k,R,q,A,K,W,ne,ge,de,ue,se,qe,fe,or,ar;const Fe=M.strict,cr=(j=M.code)===null||j===void 0?void 0:j.optimize,ds=cr===!0||cr===void 0?1:cr||0,us=(I=(D=M.code)===null||D===void 0?void 0:D.regExp)!==null&&I!==void 0?I:v,Oi=(p=M.uriResolver)!==null&&p!==void 0?p:_.default;return{strictSchema:(N=(S=M.strictSchema)!==null&&S!==void 0?S:Fe)!==null&&N!==void 0?N:!0,strictNumbers:(J=(U=M.strictNumbers)!==null&&U!==void 0?U:Fe)!==null&&J!==void 0?J:!0,strictTypes:(B=(x=M.strictTypes)!==null&&x!==void 0?x:Fe)!==null&&B!==void 0?B:"log",strictTuples:(R=(k=M.strictTuples)!==null&&k!==void 0?k:Fe)!==null&&R!==void 0?R:"log",strictRequired:(A=(q=M.strictRequired)!==null&&q!==void 0?q:Fe)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:ds,regExp:us}:{optimize:ds,regExp:us},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:n,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:n,meta:(ne=M.meta)!==null&&ne!==void 0?ne:!0,messages:(ge=M.messages)!==null&&ge!==void 0?ge:!0,inlineRefs:(de=M.inlineRefs)!==null&&de!==void 0?de:!0,schemaId:(ue=M.schemaId)!==null&&ue!==void 0?ue:"$id",addUsedSchema:(se=M.addUsedSchema)!==null&&se!==void 0?se:!0,validateSchema:(qe=M.validateSchema)!==null&&qe!==void 0?qe:!0,validateFormats:(fe=M.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(or=M.unicodeRegExp)!==null&&or!==void 0?or:!0,int32range:(ar=M.int32range)!==null&&ar!==void 0?ar:!0,uriResolver:Oi}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...c(j)};const{es5:D,lines:I}=this.opts.code;this.scope=new d.ValueScope({scope:{},prefixes:h,es5:D,lines:I}),this.logger=V(j.logger);const p=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),o.call(this,a,j,"NOT SUPPORTED"),o.call(this,u,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&T.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=p}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:I}=this.opts;let p=E;I==="id"&&(p={...E},p.id=p.$id,delete p.$id),D&&j&&this.addMetaSchema(p,p[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 p=I(D);return"$async"in I||(this.errors=I.errors),p}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 p.call(this,j,D);async function p(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 p.call(this,{$ref:B},!0)}async function N(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof g.default))throw k;return U.call(this,k),await J.call(this,k.missingSchema),N.call(this,B)}}function U({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,p=this.opts.validateSchema){if(Array.isArray(j)){for(const N of j)this.addSchema(N,void 0,I,p);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,p,!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 p=this.validate(I,j);if(!p&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return p}getSchema(j){let D;for(;typeof(D=m.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:I}=this.opts,p=new l.SchemaEnv({schema:{},schemaId:I});if(D=l.resolveSchema.call(this,p,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=m.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(L.call(this,I,D),!D)return(0,$.eachItem)(I,S=>Q.call(this,S)),this;ae.call(this,D);const p={...D,type:(0,w.getJSONTypes)(D.type),schemaType:(0,w.getJSONTypes)(D.schemaType)};return(0,$.eachItem)(I,p.type.length===0?S=>Q.call(this,S,p):S=>p.type.forEach(N=>Q.call(this,S,p,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 p=I.rules.findIndex(S=>S.keyword===j);p>=0&&I.rules.splice(p,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(p=>`${I}${p.instancePath} ${p.message}`).reduce((p,S)=>p+D+S)}$dataMetaSchema(j,D){const I=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const p of D){const S=p.split("/").slice(1);let N=j;for(const U of S)N=N[U];for(const U in I){const J=I[U];if(typeof J!="object")continue;const{$data:x}=J.definition,B=N[U];x&&B&&(N[U]=ye(B))}}return j}_removeAllSchemas(j,D){for(const I in j){const p=j[I];(!D||D.test(I))&&(typeof p=="string"?delete j[I]:p&&!p.meta&&(this._cache.delete(p.schema),delete j[I]))}}_addSchema(j,D,I,p=this.opts.validateSchema,S=this.opts.addUsedSchema){let N;const{schemaId:U}=this.opts;if(typeof j=="object")N=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let 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 l.SchemaEnv({schema:j,schemaId:U,meta:D,baseId:I,localRefs:x}),this._cache.set(J.schema,J),S&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=J),p&&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):l.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{l.compileSchema.call(this,j)}finally{this.opts=D}}}y.ValidationError=i.default,y.MissingRefError=g.default,e.default=y;function o(M,j,D,I="error"){for(const p in M){const S=p;S in j&&this.logger[I](`${D}: option ${p}. ${M[S]}`)}}function m(M){return M=(0,f.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const j in M)this.addSchema(M[j],j)}function O(){for(const M in this.opts.formats){const j=this.opts.formats[M];j&&this.addFormat(M,j)}}function T(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in M){const D=M[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const M={...this.opts};for(const j of b)delete M[j];return M}const C={log(){},warn(){},error(){}};function V(M){if(M===!1)return C;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,j){const{RULES:D}=this;if((0,$.eachItem)(M,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(M,j,D){var I;const p=j?.post;if(D&&p)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let N=p?S.post:S.rules.find(({type:J})=>J===D);if(N||(N={type:D,rules:[]},S.rules.push(N)),S.keywords[M]=!0,!j)return;const U={keyword:M,definition:{...j,type:(0,w.getJSONTypes)(j.type),schemaType:(0,w.getJSONTypes)(j.schemaType)}};j.before?oe.call(this,N,U,j.before):N.rules.push(U),S.all[M]=U,(I=j.implements)===null||I===void 0||I.forEach(J=>this.addKeyword(J))}function oe(M,j,D){const I=M.rules.findIndex(p=>p.keyword===D);I>=0?M.rules.splice(I,0,j):(M.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function ae(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=ye(j)),M.validateSchema=this.compile(j,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(M){return{anyOf:[M,X]}}})(Ft)),Ft}var Ze={},Xe={},et={},Fr;function bs(){if(Fr)return et;Fr=1,Object.defineProperty(et,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return et.default=e,et}var we={},Lr;function ws(){if(Lr)return we;Lr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.callRef=we.getValidate=void 0;const e=xe(),t=me(),r=H(),i=be(),g=Bt(),s=Y(),l={keyword:"$ref",schemaType:"string",code(w){const{gen:$,schema:E,it:_}=w,{baseId:v,schemaEnv:b,validateName:h,opts:a,self:u}=_,{root:n}=b;if((E==="#"||E==="#/")&&v===n.baseId)return y();const c=g.resolveRef.call(u,n,v,E);if(c===void 0)throw new e.default(_.opts.uriResolver,v,E);if(c instanceof g.SchemaEnv)return o(c);return m(c);function y(){if(b===n)return f(w,h,b,b.$async);const P=$.scopeValue("root",{ref:n});return f(w,(0,r._)`${P}.validate`,n,n.$async)}function o(P){const O=d(w,P);f(w,O,P,P.$async)}function m(P){const O=$.scopeValue("schema",a.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),T=$.name("valid"),z=w.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:O,errSchemaPath:E},T);w.mergeEvaluated(z),w.ok(T)}}};function d(w,$){const{gen:E}=w;return $.validate?E.scopeValue("validate",{ref:$.validate}):(0,r._)`${E.scopeValue("wrapper",{ref:$})}.validate`}we.getValidate=d;function f(w,$,E,_){const{gen:v,it:b}=w,{allErrors:h,schemaEnv:a,opts:u}=b,n=u.passContext?i.default.this:r.nil;_?c():y();function c(){if(!a.$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)(w,$,n)}`),m($),h||v.assign(P,!0)},O=>{v.if((0,r._)`!(${O} instanceof ${b.ValidationError})`,()=>v.throw(O)),o(O),h||v.assign(P,!1)}),w.ok(P)}function y(){w.result((0,t.callValidateCode)(w,$,n),()=>m($),()=>o($))}function o(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 m(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(v,T.props,b.props));else{const z=v.var("props",(0,r._)`${P}.evaluated.props`);b.props=s.mergeEvaluated.props(v,z,b.props,r.Name)}if(b.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(b.items=s.mergeEvaluated.items(v,T.items,b.items));else{const z=v.var("items",(0,r._)`${P}.evaluated.items`);b.items=s.mergeEvaluated.items(v,z,b.items,r.Name)}}}return we.callRef=f,we.default=l,we}var Ur;function Ps(){if(Ur)return Xe;Ur=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=bs(),t=ws(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Xe.default=r,Xe}var tt={},rt={},Kr;function Ss(){if(Kr)return rt;Kr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=H(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},i={message:({keyword:s,schemaCode:l})=>(0,e.str)`must be ${r[s].okStr} ${l}`,params:({keyword:s,schemaCode:l})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${l}}`},g={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:i,code(s){const{keyword:l,data:d,schemaCode:f}=s;s.fail$data((0,e._)`${d} ${r[l].fail} ${f} || isNaN(${d})`)}};return rt.default=g,rt}var nt={},Jr;function Es(){if(Jr)return nt;Jr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=H(),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:g,data:s,schemaCode:l,it:d}=i,f=d.opts.multipleOfPrecision,w=g.let("res"),$=f?(0,e._)`Math.abs(Math.round(${w}) - ${w}) > 1e-${f}`:(0,e._)`${w} !== parseInt(${w})`;i.fail$data((0,e._)`(${l} === 0 || (${w} = ${s}/${l}, ${$}))`)}};return nt.default=r,nt}var st={},it={},Hr;function ks(){if(Hr)return it;Hr=1,Object.defineProperty(it,"__esModule",{value:!0});function e(t){const r=t.length;let i=0,g=0,s;for(;g<r;)i++,s=t.charCodeAt(g++),s>=55296&&s<=56319&&g<r&&(s=t.charCodeAt(g),(s&64512)===56320&&g++);return i}return it.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',it}var Gr;function js(){if(Gr)return st;Gr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=H(),t=Y(),r=ks(),g={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:l}){const d=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${d} than ${l} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:l,data:d,schemaCode:f,it:w}=s,$=l==="maxLength"?e.operators.GT:e.operators.LT,E=w.opts.unicode===!1?(0,e._)`${d}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${d})`;s.fail$data((0,e._)`${E} ${$} ${f}`)}};return st.default=g,st}var ot={},Wr;function Rs(){if(Wr)return ot;Wr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=me(),t=H(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:g})=>(0,t.str)`must match pattern "${g}"`,params:({schemaCode:g})=>(0,t._)`{pattern: ${g}}`},code(g){const{data:s,$data:l,schema:d,schemaCode:f,it:w}=g,$=w.opts.unicodeRegExp?"u":"",E=l?(0,t._)`(new RegExp(${f}, ${$}))`:(0,e.usePattern)(g,d);g.fail$data((0,t._)`!${E}.test(${s})`)}};return ot.default=i,ot}var at={},Br;function Is(){if(Br)return at;Br=1,Object.defineProperty(at,"__esModule",{value:!0});const e=H(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:g}){const s=i==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${g} properties`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:g,data:s,schemaCode:l}=i,d=g==="maxProperties"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`Object.keys(${s}).length ${d} ${l}`)}};return at.default=r,at}var ct={},Yr;function Os(){if(Yr)return ct;Yr=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=me(),t=H(),r=Y(),g={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:l,schema:d,schemaCode:f,data:w,$data:$,it:E}=s,{opts:_}=E;if(!$&&d.length===0)return;const v=d.length>=_.loopRequired;if(E.allErrors?b():h(),_.strictRequired){const n=s.parentSchema.properties,{definedProperties:c}=s.it;for(const y of d)if(n?.[y]===void 0&&!c.has(y)){const o=E.schemaEnv.baseId+E.errSchemaPath,m=`required property "${y}" is not defined at "${o}" (strictRequired)`;(0,r.checkStrictMode)(E,m,E.opts.strictRequired)}}function b(){if(v||$)s.block$data(t.nil,a);else for(const n of d)(0,e.checkReportMissingProp)(s,n)}function h(){const n=l.let("missing");if(v||$){const c=l.let("valid",!0);s.block$data(c,()=>u(n,c)),s.ok(c)}else l.if((0,e.checkMissingProp)(s,d,n)),(0,e.reportMissingProp)(s,n),l.else()}function a(){l.forOf("prop",f,n=>{s.setParams({missingProperty:n}),l.if((0,e.noPropertyInData)(l,w,n,_.ownProperties),()=>s.error())})}function u(n,c){s.setParams({missingProperty:n}),l.forOf(n,f,()=>{l.assign(c,(0,e.propertyInData)(l,w,n,_.ownProperties)),l.if((0,t.not)(c),()=>{s.error(),l.break()})},t.nil)}}};return ct.default=g,ct}var dt={},xr;function Ns(){if(xr)return dt;xr=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=H(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:g}){const s=i==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${g} items`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:g,data:s,schemaCode:l}=i,d=g==="maxItems"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`${s}.length ${d} ${l}`)}};return dt.default=r,dt}var ut={},lt={},Qr;function Qt(){if(Qr)return lt;Qr=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=jr();return e.code='require("ajv/dist/runtime/equal").default',lt.default=e,lt}var Zr;function Cs(){if(Zr)return ut;Zr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=He(),t=H(),r=Y(),i=Qt(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:d}})=>(0,t.str)`must NOT have duplicate items (items ## ${d} and ${l} are identical)`,params:({params:{i:l,j:d}})=>(0,t._)`{i: ${l}, j: ${d}}`},code(l){const{gen:d,data:f,$data:w,schema:$,parentSchema:E,schemaCode:_,it:v}=l;if(!w&&!$)return;const b=d.let("valid"),h=E.items?(0,e.getSchemaTypes)(E.items):[];l.block$data(b,a,(0,t._)`${_} === false`),l.ok(b);function a(){const y=d.let("i",(0,t._)`${f}.length`),o=d.let("j");l.setParams({i:y,j:o}),d.assign(b,!0),d.if((0,t._)`${y} > 1`,()=>(u()?n:c)(y,o))}function u(){return h.length>0&&!h.some(y=>y==="object"||y==="array")}function n(y,o){const m=d.name("item"),P=(0,e.checkDataTypes)(h,m,v.opts.strictNumbers,e.DataType.Wrong),O=d.const("indices",(0,t._)`{}`);d.for((0,t._)`;${y}--;`,()=>{d.let(m,(0,t._)`${f}[${y}]`),d.if(P,(0,t._)`continue`),h.length>1&&d.if((0,t._)`typeof ${m} == "string"`,(0,t._)`${m} += "_"`),d.if((0,t._)`typeof ${O}[${m}] == "number"`,()=>{d.assign(o,(0,t._)`${O}[${m}]`),l.error(),d.assign(b,!1).break()}).code((0,t._)`${O}[${m}] = ${y}`)})}function c(y,o){const m=(0,r.useFunc)(d,i.default),P=d.name("outer");d.label(P).for((0,t._)`;${y}--;`,()=>d.for((0,t._)`${o} = ${y}; ${o}--;`,()=>d.if((0,t._)`${m}(${f}[${y}], ${f}[${o}])`,()=>{l.error(),d.assign(b,!1).break(P)})))}}};return ut.default=s,ut}var ft={},Xr;function qs(){if(Xr)return ft;Xr=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=H(),t=Y(),r=Qt(),g={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:l,data:d,$data:f,schemaCode:w,schema:$}=s;f||$&&typeof $=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(l,r.default)}(${d}, ${w})`):s.fail((0,e._)`${$} !== ${d}`)}};return ft.default=g,ft}var pt={},en;function Ds(){if(en)return pt;en=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=H(),t=Y(),r=Qt(),g={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:l,data:d,$data:f,schema:w,schemaCode:$,it:E}=s;if(!f&&w.length===0)throw new Error("enum must have non-empty array");const _=w.length>=E.opts.loopEnum;let v;const b=()=>v??(v=(0,t.useFunc)(l,r.default));let h;if(_||f)h=l.let("valid"),s.block$data(h,a);else{if(!Array.isArray(w))throw new Error("ajv implementation error");const n=l.const("vSchema",$);h=(0,e.or)(...w.map((c,y)=>u(n,y)))}s.pass(h);function a(){l.assign(h,!1),l.forOf("v",$,n=>l.if((0,e._)`${b()}(${d}, ${n})`,()=>l.assign(h,!0).break()))}function u(n,c){const y=w[c];return typeof y=="object"&&y!==null?(0,e._)`${b()}(${d}, ${n}[${c}])`:(0,e._)`${d} === ${y}`}}};return pt.default=g,pt}var tn;function Ts(){if(tn)return tt;tn=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=Ss(),t=Es(),r=js(),i=Rs(),g=Is(),s=Os(),l=Ns(),d=Cs(),f=qs(),w=Ds(),$=[e.default,t.default,r.default,i.default,g.default,s.default,l.default,d.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,w.default];return tt.default=$,tt}var mt={},Oe={},rn;function nn(){if(rn)return Oe;rn=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.validateAdditionalItems=void 0;const e=H(),t=Y(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:l,it:d}=s,{items:f}=l;if(!Array.isArray(f)){(0,t.checkStrictMode)(d,'"additionalItems" is ignored when "items" is not an array of schemas');return}g(s,f)}};function g(s,l){const{gen:d,schema:f,data:w,keyword:$,it:E}=s;E.items=!0;const _=d.const("len",(0,e._)`${w}.length`);if(f===!1)s.setParams({len:l.length}),s.pass((0,e._)`${_} <= ${l.length}`);else if(typeof f=="object"&&!(0,t.alwaysValidSchema)(E,f)){const b=d.var("valid",(0,e._)`${_} <= ${l.length}`);d.if((0,e.not)(b),()=>v(b)),s.ok(b)}function v(b){d.forRange("i",l.length,_,h=>{s.subschema({keyword:$,dataProp:h,dataPropType:t.Type.Num},b),E.allErrors||d.if((0,e.not)(b),()=>d.break())})}}return Oe.validateAdditionalItems=g,Oe.default=i,Oe}var ht={},Ne={},sn;function on(){if(sn)return Ne;sn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.validateTuple=void 0;const e=H(),t=Y(),r=me(),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:l,it:d}=s;if(Array.isArray(l))return g(s,"additionalItems",l);d.items=!0,!(0,t.alwaysValidSchema)(d,l)&&s.ok((0,r.validateArray)(s))}};function g(s,l,d=s.schema){const{gen:f,parentSchema:w,data:$,keyword:E,it:_}=s;h(w),_.opts.unevaluated&&d.length&&_.items!==!0&&(_.items=t.mergeEvaluated.items(f,d.length,_.items));const v=f.name("valid"),b=f.const("len",(0,e._)`${$}.length`);d.forEach((a,u)=>{(0,t.alwaysValidSchema)(_,a)||(f.if((0,e._)`${b} > ${u}`,()=>s.subschema({keyword:E,schemaProp:u,dataProp:u},v)),s.ok(v))});function h(a){const{opts:u,errSchemaPath:n}=_,c=d.length,y=c===a.minItems&&(c===a.maxItems||a[l]===!1);if(u.strictTuples&&!y){const o=`"${E}" is ${c}-tuple, but minItems or maxItems/${l} are not specified or different at path "${n}"`;(0,t.checkStrictMode)(_,o,u.strictTuples)}}}return Ne.validateTuple=g,Ne.default=i,Ne}var an;function Ms(){if(an)return ht;an=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=on(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return ht.default=t,ht}var yt={},cn;function As(){if(cn)return yt;cn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=H(),t=Y(),r=me(),i=nn(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:d,parentSchema:f,it:w}=l,{prefixItems:$}=f;w.items=!0,!(0,t.alwaysValidSchema)(w,d)&&($?(0,i.validateAdditionalItems)(l,$):l.ok((0,r.validateArray)(l)))}};return yt.default=s,yt}var gt={},dn;function Vs(){if(dn)return gt;dn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=H(),t=Y(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:g,max:s}})=>s===void 0?(0,e.str)`must contain at least ${g} valid item(s)`:(0,e.str)`must contain at least ${g} and no more than ${s} valid item(s)`,params:({params:{min:g,max:s}})=>s===void 0?(0,e._)`{minContains: ${g}}`:(0,e._)`{minContains: ${g}, maxContains: ${s}}`},code(g){const{gen:s,schema:l,parentSchema:d,data:f,it:w}=g;let $,E;const{minContains:_,maxContains:v}=d;w.opts.next?($=_===void 0?1:_,E=v):$=1;const b=s.const("len",(0,e._)`${f}.length`);if(g.setParams({min:$,max:E}),E===void 0&&$===0){(0,t.checkStrictMode)(w,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&$>E){(0,t.checkStrictMode)(w,'"minContains" > "maxContains" is always invalid'),g.fail();return}if((0,t.alwaysValidSchema)(w,l)){let c=(0,e._)`${b} >= ${$}`;E!==void 0&&(c=(0,e._)`${c} && ${b} <= ${E}`),g.pass(c);return}w.items=!0;const h=s.name("valid");E===void 0&&$===1?u(h,()=>s.if(h,()=>s.break())):$===0?(s.let(h,!0),E!==void 0&&s.if((0,e._)`${f}.length > 0`,a)):(s.let(h,!1),a()),g.result(h,()=>g.reset());function a(){const c=s.name("_valid"),y=s.let("count",0);u(c,()=>s.if(c,()=>n(y)))}function u(c,y){s.forRange("i",0,b,o=>{g.subschema({keyword:"contains",dataProp:o,dataPropType:t.Type.Num,compositeRule:!0},c),y()})}function n(c){s.code((0,e._)`${c}++`),E===void 0?s.if((0,e._)`${c} >= ${$}`,()=>s.assign(h,!0).break()):(s.if((0,e._)`${c} > ${E}`,()=>s.assign(h,!1).break()),$===1?s.assign(h,!0):s.if((0,e._)`${c} >= ${$}`,()=>s.assign(h,!0)))}}};return gt.default=i,gt}var Zt={},un;function zs(){return un||(un=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=H(),r=Y(),i=me();e.error={message:({params:{property:f,depsCount:w,deps:$}})=>{const E=w===1?"property":"properties";return(0,t.str)`must have ${E} ${$} when property ${f} is present`},params:({params:{property:f,depsCount:w,deps:$,missingProperty:E}})=>(0,t._)`{property: ${f},
|
|
6
6
|
missingProperty: ${E},
|
|
7
|
-
depsCount: ${
|
|
8
|
-
deps: ${g}}`};const h={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(f){const[$,g]=n(f);u(f,$),i(f,g)}};function n({schema:f}){const $={},g={};for(const E in f){if(E==="__proto__")continue;const v=Array.isArray(f[E])?$:g;v[E]=f[E]}return[$,g]}function u(f,$=f.schema){const{gen:g,data:E,it:v}=f;if(Object.keys($).length===0)return;const _=g.let("missing");for(const b in $){const w=$[b];if(w.length===0)continue;const d=(0,o.propertyInData)(g,E,b,v.opts.ownProperties);f.setParams({property:b,depsCount:w.length,deps:w.join(", ")}),v.allErrors?g.if(d,()=>{for(const l of w)(0,o.checkReportMissingProp)(f,l)}):(g.if((0,t._)`${d} && (${(0,o.checkMissingProp)(f,w,_)})`),(0,o.reportMissingProp)(f,_),g.else())}}e.validatePropertyDeps=u;function i(f,$=f.schema){const{gen:g,data:E,keyword:v,it:_}=f,b=g.name("valid");for(const w in $)(0,r.alwaysValidSchema)(_,$[w])||(g.if((0,o.propertyInData)(g,E,w,_.opts.ownProperties),()=>{const d=f.subschema({keyword:v,schemaProp:w},b);f.mergeValidEvaluated(d,b)},()=>g.var(b,!0)),f.ok(b))}e.validateSchemaDeps=i,e.default=h})(Zt)),Zt}var ht={},cn;function As(){if(cn)return ht;cn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=H(),t=Y(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:h})=>(0,e._)`{propertyName: ${h.propertyName}}`},code(h){const{gen:n,schema:u,data:i,it:f}=h;if((0,t.alwaysValidSchema)(f,u))return;const $=n.name("valid");n.forIn("key",i,g=>{h.setParams({propertyName:g}),h.subschema({keyword:"propertyNames",data:g,dataTypes:["string"],propertyName:g,compositeRule:!0},$),n.if((0,e.not)($),()=>{h.error(!0),f.allErrors||n.break()})}),h.ok($)}};return ht.default=o,ht}var yt={},dn;function un(){if(dn)return yt;dn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=pe(),t=H(),r=$e(),o=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:i,schema:f,parentSchema:$,data:g,errsCount:E,it:v}=u;if(!E)throw new Error("ajv implementation error");const{allErrors:_,opts:b}=v;if(v.props=!0,b.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(v,f))return;const w=(0,e.allSchemaProperties)($.properties),d=(0,e.allSchemaProperties)($.patternProperties);l(),u.ok((0,t._)`${E} === ${r.default.errors}`);function l(){i.forIn("key",g,m=>{!w.length&&!d.length?y(m):i.if(s(m),()=>y(m))})}function s(m){let P;if(w.length>8){const R=(0,o.schemaRefOrVal)(v,$.properties,"properties");P=(0,e.isOwnProperty)(i,R,m)}else w.length?P=(0,t.or)(...w.map(R=>(0,t._)`${m} === ${R}`)):P=t.nil;return d.length&&(P=(0,t.or)(P,...d.map(R=>(0,t._)`${(0,e.usePattern)(u,R)}.test(${m})`))),(0,t.not)(P)}function c(m){i.code((0,t._)`delete ${g}[${m}]`)}function y(m){if(b.removeAdditional==="all"||b.removeAdditional&&f===!1){c(m);return}if(f===!1){u.setParams({additionalProperty:m}),u.error(),_||i.break();return}if(typeof f=="object"&&!(0,o.alwaysValidSchema)(v,f)){const P=i.name("valid");b.removeAdditional==="failing"?(a(m,P,!1),i.if((0,t.not)(P),()=>{u.reset(),c(m)})):(a(m,P),_||i.if((0,t.not)(P),()=>i.break()))}}function a(m,P,R){const T={keyword:"additionalProperties",dataProp:m,dataPropType:o.Type.Str};R===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),u.subschema(T,P)}}};return yt.default=n,yt}var gt={},ln;function Vs(){if(ln)return gt;ln=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Je(),t=pe(),r=Y(),o=un(),h={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:u,schema:i,parentSchema:f,data:$,it:g}=n;g.opts.removeAdditional==="all"&&f.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(g,o.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(i);for(const d of E)g.definedProperties.add(d);g.opts.unevaluated&&E.length&&g.props!==!0&&(g.props=r.mergeEvaluated.props(u,(0,r.toHash)(E),g.props));const v=E.filter(d=>!(0,r.alwaysValidSchema)(g,i[d]));if(v.length===0)return;const _=u.name("valid");for(const d of v)b(d)?w(d):(u.if((0,t.propertyInData)(u,$,d,g.opts.ownProperties)),w(d),g.allErrors||u.else().var(_,!0),u.endIf()),n.it.definedProperties.add(d),n.ok(_);function b(d){return g.opts.useDefaults&&!g.compositeRule&&i[d].default!==void 0}function w(d){n.subschema({keyword:"properties",schemaProp:d,dataProp:d},_)}}};return gt.default=h,gt}var vt={},fn;function zs(){if(fn)return vt;fn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=pe(),t=H(),r=Y(),o=Y(),h={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:u,schema:i,data:f,parentSchema:$,it:g}=n,{opts:E}=g,v=(0,e.allSchemaProperties)(i),_=v.filter(y=>(0,r.alwaysValidSchema)(g,i[y]));if(v.length===0||_.length===v.length&&(!g.opts.unevaluated||g.props===!0))return;const b=E.strictSchema&&!E.allowMatchingProperties&&$.properties,w=u.name("valid");g.props!==!0&&!(g.props instanceof t.Name)&&(g.props=(0,o.evaluatedPropsToName)(u,g.props));const{props:d}=g;l();function l(){for(const y of v)b&&s(y),g.allErrors?c(y):(u.var(w,!0),c(y),u.if(w))}function s(y){for(const a in b)new RegExp(y).test(a)&&(0,r.checkStrictMode)(g,`property ${a} matches pattern ${y} (use allowMatchingProperties)`)}function c(y){u.forIn("key",f,a=>{u.if((0,t._)`${(0,e.usePattern)(n,y)}.test(${a})`,()=>{const m=_.includes(y);m||n.subschema({keyword:"patternProperties",schemaProp:y,dataProp:a,dataPropType:o.Type.Str},w),g.opts.unevaluated&&d!==!0?u.assign((0,t._)`${d}[${a}]`,!0):!m&&!g.allErrors&&u.if((0,t.not)(w),()=>u.break())})})}}};return vt.default=h,vt}var _t={},pn;function Fs(){if(pn)return _t;pn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:o,schema:h,it:n}=r;if((0,e.alwaysValidSchema)(n,h)){r.fail();return}const u=o.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 _t.default=t,_t}var $t={},mn;function Ls(){if(mn)return $t;mn=1,Object.defineProperty($t,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pe().validateUnion,error:{message:"must match a schema in anyOf"}};return $t.default=t,$t}var bt={},hn;function Us(){if(hn)return bt;hn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=H(),t=Y(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:h})=>(0,e._)`{passingSchemas: ${h.passing}}`},code(h){const{gen:n,schema:u,parentSchema:i,it:f}=h;if(!Array.isArray(u))throw new Error("ajv implementation error");if(f.opts.discriminator&&i.discriminator)return;const $=u,g=n.let("valid",!1),E=n.let("passing",null),v=n.name("_valid");h.setParams({passing:E}),n.block(_),h.result(g,()=>h.reset(),()=>h.error(!0));function _(){$.forEach((b,w)=>{let d;(0,t.alwaysValidSchema)(f,b)?n.var(v,!0):d=h.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&n.if((0,e._)`${v} && ${g}`).assign(g,!1).assign(E,(0,e._)`[${E}, ${w}]`).else(),n.if(v,()=>{n.assign(g,!0),n.assign(E,w),d&&h.mergeEvaluated(d,e.Name)})})}}};return bt.default=o,bt}var wt={},yn;function Ks(){if(yn)return wt;yn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:o,schema:h,it:n}=r;if(!Array.isArray(h))throw new Error("ajv implementation error");const u=o.name("valid");h.forEach((i,f)=>{if((0,e.alwaysValidSchema)(n,i))return;const $=r.subschema({keyword:"allOf",schemaProp:f},u);r.ok(u),r.mergeEvaluated($)})}};return wt.default=t,wt}var Pt={},gn;function Js(){if(gn)return Pt;gn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=H(),t=Y(),o={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:i,it:f}=n;i.then===void 0&&i.else===void 0&&(0,t.checkStrictMode)(f,'"if" without "then" and "else" is ignored');const $=h(f,"then"),g=h(f,"else");if(!$&&!g)return;const E=u.let("valid",!0),v=u.name("_valid");if(_(),n.reset(),$&&g){const w=u.let("ifClause");n.setParams({ifClause:w}),u.if(v,b("then",w),b("else",w))}else $?u.if(v,b("then")):u.if((0,e.not)(v),b("else"));n.pass(E,()=>n.error(!0));function _(){const w=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);n.mergeEvaluated(w)}function b(w,d){return()=>{const l=n.subschema({keyword:w},v);u.assign(E,v),n.mergeValidEvaluated(l,E),d?u.assign(d,(0,e._)`${w}`):n.setParams({ifClause:w})}}}};function h(n,u){const i=n.schema[u];return i!==void 0&&!(0,t.alwaysValidSchema)(n,i)}return Pt.default=o,Pt}var St={},vn;function Hs(){if(vn)return St;vn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:o,it:h}){o.if===void 0&&(0,e.checkStrictMode)(h,`"${r}" without "if" is ignored`)}};return St.default=t,St}var _n;function Gs(){if(_n)return lt;_n=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=en(),t=qs(),r=rn(),o=Ds(),h=Ts(),n=Ms(),u=As(),i=un(),f=Vs(),$=zs(),g=Fs(),E=Ls(),v=Us(),_=Ks(),b=Js(),w=Hs();function d(l=!1){const s=[g.default,E.default,v.default,_.default,b.default,w.default,u.default,i.default,n.default,f.default,$.default];return l?s.push(t.default,o.default):s.push(e.default,r.default),s.push(h.default),s}return lt.default=d,lt}var Et={},kt={},$n;function Ws(){if($n)return kt;$n=1,Object.defineProperty(kt,"__esModule",{value:!0});const e=H(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,e.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,e._)`{format: ${o}}`},code(o,h){const{gen:n,data:u,$data:i,schema:f,schemaCode:$,it:g}=o,{opts:E,errSchemaPath:v,schemaEnv:_,self:b}=g;if(!E.validateFormats)return;i?w():d();function w(){const l=n.scopeValue("formats",{ref:b.formats,code:E.code.formats}),s=n.const("fDef",(0,e._)`${l}[${$}]`),c=n.let("fType"),y=n.let("format");n.if((0,e._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>n.assign(c,(0,e._)`${s}.type || "string"`).assign(y,(0,e._)`${s}.validate`),()=>n.assign(c,(0,e._)`"string"`).assign(y,s)),o.fail$data((0,e.or)(a(),m()));function a(){return E.strictSchema===!1?e.nil:(0,e._)`${$} && !${y}`}function m(){const P=_.$async?(0,e._)`(${s}.async ? await ${y}(${u}) : ${y}(${u}))`:(0,e._)`${y}(${u})`,R=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${u}))`;return(0,e._)`${y} && ${y} !== true && ${c} === ${h} && !${R}`}}function d(){const l=b.formats[f];if(!l){a();return}if(l===!0)return;const[s,c,y]=m(l);s===h&&o.pass(P());function a(){if(E.strictSchema===!1){b.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${f}" ignored in schema at path "${v}"`}}function m(R){const T=R instanceof RegExp?(0,e.regexpCode)(R):E.code.formats?(0,e._)`${E.code.formats}${(0,e.getProperty)(f)}`:void 0,z=n.scopeValue("formats",{key:f,ref:R,code:T});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,e._)`${z}.validate`]:["string",R,z]}function P(){if(typeof l=="object"&&!(l instanceof RegExp)&&l.async){if(!_.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${u})`}return typeof c=="function"?(0,e._)`${y}(${u})`:(0,e._)`${y}.test(${u})`}}}};return kt.default=r,kt}var bn;function Bs(){if(bn)return Et;bn=1,Object.defineProperty(Et,"__esModule",{value:!0});const t=[Ws().default];return Et.default=t,Et}var Ee={},wn;function Ys(){return wn||(wn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.contentVocabulary=Ee.metadataVocabulary=void 0,Ee.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ee.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ee}var Pn;function Zs(){if(Pn)return Ye;Pn=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=$s(),t=Ns(),r=Gs(),o=Bs(),h=Ys(),n=[e.default,t.default,(0,r.default)(),o.default,h.metadataVocabulary,h.contentVocabulary];return Ye.default=n,Ye}var jt={},qe={},Sn;function Qs(){if(Sn)return qe;Sn=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(qe.DiscrError=e={})),qe}var En;function xs(){if(En)return jt;En=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=H(),t=Qs(),r=Gt(),o=We(),h=Y(),u={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:f}})=>i===t.DiscrError.Tag?`tag "${f}" must be string`:`value of tag "${f}" must be in oneOf`,params:({params:{discrError:i,tag:f,tagName:$}})=>(0,e._)`{error: ${i}, tag: ${$}, tagValue: ${f}}`},code(i){const{gen:f,data:$,schema:g,parentSchema:E,it:v}=i,{oneOf:_}=E;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=g.propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(g.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const w=f.let("valid",!1),d=f.const("tag",(0,e._)`${$}${(0,e.getProperty)(b)}`);f.if((0,e._)`typeof ${d} == "string"`,()=>l(),()=>i.error(!1,{discrError:t.DiscrError.Tag,tag:d,tagName:b})),i.ok(w);function l(){const y=c();f.if(!1);for(const a in y)f.elseIf((0,e._)`${d} === ${a}`),f.assign(w,s(y[a]));f.else(),i.error(!1,{discrError:t.DiscrError.Mapping,tag:d,tagName:b}),f.endIf()}function s(y){const a=f.name("valid"),m=i.subschema({keyword:"oneOf",schemaProp:y},a);return i.mergeEvaluated(m,e.Name),a}function c(){var y;const a={},m=R(E);let P=!0;for(let N=0;N<_.length;N++){let V=_[N];if(V?.$ref&&!(0,h.schemaHasRulesButRef)(V,v.self.RULES)){const L=V.$ref;if(V=r.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,L),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new o.default(v.opts.uriResolver,v.baseId,L)}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&&(m||R(V)),T(F,N)}if(!P)throw new Error(`discriminator: "${b}" must be required`);return a;function R({required:N}){return Array.isArray(N)&&N.includes(b)}function T(N,V){if(N.const)z(N.const,V);else if(N.enum)for(const F of N.enum)z(F,V);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function z(N,V){if(typeof N!="string"||N in a)throw new Error(`discriminator: "${b}" values must be unique strings`);a[N]=V}}}};return jt.default=u,jt}const Xs={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};var kn;function jn(){return kn||(kn=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=gs(),o=Zs(),h=xs(),n=Xs,u=["/properties"],i="http://json-schema.org/draft-07/schema";class f extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(h.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(n,u):n;this.addMetaSchema(b,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=f,e.exports=t=f,e.exports.Ajv=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var $=Je();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var g=H();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});var E=Ht();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var v=We();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(Ve,Ve.exports)),Ve.exports}var ei=jn();const ti=je(ei);var It={exports:{}},Qt={},In;function ri(){return In||(In=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(N,V){return{validate:N,compare:V}}e.fullFormats={date:t(n,u),time:t(f(!0),$),"date-time":t(v(!0),_),"iso-time":t(f(),g),"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: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:c,int32:{type:"number",validate:m},int64:{type:"number",validate:P},float:{type:"number",validate:R},double:{type:"number",validate:R},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,_),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),"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(N){return N%4===0&&(N%100!==0||N%400===0)}const o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,h=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n(N){const V=o.exec(N);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&r(F)?29:h[L])}function u(N,V){if(N&&V)return N>V?1:N<V?-1:0}const i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function f(N){return function(F){const L=i.exec(F);if(!L)return!1;const Q=+L[1],oe=+L[2],ae=+L[3],X=L[4],he=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||N&&!X)return!1;if(Q<=23&&oe<=59&&ae<60)return!0;const D=oe-j*he,O=Q-M*he-(D<0?1:0);return(O===23||O===-1)&&(D===59||D===-1)&&ae<61}}function $(N,V){if(!(N&&V))return;const F=new Date("2020-01-01T"+N).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function g(N,V){if(!(N&&V))return;const F=i.exec(N),L=i.exec(V);if(F&&L)return N=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],N>V?1:N<V?-1:0}const E=/t|\s/i;function v(N){const V=f(N);return function(L){const Q=L.split(E);return Q.length===2&&n(Q[0])&&V(Q[1])}}function _(N,V){if(!(N&&V))return;const F=new Date(N).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function b(N,V){if(!(N&&V))return;const[F,L]=N.split(E),[Q,oe]=V.split(E),ae=u(F,Q);if(ae!==void 0)return ae||$(L,oe)}const w=/\/|:/,d=/^(?:[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(N){return w.test(N)&&d.test(N)}const s=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function c(N){return s.lastIndex=0,s.test(N)}const y=-2147483648,a=2**31-1;function m(N){return Number.isInteger(N)&&N<=a&&N>=y}function P(N){return Number.isInteger(N)}function R(){return!0}const T=/[^\\]\\Z/;function z(N){if(T.test(N))return!1;try{return new RegExp(N),!0}catch{return!1}}})(Qt)),Qt}var xt={},On;function ni(){return On||(On=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=jn(),r=H(),o=r.operators,h={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},n={message:({keyword:i,schemaCode:f})=>(0,r.str)`should be ${h[i].okStr} ${f}`,params:({keyword:i,schemaCode:f})=>(0,r._)`{comparison: ${h[i].okStr}, limit: ${f}}`};e.formatLimitDefinition={keyword:Object.keys(h),type:"string",schemaType:"string",$data:!0,error:n,code(i){const{gen:f,data:$,schemaCode:g,keyword:E,it:v}=i,{opts:_,self:b}=v;if(!_.validateFormats)return;const w=new t.KeywordCxt(v,b.RULES.all.format.definition,"format");w.$data?d():l();function d(){const c=f.scopeValue("formats",{ref:b.formats,code:_.code.formats}),y=f.const("fmt",(0,r._)`${c}[${w.schemaCode}]`);i.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,s(y)))}function l(){const c=w.schema,y=b.formats[c];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${E}": format "${c}" does not define "compare" function`);const a=f.scopeValue("formats",{key:c,ref:y,code:_.code.formats?(0,r._)`${_.code.formats}${(0,r.getProperty)(c)}`:void 0});i.fail$data(s(a))}function s(c){return(0,r._)`${c}.compare(${$}, ${g}) ${h[E].fail} 0`}},dependencies:["format"]};const u=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=u})(xt)),xt}var Rn;function si(){return Rn||(Rn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=ri(),o=ni(),h=H(),n=new h.Name("fullFormats"),u=new h.Name("fastFormats"),i=($,g={keywords:!0})=>{if(Array.isArray(g))return f($,g,r.fullFormats,n),$;const[E,v]=g.mode==="fast"?[r.fastFormats,u]:[r.fullFormats,n],_=g.formats||r.formatNames;return f($,_,E,v),g.keywords&&(0,o.default)($),$};i.get=($,g="full")=>{const v=(g==="fast"?r.fastFormats:r.fullFormats)[$];if(!v)throw new Error(`Unknown format "${$}"`);return v};function f($,g,E,v){var _,b;(_=(b=$.opts.code).formats)!==null&&_!==void 0||(b.formats=(0,h._)`require("ajv-formats/dist/formats").${v}`);for(const w of g)$.addFormat(w,E[w])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})(It,It.exports)),It.exports}var ii=si();const oi=je(ii),De={$schema:"http://json-schema.org/draft-07/schema#",$ref:"#/definitions/CICConfig",definitions:JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}')},Te=e=>typeof e=="number"&&isFinite(e)&&e>0,Xt=()=>{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,o=>o.toString(16).padStart(2,"0"));return`${r[0]}${r[1]}${r[2]}${r[3]}-${r[4]}${r[5]}-${r[6]}${r[7]}-${r[8]}${r[9]}-${r[10]}${r[11]}${r[12]}${r[13]}${r[14]}${r[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})},ee=e=>{if(!Array.isArray(e))return[];const t=e.map(i=>{const f=i.path??i.instancePath??"",$=i.keyword,g=i.params||{};let E=i.message||"";if($==="required"&&g.missingProperty&&(E=`缺少必填字段:${g.missingProperty}`),$==="type"&&i.schema&&(E=`类型必须为:${i.schema}`),$==="enum"){const v=Array.isArray(g.allowedValues)?g.allowedValues:void 0;E=v?`取值必须为枚举之一:${v.join(", ")}`:"取值必须为枚举之一"}if($==="const"){const v=g.allowedValue;E=v!==void 0?`取值必须为:${JSON.stringify(v)}`:"必须等于常量"}return $==="additionalProperties"&&g.additionalProperty&&(E=`不允许额外字段:${g.additionalProperty}`),{path:f,message:E,keyword:$,params:g}}),r={},o=[];for(const i of t){const f=i.keyword==="required"?`${i.keyword}|${i.path}|${i.params?.missingProperty}`:`${i.keyword}|${i.path}|${JSON.stringify(i.params||{})}`;r[f]||(r[f]=!0,o.push(i))}const n=o.some(i=>i.keyword!=="anyOf")?o.filter(i=>i.keyword!=="anyOf"):o,u=i=>i.keyword==="required"&&(i.params?.missingProperty==="type"||i.params?.missingProperty==="role")?0:i.keyword==="required"&&i.params?.missingProperty==="id"?1:i.keyword==="required"?2:3;return n.sort((i,f)=>u(i)-u(f)),n},me=(e,t)=>{if(!t||typeof t!="object")return e;const r=e||{};for(const o of Object.keys(t))(!(o in r)||r[o]===void 0)&&(r[o]=t[o]);return r},we=(e,t)=>!t||!t.length?[]:t.map(r=>({...r,path:`${e}${r.path||""}`})),er=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",message:`JSON 解析失败:${t?.message||String(t)}`,keyword:"type",params:{}}]}}},Cn=e=>e.map(t=>({path:"",message:`缺少必填字段:${t}`,keyword:"required",params:{missingProperty:t}})),tr=(e,t,r,o)=>{const h=e;if(h&&typeof h=="object"&&typeof h[o]=="string"){const i=r[h[o]];if(i)return i(e)?{ok:!0}:{ok:!1,errors:ee(i.errors||[])}}if(t(e))return{ok:!0};const u=ee(t.errors||[]);if(!h||typeof h!="object"||typeof h[o]!="string"){const i=Cn([o,"id"]);return{ok:!1,errors:ee(i)}}return{ok:!1,errors:u}},rr=(e,t,r,o,h,n,u=[n,"id"])=>{const i=r(e,t);if(i&&typeof i=="object"&&typeof i[n]=="string"){const $=h[i[n]];if($)return $(i)?{ok:!0,value:i}:{ok:!1,errors:ee($.errors||[])}}if(o(i))return{ok:!0,value:i};if(!i||typeof i[n]!="string"){const $=Cn(u);return{ok:!1,errors:ee($)}}return{ok:!1,errors:ee(o.errors||[])}};let Ot=null;const Nn=()=>(Ot||(Ot=new ti({allErrors:!0,strict:!1}),oi(Ot)),Ot),qn=new Map,ai=JSON.stringify(De),ci={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"]},di=(e,t)=>e.compile({$ref:t,definitions:De.definitions,properties:De.properties}),te=e=>{const t=Nn(),r=`type:${e}::${ai}`,o=qn.get(r);if(o)return o;const h=ci[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const n of h)try{const u=di(t,n);return qn.set(r,u),u}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Dn=te("DataSourceItem"),Tn=te("DataSourceRest"),Mn=te("DataSourceWebSocket"),An=te("DataSourceStatic"),Vn=te("DataSourceFunction"),ui=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=Xt()),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))),me(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)),me(r,t?.defaults)):r.type==="static"?t?.strict||me(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&Te(r.timeout)&&(r.timeout=Math.round(r.timeout)),t?.strict||me(r,t?.defaults))),r},li=e=>tr(e,Dn,{rest:Tn,websocket:Mn,static:An,function:Vn},"type"),zn=(e,t)=>rr(e,t,ui,Dn,{rest:Tn,websocket:Mn,static:An,function:Vn},"type",["type","id"]),Fn=te("ComponentInstance"),Ln=te("ViewComponentInstance"),Un=te("ContainerComponentInstance"),Kn=te("LogicComponentInstanceRef"),fi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=Xt()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),me(r,t?.defaults),r},pi=e=>tr(e,Fn,{view:Ln,container:Un,logic:Kn},"role"),Jn=(e,t)=>rr(e,t,fi,Fn,{view:Ln,container:Un,logic:Kn},"role",["role","id"]),Rt=te("CICPage"),mi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=Xt()),t?.strict||me(r,t?.defaults),r},hi=e=>Rt(e)?{ok:!0}:{ok:!1,errors:ee(Rt.errors||[])},Hn=(e,t)=>{const r=mi(e,t);return Rt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Rt.errors||[])}},Ct=te("Meta"),Nt=te("Layout"),yi=e=>Ct(e)?{ok:!0}:{ok:!1,errors:ee(Ct.errors||[])},gi=e=>Nt(e)?{ok:!0}:{ok:!1,errors:ee(Nt.errors||[])},Gn=(e,t)=>{const r=t?.strict?e:me(e,t?.defaults);return Ct(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Ct.errors||[])}},Wn=(e,t)=>{const r=t?.strict?e:me(e,t?.defaults);return Nt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Nt.errors||[])}},qt=te("Variables"),vi=e=>qt(e)?{ok:!0}:{ok:!1,errors:ee(qt.errors||[])},Bn=(e,t)=>{const r=t?.strict?e:me(e,t?.defaults);return qt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(qt.errors||[])}},Yn=te("Dependency"),Zn=te("JSDependency"),Qn=te("CSSDependency"),xn=te("FontDependency"),Xn=te("ImageDependency"),es=te("JSONDependency"),ts=te("WasmDependency"),rs=te("OtherDependency"),_i=e=>tr(e,Yn,{js:Zn,css:Qn,font:xn,image:Xn,json:es,wasm:ts,other:rs},"type"),ns=(e,t)=>rr(e,t,(o,h)=>h?.strict?o:me(o,h?.defaults),Yn,{js:Zn,css:Qn,font:xn,image:Xn,json:es,wasm:ts,other:rs},"type",["type","id"]),Dt=te("RegistryComponents"),$i=e=>Dt(e)?{ok:!0}:{ok:!1,errors:ee(Dt.errors||[])},ss=(e,t)=>{const r=t?.strict?e:me(e,t?.defaults);return Dt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Dt.errors||[])}};let Tt,is;const bi=()=>{const e=Nn(),t=JSON.stringify(De);(!Tt||is!==t)&&(Tt=e.compile(De),is=t)},Mt=e=>{try{return bi(),Tt(e)?{ok:!0}:{ok:!1,errors:ee(Tt.errors||[])}}catch(t){const r=[{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}];return{ok:!1,errors:ee(r)}}},wi=(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 h=er(r);return h.ok?Me(h.value,t):{ok:!1,errors:h.errors}},Pi=async(e,t)=>{if(e&&typeof e=="object")return Me(e,t);const r=(e||"").trim();if(r.startsWith("{")||r.startsWith("[")){const n=er(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(),i=er(u);return i.ok?Me(i.value,t):{ok:!1,errors:i.errors}}catch(n){const u=[{path:"",message:`请求失败:${n?.message||n}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(u)}}},Si=e=>{const t=Mt(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,o=[];if(!r||typeof r!="object")return o.push({path:"",message:"配置必须为对象",keyword:"type",params:{schema:"object"}}),{ok:!1,errors:ee(o)};if(r.version||o.push({path:"/version",message:"缺少必填字段:version",keyword:"required",params:{missingProperty:"version"}}),r.meta||o.push({path:"/meta",message:"缺少必填字段:meta",keyword:"required",params:{missingProperty:"meta"}}),r.pages||o.push({path:"/pages",message:"缺少必填字段:pages",keyword:"required",params:{missingProperty:"pages"}}),o.length)return{ok:!1,errors:ee(o)};const h=Gn(r.meta,t?.meta);if(h.ok||o.push(...we("/meta",h.errors)),r.meta?.layout){const u=Wn(r.meta.layout,t?.layout);u.ok?r.meta.layout=u.value:o.push(...we("/meta/layout",u.errors))}if(h.ok&&(r.meta=h.value),r.variables){const u=Bn(r.variables,t?.variables);u.ok?r.variables=u.value:o.push(...we("/variables",u.errors))}if(r.registry?.components){const u=[];for(let i=0;i<r.registry.components.length;i++){const f=ss(r.registry.components[i],t?.registry);f.ok?u.push(f.value):o.push(...we(`/registry/components[${i}]`,f.errors))}r.registry.components=u}if(r.deps){const u=[];for(let i=0;i<r.deps.length;i++){const f=ns(r.deps[i],t?.dependency);f.ok?u.push(f.value):o.push(...we(`/deps[${i}]`,f.errors))}r.deps=u}if(Array.isArray(r.pages)){const u=[];for(let i=0;i<r.pages.length;i++){const f=r.pages[i],$=Hn(f,t?.page);if(!$.ok){o.push(...we(`/pages[${i}]`,$.errors));continue}const g=$.value;if(Array.isArray(f.components)){const E=[];for(let v=0;v<f.components.length;v++){const _=Jn(f.components[v],t?.component);_.ok?E.push(_.value):o.push(...we(`/pages[${i}]/components[${v}]`,_.errors))}g.components=E}if(Array.isArray(f.dataSources)){const E=[];for(let v=0;v<f.dataSources.length;v++){const _=zn(f.dataSources[v],t?.dataSource);_.ok?E.push(_.value):o.push(...we(`/pages[${i}]/dataSources[${v}]`,_.errors))}g.dataSources=E}u.push(g)}r.pages=u}if(o.length)return{ok:!1,errors:ee(o)};const n=Mt(r);return n.ok?{ok:!0,value:r}:{ok:!1,errors:n.errors}};class At{config;constructor(t){const r=Mt(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(o=>o.id===t?(r=o,!1):!0),r}findPageByComponent(t){let r;return this.walkComponents((o,h)=>o.id===t?(r=h,!1):!0),r}getVariable(t,r){const o=this.config.variables;if(o){if(t.componentId&&o.component&&o.component[t.componentId]){const h=o.component[t.componentId][r];if(h)return h.value??h.default}if(t.pageId&&o.page&&o.page[t.pageId]){const h=o.page[t.pageId][r];if(h)return h.value??h.default}if(o.global&&o.global[r]){const h=o.global[r];return h.value??h.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,o,h,n]=r;if(o==="global")return this.getVariable({},n);if(o==="page")return this.getVariable({pageId:h},n);if(o==="component")return this.getVariable({componentId:h},n)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const o=[];for(const n of r.components||[])o.push({node:n});let h=!1;for(;o.length>0&&!h;){const{node:n,parent:u}=o.pop();if(t(n,r,u)===!1){h=!0;break}if(n.children&&n.children.length>0)for(let f=n.children.length-1;f>=0;f--)o.push({node:n.children[f],parent:n})}if(h)break}}static getValueByPath(t,r,o){if(t==null||!r)return o;const h=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(u=>{u.trim()&&h.push(u.trim())});let n=t;for(const u of h){if(n==null)return o;n=n[u]}return n===void 0?o:n}static traverseTree(t,r,o){const h=Array.isArray(t)?t:[t];for(const n of h)r(n,o)!==!1&&n.children&&n.children.length>0&&At.traverseTree(n.children,r,n)}static createDataSource=zn;static validateDataSource=li;static createComponent=Jn;static validateComponent=pi;static createPage=Hn;static validatePage=hi;static createMeta=Gn;static createLayout=Wn;static validateMeta=yi;static validateLayout=gi;static createVariables=Bn;static validateVariables=vi;static createDependency=ns;static validateDependency=_i;static createRegistryComponent=ss;static validateRegistryComponent=$i;static importCIC=wi;static exportCIC=Si;static validateCIC=Mt;static importCICAsync=Pi}globalThis.CICSDK=At,ke.CICSDK=At,Object.defineProperty(ke,Symbol.toStringTag,{value:"Module"})}));
|
|
7
|
+
depsCount: ${w},
|
|
8
|
+
deps: ${$}}`};const g={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(f){const[w,$]=s(f);l(f,w),d(f,$)}};function s({schema:f}){const w={},$={};for(const E in f){if(E==="__proto__")continue;const _=Array.isArray(f[E])?w:$;_[E]=f[E]}return[w,$]}function l(f,w=f.schema){const{gen:$,data:E,it:_}=f;if(Object.keys(w).length===0)return;const v=$.let("missing");for(const b in w){const h=w[b];if(h.length===0)continue;const a=(0,i.propertyInData)($,E,b,_.opts.ownProperties);f.setParams({property:b,depsCount:h.length,deps:h.join(", ")}),_.allErrors?$.if(a,()=>{for(const u of h)(0,i.checkReportMissingProp)(f,u)}):($.if((0,t._)`${a} && (${(0,i.checkMissingProp)(f,h,v)})`),(0,i.reportMissingProp)(f,v),$.else())}}e.validatePropertyDeps=l;function d(f,w=f.schema){const{gen:$,data:E,keyword:_,it:v}=f,b=$.name("valid");for(const h in w)(0,r.alwaysValidSchema)(v,w[h])||($.if((0,i.propertyInData)($,E,h,v.opts.ownProperties),()=>{const a=f.subschema({keyword:_,schemaProp:h},b);f.mergeValidEvaluated(a,b)},()=>$.var(b,!0)),f.ok(b))}e.validateSchemaDeps=d,e.default=g})(Zt)),Zt}var vt={},ln;function Fs(){if(ln)return vt;ln=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=H(),t=Y(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:g})=>(0,e._)`{propertyName: ${g.propertyName}}`},code(g){const{gen:s,schema:l,data:d,it:f}=g;if((0,t.alwaysValidSchema)(f,l))return;const w=s.name("valid");s.forIn("key",d,$=>{g.setParams({propertyName:$}),g.subschema({keyword:"propertyNames",data:$,dataTypes:["string"],propertyName:$,compositeRule:!0},w),s.if((0,e.not)(w),()=>{g.error(!0),f.allErrors||s.break()})}),g.ok(w)}};return vt.default=i,vt}var _t={},fn;function pn(){if(fn)return _t;fn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=me(),t=H(),r=be(),i=Y(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:d,schema:f,parentSchema:w,data:$,errsCount:E,it:_}=l;if(!E)throw new Error("ajv implementation error");const{allErrors:v,opts:b}=_;if(_.props=!0,b.removeAdditional!=="all"&&(0,i.alwaysValidSchema)(_,f))return;const h=(0,e.allSchemaProperties)(w.properties),a=(0,e.allSchemaProperties)(w.patternProperties);u(),l.ok((0,t._)`${E} === ${r.default.errors}`);function u(){d.forIn("key",$,m=>{!h.length&&!a.length?y(m):d.if(n(m),()=>y(m))})}function n(m){let P;if(h.length>8){const O=(0,i.schemaRefOrVal)(_,w.properties,"properties");P=(0,e.isOwnProperty)(d,O,m)}else h.length?P=(0,t.or)(...h.map(O=>(0,t._)`${m} === ${O}`)):P=t.nil;return a.length&&(P=(0,t.or)(P,...a.map(O=>(0,t._)`${(0,e.usePattern)(l,O)}.test(${m})`))),(0,t.not)(P)}function c(m){d.code((0,t._)`delete ${$}[${m}]`)}function y(m){if(b.removeAdditional==="all"||b.removeAdditional&&f===!1){c(m);return}if(f===!1){l.setParams({additionalProperty:m}),l.error(),v||d.break();return}if(typeof f=="object"&&!(0,i.alwaysValidSchema)(_,f)){const P=d.name("valid");b.removeAdditional==="failing"?(o(m,P,!1),d.if((0,t.not)(P),()=>{l.reset(),c(m)})):(o(m,P),v||d.if((0,t.not)(P),()=>d.break()))}}function o(m,P,O){const T={keyword:"additionalProperties",dataProp:m,dataPropType:i.Type.Str};O===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(T,P)}}};return _t.default=s,_t}var $t={},mn;function Ls(){if(mn)return $t;mn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=We(),t=me(),r=Y(),i=pn(),g={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:l,schema:d,parentSchema:f,data:w,it:$}=s;$.opts.removeAdditional==="all"&&f.additionalProperties===void 0&&i.default.code(new e.KeywordCxt($,i.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(d);for(const a of E)$.definedProperties.add(a);$.opts.unevaluated&&E.length&&$.props!==!0&&($.props=r.mergeEvaluated.props(l,(0,r.toHash)(E),$.props));const _=E.filter(a=>!(0,r.alwaysValidSchema)($,d[a]));if(_.length===0)return;const v=l.name("valid");for(const a of _)b(a)?h(a):(l.if((0,t.propertyInData)(l,w,a,$.opts.ownProperties)),h(a),$.allErrors||l.else().var(v,!0),l.endIf()),s.it.definedProperties.add(a),s.ok(v);function b(a){return $.opts.useDefaults&&!$.compositeRule&&d[a].default!==void 0}function h(a){s.subschema({keyword:"properties",schemaProp:a,dataProp:a},v)}}};return $t.default=g,$t}var bt={},hn;function Us(){if(hn)return bt;hn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=me(),t=H(),r=Y(),i=Y(),g={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:l,schema:d,data:f,parentSchema:w,it:$}=s,{opts:E}=$,_=(0,e.allSchemaProperties)(d),v=_.filter(y=>(0,r.alwaysValidSchema)($,d[y]));if(_.length===0||v.length===_.length&&(!$.opts.unevaluated||$.props===!0))return;const b=E.strictSchema&&!E.allowMatchingProperties&&w.properties,h=l.name("valid");$.props!==!0&&!($.props instanceof t.Name)&&($.props=(0,i.evaluatedPropsToName)(l,$.props));const{props:a}=$;u();function u(){for(const y of _)b&&n(y),$.allErrors?c(y):(l.var(h,!0),c(y),l.if(h))}function n(y){for(const o in b)new RegExp(y).test(o)&&(0,r.checkStrictMode)($,`property ${o} matches pattern ${y} (use allowMatchingProperties)`)}function c(y){l.forIn("key",f,o=>{l.if((0,t._)`${(0,e.usePattern)(s,y)}.test(${o})`,()=>{const m=v.includes(y);m||s.subschema({keyword:"patternProperties",schemaProp:y,dataProp:o,dataPropType:i.Type.Str},h),$.opts.unevaluated&&a!==!0?l.assign((0,t._)`${a}[${o}]`,!0):!m&&!$.allErrors&&l.if((0,t.not)(h),()=>l.break())})})}}};return bt.default=g,bt}var wt={},yn;function Ks(){if(yn)return wt;yn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:i,schema:g,it:s}=r;if((0,e.alwaysValidSchema)(s,g)){r.fail();return}const l=i.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),r.failResult(l,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return wt.default=t,wt}var Pt={},gn;function Js(){if(gn)return Pt;gn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:me().validateUnion,error:{message:"must match a schema in anyOf"}};return Pt.default=t,Pt}var St={},vn;function Hs(){if(vn)return St;vn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=H(),t=Y(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:g})=>(0,e._)`{passingSchemas: ${g.passing}}`},code(g){const{gen:s,schema:l,parentSchema:d,it:f}=g;if(!Array.isArray(l))throw new Error("ajv implementation error");if(f.opts.discriminator&&d.discriminator)return;const w=l,$=s.let("valid",!1),E=s.let("passing",null),_=s.name("_valid");g.setParams({passing:E}),s.block(v),g.result($,()=>g.reset(),()=>g.error(!0));function v(){w.forEach((b,h)=>{let a;(0,t.alwaysValidSchema)(f,b)?s.var(_,!0):a=g.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},_),h>0&&s.if((0,e._)`${_} && ${$}`).assign($,!1).assign(E,(0,e._)`[${E}, ${h}]`).else(),s.if(_,()=>{s.assign($,!0),s.assign(E,h),a&&g.mergeEvaluated(a,e.Name)})})}}};return St.default=i,St}var Et={},_n;function Gs(){if(_n)return Et;_n=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:i,schema:g,it:s}=r;if(!Array.isArray(g))throw new Error("ajv implementation error");const l=i.name("valid");g.forEach((d,f)=>{if((0,e.alwaysValidSchema)(s,d))return;const w=r.subschema({keyword:"allOf",schemaProp:f},l);r.ok(l),r.mergeEvaluated(w)})}};return Et.default=t,Et}var kt={},$n;function Ws(){if($n)return kt;$n=1,Object.defineProperty(kt,"__esModule",{value:!0});const e=H(),t=Y(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:l,parentSchema:d,it:f}=s;d.then===void 0&&d.else===void 0&&(0,t.checkStrictMode)(f,'"if" without "then" and "else" is ignored');const w=g(f,"then"),$=g(f,"else");if(!w&&!$)return;const E=l.let("valid",!0),_=l.name("_valid");if(v(),s.reset(),w&&$){const h=l.let("ifClause");s.setParams({ifClause:h}),l.if(_,b("then",h),b("else",h))}else w?l.if(_,b("then")):l.if((0,e.not)(_),b("else"));s.pass(E,()=>s.error(!0));function v(){const h=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);s.mergeEvaluated(h)}function b(h,a){return()=>{const u=s.subschema({keyword:h},_);l.assign(E,_),s.mergeValidEvaluated(u,E),a?l.assign(a,(0,e._)`${h}`):s.setParams({ifClause:h})}}}};function g(s,l){const d=s.schema[l];return d!==void 0&&!(0,t.alwaysValidSchema)(s,d)}return kt.default=i,kt}var jt={},bn;function Bs(){if(bn)return jt;bn=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:i,it:g}){i.if===void 0&&(0,e.checkStrictMode)(g,`"${r}" without "if" is ignored`)}};return jt.default=t,jt}var wn;function Ys(){if(wn)return mt;wn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=nn(),t=Ms(),r=on(),i=As(),g=Vs(),s=zs(),l=Fs(),d=pn(),f=Ls(),w=Us(),$=Ks(),E=Js(),_=Hs(),v=Gs(),b=Ws(),h=Bs();function a(u=!1){const n=[$.default,E.default,_.default,v.default,b.default,h.default,l.default,d.default,s.default,f.default,w.default];return u?n.push(t.default,i.default):n.push(e.default,r.default),n.push(g.default),n}return mt.default=a,mt}var Rt={},It={},Pn;function xs(){if(Pn)return It;Pn=1,Object.defineProperty(It,"__esModule",{value:!0});const e=H(),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,g){const{gen:s,data:l,$data:d,schema:f,schemaCode:w,it:$}=i,{opts:E,errSchemaPath:_,schemaEnv:v,self:b}=$;if(!E.validateFormats)return;d?h():a();function h(){const u=s.scopeValue("formats",{ref:b.formats,code:E.code.formats}),n=s.const("fDef",(0,e._)`${u}[${w}]`),c=s.let("fType"),y=s.let("format");s.if((0,e._)`typeof ${n} == "object" && !(${n} instanceof RegExp)`,()=>s.assign(c,(0,e._)`${n}.type || "string"`).assign(y,(0,e._)`${n}.validate`),()=>s.assign(c,(0,e._)`"string"`).assign(y,n)),i.fail$data((0,e.or)(o(),m()));function o(){return E.strictSchema===!1?e.nil:(0,e._)`${w} && !${y}`}function m(){const P=v.$async?(0,e._)`(${n}.async ? await ${y}(${l}) : ${y}(${l}))`:(0,e._)`${y}(${l})`,O=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${l}))`;return(0,e._)`${y} && ${y} !== true && ${c} === ${g} && !${O}`}}function a(){const u=b.formats[f];if(!u){o();return}if(u===!0)return;const[n,c,y]=m(u);n===g&&i.pass(P());function o(){if(E.strictSchema===!1){b.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${f}" ignored in schema at path "${_}"`}}function m(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=s.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 u=="object"&&!(u instanceof RegExp)&&u.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${l})`}return typeof c=="function"?(0,e._)`${y}(${l})`:(0,e._)`${y}.test(${l})`}}}};return It.default=r,It}var Sn;function Qs(){if(Sn)return Rt;Sn=1,Object.defineProperty(Rt,"__esModule",{value:!0});const t=[xs().default];return Rt.default=t,Rt}var je={},En;function Zs(){return En||(En=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 kn;function Xs(){if(kn)return Ze;kn=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=Ps(),t=Ts(),r=Ys(),i=Qs(),g=Zs(),s=[e.default,t.default,(0,r.default)(),i.default,g.metadataVocabulary,g.contentVocabulary];return Ze.default=s,Ze}var Ot={},Me={},jn;function ei(){if(jn)return Me;jn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Me.DiscrError=e={})),Me}var Rn;function ti(){if(Rn)return Ot;Rn=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=H(),t=ei(),r=Bt(),i=xe(),g=Y(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:d,tagName:f}})=>d===t.DiscrError.Tag?`tag "${f}" must be string`:`value of tag "${f}" must be in oneOf`,params:({params:{discrError:d,tag:f,tagName:w}})=>(0,e._)`{error: ${d}, tag: ${w}, tagValue: ${f}}`},code(d){const{gen:f,data:w,schema:$,parentSchema:E,it:_}=d,{oneOf:v}=E;if(!_.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(!v)throw new Error("discriminator: requires oneOf keyword");const h=f.let("valid",!1),a=f.const("tag",(0,e._)`${w}${(0,e.getProperty)(b)}`);f.if((0,e._)`typeof ${a} == "string"`,()=>u(),()=>d.error(!1,{discrError:t.DiscrError.Tag,tag:a,tagName:b})),d.ok(h);function u(){const y=c();f.if(!1);for(const o in y)f.elseIf((0,e._)`${a} === ${o}`),f.assign(h,n(y[o]));f.else(),d.error(!1,{discrError:t.DiscrError.Mapping,tag:a,tagName:b}),f.endIf()}function n(y){const o=f.name("valid"),m=d.subschema({keyword:"oneOf",schemaProp:y},o);return d.mergeEvaluated(m,e.Name),o}function c(){var y;const o={},m=O(E);let P=!0;for(let C=0;C<v.length;C++){let V=v[C];if(V?.$ref&&!(0,g.schemaHasRulesButRef)(V,_.self.RULES)){const L=V.$ref;if(V=r.resolveRef.call(_.self,_.schemaEnv.root,_.baseId,L),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new i.default(_.opts.uriResolver,_.baseId,L)}const F=(y=V?.properties)===null||y===void 0?void 0:y[b];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);P=P&&(m||O(V)),T(F,C)}if(!P)throw new Error(`discriminator: "${b}" must be required`);return o;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 o)throw new Error(`discriminator: "${b}" values must be unique strings`);o[C]=V}}}};return Ot.default=l,Ot}const ri={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};var In;function On(){return In||(In=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=$s(),i=Xs(),g=ti(),s=ri,l=["/properties"],d="http://json-schema.org/draft-07/schema";class f extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(g.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(s,l):s;this.addMetaSchema(b,d,!1),this.refs["http://json-schema.org/schema"]=d}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(d)?d:void 0)}}t.Ajv=f,e.exports=t=f,e.exports.Ajv=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var w=We();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return w.KeywordCxt}});var $=H();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=Wt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var _=xe();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(Le,Le.exports)),Le.exports}var ni=On();const si=Ie(ni);var Nt={exports:{}},Xt={},Nn;function ii(){return Nn||(Nn=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,l),time:t(f(!0),w),"date-time":t(_(!0),v),"iso-time":t(f(),$),"iso-date-time":t(_(),b),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:u,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:c,int32:{type:"number",validate:m},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$/,l),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,w),"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,$),"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 i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,g=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const V=i.exec(C);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&r(F)?29:g[L])}function l(C,V){if(C&&V)return C>V?1:C<V?-1:0}const d=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function f(C){return function(F){const L=d.exec(F);if(!L)return!1;const Q=+L[1],oe=+L[2],ae=+L[3],X=L[4],ye=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||C&&!X)return!1;if(Q<=23&&oe<=59&&ae<60)return!0;const D=oe-j*ye,I=Q-M*ye-(D<0?1:0);return(I===23||I===-1)&&(D===59||D===-1)&&ae<61}}function w(C,V){if(!(C&&V))return;const F=new Date("2020-01-01T"+C).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function $(C,V){if(!(C&&V))return;const F=d.exec(C),L=d.exec(V);if(F&&L)return C=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],C>V?1:C<V?-1:0}const E=/t|\s/i;function _(C){const V=f(C);return function(L){const Q=L.split(E);return Q.length===2&&s(Q[0])&&V(Q[1])}}function v(C,V){if(!(C&&V))return;const F=new Date(C).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function b(C,V){if(!(C&&V))return;const[F,L]=C.split(E),[Q,oe]=V.split(E),ae=l(F,Q);if(ae!==void 0)return ae||w(L,oe)}const h=/\/|:/,a=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function u(C){return h.test(C)&&a.test(C)}const n=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function c(C){return n.lastIndex=0,n.test(C)}const y=-2147483648,o=2**31-1;function m(C){return Number.isInteger(C)&&C<=o&&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}}})(Xt)),Xt}var er={},Cn;function oi(){return Cn||(Cn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=On(),r=H(),i=r.operators,g={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:d,schemaCode:f})=>(0,r.str)`should be ${g[d].okStr} ${f}`,params:({keyword:d,schemaCode:f})=>(0,r._)`{comparison: ${g[d].okStr}, limit: ${f}}`};e.formatLimitDefinition={keyword:Object.keys(g),type:"string",schemaType:"string",$data:!0,error:s,code(d){const{gen:f,data:w,schemaCode:$,keyword:E,it:_}=d,{opts:v,self:b}=_;if(!v.validateFormats)return;const h=new t.KeywordCxt(_,b.RULES.all.format.definition,"format");h.$data?a():u();function a(){const c=f.scopeValue("formats",{ref:b.formats,code:v.code.formats}),y=f.const("fmt",(0,r._)`${c}[${h.schemaCode}]`);d.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,n(y)))}function u(){const c=h.schema,y=b.formats[c];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${E}": format "${c}" does not define "compare" function`);const o=f.scopeValue("formats",{key:c,ref:y,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(c)}`:void 0});d.fail$data(n(o))}function n(c){return(0,r._)`${c}.compare(${w}, ${$}) ${g[E].fail} 0`}},dependencies:["format"]};const l=d=>(d.addKeyword(e.formatLimitDefinition),d);e.default=l})(er)),er}var qn;function ai(){return qn||(qn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=ii(),i=oi(),g=H(),s=new g.Name("fullFormats"),l=new g.Name("fastFormats"),d=(w,$={keywords:!0})=>{if(Array.isArray($))return f(w,$,r.fullFormats,s),w;const[E,_]=$.mode==="fast"?[r.fastFormats,l]:[r.fullFormats,s],v=$.formats||r.formatNames;return f(w,v,E,_),$.keywords&&(0,i.default)(w),w};d.get=(w,$="full")=>{const _=($==="fast"?r.fastFormats:r.fullFormats)[w];if(!_)throw new Error(`Unknown format "${w}"`);return _};function f(w,$,E,_){var v,b;(v=(b=w.opts.code).formats)!==null&&v!==void 0||(b.formats=(0,g._)`require("ajv-formats/dist/formats").${_}`);for(const h of $)w.addFormat(h,E[h])}e.exports=t=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d})(Nt,Nt.exports)),Nt.exports}var ci=ai();const di=Ie(ci),Ae={$schema:"http://json-schema.org/draft-07/schema#",$ref:"#/definitions/CICConfig",definitions:JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"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":"其他"}}')},ce={REQUIRED:"required",TYPE:"type",ENUM:"enum",CONST:"const",ADDITIONAL:"additionalProperties",ANY_OF:"anyOf"},Pe={TYPE:"/type",VALUE:"/value",DEFAULT:"/default",ARGS:"/args"},Ce={missing:e=>`缺少必填字段:${e}`,type:e=>`类型必须为:${e}`,enum:e=>`取值必须为枚举之一:${e.join(", ")}`,constOne:e=>`取值必须为:${JSON.stringify(e)}`,additionalProp:e=>`不允许额外字段:${e}`},ui=[{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"]}],Ve=e=>typeof e=="number"&&Number.isFinite(e)&&e>0,tr=()=>{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=h=>{const a=h.instancePath||h.path||"",u=h.keyword,n=h.params||{};let c=h.message||"";switch(u){case ce.REQUIRED:n.missingProperty&&(c=Ce.missing(n.missingProperty));break;case ce.TYPE:h.schema&&(c=Ce.type(h.schema));break;case ce.ENUM:Array.isArray(n.allowedValues)&&(c=Ce.enum(n.allowedValues));break;case ce.CONST:c=n.allowedValue!==void 0?Ce.constOne(n.allowedValue):"必须等于常量";break;case ce.ADDITIONAL:n.additionalProperty&&(c=Ce.additionalProp(n.additionalProperty));break}return{path:a,message:c,keyword:u,params:n}},r=e.map(t),i=[],g=new Map,s=new Set;for(const h of r)if(h.keyword===ce.CONST&&h.path.endsWith(Pe.TYPE)){const a=h.path,u=g.get(a)||{path:h.path,values:[]},n=h.params?.allowedValue;n!==void 0&&!u.values.includes(n)&&u.values.push(n),g.set(a,u)}else i.push(h);for(const[,h]of g)if(h.values.length<=1)h.values.length===1&&i.push({path:h.path,keyword:ce.CONST,params:{allowedValue:h.values[0]},message:Ce.constOne(h.values[0])});else{const a=h.path.replace(new RegExp(`${Pe.TYPE}$`),"");s.add(a)}const l=i,d=new Set,f=[];for(const h of l){const a=`${h.keyword}|${h.path}|${JSON.stringify(h.params??{})}`;d.has(a)||(d.add(a),f.push(h))}const w=new Map,$=h=>{if(!h)return"";const a=h.match(new RegExp(`^(.*?)(?:${Pe.TYPE}|${Pe.VALUE}|${Pe.DEFAULT}|${Pe.ARGS})(?:$|\\/)`));return a?a[1]:h};for(const h of f){const a=$(h.path),u=w.get(a)||[];u.push(h),w.set(a,u)}const E=[];for(const[h,a]of w.entries()){const u=ui.find(c=>c.rootPattern.test(h));if(u&&a.some(y=>y.keyword===ce.REQUIRED&&y.params?.missingProperty===u.discriminator)){for(const y of a)y.keyword===ce.REQUIRED&&u.keepRequired.includes(y.params?.missingProperty)&&E.push(y);continue}if(!s.has(h)){E.push(...a);continue}for(const c of a){const y=c.keyword===ce.TYPE&&(c.path===`${h}${Pe.VALUE}`||c.path===`${h}${Pe.DEFAULT}`),o=c.keyword===ce.ADDITIONAL&&c.path===h;y||o||E.push(c)}}const v=E.some(h=>h.keyword!==ce.ANY_OF)?E.filter(h=>h.keyword!==ce.ANY_OF):E,b=h=>{if(h.keyword===ce.REQUIRED){const a=h.params?.missingProperty;return a==="type"||a==="role"?0:a==="id"?1:2}return 3};return v.sort((h,a)=>b(h)-b(a))},he=(e,t)=>{if(!t||typeof t!="object")return e;const r=e??{};for(const i of Object.keys(t))(!(i in r)||r[i]===void 0)&&(r[i]=t[i]);return r},Se=(e,t)=>t?.length?t.map(r=>({...r,path:`${e}${r.path?`.${r.path}`:""}`})):[],rr=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",keyword:"type",message:`JSON 解析失败:${t?.message??String(t)}`}]}}},li=e=>e.map(t=>({path:"",keyword:"required",params:{missingProperty:t},message:`缺少必填字段:${t}`})),Dn=({input:e,normalize:t,base:r,branches:i,key:g,missingKeys:s,onSuccess:l})=>{const d=t?t(e):e,f=d;if(f&&typeof f=="object"&&typeof f[g]=="string"){const w=i[f[g]];if(w)return w(f)?l(f):{ok:!1,errors:ee(w.errors)}}return r(d)?l(d):!f||typeof f[g]!="string"?{ok:!1,errors:li(s)}:{ok:!1,errors:ee(r.errors)}},nr=(e,t,r,i)=>Dn({input:e,base:t,branches:r,key:i,missingKeys:[i,"id"],onSuccess:()=>({ok:!0,value:null})}),sr=(e,t,r,i,g,s,l=[s,"id"])=>Dn({input:e,normalize:d=>r(d,t),base:i,branches:g,key:s,missingKeys:l,onSuccess:d=>({ok:!0,value:d})});let Ct=null;const Tn=()=>(Ct||(Ct=new si({allErrors:!0,strict:!1}),di(Ct)),Ct),Mn=new Map,fi=JSON.stringify(Ae),pi={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"]},mi=(e,t)=>e.compile({$ref:t,definitions:Ae.definitions,properties:Ae.properties}),te=e=>{const t=Tn(),r=`type:${e}::${fi}`,i=Mn.get(r);if(i)return i;const g=pi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of g)try{const l=mi(t,s);return Mn.set(r,l),l}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},An=te("DataSourceItem"),Vn=te("DataSourceRest"),zn=te("DataSourceWebSocket"),Fn=te("DataSourceStatic"),Ln=te("DataSourceFunction"),hi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),r.type&&(r.type==="rest"?(t?.strict||("pollInterval"in r&&Ve(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&Ve(r.timeout)&&(r.timeout=Math.round(r.timeout))),he(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&Ve(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&Ve(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),he(r,t?.defaults)):r.type==="static"?t?.strict||he(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&Ve(r.timeout)&&(r.timeout=Math.round(r.timeout)),t?.strict||he(r,t?.defaults))),r},yi=e=>nr(e,An,{rest:Vn,websocket:zn,static:Fn,function:Ln},"type"),Un=(e,t)=>sr(e,t,hi,An,{rest:Vn,websocket:zn,static:Fn,function:Ln},"type",["type","id"]),Kn=te("ComponentInstance"),Jn=te("ViewComponentInstance"),Hn=te("ContainerComponentInstance"),Gn=te("LogicComponentInstanceRef"),gi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),he(r,t?.defaults),r},vi=e=>nr(e,Kn,{view:Jn,container:Hn,logic:Gn},"role"),Wn=(e,t)=>sr(e,t,gi,Kn,{view:Jn,container:Hn,logic:Gn},"role",["role","id"]),qt=te("CICPage"),_i=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),t?.strict||he(r,t?.defaults),r},$i=e=>qt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(qt.errors||[])},Bn=(e,t)=>{const r=_i(e,t);return qt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(qt.errors||[])}},Dt=te("Meta"),Tt=te("Layout"),bi=e=>Dt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Dt.errors||[])},wi=e=>Tt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Tt.errors||[])},Yn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return Dt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Dt.errors||[])}},xn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return Tt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Tt.errors||[])}},Mt=te("Variables"),Pi=e=>Mt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Mt.errors||[])},Qn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return Mt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Mt.errors||[])}},Zn=te("Dependency"),Xn=te("JSDependency"),es=te("CSSDependency"),ts=te("FontDependency"),rs=te("ImageDependency"),ns=te("JSONDependency"),ss=te("WasmDependency"),is=te("OtherDependency"),Si=e=>nr(e,Zn,{js:Xn,css:es,font:ts,image:rs,json:ns,wasm:ss,other:is},"type"),os=(e,t)=>sr(e,t,(i,g)=>g?.strict?i:he(i,g?.defaults),Zn,{js:Xn,css:es,font:ts,image:rs,json:ns,wasm:ss,other:is},"type",["type","id"]),At=te("RegistryComponents"),Ei=e=>At(e)?{ok:!0,value:null}:{ok:!1,errors:ee(At.errors||[])},as=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return At(r)?{ok:!0,value:r}:{ok:!1,errors:ee(At.errors||[])}};let Vt,cs;const ki=()=>{const e=Tn(),t=JSON.stringify(Ae);(!Vt||cs!==t)&&(Vt=e.compile(Ae),cs=t)},zt=e=>{try{return ki(),Vt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Vt.errors||[])}}catch(t){const r=[{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}];return{ok:!1,errors:ee(r)}}},ji=(e,t)=>{if(e&&typeof e=="object")return ze(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 g=rr(r);return g.ok?ze(g.value,t):{ok:!1,errors:g.errors}},Ri=async(e,t)=>{if(e&&typeof e=="object")return ze(e,t);const r=(e||"").trim();if(r.startsWith("{")||r.startsWith("[")){const s=rr(r);return s.ok?ze(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 f=[{path:"",message:`网络或资源错误:${s?.status} ${s?.statusText||""}`.trim(),keyword:"type",params:{}}];return{ok:!1,errors:ee(f)}}const l=await s.text(),d=rr(l);return d.ok?ze(d.value,t):{ok:!1,errors:d.errors}}catch(s){const l=[{path:"",message:`请求失败:${s?.message||s}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(l)}}},Ii=e=>{const t=zt(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)}},ze=(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 g=Yn(r.meta,t?.meta);if(g.ok||i.push(...Se("/meta",g.errors)),r.meta?.layout){const l=xn(r.meta.layout,t?.layout);l.ok?r.meta.layout=l.value:i.push(...Se("/meta/layout",l.errors))}if(g.ok&&(r.meta=g.value),r.variables){const l=Qn(r.variables,t?.variables);l.ok?r.variables=l.value:i.push(...Se("/variables",l.errors))}if(r.registry?.components){const l=[];for(let d=0;d<r.registry.components.length;d++){const f=as(r.registry.components[d],t?.registry);f.ok?l.push(f.value):i.push(...Se(`/registry/components[${d}]`,f.errors))}r.registry.components=l}if(r.deps){const l=[];for(let d=0;d<r.deps.length;d++){const f=os(r.deps[d],t?.dependency);f.ok?l.push(f.value):i.push(...Se(`/deps[${d}]`,f.errors))}r.deps=l}if(Array.isArray(r.pages)){const l=[];for(let d=0;d<r.pages.length;d++){const f=r.pages[d],w=Bn(f,t?.page);if(!w.ok){i.push(...Se(`/pages[${d}]`,w.errors));continue}const $=w.value;if(Array.isArray(f.components)){const E=[];for(let _=0;_<f.components.length;_++){const v=Wn(f.components[_],t?.component);v.ok?E.push(v.value):i.push(...Se(`/pages[${d}]/components[${_}]`,v.errors))}$.components=E}if(Array.isArray(f.dataSources)){const E=[];for(let _=0;_<f.dataSources.length;_++){const v=Un(f.dataSources[_],t?.dataSource);v.ok?E.push(v.value):i.push(...Se(`/pages[${d}]/dataSources[${_}]`,v.errors))}$.dataSources=E}l.push($)}r.pages=l}if(i.length)return{ok:!1,errors:ee(i)};const s=zt(r);return s.ok?{ok:!0,value:r}:{ok:!1,errors:s.errors}};class ir{config;constructor(t){const r=zt(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,g)=>i.id===t?(r=g,!1):!0),r}getVariable(t,r){const i=this.config.variables;if(i){if(t.componentId&&i.component&&i.component[t.componentId]){const g=i.component[t.componentId][r];if(g)return g.value??g.default}if(t.pageId&&i.page&&i.page[t.pageId]){const g=i.page[t.pageId][r];if(g)return g.value??g.default}if(i.global&&i.global[r]){const g=i.global[r];return g.value??g.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,i,g,s]=r;if(i==="global")return this.getVariable({},s);if(i==="page")return this.getVariable({pageId:g},s);if(i==="component")return this.getVariable({componentId:g},s)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const i=[];for(const s of r.components||[])i.push({node:s});let g=!1;for(;i.length>0&&!g;){const{node:s,parent:l}=i.pop();if(t(s,r,l)===!1){g=!0;break}if(s.children&&s.children.length>0)for(let f=s.children.length-1;f>=0;f--)i.push({node:s.children[f],parent:s})}if(g)break}}static getValueByPath(t,r,i){if(t==null||!r)return i;const g=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(l=>{l.trim()&&g.push(l.trim())});let s=t;for(const l of g){if(s==null)return i;s=s[l]}return s===void 0?i:s}static traverseTree(t,r,i){const g=Array.isArray(t)?t:[t];for(const s of g)r(s,i)!==!1&&s.children&&s.children.length>0&&ir.traverseTree(s.children,r,s)}static createDataSource=Un;static validateDataSource=yi;static createComponent=Wn;static validateComponent=vi;static createPage=Bn;static validatePage=$i;static createMeta=Yn;static createLayout=xn;static validateMeta=bi;static validateLayout=wi;static createVariables=Qn;static validateVariables=Pi;static createDependency=os;static validateDependency=Si;static createRegistryComponent=as;static validateRegistryComponent=Ei;static importCIC=ji;static exportCIC=Ii;static validateCIC=zt;static importCICAsync=Ri}Re.CICSDK=ir,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})}));
|