@aipt/cli 0.1.24 → 0.1.25
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/README.md +11 -7
- package/dist/application-runner.js +14 -14
- package/dist/application.js +1 -1
- package/dist/chunk.js +1 -1
- package/dist/package-releases/aipt--cli/0.1.24/release.json +29 -0
- package/dist/package-releases/aipt--cli/0.1.25/release.json +29 -0
- package/dist/package-releases/aipt--idp-setup/0.1.2/release.json +31 -0
- package/docs/bootstrap.md +1 -1
- package/docs/engineering-workflow.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/vibe-coding-guide.md +2 -2
- package/documentation-manifest.json +5 -5
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as E,b as Kr,c as On,d as Od,e as T,f as Sd,g as Dd,h as jd,i as $d,j as Cd}from"./chunk.js";var jn=E(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.regexpCode=K.getEsmExportName=K.getProperty=K.safeStringify=K.stringify=K.strConcat=K.addCodeArg=K.str=K._=K.nil=K._Code=K.Name=K.IDENTIFIER=K._CodeOrName=void 0;var Sn=class{};K._CodeOrName=Sn;K.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ur=class extends Sn{constructor(t){if(super(),!K.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};K.Name=ur;var nt=class extends Sn{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof ur&&(r[n.str]=(r[n.str]||0)+1),r),{})}};K._Code=nt;K.nil=new nt("");function Td(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Ya(r,t[n]),r.push(e[++n]);return new nt(r)}K._=Td;var Ka=new nt("+");function Ld(e,...t){let r=[Dn(e[0])],n=0;for(;n<t.length;)r.push(Ka),Ya(r,t[n]),r.push(Ka,Dn(e[++n]));return dy(r),new nt(r)}K.str=Ld;function Ya(e,t){t instanceof nt?e.push(...t._items):t instanceof ur?e.push(t):e.push(fy(t))}K.addCodeArg=Ya;function dy(e){let t=1;for(;t<e.length-1;){if(e[t]===Ka){let r=py(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function py(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof ur||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof ur))return`"${e}${t.slice(1)}`}function uy(e,t){return t.emptyStr()?e:e.emptyStr()?t:Ld`${e}${t}`}K.strConcat=uy;function fy(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Dn(Array.isArray(e)?e.join(","):e)}function my(e){return new nt(Dn(e))}K.stringify=my;function Dn(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}K.safeStringify=Dn;function gy(e){return typeof e=="string"&&K.IDENTIFIER.test(e)?new nt(`.${e}`):Td`[${e}]`}K.getProperty=gy;function hy(e){if(typeof e=="string"&&K.IDENTIFIER.test(e))return new nt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}K.getEsmExportName=hy;function yy(e){return new nt(e.toString())}K.regexpCode=yy});var Za=E(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.ValueScope=Je.ValueScopeName=Je.Scope=Je.varKinds=Je.UsedValueState=void 0;var ze=jn(),Ha=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Ko;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Ko||(Je.UsedValueState=Ko={}));Je.varKinds={const:new ze.Name("const"),let:new ze.Name("let"),var:new ze.Name("var")};var Yo=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof ze.Name?t:this.name(t)}name(t){return new ze.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Je.Scope=Yo;var Ho=class extends ze.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,ze._)`.${new ze.Name(r)}[${n}]`}};Je.ValueScopeName=Ho;var wy=(0,ze._)`\n`,Xa=class extends Yo{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?wy:ze.nil}}get(){return this._scope}name(t){return new Ho(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,a=(n=r.key)!==null&&n!==void 0?n:r.ref,s=this._values[i];if(s){let d=s.get(a);if(d)return d}else s=this._values[i]=new Map;s.set(a,o);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,o.setValue(r,{property:i,itemIndex:l}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ze._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=ze.nil;for(let a in t){let s=t[a];if(!s)continue;let c=n[a]=n[a]||new Map;s.forEach(l=>{if(c.has(l))return;c.set(l,Ko.Started);let d=r(l);if(d){let p=this.opts.es5?Je.varKinds.var:Je.varKinds.const;i=(0,ze._)`${i}${p} ${l} = ${d};${this.opts._n}`}else if(d=o?.(l))i=(0,ze._)`${i}${d}${this.opts._n}`;else throw new Ha(l);c.set(l,Ko.Completed)})}return i}};Je.ValueScope=Xa});var x=E(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.or=U.and=U.not=U.CodeGen=U.operators=U.varKinds=U.ValueScopeName=U.ValueScope=U.Scope=U.Name=U.regexpCode=U.stringify=U.getProperty=U.nil=U.strConcat=U.str=U._=void 0;var B=jn(),mt=Za(),Wt=jn();Object.defineProperty(U,"_",{enumerable:!0,get:function(){return Wt._}});Object.defineProperty(U,"str",{enumerable:!0,get:function(){return Wt.str}});Object.defineProperty(U,"strConcat",{enumerable:!0,get:function(){return Wt.strConcat}});Object.defineProperty(U,"nil",{enumerable:!0,get:function(){return Wt.nil}});Object.defineProperty(U,"getProperty",{enumerable:!0,get:function(){return Wt.getProperty}});Object.defineProperty(U,"stringify",{enumerable:!0,get:function(){return Wt.stringify}});Object.defineProperty(U,"regexpCode",{enumerable:!0,get:function(){return Wt.regexpCode}});Object.defineProperty(U,"Name",{enumerable:!0,get:function(){return Wt.Name}});var ei=Za();Object.defineProperty(U,"Scope",{enumerable:!0,get:function(){return ei.Scope}});Object.defineProperty(U,"ValueScope",{enumerable:!0,get:function(){return ei.ValueScope}});Object.defineProperty(U,"ValueScopeName",{enumerable:!0,get:function(){return ei.ValueScopeName}});Object.defineProperty(U,"varKinds",{enumerable:!0,get:function(){return ei.varKinds}});U.operators={GT:new B._Code(">"),GTE:new B._Code(">="),LT:new B._Code("<"),LTE:new B._Code("<="),EQ:new B._Code("==="),NEQ:new B._Code("!=="),NOT:new B._Code("!"),OR:new B._Code("||"),AND:new B._Code("&&"),ADD:new B._Code("+")};var $t=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},Qa=class extends $t{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?mt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Hr(this.rhs,t,r)),this}get names(){return this.rhs instanceof B._CodeOrName?this.rhs.names:{}}},Xo=class extends $t{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof B.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Hr(this.rhs,t,r),this}get names(){let t=this.lhs instanceof B.Name?{}:{...this.lhs.names};return Qo(t,this.rhs)}},es=class extends Xo{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},ts=class extends $t{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},rs=class extends $t{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},ns=class extends $t{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},os=class extends $t{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Hr(this.code,t,r),this}get names(){return this.code instanceof B._CodeOrName?this.code.names:{}}},$n=class extends $t{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(Iy(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>gr(t,r.names),{})}},Ct=class extends $n{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},is=class extends $n{},Yr=class extends Ct{};Yr.kind="else";var fr=class e extends Ct{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Yr(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(xd(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Hr(this.condition,t,r),this}get names(){let t=super.names;return Qo(t,this.condition),this.else&&gr(t,this.else.names),t}};fr.kind="if";var mr=class extends Ct{};mr.kind="for";var as=class extends mr{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Hr(this.iteration,t,r),this}get names(){return gr(super.names,this.iteration.names)}},ss=class extends mr{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?mt.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=Qo(super.names,this.from);return Qo(t,this.to)}},Zo=class extends mr{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Hr(this.iterable,t,r),this}get names(){return gr(super.names,this.iterable.names)}},Cn=class extends Ct{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Cn.kind="func";var Tn=class extends $n{render(t){return"return "+super.render(t)}};Tn.kind="return";var cs=class extends Ct{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&gr(t,this.catch.names),this.finally&&gr(t,this.finally.names),t}},Ln=class extends Ct{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Ln.kind="catch";var xn=class extends Ct{render(t){return"finally"+super.render(t)}};xn.kind="finally";var ls=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
1
|
+
import{a as E,b as Kr,c as On,d as Od,e as T,f as Sd,g as Dd,h as jd,i as $d,j as Cd}from"./chunk.js";var jn=E(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.regexpCode=K.getEsmExportName=K.getProperty=K.safeStringify=K.stringify=K.strConcat=K.addCodeArg=K.str=K._=K.nil=K._Code=K.Name=K.IDENTIFIER=K._CodeOrName=void 0;var Sn=class{};K._CodeOrName=Sn;K.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ur=class extends Sn{constructor(t){if(super(),!K.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};K.Name=ur;var nt=class extends Sn{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof ur&&(r[n.str]=(r[n.str]||0)+1),r),{})}};K._Code=nt;K.nil=new nt("");function Td(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Ya(r,t[n]),r.push(e[++n]);return new nt(r)}K._=Td;var Ka=new nt("+");function Ld(e,...t){let r=[Dn(e[0])],n=0;for(;n<t.length;)r.push(Ka),Ya(r,t[n]),r.push(Ka,Dn(e[++n]));return dy(r),new nt(r)}K.str=Ld;function Ya(e,t){t instanceof nt?e.push(...t._items):t instanceof ur?e.push(t):e.push(fy(t))}K.addCodeArg=Ya;function dy(e){let t=1;for(;t<e.length-1;){if(e[t]===Ka){let r=py(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function py(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof ur||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof ur))return`"${e}${t.slice(1)}`}function uy(e,t){return t.emptyStr()?e:e.emptyStr()?t:Ld`${e}${t}`}K.strConcat=uy;function fy(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Dn(Array.isArray(e)?e.join(","):e)}function my(e){return new nt(Dn(e))}K.stringify=my;function Dn(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}K.safeStringify=Dn;function gy(e){return typeof e=="string"&&K.IDENTIFIER.test(e)?new nt(`.${e}`):Td`[${e}]`}K.getProperty=gy;function hy(e){if(typeof e=="string"&&K.IDENTIFIER.test(e))return new nt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}K.getEsmExportName=hy;function yy(e){return new nt(e.toString())}K.regexpCode=yy});var Za=E(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ValueScope=Ge.ValueScopeName=Ge.Scope=Ge.varKinds=Ge.UsedValueState=void 0;var Je=jn(),Ha=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Ko;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Ko||(Ge.UsedValueState=Ko={}));Ge.varKinds={const:new Je.Name("const"),let:new Je.Name("let"),var:new Je.Name("var")};var Yo=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Je.Name?t:this.name(t)}name(t){return new Je.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Ge.Scope=Yo;var Ho=class extends Je.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Je._)`.${new Je.Name(r)}[${n}]`}};Ge.ValueScopeName=Ho;var wy=(0,Je._)`\n`,Xa=class extends Yo{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?wy:Je.nil}}get(){return this._scope}name(t){return new Ho(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,a=(n=r.key)!==null&&n!==void 0?n:r.ref,s=this._values[i];if(s){let d=s.get(a);if(d)return d}else s=this._values[i]=new Map;s.set(a,o);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,o.setValue(r,{property:i,itemIndex:l}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Je._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=Je.nil;for(let a in t){let s=t[a];if(!s)continue;let c=n[a]=n[a]||new Map;s.forEach(l=>{if(c.has(l))return;c.set(l,Ko.Started);let d=r(l);if(d){let p=this.opts.es5?Ge.varKinds.var:Ge.varKinds.const;i=(0,Je._)`${i}${p} ${l} = ${d};${this.opts._n}`}else if(d=o?.(l))i=(0,Je._)`${i}${d}${this.opts._n}`;else throw new Ha(l);c.set(l,Ko.Completed)})}return i}};Ge.ValueScope=Xa});var x=E(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.or=U.and=U.not=U.CodeGen=U.operators=U.varKinds=U.ValueScopeName=U.ValueScope=U.Scope=U.Name=U.regexpCode=U.stringify=U.getProperty=U.nil=U.strConcat=U.str=U._=void 0;var B=jn(),mt=Za(),Wt=jn();Object.defineProperty(U,"_",{enumerable:!0,get:function(){return Wt._}});Object.defineProperty(U,"str",{enumerable:!0,get:function(){return Wt.str}});Object.defineProperty(U,"strConcat",{enumerable:!0,get:function(){return Wt.strConcat}});Object.defineProperty(U,"nil",{enumerable:!0,get:function(){return Wt.nil}});Object.defineProperty(U,"getProperty",{enumerable:!0,get:function(){return Wt.getProperty}});Object.defineProperty(U,"stringify",{enumerable:!0,get:function(){return Wt.stringify}});Object.defineProperty(U,"regexpCode",{enumerable:!0,get:function(){return Wt.regexpCode}});Object.defineProperty(U,"Name",{enumerable:!0,get:function(){return Wt.Name}});var ei=Za();Object.defineProperty(U,"Scope",{enumerable:!0,get:function(){return ei.Scope}});Object.defineProperty(U,"ValueScope",{enumerable:!0,get:function(){return ei.ValueScope}});Object.defineProperty(U,"ValueScopeName",{enumerable:!0,get:function(){return ei.ValueScopeName}});Object.defineProperty(U,"varKinds",{enumerable:!0,get:function(){return ei.varKinds}});U.operators={GT:new B._Code(">"),GTE:new B._Code(">="),LT:new B._Code("<"),LTE:new B._Code("<="),EQ:new B._Code("==="),NEQ:new B._Code("!=="),NOT:new B._Code("!"),OR:new B._Code("||"),AND:new B._Code("&&"),ADD:new B._Code("+")};var $t=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},Qa=class extends $t{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?mt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Hr(this.rhs,t,r)),this}get names(){return this.rhs instanceof B._CodeOrName?this.rhs.names:{}}},Xo=class extends $t{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof B.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Hr(this.rhs,t,r),this}get names(){let t=this.lhs instanceof B.Name?{}:{...this.lhs.names};return Qo(t,this.rhs)}},es=class extends Xo{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},ts=class extends $t{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},rs=class extends $t{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},ns=class extends $t{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},os=class extends $t{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Hr(this.code,t,r),this}get names(){return this.code instanceof B._CodeOrName?this.code.names:{}}},$n=class extends $t{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(Iy(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>gr(t,r.names),{})}},Ct=class extends $n{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},is=class extends $n{},Yr=class extends Ct{};Yr.kind="else";var fr=class e extends Ct{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Yr(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(xd(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Hr(this.condition,t,r),this}get names(){let t=super.names;return Qo(t,this.condition),this.else&&gr(t,this.else.names),t}};fr.kind="if";var mr=class extends Ct{};mr.kind="for";var as=class extends mr{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Hr(this.iteration,t,r),this}get names(){return gr(super.names,this.iteration.names)}},ss=class extends mr{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?mt.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=Qo(super.names,this.from);return Qo(t,this.to)}},Zo=class extends mr{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Hr(this.iterable,t,r),this}get names(){return gr(super.names,this.iterable.names)}},Cn=class extends Ct{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Cn.kind="func";var Tn=class extends $n{render(t){return"return "+super.render(t)}};Tn.kind="return";var cs=class extends Ct{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&gr(t,this.catch.names),this.finally&&gr(t,this.finally.names),t}},Ln=class extends Ct{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Ln.kind="catch";var xn=class extends Ct{render(t){return"finally"+super.render(t)}};xn.kind="finally";var ls=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
2
2
|
`:""},this._extScope=t,this._scope=new mt.Scope({parent:t}),this._nodes=[new is]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new Qa(t,i,n)),i}const(t,r,n){return this._def(mt.varKinds.const,t,r,n)}let(t,r,n){return this._def(mt.varKinds.let,t,r,n)}var(t,r,n){return this._def(mt.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Xo(t,r,n))}add(t,r){return this._leafNode(new es(t,U.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==B.nil&&this._leafNode(new os(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,B.addCodeArg)(r,o));return r.push("}"),new B._Code(r)}if(t,r,n){if(this._blockNode(new fr(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new fr(t))}else(){return this._elseNode(new Yr)}endIf(){return this._endBlockNode(fr,Yr)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new as(t),r)}forRange(t,r,n,o,i=this.opts.es5?mt.varKinds.var:mt.varKinds.let){let a=this._scope.toName(t);return this._for(new ss(i,a,r,n),()=>o(a))}forOf(t,r,n,o=mt.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let a=r instanceof B.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,B._)`${a}.length`,s=>{this.var(i,(0,B._)`${a}[${s}]`),n(i)})}return this._for(new Zo("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?mt.varKinds.var:mt.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,B._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new Zo("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(mr)}label(t){return this._leafNode(new ts(t))}break(t){return this._leafNode(new rs(t))}return(t){let r=new Tn;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Tn)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new cs;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Ln(i),r(i)}return n&&(this._currNode=o.finally=new xn,this.code(n)),this._endBlockNode(Ln,xn)}throw(t){return this._leafNode(new ns(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=B.nil,n,o){return this._blockNode(new Cn(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Cn)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof fr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};U.CodeGen=ls;function gr(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Qo(e,t){return t instanceof B._CodeOrName?gr(e,t.names):e}function Hr(e,t,r){if(e instanceof B.Name)return n(e);if(!o(e))return e;return new B._Code(e._items.reduce((i,a)=>(a instanceof B.Name&&(a=n(a)),a instanceof B._Code?i.push(...a._items):i.push(a),i),[]));function n(i){let a=r[i.str];return a===void 0||t[i.str]!==1?i:(delete t[i.str],a)}function o(i){return i instanceof B._Code&&i._items.some(a=>a instanceof B.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function Iy(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function xd(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,B._)`!${ds(e)}`}U.not=xd;var vy=Vd(U.operators.AND);function by(...e){return e.reduce(vy)}U.and=by;var ky=Vd(U.operators.OR);function Ry(...e){return e.reduce(ky)}U.or=Ry;function Vd(e){return(t,r)=>t===B.nil?r:r===B.nil?t:(0,B._)`${ds(t)} ${e} ${ds(r)}`}function ds(e){return e instanceof B.Name?e:(0,B._)`(${e})`}});var q=E(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.checkStrictMode=F.getErrorPath=F.Type=F.useFunc=F.setEvaluated=F.evaluatedPropsToName=F.mergeEvaluated=F.eachItem=F.unescapeJsonPointer=F.escapeJsonPointer=F.escapeFragment=F.unescapeFragment=F.schemaRefOrVal=F.schemaHasRulesButRef=F.schemaHasRules=F.checkUnknownRules=F.alwaysValidSchema=F.toHash=void 0;var ne=x(),_y=jn();function Ay(e){let t={};for(let r of e)t[r]=!0;return t}F.toHash=Ay;function Ey(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Fd(e,t),!qd(t,e.self.RULES.all))}F.alwaysValidSchema=Ey;function Fd(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||Jd(e,`unknown keyword: "${i}"`)}F.checkUnknownRules=Fd;function qd(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}F.schemaHasRules=qd;function Py(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}F.schemaHasRulesButRef=Py;function Ny({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ne._)`${r}`}return(0,ne._)`${e}${t}${(0,ne.getProperty)(n)}`}F.schemaRefOrVal=Ny;function Oy(e){return Bd(decodeURIComponent(e))}F.unescapeFragment=Oy;function Sy(e){return encodeURIComponent(us(e))}F.escapeFragment=Sy;function us(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}F.escapeJsonPointer=us;function Bd(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}F.unescapeJsonPointer=Bd;function Dy(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}F.eachItem=Dy;function Md({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,a,s)=>{let c=a===void 0?i:a instanceof ne.Name?(i instanceof ne.Name?e(o,i,a):t(o,i,a),a):i instanceof ne.Name?(t(o,a,i),i):r(i,a);return s===ne.Name&&!(c instanceof ne.Name)?n(o,c):c}}F.mergeEvaluated={props:Md({mergeNames:(e,t,r)=>e.if((0,ne._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,ne._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,ne._)`${r} || {}`).code((0,ne._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,ne._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,ne._)`${r} || {}`),fs(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:zd}),items:Md({mergeNames:(e,t,r)=>e.if((0,ne._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,ne._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,ne._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,ne._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function zd(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,ne._)`{}`);return t!==void 0&&fs(e,r,t),r}F.evaluatedPropsToName=zd;function fs(e,t,r){Object.keys(r).forEach(n=>e.assign((0,ne._)`${t}${(0,ne.getProperty)(n)}`,!0))}F.setEvaluated=fs;var Ud={};function jy(e,t){return e.scopeValue("func",{ref:t,code:Ud[t.code]||(Ud[t.code]=new _y._Code(t.code))})}F.useFunc=jy;var ps;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ps||(F.Type=ps={}));function $y(e,t,r){if(e instanceof ne.Name){let n=t===ps.Num;return r?n?(0,ne._)`"[" + ${e} + "]"`:(0,ne._)`"['" + ${e} + "']"`:n?(0,ne._)`"/" + ${e}`:(0,ne._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ne.getProperty)(e).toString():"/"+us(e)}F.getErrorPath=$y;function Jd(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}F.checkStrictMode=Jd});var ot=E(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var $e=x(),Cy={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")};ms.default=Cy});var Vn=E(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.extendErrors=Ce.resetErrorsCount=Ce.reportExtraError=Ce.reportError=Ce.keyword$DataError=Ce.keywordError=void 0;var G=x(),ti=q(),Ue=ot();Ce.keywordError={message:({keyword:e})=>(0,G.str)`must pass "${e}" keyword validation`};Ce.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,G.str)`"${e}" keyword must be ${t} ($data)`:(0,G.str)`"${e}" keyword is invalid ($data)`};function Ty(e,t=Ce.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:a,allErrors:s}=o,c=Kd(e,t,r);n??(a||s)?Gd(i,c):Wd(o,(0,G._)`[${c}]`)}Ce.reportError=Ty;function Ly(e,t=Ce.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:a}=n,s=Kd(e,t,r);Gd(o,s),i||a||Wd(n,Ue.default.vErrors)}Ce.reportExtraError=Ly;function xy(e,t){e.assign(Ue.default.errors,t),e.if((0,G._)`${Ue.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,G._)`${Ue.default.vErrors}.length`,t),()=>e.assign(Ue.default.vErrors,null)))}Ce.resetErrorsCount=xy;function Vy({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",o,Ue.default.errors,s=>{e.const(a,(0,G._)`${Ue.default.vErrors}[${s}]`),e.if((0,G._)`${a}.instancePath === undefined`,()=>e.assign((0,G._)`${a}.instancePath`,(0,G.strConcat)(Ue.default.instancePath,i.errorPath))),e.assign((0,G._)`${a}.schemaPath`,(0,G.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,G._)`${a}.schema`,r),e.assign((0,G._)`${a}.data`,n))})}Ce.extendErrors=Vy;function Gd(e,t){let r=e.const("err",t);e.if((0,G._)`${Ue.default.vErrors} === null`,()=>e.assign(Ue.default.vErrors,(0,G._)`[${r}]`),(0,G._)`${Ue.default.vErrors}.push(${r})`),e.code((0,G._)`${Ue.default.errors}++`)}function Wd(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,G._)`new ${e.ValidationError}(${t})`):(r.assign((0,G._)`${n}.errors`,t),r.return(!1))}var hr={keyword:new G.Name("keyword"),schemaPath:new G.Name("schemaPath"),params:new G.Name("params"),propertyName:new G.Name("propertyName"),message:new G.Name("message"),schema:new G.Name("schema"),parentSchema:new G.Name("parentSchema")};function Kd(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,G._)`{}`:My(e,t,r)}function My(e,t,r={}){let{gen:n,it:o}=e,i=[Uy(o,r),Fy(e,r)];return qy(e,t,i),n.object(...i)}function Uy({errorPath:e},{instancePath:t}){let r=t?(0,G.str)`${e}${(0,ti.getErrorPath)(t,ti.Type.Str)}`:e;return[Ue.default.instancePath,(0,G.strConcat)(Ue.default.instancePath,r)]}function Fy({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,G.str)`${t}/${e}`;return r&&(o=(0,G.str)`${o}${(0,ti.getErrorPath)(r,ti.Type.Str)}`),[hr.schemaPath,o]}function qy(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:a,it:s}=e,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:p}=s;n.push([hr.keyword,o],[hr.params,typeof t=="function"?t(e):t||(0,G._)`{}`]),c.messages&&n.push([hr.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([hr.schema,a],[hr.parentSchema,(0,G._)`${d}${p}`],[Ue.default.data,i]),l&&n.push([hr.propertyName,l])}});var Hd=E(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.boolOrEmptySchema=Xr.topBoolOrEmptySchema=void 0;var By=Vn(),zy=x(),Jy=ot(),Gy={message:"boolean schema is false"};function Wy(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Yd(e,!1):typeof r=="object"&&r.$async===!0?t.return(Jy.default.data):(t.assign((0,zy._)`${n}.errors`,null),t.return(!0))}Xr.topBoolOrEmptySchema=Wy;function Ky(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Yd(e)):r.var(t,!0)}Xr.boolOrEmptySchema=Ky;function Yd(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,By.reportError)(o,Gy,void 0,t)}});var gs=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.getRules=Zr.isJSONType=void 0;var Yy=["string","number","integer","boolean","null","object","array"],Hy=new Set(Yy);function Xy(e){return typeof e=="string"&&Hy.has(e)}Zr.isJSONType=Xy;function Zy(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Zr.getRules=Zy});var hs=E(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.shouldUseRule=Kt.shouldUseGroup=Kt.schemaHasRulesForType=void 0;function Qy({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Xd(e,n)}Kt.schemaHasRulesForType=Qy;function Xd(e,t){return t.rules.some(r=>Zd(e,r))}Kt.shouldUseGroup=Xd;function Zd(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Kt.shouldUseRule=Zd});var Mn=E(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.reportTypeError=Te.checkDataTypes=Te.checkDataType=Te.coerceAndCheckDataType=Te.getJSONTypes=Te.getSchemaTypes=Te.DataType=void 0;var ew=gs(),tw=hs(),rw=Vn(),V=x(),Qd=q(),Qr;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Qr||(Te.DataType=Qr={}));function nw(e){let t=ep(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Te.getSchemaTypes=nw;function ep(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(ew.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Te.getJSONTypes=ep;function ow(e,t){let{gen:r,data:n,opts:o}=e,i=iw(t,o.coerceTypes),a=t.length>0&&!(i.length===0&&t.length===1&&(0,tw.schemaHasRulesForType)(e,t[0]));if(a){let s=ws(t,n,o.strictNumbers,Qr.Wrong);r.if(s,()=>{i.length?aw(e,t,i):Is(e)})}return a}Te.coerceAndCheckDataType=ow;var tp=new Set(["string","number","integer","boolean","null"]);function iw(e,t){return t?e.filter(r=>tp.has(r)||t==="array"&&r==="array"):[]}function aw(e,t,r){let{gen:n,data:o,opts:i}=e,a=n.let("dataType",(0,V._)`typeof ${o}`),s=n.let("coerced",(0,V._)`undefined`);i.coerceTypes==="array"&&n.if((0,V._)`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,V._)`${o}[0]`).assign(a,(0,V._)`typeof ${o}`).if(ws(t,o,i.strictNumbers),()=>n.assign(s,o))),n.if((0,V._)`${s} !== undefined`);for(let l of r)(tp.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),Is(e),n.endIf(),n.if((0,V._)`${s} !== undefined`,()=>{n.assign(o,s),sw(e,s)});function c(l){switch(l){case"string":n.elseIf((0,V._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,V._)`"" + ${o}`).elseIf((0,V._)`${o} === null`).assign(s,(0,V._)`""`);return;case"number":n.elseIf((0,V._)`${a} == "boolean" || ${o} === null
|
|
3
3
|
|| (${a} == "string" && ${o} && ${o} == +${o})`).assign(s,(0,V._)`+${o}`);return;case"integer":n.elseIf((0,V._)`${a} === "boolean" || ${o} === null
|
|
4
4
|
|| (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(s,(0,V._)`+${o}`);return;case"boolean":n.elseIf((0,V._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(s,!1).elseIf((0,V._)`${o} === "true" || ${o} === 1`).assign(s,!0);return;case"null":n.elseIf((0,V._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(s,null);return;case"array":n.elseIf((0,V._)`${a} === "string" || ${a} === "number"
|
|
5
|
-
|| ${a} === "boolean" || ${o} === null`).assign(s,(0,V._)`[${o}]`)}}}function sw({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,V._)`${t} !== undefined`,()=>e.assign((0,V._)`${t}[${r}]`,n))}function ys(e,t,r,n=Qr.Correct){let o=n===Qr.Correct?V.operators.EQ:V.operators.NEQ,i;switch(e){case"null":return(0,V._)`${t} ${o} null`;case"array":i=(0,V._)`Array.isArray(${t})`;break;case"object":i=(0,V._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a((0,V._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return(0,V._)`typeof ${t} ${o} ${e}`}return n===Qr.Correct?i:(0,V.not)(i);function a(s=V.nil){return(0,V.and)((0,V._)`typeof ${t} == "number"`,s,r?(0,V._)`isFinite(${t})`:V.nil)}}Te.checkDataType=ys;function ws(e,t,r,n){if(e.length===1)return ys(e[0],t,r,n);let o,i=(0,Qd.toHash)(e);if(i.array&&i.object){let a=(0,V._)`typeof ${t} != "object"`;o=i.null?a:(0,V._)`!${t} || ${a}`,delete i.null,delete i.array,delete i.object}else o=V.nil;i.number&&delete i.integer;for(let a in i)o=(0,V.and)(o,ys(a,t,r,n));return o}Te.checkDataTypes=ws;var cw={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,V._)`{type: ${e}}`:(0,V._)`{type: ${t}}`};function Is(e){let t=lw(e);(0,rw.reportError)(t,cw)}Te.reportTypeError=Is;function lw(e){let{gen:t,data:r,schema:n}=e,o=(0,Qd.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var np=E(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.assignDefaults=void 0;var en=x(),dw=q();function pw(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)rp(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>rp(e,i,o.default))}ri.assignDefaults=pw;function rp(e,t,r){let{gen:n,compositeRule:o,data:i,opts:a}=e;if(r===void 0)return;let s=(0,en._)`${i}${(0,en.getProperty)(t)}`;if(o){(0,dw.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,en._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,en._)`${c} || ${s} === null || ${s} === ""`),n.if(c,(0,en._)`${s} = ${(0,en.stringify)(r)}`)}});var it=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.validateUnion=te.validateArray=te.usePattern=te.callValidateCode=te.schemaProperties=te.allSchemaProperties=te.noPropertyInData=te.propertyInData=te.isOwnProperty=te.hasPropFunc=te.reportMissingProp=te.checkMissingProp=te.checkReportMissingProp=void 0;var de=x(),vs=q(),Yt=ot(),uw=q();function fw(e,t){let{gen:r,data:n,it:o}=e;r.if(ks(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,de._)`${t}`},!0),e.error()})}te.checkReportMissingProp=fw;function mw({gen:e,data:t,it:{opts:r}},n,o){return(0,de.or)(...n.map(i=>(0,de.and)(ks(e,t,i,r.ownProperties),(0,de._)`${o} = ${i}`)))}te.checkMissingProp=mw;function gw(e,t){e.setParams({missingProperty:t},!0),e.error()}te.reportMissingProp=gw;function op(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,de._)`Object.prototype.hasOwnProperty`})}te.hasPropFunc=op;function bs(e,t,r){return(0,de._)`${op(e)}.call(${t}, ${r})`}te.isOwnProperty=bs;function hw(e,t,r,n){let o=(0,de._)`${t}${(0,de.getProperty)(r)} !== undefined`;return n?(0,de._)`${o} && ${bs(e,t,r)}`:o}te.propertyInData=hw;function ks(e,t,r,n){let o=(0,de._)`${t}${(0,de.getProperty)(r)} === undefined`;return n?(0,de.or)(o,(0,de.not)(bs(e,t,r))):o}te.noPropertyInData=ks;function ip(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}te.allSchemaProperties=ip;function yw(e,t){return ip(t).filter(r=>!(0,vs.alwaysValidSchema)(e,t[r]))}te.schemaProperties=yw;function ww({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:a},s,c,l){let d=l?(0,de._)`${e}, ${t}, ${n}${o}`:t,p=[[Yt.default.instancePath,(0,de.strConcat)(Yt.default.instancePath,i)],[Yt.default.parentData,a.parentData],[Yt.default.parentDataProperty,a.parentDataProperty],[Yt.default.rootData,Yt.default.rootData]];a.opts.dynamicRef&&p.push([Yt.default.dynamicAnchors,Yt.default.dynamicAnchors]);let f=(0,de._)`${d}, ${r.object(...p)}`;return c!==de.nil?(0,de._)`${s}.call(${c}, ${f})`:(0,de._)`${s}(${f})`}te.callValidateCode=ww;var Iw=(0,de._)`new RegExp`;function vw({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,de._)`${o.code==="new RegExp"?Iw:(0,uw.useFunc)(e,o)}(${r}, ${n})`})}te.usePattern=vw;function bw(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let s=t.let("valid",!0);return a(()=>t.assign(s,!1)),s}return t.var(i,!0),a(()=>t.break()),i;function a(s){let c=t.const("len",(0,de._)`${r}.length`);t.forRange("i",0,c,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:vs.Type.Num},i),t.if((0,de.not)(i),s)})}}te.validateArray=bw;function kw(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,vs.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let d=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},s);t.assign(a,(0,de._)`${a} || ${s}`),e.mergeValidEvaluated(d,s)||t.if((0,de.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}te.validateUnion=kw});var cp=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.validateKeywordUsage=Et.validSchemaType=Et.funcKeywordCode=Et.macroKeywordCode=void 0;var Fe=x(),yr=ot(),Rw=it(),_w=Vn();function Aw(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:a}=e,s=t.macro.call(a.self,o,i,a),c=sp(r,n,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let l=r.name("valid");e.subschema({schema:s,schemaPath:Fe.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}Et.macroKeywordCode=Aw;function Ew(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:a,$data:s,it:c}=e;Nw(c,t);let l=!s&&t.compile?t.compile.call(c.self,i,a,c):t.validate,d=sp(n,o,l),p=n.let("valid");e.block$data(p,f),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function f(){if(t.errors===!1)g(),t.modifying&&ap(e),h(()=>e.error());else{let w=t.async?u():m();t.modifying&&ap(e),h(()=>Pw(e,w))}}function u(){let w=n.let("ruleErrs",null);return n.try(()=>g((0,Fe._)`await `),_=>n.assign(p,!1).if((0,Fe._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(w,(0,Fe._)`${_}.errors`),()=>n.throw(_))),w}function m(){let w=(0,Fe._)`${d}.errors`;return n.assign(w,null),g(Fe.nil),w}function g(w=t.async?(0,Fe._)`await `:Fe.nil){let _=c.opts.passContext?yr.default.this:yr.default.self,b=!("compile"in t&&!s||t.schema===!1);n.assign(p,(0,Fe._)`${w}${(0,Rw.callValidateCode)(e,d,_,b)}`,t.modifying)}function h(w){var _;n.if((0,Fe.not)((_=t.valid)!==null&&_!==void 0?_:p),w)}}Et.funcKeywordCode=Ew;function ap(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Fe._)`${n.parentData}[${n.parentDataProperty}]`))}function Pw(e,t){let{gen:r}=e;r.if((0,Fe._)`Array.isArray(${t})`,()=>{r.assign(yr.default.vErrors,(0,Fe._)`${yr.default.vErrors} === null ? ${t} : ${yr.default.vErrors}.concat(${t})`).assign(yr.default.errors,(0,Fe._)`${yr.default.vErrors}.length`),(0,_w.extendErrors)(e)},()=>e.error())}function Nw({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function sp(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Fe.stringify)(r)})}function Ow(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Et.validSchemaType=Ow;function Sw({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let a=o.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Et.validateKeywordUsage=Sw});var dp=E(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.extendSubschemaMode=Ht.extendSubschemaData=Ht.getSubschema=void 0;var Pt=x(),lp=q();function Dw(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return r===void 0?{schema:s,schemaPath:(0,Pt._)`${e.schemaPath}${(0,Pt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:(0,Pt._)`${e.schemaPath}${(0,Pt.getProperty)(t)}${(0,Pt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,lp.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ht.getSubschema=Dw;function jw(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:a}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(r!==void 0){let{errorPath:l,dataPathArr:d,opts:p}=t,f=s.let("data",(0,Pt._)`${t.data}${(0,Pt.getProperty)(r)}`,!0);c(f),e.errorPath=(0,Pt.str)`${l}${(0,lp.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Pt._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(o!==void 0){let l=o instanceof Pt.Name?o:s.let("data",o,!0);c(l),a!==void 0&&(e.propertyName=a)}i&&(e.dataTypes=i);function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}Ht.extendSubschemaData=jw;function $w(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Ht.extendSubschemaMode=$w});var Rs=E((hN,pp)=>{"use strict";pp.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var a=i[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var fp=E((yN,up)=>{"use strict";var Xt=up.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};ni(t,n,o,e,"",e)};Xt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Xt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Xt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Xt.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 ni(e,t,r,n,o,i,a,s,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,a,s,c,l);for(var d in n){var p=n[d];if(Array.isArray(p)){if(d in Xt.arrayKeywords)for(var f=0;f<p.length;f++)ni(e,t,r,p[f],o+"/"+d+"/"+f,i,o,d,n,f)}else if(d in Xt.propsKeywords){if(p&&typeof p=="object")for(var u in p)ni(e,t,r,p[u],o+"/"+d+"/"+Cw(u),i,o,d,n,u)}else(d in Xt.keywords||e.allKeys&&!(d in Xt.skipKeywords))&&ni(e,t,r,p,o+"/"+d,i,o,d,n)}r(n,o,i,a,s,c,l)}}function Cw(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Un=E(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.getSchemaRefs=Ge.resolveUrl=Ge.normalizeId=Ge._getFullPath=Ge.getFullPath=Ge.inlineRef=void 0;var Tw=q(),Lw=Rs(),xw=fp(),Vw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Mw(e,t=!0){return typeof e=="boolean"?!0:t===!0?!_s(e):t?mp(e)<=t:!1}Ge.inlineRef=Mw;var Uw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _s(e){for(let t in e){if(Uw.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(_s)||typeof r=="object"&&_s(r))return!0}return!1}function mp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Vw.has(r)&&(typeof e[r]=="object"&&(0,Tw.eachItem)(e[r],n=>t+=mp(n)),t===1/0))return 1/0}return t}function gp(e,t="",r){r!==!1&&(t=tn(t));let n=e.parse(t);return hp(e,n)}Ge.getFullPath=gp;function hp(e,t){return e.serialize(t).split("#")[0]+"#"}Ge._getFullPath=hp;var Fw=/#\/?$/;function tn(e){return e?e.replace(Fw,""):""}Ge.normalizeId=tn;function qw(e,t,r){return r=tn(r),e.resolve(t,r)}Ge.resolveUrl=qw;var Bw=/^[a-z_][-a-z0-9._]*$/i;function zw(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=tn(e[r]||t),i={"":o},a=gp(n,o,!1),s={},c=new Set;return xw(e,{allKeys:!0},(p,f,u,m)=>{if(m===void 0)return;let g=a+f,h=i[m];typeof p[r]=="string"&&(h=w.call(this,p[r])),_.call(this,p.$anchor),_.call(this,p.$dynamicAnchor),i[f]=h;function w(b){let A=this.opts.uriResolver.resolve;if(b=tn(h?A(h,b):b),c.has(b))throw d(b);c.add(b);let I=this.refs[b];return typeof I=="string"&&(I=this.refs[I]),typeof I=="object"?l(p,I.schema,b):b!==tn(g)&&(b[0]==="#"?(l(p,s[b],b),s[b]=p):this.refs[b]=g),b}function _(b){if(typeof b=="string"){if(!Bw.test(b))throw new Error(`invalid anchor "${b}"`);w.call(this,`#${b}`)}}}),s;function l(p,f,u){if(f!==void 0&&!Lw(p,f))throw d(u)}function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}}Ge.getSchemaRefs=zw});var Bn=E(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.getData=Zt.KeywordCxt=Zt.validateFunctionCode=void 0;var bp=Hd(),yp=Mn(),Es=hs(),oi=Mn(),Jw=np(),qn=cp(),As=dp(),O=x(),L=ot(),Gw=Un(),Tt=q(),Fn=Vn();function Ww(e){if(_p(e)&&(Ap(e),Rp(e))){Hw(e);return}kp(e,()=>(0,bp.topBoolOrEmptySchema)(e))}Zt.validateFunctionCode=Ww;function kp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,O._)`${L.default.data}, ${L.default.valCxt}`,n.$async,()=>{e.code((0,O._)`"use strict"; ${wp(r,o)}`),Yw(e,o),e.code(i)}):e.func(t,(0,O._)`${L.default.data}, ${Kw(o)}`,n.$async,()=>e.code(wp(r,o)).code(i))}function Kw(e){return(0,O._)`{${L.default.instancePath}="", ${L.default.parentData}, ${L.default.parentDataProperty}, ${L.default.rootData}=${L.default.data}${e.dynamicRef?(0,O._)`, ${L.default.dynamicAnchors}={}`:O.nil}}={}`}function Yw(e,t){e.if(L.default.valCxt,()=>{e.var(L.default.instancePath,(0,O._)`${L.default.valCxt}.${L.default.instancePath}`),e.var(L.default.parentData,(0,O._)`${L.default.valCxt}.${L.default.parentData}`),e.var(L.default.parentDataProperty,(0,O._)`${L.default.valCxt}.${L.default.parentDataProperty}`),e.var(L.default.rootData,(0,O._)`${L.default.valCxt}.${L.default.rootData}`),t.dynamicRef&&e.var(L.default.dynamicAnchors,(0,O._)`${L.default.valCxt}.${L.default.dynamicAnchors}`)},()=>{e.var(L.default.instancePath,(0,O._)`""`),e.var(L.default.parentData,(0,O._)`undefined`),e.var(L.default.parentDataProperty,(0,O._)`undefined`),e.var(L.default.rootData,L.default.data),t.dynamicRef&&e.var(L.default.dynamicAnchors,(0,O._)`{}`)})}function Hw(e){let{schema:t,opts:r,gen:n}=e;kp(e,()=>{r.$comment&&t.$comment&&Pp(e),tI(e),n.let(L.default.vErrors,null),n.let(L.default.errors,0),r.unevaluated&&Xw(e),Ep(e),oI(e)})}function Xw(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,O._)`${r}.evaluated`),t.if((0,O._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,O._)`${e.evaluated}.props`,(0,O._)`undefined`)),t.if((0,O._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,O._)`${e.evaluated}.items`,(0,O._)`undefined`))}function wp(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}function Zw(e,t){if(_p(e)&&(Ap(e),Rp(e))){Qw(e,t);return}(0,bp.boolOrEmptySchema)(e,t)}function Rp({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function _p(e){return typeof e.schema!="boolean"}function Qw(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&Pp(e),rI(e),nI(e);let i=n.const("_errs",L.default.errors);Ep(e,i),n.var(t,(0,O._)`${i} === ${L.default.errors}`)}function Ap(e){(0,Tt.checkUnknownRules)(e),eI(e)}function Ep(e,t){if(e.opts.jtd)return Ip(e,[],!1,t);let r=(0,yp.getSchemaTypes)(e.schema),n=(0,yp.coerceAndCheckDataType)(e,r);Ip(e,r,!n,t)}function eI(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Tt.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function tI(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Tt.checkStrictMode)(e,"default is ignored in the schema root")}function rI(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Gw.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function nI(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Pp({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,O._)`${L.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let a=(0,O.str)`${n}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,O._)`${L.default.self}.opts.$comment(${i}, ${a}, ${s}.schema)`)}}function oI(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,O._)`${L.default.errors} === 0`,()=>t.return(L.default.data),()=>t.throw((0,O._)`new ${o}(${L.default.vErrors})`)):(t.assign((0,O._)`${n}.errors`,L.default.vErrors),i.unevaluated&&iI(e),t.return((0,O._)`${L.default.errors} === 0`))}function iI({gen:e,evaluated:t,props:r,items:n}){r instanceof O.Name&&e.assign((0,O._)`${t}.props`,r),n instanceof O.Name&&e.assign((0,O._)`${t}.items`,n)}function Ip(e,t,r,n){let{gen:o,schema:i,data:a,allErrors:s,opts:c,self:l}=e,{RULES:d}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Tt.schemaHasRulesButRef)(i,d))){o.block(()=>Op(e,"$ref",d.all.$ref.definition));return}c.jtd||aI(e,t),o.block(()=>{for(let f of d.rules)p(f);p(d.post)});function p(f){(0,Es.shouldUseGroup)(i,f)&&(f.type?(o.if((0,oi.checkDataType)(f.type,a,c.strictNumbers)),vp(e,f),t.length===1&&t[0]===f.type&&r&&(o.else(),(0,oi.reportTypeError)(e)),o.endIf()):vp(e,f),s||o.if((0,O._)`${L.default.errors} === ${n||0}`))}}function vp(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,Jw.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Es.shouldUseRule)(n,i)&&Op(e,i.keyword,i.definition,t.type)})}function aI(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(sI(e,t),e.opts.allowUnionTypes||cI(e,t),lI(e,e.dataTypes))}function sI(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Np(e.dataTypes,r)||Ps(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),pI(e,t)}}function cI(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Ps(e,"use allowUnionTypes to allow union type keyword")}function lI(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Es.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(a=>dI(t,a))&&Ps(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function dI(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Np(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function pI(e,t){let r=[];for(let n of e.dataTypes)Np(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Ps(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Tt.checkStrictMode)(e,t,e.opts.strictTypes)}var ii=class{constructor(t,r,n){if((0,qn.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Tt.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Sp(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,qn.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",L.default.errors))}result(t,r,n){this.failResult((0,O.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,O.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Fn.reportExtraError:Fn.reportError)(this,this.def.error,r)}$dataError(){(0,Fn.reportError)(this,this.def.$dataError||Fn.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Fn.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=O.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:a}=this;n.if((0,O.or)((0,O._)`${o} === undefined`,r)),t!==O.nil&&n.assign(t,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==O.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,O.or)(a(),s());function a(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,O._)`${(0,oi.checkDataTypes)(c,r,i.opts.strictNumbers,oi.DataType.Wrong)}`}return O.nil}function s(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,O._)`!${c}(${r})`}return O.nil}}subschema(t,r){let n=(0,As.getSubschema)(this.it,t);(0,As.extendSubschemaData)(n,this.it,t),(0,As.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return Zw(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Tt.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Tt.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,O.Name)),!0}};Zt.KeywordCxt=ii;function Op(e,t,r,n){let o=new ii(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,qn.funcKeywordCode)(o,r):"macro"in r?(0,qn.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,qn.funcKeywordCode)(o,r)}var uI=/^\/(?:[^~]|~0|~1)*$/,fI=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Sp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return L.default.rootData;if(e[0]==="/"){if(!uI.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=L.default.rootData}else{let l=fI.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let d=+l[1];if(o=l[2],o==="#"){if(d>=t)throw new Error(c("property/index",d));return n[t-d]}if(d>t)throw new Error(c("data",d));if(i=r[t-d],!o)return i}let a=i,s=o.split("/");for(let l of s)l&&(i=(0,O._)`${i}${(0,O.getProperty)((0,Tt.unescapeJsonPointer)(l))}`,a=(0,O._)`${a} && ${i}`);return a;function c(l,d){return`Cannot access ${l} ${d} levels up, current level is ${t}`}}Zt.getData=Sp});var ai=E(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var Ns=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Os.default=Ns});var zn=E(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});var Ss=Un(),Ds=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Ss.resolveUrl)(t,r,n),this.missingSchema=(0,Ss.normalizeId)((0,Ss.getFullPath)(t,this.missingRef))}};js.default=Ds});var Jn=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.resolveSchema=at.getCompilingSchema=at.resolveRef=at.compileSchema=at.SchemaEnv=void 0;var gt=x(),mI=ai(),wr=ot(),ht=Un(),Dp=q(),gI=Bn(),rn=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,ht.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};at.SchemaEnv=rn;function Cs(e){let t=jp.call(this,e);if(t)return t;let r=(0,ht.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,a=new gt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),s;e.$async&&(s=a.scopeValue("Error",{ref:mI.default,code:(0,gt._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let l={gen:a,allErrors:this.opts.allErrors,data:wr.default.data,parentData:wr.default.parentData,parentDataProperty:wr.default.parentDataProperty,dataNames:[wr.default.data],dataPathArr:[gt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,gt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:gt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,gt._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),(0,gI.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let p=a.toString();d=`${a.scopeRefs(wr.default.scope)}return ${p}`,this.opts.code.process&&(d=this.opts.code.process(d,e));let u=new Function(`${wr.default.self}`,`${wr.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:u}),u.errors=null,u.schema=e.schema,u.schemaEnv=e,e.$async&&(u.$async=!0),this.opts.code.source===!0&&(u.source={validateName:c,validateCode:p,scopeValues:a._values}),this.opts.unevaluated){let{props:m,items:g}=l;u.evaluated={props:m instanceof gt.Name?void 0:m,items:g instanceof gt.Name?void 0:g,dynamicProps:m instanceof gt.Name,dynamicItems:g instanceof gt.Name},u.source&&(u.source.evaluated=(0,gt.stringify)(u.evaluated))}return e.validate=u,e}catch(p){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),p}finally{this._compilations.delete(e)}}at.compileSchema=Cs;function hI(e,t,r){var n;r=(0,ht.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=II.call(this,e,r);if(i===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:s}=this.opts;a&&(i=new rn({schema:a,schemaId:s,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=yI.call(this,i)}at.resolveRef=hI;function yI(e){return(0,ht.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Cs.call(this,e)}function jp(e){for(let t of this._compilations)if(wI(t,e))return t}at.getCompilingSchema=jp;function wI(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function II(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||si.call(this,e,t)}function si(e,t){let r=this.opts.uriResolver.parse(t),n=(0,ht._getFullPath)(this.opts.uriResolver,r),o=(0,ht.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return $s.call(this,r,e);let i=(0,ht.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let s=si.call(this,e,a);return typeof s?.schema!="object"?void 0:$s.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||Cs.call(this,a),i===(0,ht.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,l=s[c];return l&&(o=(0,ht.resolveUrl)(this.opts.uriResolver,o,l)),new rn({schema:s,schemaId:c,root:e,baseId:o})}return $s.call(this,r,a)}}at.resolveSchema=si;var vI=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $s(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Dp.unescapeFragment)(s)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!vI.has(s)&&l&&(t=(0,ht.resolveUrl)(this.opts.uriResolver,t,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Dp.schemaHasRulesButRef)(r,this.RULES)){let s=(0,ht.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=si.call(this,n,s)}let{schemaId:a}=this.opts;if(i=i||new rn({schema:r,schemaId:a,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var $p=E((RN,bI)=>{bI.exports={$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 xs=E((_N,Mp)=>{"use strict";var kI=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Tp=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),Ts=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Lp=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),RI=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Ls(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var _I=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Cp(e){return e.length=0,!0}function AI(e,t,r){if(e.length){let n=Ls(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function EI(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,a=!1,s=AI;for(let c=0;c<e.length;c++){let l=e[c];if(!(l==="["||l==="]"))if(l===":"){if(i===!0&&(a=!0),!s(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(l==="%"){if(!s(o,n,r))break;s=Cp}else{o.push(l);continue}}return o.length&&(s===Cp?r.zone=o.join(""):a?n.push(o.join("")):n.push(Ls(o))),r.address=n.join(""),r}function xp(e){if(PI(e,":")<2)return{host:e,isIPV6:!1};let t=EI(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function PI(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function NI(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}var OI={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},SI=/[@/?#:]/g,DI=/[@/?#]/g;function Vp(e,t){let r=t?DI:SI;return r.lastIndex=0,e.replace(r,n=>OI[n])}function jI(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let o=e.slice(n+1,n+3);if(Ts(o)){let i=o.toUpperCase(),a=String.fromCharCode(parseInt(i,16));t&&Lp(a)?r+=a:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function $I(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Ts(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));i!=="."&&Lp(i)?t+=i:t+="%"+o,r+=2;continue}}RI(e[r])?t+=e[r]:t+=escape(e[r])}return t}function CI(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Ts(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function TI(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!Tp(r)){let n=xp(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Vp(r,!1)}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}Mp.exports={nonSimpleDomain:_I,recomposeAuthority:TI,reescapeHostDelimiters:Vp,normalizePercentEncoding:jI,normalizePathEncoding:$I,escapePreservingEscapes:CI,removeDotSegments:NI,isIPv4:Tp,isUUID:kI,normalizeIPv6:xp,stringArrayToHexStripped:Ls}});var zp=E((AN,Bp)=>{"use strict";var{isUUID:LI}=xs(),xI=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,VI=["http","https","ws","wss","urn","urn:uuid"];function MI(e){return VI.indexOf(e)!==-1}function Vs(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Up(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Fp(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function UI(e){return e.secure=Vs(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function FI(e){if((e.port===(Vs(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function qI(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(xI);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=Ms(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function BI(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=Ms(o);i&&(e=i.serialize(e,t));let a=e,s=e.nss;return a.path=`${n||t.nid}:${s}`,t.skipEscape=!0,a}function zI(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!LI(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function JI(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var qp={scheme:"http",domainHost:!0,parse:Up,serialize:Fp},GI={scheme:"https",domainHost:qp.domainHost,parse:Up,serialize:Fp},ci={scheme:"ws",domainHost:!0,parse:UI,serialize:FI},WI={scheme:"wss",domainHost:ci.domainHost,parse:ci.parse,serialize:ci.serialize},KI={scheme:"urn",parse:qI,serialize:BI,skipNormalize:!0},YI={scheme:"urn:uuid",parse:zI,serialize:JI,skipNormalize:!0},li={http:qp,https:GI,ws:ci,wss:WI,urn:KI,"urn:uuid":YI};Object.setPrototypeOf(li,null);function Ms(e){return e&&(li[e]||li[e.toLowerCase()])||void 0}Bp.exports={wsIsSecure:Vs,SCHEMES:li,isValidSchemeName:MI,getSchemeHandler:Ms}});var Yp=E((EN,ui)=>{"use strict";var{normalizeIPv6:HI,removeDotSegments:Gn,recomposeAuthority:XI,normalizePercentEncoding:ZI,normalizePathEncoding:QI,escapePreservingEscapes:ev,reescapeHostDelimiters:tv,isIPv4:rv,nonSimpleDomain:nv}=xs(),{SCHEMES:ov,getSchemeHandler:Gp}=zp();function iv(e,t){return typeof e=="string"?e=uv(e,t):typeof e=="object"&&(e=pi(Ir(e,t),t)),e}function av(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:i}=di(e,n),{parsed:a,malformedAuthorityOrPort:s}=di(t,n);if(i||s)throw new Error(o.error||a.error||"URI is malformed.");let c=Wp(o,a,n,!0);return n.skipEscape=!0,Ir(c,n)}function Wp(e,t,r,n){let o={};return n||(e=pi(Ir(e,r),r),t=pi(Ir(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Gn(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Gn(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=Gn(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=Gn(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function sv(e,t,r){let n=Jp(e,r),o=Jp(t,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Ir(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=Gp(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=ZI(r.path):(r.path=ev(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let a=XI(r);if(a!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(a),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let s=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(s=Gn(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),o.push(s)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var cv=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,lv=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,dv=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function pv(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function di(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,i=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let a=e.match(lv);a!==null&&a[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let s=e.match(dv);if(s!==null){let l=s[1],d=l.replace(/[\t\n\r]/g,"");d.length>=2&&(d.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):l.length!==d.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}let c=e.match(cv);if(c){n.scheme=c[1],n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let l=pv(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(rv(n.host)===!1){let f=HI(n.host);n.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let d=Gp(r.scheme||n.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&n.host&&(r.domainHost||d&&d.domainHost)&&i===!1&&nv(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(p){n.error=n.error||"Host's domain name can not be converted to ASCII: "+p}if((!d||d&&!d.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=tv(unescape(n.host),i))),n.path&&(n.path=QI(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}d&&d.parse&&d.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function pi(e,t){return di(e,t).parsed}function uv(e,t){return Kp(e,t).normalized}function Kp(e,t){let{parsed:r,malformedAuthorityOrPort:n}=di(e,t);return{normalized:n?e:Ir(r,t),malformedAuthorityOrPort:n}}function Jp(e,t){if(typeof e=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Kp(e,t);return n?void 0:r}if(typeof e=="object")return Ir(e,t)}var Us={SCHEMES:ov,normalize:iv,resolve:av,resolveComponent:Wp,equal:sv,serialize:Ir,parse:pi};ui.exports=Us;ui.exports.default=Us;ui.exports.fastUri=Us});var Xp=E(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});var Hp=Yp();Hp.code='require("ajv/dist/runtime/uri").default';Fs.default=Hp});var iu=E(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.CodeGen=Ae.Name=Ae.nil=Ae.stringify=Ae.str=Ae._=Ae.KeywordCxt=void 0;var fv=Bn();Object.defineProperty(Ae,"KeywordCxt",{enumerable:!0,get:function(){return fv.KeywordCxt}});var nn=x();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return nn._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return nn.str}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return nn.stringify}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return nn.nil}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return nn.Name}});Object.defineProperty(Ae,"CodeGen",{enumerable:!0,get:function(){return nn.CodeGen}});var mv=ai(),ru=zn(),gv=gs(),Wn=Jn(),hv=x(),Kn=Un(),fi=Mn(),Bs=q(),Zp=$p(),yv=Xp(),nu=(e,t)=>new RegExp(e,t);nu.code="new RegExp";var wv=["removeAdditional","useDefaults","coerceTypes"],Iv=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),vv={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."},bv={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Qp=200;function kv(e){var t,r,n,o,i,a,s,c,l,d,p,f,u,m,g,h,w,_,b,A,I,R,S,C,le;let $=e.strict,P=(t=e.code)===null||t===void 0?void 0:t.optimize,X=P===!0||P===void 0?1:P||0,ie=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:nu,rt=(o=e.uriResolver)!==null&&o!==void 0?o:yv.default;return{strictSchema:(a=(i=e.strictSchema)!==null&&i!==void 0?i:$)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:$)!==null&&c!==void 0?c:!0,strictTypes:(d=(l=e.strictTypes)!==null&&l!==void 0?l:$)!==null&&d!==void 0?d:"log",strictTuples:(f=(p=e.strictTuples)!==null&&p!==void 0?p:$)!==null&&f!==void 0?f:"log",strictRequired:(m=(u=e.strictRequired)!==null&&u!==void 0?u:$)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:X,regExp:ie}:{optimize:X,regExp:ie},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:Qp,loopEnum:(h=e.loopEnum)!==null&&h!==void 0?h:Qp,meta:(w=e.meta)!==null&&w!==void 0?w:!0,messages:(_=e.messages)!==null&&_!==void 0?_:!0,inlineRefs:(b=e.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(A=e.schemaId)!==null&&A!==void 0?A:"$id",addUsedSchema:(I=e.addUsedSchema)!==null&&I!==void 0?I:!0,validateSchema:(R=e.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(S=e.validateFormats)!==null&&S!==void 0?S:!0,unicodeRegExp:(C=e.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(le=e.int32range)!==null&&le!==void 0?le:!0,uriResolver:rt}}var Yn=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...kv(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new hv.ValueScope({scope:{},prefixes:Iv,es5:r,lines:n}),this.logger=Nv(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,gv.getRules)(),eu.call(this,vv,t,"NOT SUPPORTED"),eu.call(this,bv,t,"DEPRECATED","warn"),this._metaOpts=Ev.call(this),t.formats&&_v.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&Av.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),Rv.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=Zp;n==="id"&&(o={...Zp},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(d,p){await i.call(this,d.$schema);let f=this._addSchema(d,p);return f.validate||a.call(this,f)}async function i(d){d&&!this.getSchema(d)&&await o.call(this,{$ref:d},!0)}async function a(d){try{return this._compileSchemaEnv(d)}catch(p){if(!(p instanceof ru.default))throw p;return s.call(this,p),await c.call(this,p.missingSchema),a.call(this,d)}}function s({missingSchema:d,missingRef:p}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${p} cannot be resolved`)}async function c(d){let p=await l.call(this,d);this.refs[d]||await i.call(this,p.$schema),this.refs[d]||this.addSchema(p,d,r)}async function l(d){let p=this._loading[d];if(p)return p;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:a}=this.opts;if(i=t[a],i!==void 0&&typeof i!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Kn.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=tu.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new Wn.SchemaEnv({schema:{},schemaId:n});if(r=Wn.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=tu.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Kn.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Sv.call(this,n,r),!r)return(0,Bs.eachItem)(n,i=>qs.call(this,i)),this;jv.call(this,r);let o={...r,type:(0,fi.getJSONTypes)(r.type),schemaType:(0,fi.getJSONTypes)(r.schemaType)};return(0,Bs.eachItem)(n,o.type.length===0?i=>qs.call(this,i,o):i=>o.type.forEach(a=>qs.call(this,i,o,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),a=t;for(let s of i)a=a[s];for(let s in n){let c=n[s];if(typeof c!="object")continue;let{$data:l}=c.definition,d=a[s];l&&d&&(a[s]=ou(d))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof t=="object")a=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,Kn.normalizeId)(a||n);let l=Kn.getSchemaRefs.call(this,t,n);return c=new Wn.SchemaEnv({schema:t,schemaId:s,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Wn.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Wn.compileSchema.call(this,t)}finally{this.opts=r}}};Yn.ValidationError=mv.default;Yn.MissingRefError=ru.default;Ae.default=Yn;function eu(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function tu(e){return e=(0,Kn.normalizeId)(e),this.schemas[e]||this.refs[e]}function Rv(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function _v(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function Av(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function Ev(){let e={...this.opts};for(let t of wv)delete e[t];return e}var Pv={log(){},warn(){},error(){}};function Nv(e){if(e===!1)return Pv;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var Ov=/^[a-z_$][a-z0-9_$:-]*$/i;function Sv(e,t){let{RULES:r}=this;if((0,Bs.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Ov.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function qs(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=o?i.post:i.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},i.rules.push(a)),i.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,fi.getJSONTypes)(t.type),schemaType:(0,fi.getJSONTypes)(t.schemaType)}};t.before?Dv.call(this,a,s,t.before):a.rules.push(s),i.all[e]=s,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function Dv(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function jv(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ou(t)),e.validateSchema=this.compile(t,!0))}var $v={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ou(e){return{anyOf:[e,$v]}}});var au=E(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});var Cv={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};zs.default=Cv});var hi=E(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.callRef=vr.getValidate=void 0;var Tv=zn(),su=it(),We=x(),on=ot(),cu=Jn(),mi=q(),Lv={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:a,opts:s,self:c}=n,{root:l}=i;if((r==="#"||r==="#/")&&o===l.baseId)return p();let d=cu.resolveRef.call(c,l,o,r);if(d===void 0)throw new Tv.default(n.opts.uriResolver,o,r);if(d instanceof cu.SchemaEnv)return f(d);return u(d);function p(){if(i===l)return gi(e,a,i,i.$async);let m=t.scopeValue("root",{ref:l});return gi(e,(0,We._)`${m}.validate`,l,l.$async)}function f(m){let g=lu(e,m);gi(e,g,m,m.$async)}function u(m){let g=t.scopeValue("schema",s.code.source===!0?{ref:m,code:(0,We.stringify)(m)}:{ref:m}),h=t.name("valid"),w=e.subschema({schema:m,dataTypes:[],schemaPath:We.nil,topSchemaRef:g,errSchemaPath:r},h);e.mergeEvaluated(w),e.ok(h)}}};function lu(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,We._)`${r.scopeValue("wrapper",{ref:t})}.validate`}vr.getValidate=lu;function gi(e,t,r,n){let{gen:o,it:i}=e,{allErrors:a,schemaEnv:s,opts:c}=i,l=c.passContext?on.default.this:We.nil;n?d():p();function d(){if(!s.$async)throw new Error("async schema referenced by sync schema");let m=o.let("valid");o.try(()=>{o.code((0,We._)`await ${(0,su.callValidateCode)(e,t,l)}`),u(t),a||o.assign(m,!0)},g=>{o.if((0,We._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),f(g),a||o.assign(m,!1)}),e.ok(m)}function p(){e.result((0,su.callValidateCode)(e,t,l),()=>u(t),()=>f(t))}function f(m){let g=(0,We._)`${m}.errors`;o.assign(on.default.vErrors,(0,We._)`${on.default.vErrors} === null ? ${g} : ${on.default.vErrors}.concat(${g})`),o.assign(on.default.errors,(0,We._)`${on.default.vErrors}.length`)}function u(m){var g;if(!i.opts.unevaluated)return;let h=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(h&&!h.dynamicProps)h.props!==void 0&&(i.props=mi.mergeEvaluated.props(o,h.props,i.props));else{let w=o.var("props",(0,We._)`${m}.evaluated.props`);i.props=mi.mergeEvaluated.props(o,w,i.props,We.Name)}if(i.items!==!0)if(h&&!h.dynamicItems)h.items!==void 0&&(i.items=mi.mergeEvaluated.items(o,h.items,i.items));else{let w=o.var("items",(0,We._)`${m}.evaluated.items`);i.items=mi.mergeEvaluated.items(o,w,i.items,We.Name)}}}vr.callRef=gi;vr.default=Lv});var du=E(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});var xv=au(),Vv=hi(),Mv=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xv.default,Vv.default];Js.default=Mv});var pu=E(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});var yi=x(),Qt=yi.operators,wi={maximum:{okStr:"<=",ok:Qt.LTE,fail:Qt.GT},minimum:{okStr:">=",ok:Qt.GTE,fail:Qt.LT},exclusiveMaximum:{okStr:"<",ok:Qt.LT,fail:Qt.GTE},exclusiveMinimum:{okStr:">",ok:Qt.GT,fail:Qt.LTE}},Uv={message:({keyword:e,schemaCode:t})=>(0,yi.str)`must be ${wi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,yi._)`{comparison: ${wi[e].okStr}, limit: ${t}}`},Fv={keyword:Object.keys(wi),type:"number",schemaType:"number",$data:!0,error:Uv,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,yi._)`${r} ${wi[t].fail} ${n} || isNaN(${r})`)}};Gs.default=Fv});var uu=E(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});var Hn=x(),qv={message:({schemaCode:e})=>(0,Hn.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Hn._)`{multipleOf: ${e}}`},Bv={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:qv,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,a=t.let("res"),s=i?(0,Hn._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,Hn._)`${a} !== parseInt(${a})`;e.fail$data((0,Hn._)`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};Ws.default=Bv});var mu=E(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});function fu(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}Ks.default=fu;fu.code='require("ajv/dist/runtime/ucs2length").default'});var gu=E(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});var br=x(),zv=q(),Jv=mu(),Gv={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,br.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,br._)`{limit: ${e}}`},Wv={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Gv,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?br.operators.GT:br.operators.LT,a=o.opts.unicode===!1?(0,br._)`${r}.length`:(0,br._)`${(0,zv.useFunc)(e.gen,Jv.default)}(${r})`;e.fail$data((0,br._)`${a} ${i} ${n}`)}};Ys.default=Wv});var hu=E(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var Kv=it(),Yv=q(),an=x(),Hv={message:({schemaCode:e})=>(0,an.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,an._)`{pattern: ${e}}`},Xv={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Hv,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=a.opts.code,l=c.code==="new RegExp"?(0,an._)`new RegExp`:(0,Yv.useFunc)(t,c),d=t.let("valid");t.try(()=>t.assign(d,(0,an._)`${l}(${i}, ${s}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,an._)`!${d}`)}else{let c=(0,Kv.usePattern)(e,o);e.fail$data((0,an._)`!${c}.test(${r})`)}}};Hs.default=Xv});var yu=E(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});var Xn=x(),Zv={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Xn.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Xn._)`{limit: ${e}}`},Qv={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Zv,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Xn.operators.GT:Xn.operators.LT;e.fail$data((0,Xn._)`Object.keys(${r}).length ${o} ${n}`)}};Xs.default=Qv});var wu=E(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var Zn=it(),Qn=x(),eb=q(),tb={message:({params:{missingProperty:e}})=>(0,Qn.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Qn._)`{missingProperty: ${e}}`},rb={keyword:"required",type:"object",schemaType:"array",$data:!0,error:tb,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:a}=e,{opts:s}=a;if(!i&&r.length===0)return;let c=r.length>=s.loopRequired;if(a.allErrors?l():d(),s.strictRequired){let u=e.parentSchema.properties,{definedProperties:m}=e.it;for(let g of r)if(u?.[g]===void 0&&!m.has(g)){let h=a.schemaEnv.baseId+a.errSchemaPath,w=`required property "${g}" is not defined at "${h}" (strictRequired)`;(0,eb.checkStrictMode)(a,w,a.opts.strictRequired)}}function l(){if(c||i)e.block$data(Qn.nil,p);else for(let u of r)(0,Zn.checkReportMissingProp)(e,u)}function d(){let u=t.let("missing");if(c||i){let m=t.let("valid",!0);e.block$data(m,()=>f(u,m)),e.ok(m)}else t.if((0,Zn.checkMissingProp)(e,r,u)),(0,Zn.reportMissingProp)(e,u),t.else()}function p(){t.forOf("prop",n,u=>{e.setParams({missingProperty:u}),t.if((0,Zn.noPropertyInData)(t,o,u,s.ownProperties),()=>e.error())})}function f(u,m){e.setParams({missingProperty:u}),t.forOf(u,n,()=>{t.assign(m,(0,Zn.propertyInData)(t,o,u,s.ownProperties)),t.if((0,Qn.not)(m),()=>{e.error(),t.break()})},Qn.nil)}}};Zs.default=rb});var Iu=E(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});var eo=x(),nb={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,eo.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,eo._)`{limit: ${e}}`},ob={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:nb,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?eo.operators.GT:eo.operators.LT;e.fail$data((0,eo._)`${r}.length ${o} ${n}`)}};Qs.default=ob});var Ii=E(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var vu=Rs();vu.code='require("ajv/dist/runtime/equal").default';ec.default=vu});var bu=E(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var tc=Mn(),Ee=x(),ib=q(),ab=Ii(),sb={message:({params:{i:e,j:t}})=>(0,Ee.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ee._)`{i: ${e}, j: ${t}}`},cb={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:sb,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:a,it:s}=e;if(!n&&!o)return;let c=t.let("valid"),l=i.items?(0,tc.getSchemaTypes)(i.items):[];e.block$data(c,d,(0,Ee._)`${a} === false`),e.ok(c);function d(){let m=t.let("i",(0,Ee._)`${r}.length`),g=t.let("j");e.setParams({i:m,j:g}),t.assign(c,!0),t.if((0,Ee._)`${m} > 1`,()=>(p()?f:u)(m,g))}function p(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function f(m,g){let h=t.name("item"),w=(0,tc.checkDataTypes)(l,h,s.opts.strictNumbers,tc.DataType.Wrong),_=t.const("indices",(0,Ee._)`{}`);t.for((0,Ee._)`;${m}--;`,()=>{t.let(h,(0,Ee._)`${r}[${m}]`),t.if(w,(0,Ee._)`continue`),l.length>1&&t.if((0,Ee._)`typeof ${h} == "string"`,(0,Ee._)`${h} += "_"`),t.if((0,Ee._)`typeof ${_}[${h}] == "number"`,()=>{t.assign(g,(0,Ee._)`${_}[${h}]`),e.error(),t.assign(c,!1).break()}).code((0,Ee._)`${_}[${h}] = ${m}`)})}function u(m,g){let h=(0,ib.useFunc)(t,ab.default),w=t.name("outer");t.label(w).for((0,Ee._)`;${m}--;`,()=>t.for((0,Ee._)`${g} = ${m}; ${g}--;`,()=>t.if((0,Ee._)`${h}(${r}[${m}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(w)})))}}};rc.default=cb});var ku=E(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var nc=x(),lb=q(),db=Ii(),pb={message:"must be equal to constant",params:({schemaCode:e})=>(0,nc._)`{allowedValue: ${e}}`},ub={keyword:"const",$data:!0,error:pb,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,nc._)`!${(0,lb.useFunc)(t,db.default)}(${r}, ${o})`):e.fail((0,nc._)`${i} !== ${r}`)}};oc.default=ub});var Ru=E(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var to=x(),fb=q(),mb=Ii(),gb={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,to._)`{allowedValues: ${e}}`},hb={keyword:"enum",schemaType:"array",$data:!0,error:gb,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:a}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let s=o.length>=a.opts.loopEnum,c,l=()=>c??(c=(0,fb.useFunc)(t,mb.default)),d;if(s||n)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let u=t.const("vSchema",i);d=(0,to.or)(...o.map((m,g)=>f(u,g)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",i,u=>t.if((0,to._)`${l()}(${r}, ${u})`,()=>t.assign(d,!0).break()))}function f(u,m){let g=o[m];return typeof g=="object"&&g!==null?(0,to._)`${l()}(${r}, ${u}[${m}])`:(0,to._)`${r} === ${g}`}}};ic.default=hb});var _u=E(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});var yb=pu(),wb=uu(),Ib=gu(),vb=hu(),bb=yu(),kb=wu(),Rb=Iu(),_b=bu(),Ab=ku(),Eb=Ru(),Pb=[yb.default,wb.default,Ib.default,vb.default,bb.default,kb.default,Rb.default,_b.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ab.default,Eb.default];ac.default=Pb});var cc=E(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.validateAdditionalItems=void 0;var kr=x(),sc=q(),Nb={message:({params:{len:e}})=>(0,kr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,kr._)`{limit: ${e}}`},Ob={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Nb,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,sc.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Au(e,n)}};function Au(e,t){let{gen:r,schema:n,data:o,keyword:i,it:a}=e;a.items=!0;let s=r.const("len",(0,kr._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,kr._)`${s} <= ${t.length}`);else if(typeof n=="object"&&!(0,sc.alwaysValidSchema)(a,n)){let l=r.var("valid",(0,kr._)`${s} <= ${t.length}`);r.if((0,kr.not)(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,s,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:sc.Type.Num},l),a.allErrors||r.if((0,kr.not)(l),()=>r.break())})}}ro.validateAdditionalItems=Au;ro.default=Ob});var lc=E(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.validateTuple=void 0;var Eu=x(),vi=q(),Sb=it(),Db={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Pu(e,"additionalItems",t);r.items=!0,!(0,vi.alwaysValidSchema)(r,t)&&e.ok((0,Sb.validateArray)(e))}};function Pu(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:a,it:s}=e;d(o),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=vi.mergeEvaluated.items(n,r.length,s.items));let c=n.name("valid"),l=n.const("len",(0,Eu._)`${i}.length`);r.forEach((p,f)=>{(0,vi.alwaysValidSchema)(s,p)||(n.if((0,Eu._)`${l} > ${f}`,()=>e.subschema({keyword:a,schemaProp:f,dataProp:f},c)),e.ok(c))});function d(p){let{opts:f,errSchemaPath:u}=s,m=r.length,g=m===p.minItems&&(m===p.maxItems||p[t]===!1);if(f.strictTuples&&!g){let h=`"${a}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${u}"`;(0,vi.checkStrictMode)(s,h,f.strictTuples)}}}no.validateTuple=Pu;no.default=Db});var Nu=E(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});var jb=lc(),$b={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,jb.validateTuple)(e,"items")};dc.default=$b});var Su=E(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});var Ou=x(),Cb=q(),Tb=it(),Lb=cc(),xb={message:({params:{len:e}})=>(0,Ou.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ou._)`{limit: ${e}}`},Vb={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:xb,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,Cb.alwaysValidSchema)(n,t)&&(o?(0,Lb.validateAdditionalItems)(e,o):e.ok((0,Tb.validateArray)(e)))}};pc.default=Vb});var Du=E(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var st=x(),bi=q(),Mb={message:({params:{min:e,max:t}})=>t===void 0?(0,st.str)`must contain at least ${e} valid item(s)`:(0,st.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,st._)`{minContains: ${e}}`:(0,st._)`{minContains: ${e}, maxContains: ${t}}`},Ub={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Mb,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,a,s,{minContains:c,maxContains:l}=n;i.opts.next?(a=c===void 0?1:c,s=l):a=1;let d=t.const("len",(0,st._)`${o}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,bi.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,bi.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,bi.alwaysValidSchema)(i,r)){let g=(0,st._)`${d} >= ${a}`;s!==void 0&&(g=(0,st._)`${g} && ${d} <= ${s}`),e.pass(g);return}i.items=!0;let p=t.name("valid");s===void 0&&a===1?u(p,()=>t.if(p,()=>t.break())):a===0?(t.let(p,!0),s!==void 0&&t.if((0,st._)`${o}.length > 0`,f)):(t.let(p,!1),f()),e.result(p,()=>e.reset());function f(){let g=t.name("_valid"),h=t.let("count",0);u(g,()=>t.if(g,()=>m(h)))}function u(g,h){t.forRange("i",0,d,w=>{e.subschema({keyword:"contains",dataProp:w,dataPropType:bi.Type.Num,compositeRule:!0},g),h()})}function m(g){t.code((0,st._)`${g}++`),s===void 0?t.if((0,st._)`${g} >= ${a}`,()=>t.assign(p,!0).break()):(t.if((0,st._)`${g} > ${s}`,()=>t.assign(p,!1).break()),a===1?t.assign(p,!0):t.if((0,st._)`${g} >= ${a}`,()=>t.assign(p,!0)))}}};uc.default=Ub});var ki=E(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.validateSchemaDeps=Nt.validatePropertyDeps=Nt.error=void 0;var fc=x(),Fb=q(),oo=it();Nt.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,fc.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,fc._)`{property: ${e},
|
|
5
|
+
|| ${a} === "boolean" || ${o} === null`).assign(s,(0,V._)`[${o}]`)}}}function sw({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,V._)`${t} !== undefined`,()=>e.assign((0,V._)`${t}[${r}]`,n))}function ys(e,t,r,n=Qr.Correct){let o=n===Qr.Correct?V.operators.EQ:V.operators.NEQ,i;switch(e){case"null":return(0,V._)`${t} ${o} null`;case"array":i=(0,V._)`Array.isArray(${t})`;break;case"object":i=(0,V._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a((0,V._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return(0,V._)`typeof ${t} ${o} ${e}`}return n===Qr.Correct?i:(0,V.not)(i);function a(s=V.nil){return(0,V.and)((0,V._)`typeof ${t} == "number"`,s,r?(0,V._)`isFinite(${t})`:V.nil)}}Te.checkDataType=ys;function ws(e,t,r,n){if(e.length===1)return ys(e[0],t,r,n);let o,i=(0,Qd.toHash)(e);if(i.array&&i.object){let a=(0,V._)`typeof ${t} != "object"`;o=i.null?a:(0,V._)`!${t} || ${a}`,delete i.null,delete i.array,delete i.object}else o=V.nil;i.number&&delete i.integer;for(let a in i)o=(0,V.and)(o,ys(a,t,r,n));return o}Te.checkDataTypes=ws;var cw={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,V._)`{type: ${e}}`:(0,V._)`{type: ${t}}`};function Is(e){let t=lw(e);(0,rw.reportError)(t,cw)}Te.reportTypeError=Is;function lw(e){let{gen:t,data:r,schema:n}=e,o=(0,Qd.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var np=E(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.assignDefaults=void 0;var en=x(),dw=q();function pw(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)rp(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>rp(e,i,o.default))}ri.assignDefaults=pw;function rp(e,t,r){let{gen:n,compositeRule:o,data:i,opts:a}=e;if(r===void 0)return;let s=(0,en._)`${i}${(0,en.getProperty)(t)}`;if(o){(0,dw.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,en._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,en._)`${c} || ${s} === null || ${s} === ""`),n.if(c,(0,en._)`${s} = ${(0,en.stringify)(r)}`)}});var it=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.validateUnion=te.validateArray=te.usePattern=te.callValidateCode=te.schemaProperties=te.allSchemaProperties=te.noPropertyInData=te.propertyInData=te.isOwnProperty=te.hasPropFunc=te.reportMissingProp=te.checkMissingProp=te.checkReportMissingProp=void 0;var de=x(),vs=q(),Yt=ot(),uw=q();function fw(e,t){let{gen:r,data:n,it:o}=e;r.if(ks(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,de._)`${t}`},!0),e.error()})}te.checkReportMissingProp=fw;function mw({gen:e,data:t,it:{opts:r}},n,o){return(0,de.or)(...n.map(i=>(0,de.and)(ks(e,t,i,r.ownProperties),(0,de._)`${o} = ${i}`)))}te.checkMissingProp=mw;function gw(e,t){e.setParams({missingProperty:t},!0),e.error()}te.reportMissingProp=gw;function op(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,de._)`Object.prototype.hasOwnProperty`})}te.hasPropFunc=op;function bs(e,t,r){return(0,de._)`${op(e)}.call(${t}, ${r})`}te.isOwnProperty=bs;function hw(e,t,r,n){let o=(0,de._)`${t}${(0,de.getProperty)(r)} !== undefined`;return n?(0,de._)`${o} && ${bs(e,t,r)}`:o}te.propertyInData=hw;function ks(e,t,r,n){let o=(0,de._)`${t}${(0,de.getProperty)(r)} === undefined`;return n?(0,de.or)(o,(0,de.not)(bs(e,t,r))):o}te.noPropertyInData=ks;function ip(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}te.allSchemaProperties=ip;function yw(e,t){return ip(t).filter(r=>!(0,vs.alwaysValidSchema)(e,t[r]))}te.schemaProperties=yw;function ww({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:a},s,c,l){let d=l?(0,de._)`${e}, ${t}, ${n}${o}`:t,p=[[Yt.default.instancePath,(0,de.strConcat)(Yt.default.instancePath,i)],[Yt.default.parentData,a.parentData],[Yt.default.parentDataProperty,a.parentDataProperty],[Yt.default.rootData,Yt.default.rootData]];a.opts.dynamicRef&&p.push([Yt.default.dynamicAnchors,Yt.default.dynamicAnchors]);let f=(0,de._)`${d}, ${r.object(...p)}`;return c!==de.nil?(0,de._)`${s}.call(${c}, ${f})`:(0,de._)`${s}(${f})`}te.callValidateCode=ww;var Iw=(0,de._)`new RegExp`;function vw({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,de._)`${o.code==="new RegExp"?Iw:(0,uw.useFunc)(e,o)}(${r}, ${n})`})}te.usePattern=vw;function bw(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let s=t.let("valid",!0);return a(()=>t.assign(s,!1)),s}return t.var(i,!0),a(()=>t.break()),i;function a(s){let c=t.const("len",(0,de._)`${r}.length`);t.forRange("i",0,c,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:vs.Type.Num},i),t.if((0,de.not)(i),s)})}}te.validateArray=bw;function kw(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,vs.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let d=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},s);t.assign(a,(0,de._)`${a} || ${s}`),e.mergeValidEvaluated(d,s)||t.if((0,de.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}te.validateUnion=kw});var cp=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.validateKeywordUsage=Et.validSchemaType=Et.funcKeywordCode=Et.macroKeywordCode=void 0;var Fe=x(),yr=ot(),Rw=it(),_w=Vn();function Aw(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:a}=e,s=t.macro.call(a.self,o,i,a),c=sp(r,n,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let l=r.name("valid");e.subschema({schema:s,schemaPath:Fe.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}Et.macroKeywordCode=Aw;function Ew(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:a,$data:s,it:c}=e;Nw(c,t);let l=!s&&t.compile?t.compile.call(c.self,i,a,c):t.validate,d=sp(n,o,l),p=n.let("valid");e.block$data(p,f),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function f(){if(t.errors===!1)g(),t.modifying&&ap(e),h(()=>e.error());else{let w=t.async?u():m();t.modifying&&ap(e),h(()=>Pw(e,w))}}function u(){let w=n.let("ruleErrs",null);return n.try(()=>g((0,Fe._)`await `),_=>n.assign(p,!1).if((0,Fe._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(w,(0,Fe._)`${_}.errors`),()=>n.throw(_))),w}function m(){let w=(0,Fe._)`${d}.errors`;return n.assign(w,null),g(Fe.nil),w}function g(w=t.async?(0,Fe._)`await `:Fe.nil){let _=c.opts.passContext?yr.default.this:yr.default.self,b=!("compile"in t&&!s||t.schema===!1);n.assign(p,(0,Fe._)`${w}${(0,Rw.callValidateCode)(e,d,_,b)}`,t.modifying)}function h(w){var _;n.if((0,Fe.not)((_=t.valid)!==null&&_!==void 0?_:p),w)}}Et.funcKeywordCode=Ew;function ap(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Fe._)`${n.parentData}[${n.parentDataProperty}]`))}function Pw(e,t){let{gen:r}=e;r.if((0,Fe._)`Array.isArray(${t})`,()=>{r.assign(yr.default.vErrors,(0,Fe._)`${yr.default.vErrors} === null ? ${t} : ${yr.default.vErrors}.concat(${t})`).assign(yr.default.errors,(0,Fe._)`${yr.default.vErrors}.length`),(0,_w.extendErrors)(e)},()=>e.error())}function Nw({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function sp(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Fe.stringify)(r)})}function Ow(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Et.validSchemaType=Ow;function Sw({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let a=o.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Et.validateKeywordUsage=Sw});var dp=E(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.extendSubschemaMode=Ht.extendSubschemaData=Ht.getSubschema=void 0;var Pt=x(),lp=q();function Dw(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return r===void 0?{schema:s,schemaPath:(0,Pt._)`${e.schemaPath}${(0,Pt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:(0,Pt._)`${e.schemaPath}${(0,Pt.getProperty)(t)}${(0,Pt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,lp.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ht.getSubschema=Dw;function jw(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:a}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(r!==void 0){let{errorPath:l,dataPathArr:d,opts:p}=t,f=s.let("data",(0,Pt._)`${t.data}${(0,Pt.getProperty)(r)}`,!0);c(f),e.errorPath=(0,Pt.str)`${l}${(0,lp.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Pt._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(o!==void 0){let l=o instanceof Pt.Name?o:s.let("data",o,!0);c(l),a!==void 0&&(e.propertyName=a)}i&&(e.dataTypes=i);function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}Ht.extendSubschemaData=jw;function $w(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Ht.extendSubschemaMode=$w});var Rs=E((hN,pp)=>{"use strict";pp.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var a=i[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var fp=E((yN,up)=>{"use strict";var Xt=up.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};ni(t,n,o,e,"",e)};Xt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Xt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Xt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Xt.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 ni(e,t,r,n,o,i,a,s,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,a,s,c,l);for(var d in n){var p=n[d];if(Array.isArray(p)){if(d in Xt.arrayKeywords)for(var f=0;f<p.length;f++)ni(e,t,r,p[f],o+"/"+d+"/"+f,i,o,d,n,f)}else if(d in Xt.propsKeywords){if(p&&typeof p=="object")for(var u in p)ni(e,t,r,p[u],o+"/"+d+"/"+Cw(u),i,o,d,n,u)}else(d in Xt.keywords||e.allKeys&&!(d in Xt.skipKeywords))&&ni(e,t,r,p,o+"/"+d,i,o,d,n)}r(n,o,i,a,s,c,l)}}function Cw(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Un=E(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.getSchemaRefs=We.resolveUrl=We.normalizeId=We._getFullPath=We.getFullPath=We.inlineRef=void 0;var Tw=q(),Lw=Rs(),xw=fp(),Vw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Mw(e,t=!0){return typeof e=="boolean"?!0:t===!0?!_s(e):t?mp(e)<=t:!1}We.inlineRef=Mw;var Uw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _s(e){for(let t in e){if(Uw.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(_s)||typeof r=="object"&&_s(r))return!0}return!1}function mp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Vw.has(r)&&(typeof e[r]=="object"&&(0,Tw.eachItem)(e[r],n=>t+=mp(n)),t===1/0))return 1/0}return t}function gp(e,t="",r){r!==!1&&(t=tn(t));let n=e.parse(t);return hp(e,n)}We.getFullPath=gp;function hp(e,t){return e.serialize(t).split("#")[0]+"#"}We._getFullPath=hp;var Fw=/#\/?$/;function tn(e){return e?e.replace(Fw,""):""}We.normalizeId=tn;function qw(e,t,r){return r=tn(r),e.resolve(t,r)}We.resolveUrl=qw;var Bw=/^[a-z_][-a-z0-9._]*$/i;function zw(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=tn(e[r]||t),i={"":o},a=gp(n,o,!1),s={},c=new Set;return xw(e,{allKeys:!0},(p,f,u,m)=>{if(m===void 0)return;let g=a+f,h=i[m];typeof p[r]=="string"&&(h=w.call(this,p[r])),_.call(this,p.$anchor),_.call(this,p.$dynamicAnchor),i[f]=h;function w(b){let A=this.opts.uriResolver.resolve;if(b=tn(h?A(h,b):b),c.has(b))throw d(b);c.add(b);let I=this.refs[b];return typeof I=="string"&&(I=this.refs[I]),typeof I=="object"?l(p,I.schema,b):b!==tn(g)&&(b[0]==="#"?(l(p,s[b],b),s[b]=p):this.refs[b]=g),b}function _(b){if(typeof b=="string"){if(!Bw.test(b))throw new Error(`invalid anchor "${b}"`);w.call(this,`#${b}`)}}}),s;function l(p,f,u){if(f!==void 0&&!Lw(p,f))throw d(u)}function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}}We.getSchemaRefs=zw});var Bn=E(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.getData=Zt.KeywordCxt=Zt.validateFunctionCode=void 0;var bp=Hd(),yp=Mn(),Es=hs(),oi=Mn(),Jw=np(),qn=cp(),As=dp(),O=x(),L=ot(),Gw=Un(),Tt=q(),Fn=Vn();function Ww(e){if(_p(e)&&(Ap(e),Rp(e))){Hw(e);return}kp(e,()=>(0,bp.topBoolOrEmptySchema)(e))}Zt.validateFunctionCode=Ww;function kp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,O._)`${L.default.data}, ${L.default.valCxt}`,n.$async,()=>{e.code((0,O._)`"use strict"; ${wp(r,o)}`),Yw(e,o),e.code(i)}):e.func(t,(0,O._)`${L.default.data}, ${Kw(o)}`,n.$async,()=>e.code(wp(r,o)).code(i))}function Kw(e){return(0,O._)`{${L.default.instancePath}="", ${L.default.parentData}, ${L.default.parentDataProperty}, ${L.default.rootData}=${L.default.data}${e.dynamicRef?(0,O._)`, ${L.default.dynamicAnchors}={}`:O.nil}}={}`}function Yw(e,t){e.if(L.default.valCxt,()=>{e.var(L.default.instancePath,(0,O._)`${L.default.valCxt}.${L.default.instancePath}`),e.var(L.default.parentData,(0,O._)`${L.default.valCxt}.${L.default.parentData}`),e.var(L.default.parentDataProperty,(0,O._)`${L.default.valCxt}.${L.default.parentDataProperty}`),e.var(L.default.rootData,(0,O._)`${L.default.valCxt}.${L.default.rootData}`),t.dynamicRef&&e.var(L.default.dynamicAnchors,(0,O._)`${L.default.valCxt}.${L.default.dynamicAnchors}`)},()=>{e.var(L.default.instancePath,(0,O._)`""`),e.var(L.default.parentData,(0,O._)`undefined`),e.var(L.default.parentDataProperty,(0,O._)`undefined`),e.var(L.default.rootData,L.default.data),t.dynamicRef&&e.var(L.default.dynamicAnchors,(0,O._)`{}`)})}function Hw(e){let{schema:t,opts:r,gen:n}=e;kp(e,()=>{r.$comment&&t.$comment&&Pp(e),tI(e),n.let(L.default.vErrors,null),n.let(L.default.errors,0),r.unevaluated&&Xw(e),Ep(e),oI(e)})}function Xw(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,O._)`${r}.evaluated`),t.if((0,O._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,O._)`${e.evaluated}.props`,(0,O._)`undefined`)),t.if((0,O._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,O._)`${e.evaluated}.items`,(0,O._)`undefined`))}function wp(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}function Zw(e,t){if(_p(e)&&(Ap(e),Rp(e))){Qw(e,t);return}(0,bp.boolOrEmptySchema)(e,t)}function Rp({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function _p(e){return typeof e.schema!="boolean"}function Qw(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&Pp(e),rI(e),nI(e);let i=n.const("_errs",L.default.errors);Ep(e,i),n.var(t,(0,O._)`${i} === ${L.default.errors}`)}function Ap(e){(0,Tt.checkUnknownRules)(e),eI(e)}function Ep(e,t){if(e.opts.jtd)return Ip(e,[],!1,t);let r=(0,yp.getSchemaTypes)(e.schema),n=(0,yp.coerceAndCheckDataType)(e,r);Ip(e,r,!n,t)}function eI(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Tt.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function tI(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Tt.checkStrictMode)(e,"default is ignored in the schema root")}function rI(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Gw.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function nI(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Pp({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,O._)`${L.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let a=(0,O.str)`${n}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,O._)`${L.default.self}.opts.$comment(${i}, ${a}, ${s}.schema)`)}}function oI(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,O._)`${L.default.errors} === 0`,()=>t.return(L.default.data),()=>t.throw((0,O._)`new ${o}(${L.default.vErrors})`)):(t.assign((0,O._)`${n}.errors`,L.default.vErrors),i.unevaluated&&iI(e),t.return((0,O._)`${L.default.errors} === 0`))}function iI({gen:e,evaluated:t,props:r,items:n}){r instanceof O.Name&&e.assign((0,O._)`${t}.props`,r),n instanceof O.Name&&e.assign((0,O._)`${t}.items`,n)}function Ip(e,t,r,n){let{gen:o,schema:i,data:a,allErrors:s,opts:c,self:l}=e,{RULES:d}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Tt.schemaHasRulesButRef)(i,d))){o.block(()=>Op(e,"$ref",d.all.$ref.definition));return}c.jtd||aI(e,t),o.block(()=>{for(let f of d.rules)p(f);p(d.post)});function p(f){(0,Es.shouldUseGroup)(i,f)&&(f.type?(o.if((0,oi.checkDataType)(f.type,a,c.strictNumbers)),vp(e,f),t.length===1&&t[0]===f.type&&r&&(o.else(),(0,oi.reportTypeError)(e)),o.endIf()):vp(e,f),s||o.if((0,O._)`${L.default.errors} === ${n||0}`))}}function vp(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,Jw.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Es.shouldUseRule)(n,i)&&Op(e,i.keyword,i.definition,t.type)})}function aI(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(sI(e,t),e.opts.allowUnionTypes||cI(e,t),lI(e,e.dataTypes))}function sI(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Np(e.dataTypes,r)||Ps(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),pI(e,t)}}function cI(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Ps(e,"use allowUnionTypes to allow union type keyword")}function lI(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Es.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(a=>dI(t,a))&&Ps(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function dI(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Np(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function pI(e,t){let r=[];for(let n of e.dataTypes)Np(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Ps(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Tt.checkStrictMode)(e,t,e.opts.strictTypes)}var ii=class{constructor(t,r,n){if((0,qn.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Tt.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Sp(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,qn.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",L.default.errors))}result(t,r,n){this.failResult((0,O.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,O.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Fn.reportExtraError:Fn.reportError)(this,this.def.error,r)}$dataError(){(0,Fn.reportError)(this,this.def.$dataError||Fn.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Fn.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=O.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:a}=this;n.if((0,O.or)((0,O._)`${o} === undefined`,r)),t!==O.nil&&n.assign(t,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==O.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,O.or)(a(),s());function a(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,O._)`${(0,oi.checkDataTypes)(c,r,i.opts.strictNumbers,oi.DataType.Wrong)}`}return O.nil}function s(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,O._)`!${c}(${r})`}return O.nil}}subschema(t,r){let n=(0,As.getSubschema)(this.it,t);(0,As.extendSubschemaData)(n,this.it,t),(0,As.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return Zw(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Tt.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Tt.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,O.Name)),!0}};Zt.KeywordCxt=ii;function Op(e,t,r,n){let o=new ii(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,qn.funcKeywordCode)(o,r):"macro"in r?(0,qn.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,qn.funcKeywordCode)(o,r)}var uI=/^\/(?:[^~]|~0|~1)*$/,fI=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Sp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return L.default.rootData;if(e[0]==="/"){if(!uI.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=L.default.rootData}else{let l=fI.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let d=+l[1];if(o=l[2],o==="#"){if(d>=t)throw new Error(c("property/index",d));return n[t-d]}if(d>t)throw new Error(c("data",d));if(i=r[t-d],!o)return i}let a=i,s=o.split("/");for(let l of s)l&&(i=(0,O._)`${i}${(0,O.getProperty)((0,Tt.unescapeJsonPointer)(l))}`,a=(0,O._)`${a} && ${i}`);return a;function c(l,d){return`Cannot access ${l} ${d} levels up, current level is ${t}`}}Zt.getData=Sp});var ai=E(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var Ns=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Os.default=Ns});var zn=E(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});var Ss=Un(),Ds=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Ss.resolveUrl)(t,r,n),this.missingSchema=(0,Ss.normalizeId)((0,Ss.getFullPath)(t,this.missingRef))}};js.default=Ds});var Jn=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.resolveSchema=at.getCompilingSchema=at.resolveRef=at.compileSchema=at.SchemaEnv=void 0;var gt=x(),mI=ai(),wr=ot(),ht=Un(),Dp=q(),gI=Bn(),rn=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,ht.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};at.SchemaEnv=rn;function Cs(e){let t=jp.call(this,e);if(t)return t;let r=(0,ht.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,a=new gt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),s;e.$async&&(s=a.scopeValue("Error",{ref:mI.default,code:(0,gt._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let l={gen:a,allErrors:this.opts.allErrors,data:wr.default.data,parentData:wr.default.parentData,parentDataProperty:wr.default.parentDataProperty,dataNames:[wr.default.data],dataPathArr:[gt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,gt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:gt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,gt._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),(0,gI.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let p=a.toString();d=`${a.scopeRefs(wr.default.scope)}return ${p}`,this.opts.code.process&&(d=this.opts.code.process(d,e));let u=new Function(`${wr.default.self}`,`${wr.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:u}),u.errors=null,u.schema=e.schema,u.schemaEnv=e,e.$async&&(u.$async=!0),this.opts.code.source===!0&&(u.source={validateName:c,validateCode:p,scopeValues:a._values}),this.opts.unevaluated){let{props:m,items:g}=l;u.evaluated={props:m instanceof gt.Name?void 0:m,items:g instanceof gt.Name?void 0:g,dynamicProps:m instanceof gt.Name,dynamicItems:g instanceof gt.Name},u.source&&(u.source.evaluated=(0,gt.stringify)(u.evaluated))}return e.validate=u,e}catch(p){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),p}finally{this._compilations.delete(e)}}at.compileSchema=Cs;function hI(e,t,r){var n;r=(0,ht.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=II.call(this,e,r);if(i===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:s}=this.opts;a&&(i=new rn({schema:a,schemaId:s,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=yI.call(this,i)}at.resolveRef=hI;function yI(e){return(0,ht.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Cs.call(this,e)}function jp(e){for(let t of this._compilations)if(wI(t,e))return t}at.getCompilingSchema=jp;function wI(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function II(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||si.call(this,e,t)}function si(e,t){let r=this.opts.uriResolver.parse(t),n=(0,ht._getFullPath)(this.opts.uriResolver,r),o=(0,ht.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return $s.call(this,r,e);let i=(0,ht.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let s=si.call(this,e,a);return typeof s?.schema!="object"?void 0:$s.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||Cs.call(this,a),i===(0,ht.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,l=s[c];return l&&(o=(0,ht.resolveUrl)(this.opts.uriResolver,o,l)),new rn({schema:s,schemaId:c,root:e,baseId:o})}return $s.call(this,r,a)}}at.resolveSchema=si;var vI=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $s(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Dp.unescapeFragment)(s)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!vI.has(s)&&l&&(t=(0,ht.resolveUrl)(this.opts.uriResolver,t,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Dp.schemaHasRulesButRef)(r,this.RULES)){let s=(0,ht.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=si.call(this,n,s)}let{schemaId:a}=this.opts;if(i=i||new rn({schema:r,schemaId:a,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var $p=E((RN,bI)=>{bI.exports={$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 xs=E((_N,Mp)=>{"use strict";var kI=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Tp=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),Ts=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Lp=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),RI=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Ls(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var _I=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Cp(e){return e.length=0,!0}function AI(e,t,r){if(e.length){let n=Ls(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function EI(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,a=!1,s=AI;for(let c=0;c<e.length;c++){let l=e[c];if(!(l==="["||l==="]"))if(l===":"){if(i===!0&&(a=!0),!s(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(l==="%"){if(!s(o,n,r))break;s=Cp}else{o.push(l);continue}}return o.length&&(s===Cp?r.zone=o.join(""):a?n.push(o.join("")):n.push(Ls(o))),r.address=n.join(""),r}function xp(e){if(PI(e,":")<2)return{host:e,isIPV6:!1};let t=EI(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function PI(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function NI(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}var OI={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},SI=/[@/?#:]/g,DI=/[@/?#]/g;function Vp(e,t){let r=t?DI:SI;return r.lastIndex=0,e.replace(r,n=>OI[n])}function jI(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let o=e.slice(n+1,n+3);if(Ts(o)){let i=o.toUpperCase(),a=String.fromCharCode(parseInt(i,16));t&&Lp(a)?r+=a:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function $I(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Ts(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));i!=="."&&Lp(i)?t+=i:t+="%"+o,r+=2;continue}}RI(e[r])?t+=e[r]:t+=escape(e[r])}return t}function CI(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Ts(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function TI(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!Tp(r)){let n=xp(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Vp(r,!1)}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}Mp.exports={nonSimpleDomain:_I,recomposeAuthority:TI,reescapeHostDelimiters:Vp,normalizePercentEncoding:jI,normalizePathEncoding:$I,escapePreservingEscapes:CI,removeDotSegments:NI,isIPv4:Tp,isUUID:kI,normalizeIPv6:xp,stringArrayToHexStripped:Ls}});var zp=E((AN,Bp)=>{"use strict";var{isUUID:LI}=xs(),xI=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,VI=["http","https","ws","wss","urn","urn:uuid"];function MI(e){return VI.indexOf(e)!==-1}function Vs(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Up(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Fp(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function UI(e){return e.secure=Vs(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function FI(e){if((e.port===(Vs(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function qI(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(xI);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=Ms(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function BI(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=Ms(o);i&&(e=i.serialize(e,t));let a=e,s=e.nss;return a.path=`${n||t.nid}:${s}`,t.skipEscape=!0,a}function zI(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!LI(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function JI(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var qp={scheme:"http",domainHost:!0,parse:Up,serialize:Fp},GI={scheme:"https",domainHost:qp.domainHost,parse:Up,serialize:Fp},ci={scheme:"ws",domainHost:!0,parse:UI,serialize:FI},WI={scheme:"wss",domainHost:ci.domainHost,parse:ci.parse,serialize:ci.serialize},KI={scheme:"urn",parse:qI,serialize:BI,skipNormalize:!0},YI={scheme:"urn:uuid",parse:zI,serialize:JI,skipNormalize:!0},li={http:qp,https:GI,ws:ci,wss:WI,urn:KI,"urn:uuid":YI};Object.setPrototypeOf(li,null);function Ms(e){return e&&(li[e]||li[e.toLowerCase()])||void 0}Bp.exports={wsIsSecure:Vs,SCHEMES:li,isValidSchemeName:MI,getSchemeHandler:Ms}});var Yp=E((EN,ui)=>{"use strict";var{normalizeIPv6:HI,removeDotSegments:Gn,recomposeAuthority:XI,normalizePercentEncoding:ZI,normalizePathEncoding:QI,escapePreservingEscapes:ev,reescapeHostDelimiters:tv,isIPv4:rv,nonSimpleDomain:nv}=xs(),{SCHEMES:ov,getSchemeHandler:Gp}=zp();function iv(e,t){return typeof e=="string"?e=uv(e,t):typeof e=="object"&&(e=pi(Ir(e,t),t)),e}function av(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:i}=di(e,n),{parsed:a,malformedAuthorityOrPort:s}=di(t,n);if(i||s)throw new Error(o.error||a.error||"URI is malformed.");let c=Wp(o,a,n,!0);return n.skipEscape=!0,Ir(c,n)}function Wp(e,t,r,n){let o={};return n||(e=pi(Ir(e,r),r),t=pi(Ir(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Gn(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Gn(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=Gn(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=Gn(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function sv(e,t,r){let n=Jp(e,r),o=Jp(t,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Ir(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=Gp(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=ZI(r.path):(r.path=ev(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let a=XI(r);if(a!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(a),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let s=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(s=Gn(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),o.push(s)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var cv=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,lv=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,dv=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function pv(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function di(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,i=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let a=e.match(lv);a!==null&&a[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let s=e.match(dv);if(s!==null){let l=s[1],d=l.replace(/[\t\n\r]/g,"");d.length>=2&&(d.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):l.length!==d.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}let c=e.match(cv);if(c){n.scheme=c[1],n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let l=pv(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(rv(n.host)===!1){let f=HI(n.host);n.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let d=Gp(r.scheme||n.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&n.host&&(r.domainHost||d&&d.domainHost)&&i===!1&&nv(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(p){n.error=n.error||"Host's domain name can not be converted to ASCII: "+p}if((!d||d&&!d.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=tv(unescape(n.host),i))),n.path&&(n.path=QI(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}d&&d.parse&&d.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function pi(e,t){return di(e,t).parsed}function uv(e,t){return Kp(e,t).normalized}function Kp(e,t){let{parsed:r,malformedAuthorityOrPort:n}=di(e,t);return{normalized:n?e:Ir(r,t),malformedAuthorityOrPort:n}}function Jp(e,t){if(typeof e=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Kp(e,t);return n?void 0:r}if(typeof e=="object")return Ir(e,t)}var Us={SCHEMES:ov,normalize:iv,resolve:av,resolveComponent:Wp,equal:sv,serialize:Ir,parse:pi};ui.exports=Us;ui.exports.default=Us;ui.exports.fastUri=Us});var Xp=E(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});var Hp=Yp();Hp.code='require("ajv/dist/runtime/uri").default';Fs.default=Hp});var iu=E(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.CodeGen=Ae.Name=Ae.nil=Ae.stringify=Ae.str=Ae._=Ae.KeywordCxt=void 0;var fv=Bn();Object.defineProperty(Ae,"KeywordCxt",{enumerable:!0,get:function(){return fv.KeywordCxt}});var nn=x();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return nn._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return nn.str}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return nn.stringify}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return nn.nil}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return nn.Name}});Object.defineProperty(Ae,"CodeGen",{enumerable:!0,get:function(){return nn.CodeGen}});var mv=ai(),ru=zn(),gv=gs(),Wn=Jn(),hv=x(),Kn=Un(),fi=Mn(),Bs=q(),Zp=$p(),yv=Xp(),nu=(e,t)=>new RegExp(e,t);nu.code="new RegExp";var wv=["removeAdditional","useDefaults","coerceTypes"],Iv=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),vv={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."},bv={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Qp=200;function kv(e){var t,r,n,o,i,a,s,c,l,d,p,f,u,m,g,h,w,_,b,A,I,R,S,C,le;let $=e.strict,P=(t=e.code)===null||t===void 0?void 0:t.optimize,X=P===!0||P===void 0?1:P||0,ie=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:nu,rt=(o=e.uriResolver)!==null&&o!==void 0?o:yv.default;return{strictSchema:(a=(i=e.strictSchema)!==null&&i!==void 0?i:$)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:$)!==null&&c!==void 0?c:!0,strictTypes:(d=(l=e.strictTypes)!==null&&l!==void 0?l:$)!==null&&d!==void 0?d:"log",strictTuples:(f=(p=e.strictTuples)!==null&&p!==void 0?p:$)!==null&&f!==void 0?f:"log",strictRequired:(m=(u=e.strictRequired)!==null&&u!==void 0?u:$)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:X,regExp:ie}:{optimize:X,regExp:ie},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:Qp,loopEnum:(h=e.loopEnum)!==null&&h!==void 0?h:Qp,meta:(w=e.meta)!==null&&w!==void 0?w:!0,messages:(_=e.messages)!==null&&_!==void 0?_:!0,inlineRefs:(b=e.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(A=e.schemaId)!==null&&A!==void 0?A:"$id",addUsedSchema:(I=e.addUsedSchema)!==null&&I!==void 0?I:!0,validateSchema:(R=e.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(S=e.validateFormats)!==null&&S!==void 0?S:!0,unicodeRegExp:(C=e.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(le=e.int32range)!==null&&le!==void 0?le:!0,uriResolver:rt}}var Yn=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...kv(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new hv.ValueScope({scope:{},prefixes:Iv,es5:r,lines:n}),this.logger=Nv(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,gv.getRules)(),eu.call(this,vv,t,"NOT SUPPORTED"),eu.call(this,bv,t,"DEPRECATED","warn"),this._metaOpts=Ev.call(this),t.formats&&_v.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&Av.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),Rv.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=Zp;n==="id"&&(o={...Zp},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(d,p){await i.call(this,d.$schema);let f=this._addSchema(d,p);return f.validate||a.call(this,f)}async function i(d){d&&!this.getSchema(d)&&await o.call(this,{$ref:d},!0)}async function a(d){try{return this._compileSchemaEnv(d)}catch(p){if(!(p instanceof ru.default))throw p;return s.call(this,p),await c.call(this,p.missingSchema),a.call(this,d)}}function s({missingSchema:d,missingRef:p}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${p} cannot be resolved`)}async function c(d){let p=await l.call(this,d);this.refs[d]||await i.call(this,p.$schema),this.refs[d]||this.addSchema(p,d,r)}async function l(d){let p=this._loading[d];if(p)return p;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:a}=this.opts;if(i=t[a],i!==void 0&&typeof i!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Kn.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=tu.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new Wn.SchemaEnv({schema:{},schemaId:n});if(r=Wn.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=tu.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Kn.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Sv.call(this,n,r),!r)return(0,Bs.eachItem)(n,i=>qs.call(this,i)),this;jv.call(this,r);let o={...r,type:(0,fi.getJSONTypes)(r.type),schemaType:(0,fi.getJSONTypes)(r.schemaType)};return(0,Bs.eachItem)(n,o.type.length===0?i=>qs.call(this,i,o):i=>o.type.forEach(a=>qs.call(this,i,o,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),a=t;for(let s of i)a=a[s];for(let s in n){let c=n[s];if(typeof c!="object")continue;let{$data:l}=c.definition,d=a[s];l&&d&&(a[s]=ou(d))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof t=="object")a=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,Kn.normalizeId)(a||n);let l=Kn.getSchemaRefs.call(this,t,n);return c=new Wn.SchemaEnv({schema:t,schemaId:s,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Wn.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Wn.compileSchema.call(this,t)}finally{this.opts=r}}};Yn.ValidationError=mv.default;Yn.MissingRefError=ru.default;Ae.default=Yn;function eu(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function tu(e){return e=(0,Kn.normalizeId)(e),this.schemas[e]||this.refs[e]}function Rv(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function _v(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function Av(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function Ev(){let e={...this.opts};for(let t of wv)delete e[t];return e}var Pv={log(){},warn(){},error(){}};function Nv(e){if(e===!1)return Pv;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var Ov=/^[a-z_$][a-z0-9_$:-]*$/i;function Sv(e,t){let{RULES:r}=this;if((0,Bs.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Ov.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function qs(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=o?i.post:i.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},i.rules.push(a)),i.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,fi.getJSONTypes)(t.type),schemaType:(0,fi.getJSONTypes)(t.schemaType)}};t.before?Dv.call(this,a,s,t.before):a.rules.push(s),i.all[e]=s,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function Dv(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function jv(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ou(t)),e.validateSchema=this.compile(t,!0))}var $v={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ou(e){return{anyOf:[e,$v]}}});var au=E(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});var Cv={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};zs.default=Cv});var hi=E(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.callRef=vr.getValidate=void 0;var Tv=zn(),su=it(),Ke=x(),on=ot(),cu=Jn(),mi=q(),Lv={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:a,opts:s,self:c}=n,{root:l}=i;if((r==="#"||r==="#/")&&o===l.baseId)return p();let d=cu.resolveRef.call(c,l,o,r);if(d===void 0)throw new Tv.default(n.opts.uriResolver,o,r);if(d instanceof cu.SchemaEnv)return f(d);return u(d);function p(){if(i===l)return gi(e,a,i,i.$async);let m=t.scopeValue("root",{ref:l});return gi(e,(0,Ke._)`${m}.validate`,l,l.$async)}function f(m){let g=lu(e,m);gi(e,g,m,m.$async)}function u(m){let g=t.scopeValue("schema",s.code.source===!0?{ref:m,code:(0,Ke.stringify)(m)}:{ref:m}),h=t.name("valid"),w=e.subschema({schema:m,dataTypes:[],schemaPath:Ke.nil,topSchemaRef:g,errSchemaPath:r},h);e.mergeEvaluated(w),e.ok(h)}}};function lu(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Ke._)`${r.scopeValue("wrapper",{ref:t})}.validate`}vr.getValidate=lu;function gi(e,t,r,n){let{gen:o,it:i}=e,{allErrors:a,schemaEnv:s,opts:c}=i,l=c.passContext?on.default.this:Ke.nil;n?d():p();function d(){if(!s.$async)throw new Error("async schema referenced by sync schema");let m=o.let("valid");o.try(()=>{o.code((0,Ke._)`await ${(0,su.callValidateCode)(e,t,l)}`),u(t),a||o.assign(m,!0)},g=>{o.if((0,Ke._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),f(g),a||o.assign(m,!1)}),e.ok(m)}function p(){e.result((0,su.callValidateCode)(e,t,l),()=>u(t),()=>f(t))}function f(m){let g=(0,Ke._)`${m}.errors`;o.assign(on.default.vErrors,(0,Ke._)`${on.default.vErrors} === null ? ${g} : ${on.default.vErrors}.concat(${g})`),o.assign(on.default.errors,(0,Ke._)`${on.default.vErrors}.length`)}function u(m){var g;if(!i.opts.unevaluated)return;let h=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(h&&!h.dynamicProps)h.props!==void 0&&(i.props=mi.mergeEvaluated.props(o,h.props,i.props));else{let w=o.var("props",(0,Ke._)`${m}.evaluated.props`);i.props=mi.mergeEvaluated.props(o,w,i.props,Ke.Name)}if(i.items!==!0)if(h&&!h.dynamicItems)h.items!==void 0&&(i.items=mi.mergeEvaluated.items(o,h.items,i.items));else{let w=o.var("items",(0,Ke._)`${m}.evaluated.items`);i.items=mi.mergeEvaluated.items(o,w,i.items,Ke.Name)}}}vr.callRef=gi;vr.default=Lv});var du=E(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});var xv=au(),Vv=hi(),Mv=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xv.default,Vv.default];Js.default=Mv});var pu=E(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});var yi=x(),Qt=yi.operators,wi={maximum:{okStr:"<=",ok:Qt.LTE,fail:Qt.GT},minimum:{okStr:">=",ok:Qt.GTE,fail:Qt.LT},exclusiveMaximum:{okStr:"<",ok:Qt.LT,fail:Qt.GTE},exclusiveMinimum:{okStr:">",ok:Qt.GT,fail:Qt.LTE}},Uv={message:({keyword:e,schemaCode:t})=>(0,yi.str)`must be ${wi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,yi._)`{comparison: ${wi[e].okStr}, limit: ${t}}`},Fv={keyword:Object.keys(wi),type:"number",schemaType:"number",$data:!0,error:Uv,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,yi._)`${r} ${wi[t].fail} ${n} || isNaN(${r})`)}};Gs.default=Fv});var uu=E(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});var Hn=x(),qv={message:({schemaCode:e})=>(0,Hn.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Hn._)`{multipleOf: ${e}}`},Bv={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:qv,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,a=t.let("res"),s=i?(0,Hn._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,Hn._)`${a} !== parseInt(${a})`;e.fail$data((0,Hn._)`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};Ws.default=Bv});var mu=E(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});function fu(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}Ks.default=fu;fu.code='require("ajv/dist/runtime/ucs2length").default'});var gu=E(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});var br=x(),zv=q(),Jv=mu(),Gv={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,br.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,br._)`{limit: ${e}}`},Wv={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Gv,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?br.operators.GT:br.operators.LT,a=o.opts.unicode===!1?(0,br._)`${r}.length`:(0,br._)`${(0,zv.useFunc)(e.gen,Jv.default)}(${r})`;e.fail$data((0,br._)`${a} ${i} ${n}`)}};Ys.default=Wv});var hu=E(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var Kv=it(),Yv=q(),an=x(),Hv={message:({schemaCode:e})=>(0,an.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,an._)`{pattern: ${e}}`},Xv={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Hv,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=a.opts.code,l=c.code==="new RegExp"?(0,an._)`new RegExp`:(0,Yv.useFunc)(t,c),d=t.let("valid");t.try(()=>t.assign(d,(0,an._)`${l}(${i}, ${s}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,an._)`!${d}`)}else{let c=(0,Kv.usePattern)(e,o);e.fail$data((0,an._)`!${c}.test(${r})`)}}};Hs.default=Xv});var yu=E(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});var Xn=x(),Zv={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Xn.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Xn._)`{limit: ${e}}`},Qv={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Zv,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Xn.operators.GT:Xn.operators.LT;e.fail$data((0,Xn._)`Object.keys(${r}).length ${o} ${n}`)}};Xs.default=Qv});var wu=E(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var Zn=it(),Qn=x(),eb=q(),tb={message:({params:{missingProperty:e}})=>(0,Qn.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Qn._)`{missingProperty: ${e}}`},rb={keyword:"required",type:"object",schemaType:"array",$data:!0,error:tb,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:a}=e,{opts:s}=a;if(!i&&r.length===0)return;let c=r.length>=s.loopRequired;if(a.allErrors?l():d(),s.strictRequired){let u=e.parentSchema.properties,{definedProperties:m}=e.it;for(let g of r)if(u?.[g]===void 0&&!m.has(g)){let h=a.schemaEnv.baseId+a.errSchemaPath,w=`required property "${g}" is not defined at "${h}" (strictRequired)`;(0,eb.checkStrictMode)(a,w,a.opts.strictRequired)}}function l(){if(c||i)e.block$data(Qn.nil,p);else for(let u of r)(0,Zn.checkReportMissingProp)(e,u)}function d(){let u=t.let("missing");if(c||i){let m=t.let("valid",!0);e.block$data(m,()=>f(u,m)),e.ok(m)}else t.if((0,Zn.checkMissingProp)(e,r,u)),(0,Zn.reportMissingProp)(e,u),t.else()}function p(){t.forOf("prop",n,u=>{e.setParams({missingProperty:u}),t.if((0,Zn.noPropertyInData)(t,o,u,s.ownProperties),()=>e.error())})}function f(u,m){e.setParams({missingProperty:u}),t.forOf(u,n,()=>{t.assign(m,(0,Zn.propertyInData)(t,o,u,s.ownProperties)),t.if((0,Qn.not)(m),()=>{e.error(),t.break()})},Qn.nil)}}};Zs.default=rb});var Iu=E(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});var eo=x(),nb={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,eo.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,eo._)`{limit: ${e}}`},ob={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:nb,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?eo.operators.GT:eo.operators.LT;e.fail$data((0,eo._)`${r}.length ${o} ${n}`)}};Qs.default=ob});var Ii=E(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var vu=Rs();vu.code='require("ajv/dist/runtime/equal").default';ec.default=vu});var bu=E(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var tc=Mn(),Ee=x(),ib=q(),ab=Ii(),sb={message:({params:{i:e,j:t}})=>(0,Ee.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ee._)`{i: ${e}, j: ${t}}`},cb={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:sb,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:a,it:s}=e;if(!n&&!o)return;let c=t.let("valid"),l=i.items?(0,tc.getSchemaTypes)(i.items):[];e.block$data(c,d,(0,Ee._)`${a} === false`),e.ok(c);function d(){let m=t.let("i",(0,Ee._)`${r}.length`),g=t.let("j");e.setParams({i:m,j:g}),t.assign(c,!0),t.if((0,Ee._)`${m} > 1`,()=>(p()?f:u)(m,g))}function p(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function f(m,g){let h=t.name("item"),w=(0,tc.checkDataTypes)(l,h,s.opts.strictNumbers,tc.DataType.Wrong),_=t.const("indices",(0,Ee._)`{}`);t.for((0,Ee._)`;${m}--;`,()=>{t.let(h,(0,Ee._)`${r}[${m}]`),t.if(w,(0,Ee._)`continue`),l.length>1&&t.if((0,Ee._)`typeof ${h} == "string"`,(0,Ee._)`${h} += "_"`),t.if((0,Ee._)`typeof ${_}[${h}] == "number"`,()=>{t.assign(g,(0,Ee._)`${_}[${h}]`),e.error(),t.assign(c,!1).break()}).code((0,Ee._)`${_}[${h}] = ${m}`)})}function u(m,g){let h=(0,ib.useFunc)(t,ab.default),w=t.name("outer");t.label(w).for((0,Ee._)`;${m}--;`,()=>t.for((0,Ee._)`${g} = ${m}; ${g}--;`,()=>t.if((0,Ee._)`${h}(${r}[${m}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(w)})))}}};rc.default=cb});var ku=E(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var nc=x(),lb=q(),db=Ii(),pb={message:"must be equal to constant",params:({schemaCode:e})=>(0,nc._)`{allowedValue: ${e}}`},ub={keyword:"const",$data:!0,error:pb,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,nc._)`!${(0,lb.useFunc)(t,db.default)}(${r}, ${o})`):e.fail((0,nc._)`${i} !== ${r}`)}};oc.default=ub});var Ru=E(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var to=x(),fb=q(),mb=Ii(),gb={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,to._)`{allowedValues: ${e}}`},hb={keyword:"enum",schemaType:"array",$data:!0,error:gb,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:a}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let s=o.length>=a.opts.loopEnum,c,l=()=>c??(c=(0,fb.useFunc)(t,mb.default)),d;if(s||n)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let u=t.const("vSchema",i);d=(0,to.or)(...o.map((m,g)=>f(u,g)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",i,u=>t.if((0,to._)`${l()}(${r}, ${u})`,()=>t.assign(d,!0).break()))}function f(u,m){let g=o[m];return typeof g=="object"&&g!==null?(0,to._)`${l()}(${r}, ${u}[${m}])`:(0,to._)`${r} === ${g}`}}};ic.default=hb});var _u=E(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});var yb=pu(),wb=uu(),Ib=gu(),vb=hu(),bb=yu(),kb=wu(),Rb=Iu(),_b=bu(),Ab=ku(),Eb=Ru(),Pb=[yb.default,wb.default,Ib.default,vb.default,bb.default,kb.default,Rb.default,_b.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ab.default,Eb.default];ac.default=Pb});var cc=E(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.validateAdditionalItems=void 0;var kr=x(),sc=q(),Nb={message:({params:{len:e}})=>(0,kr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,kr._)`{limit: ${e}}`},Ob={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Nb,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,sc.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Au(e,n)}};function Au(e,t){let{gen:r,schema:n,data:o,keyword:i,it:a}=e;a.items=!0;let s=r.const("len",(0,kr._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,kr._)`${s} <= ${t.length}`);else if(typeof n=="object"&&!(0,sc.alwaysValidSchema)(a,n)){let l=r.var("valid",(0,kr._)`${s} <= ${t.length}`);r.if((0,kr.not)(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,s,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:sc.Type.Num},l),a.allErrors||r.if((0,kr.not)(l),()=>r.break())})}}ro.validateAdditionalItems=Au;ro.default=Ob});var lc=E(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.validateTuple=void 0;var Eu=x(),vi=q(),Sb=it(),Db={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Pu(e,"additionalItems",t);r.items=!0,!(0,vi.alwaysValidSchema)(r,t)&&e.ok((0,Sb.validateArray)(e))}};function Pu(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:a,it:s}=e;d(o),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=vi.mergeEvaluated.items(n,r.length,s.items));let c=n.name("valid"),l=n.const("len",(0,Eu._)`${i}.length`);r.forEach((p,f)=>{(0,vi.alwaysValidSchema)(s,p)||(n.if((0,Eu._)`${l} > ${f}`,()=>e.subschema({keyword:a,schemaProp:f,dataProp:f},c)),e.ok(c))});function d(p){let{opts:f,errSchemaPath:u}=s,m=r.length,g=m===p.minItems&&(m===p.maxItems||p[t]===!1);if(f.strictTuples&&!g){let h=`"${a}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${u}"`;(0,vi.checkStrictMode)(s,h,f.strictTuples)}}}no.validateTuple=Pu;no.default=Db});var Nu=E(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});var jb=lc(),$b={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,jb.validateTuple)(e,"items")};dc.default=$b});var Su=E(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});var Ou=x(),Cb=q(),Tb=it(),Lb=cc(),xb={message:({params:{len:e}})=>(0,Ou.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ou._)`{limit: ${e}}`},Vb={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:xb,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,Cb.alwaysValidSchema)(n,t)&&(o?(0,Lb.validateAdditionalItems)(e,o):e.ok((0,Tb.validateArray)(e)))}};pc.default=Vb});var Du=E(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var st=x(),bi=q(),Mb={message:({params:{min:e,max:t}})=>t===void 0?(0,st.str)`must contain at least ${e} valid item(s)`:(0,st.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,st._)`{minContains: ${e}}`:(0,st._)`{minContains: ${e}, maxContains: ${t}}`},Ub={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Mb,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,a,s,{minContains:c,maxContains:l}=n;i.opts.next?(a=c===void 0?1:c,s=l):a=1;let d=t.const("len",(0,st._)`${o}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,bi.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,bi.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,bi.alwaysValidSchema)(i,r)){let g=(0,st._)`${d} >= ${a}`;s!==void 0&&(g=(0,st._)`${g} && ${d} <= ${s}`),e.pass(g);return}i.items=!0;let p=t.name("valid");s===void 0&&a===1?u(p,()=>t.if(p,()=>t.break())):a===0?(t.let(p,!0),s!==void 0&&t.if((0,st._)`${o}.length > 0`,f)):(t.let(p,!1),f()),e.result(p,()=>e.reset());function f(){let g=t.name("_valid"),h=t.let("count",0);u(g,()=>t.if(g,()=>m(h)))}function u(g,h){t.forRange("i",0,d,w=>{e.subschema({keyword:"contains",dataProp:w,dataPropType:bi.Type.Num,compositeRule:!0},g),h()})}function m(g){t.code((0,st._)`${g}++`),s===void 0?t.if((0,st._)`${g} >= ${a}`,()=>t.assign(p,!0).break()):(t.if((0,st._)`${g} > ${s}`,()=>t.assign(p,!1).break()),a===1?t.assign(p,!0):t.if((0,st._)`${g} >= ${a}`,()=>t.assign(p,!0)))}}};uc.default=Ub});var ki=E(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.validateSchemaDeps=Nt.validatePropertyDeps=Nt.error=void 0;var fc=x(),Fb=q(),oo=it();Nt.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,fc.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,fc._)`{property: ${e},
|
|
6
6
|
missingProperty: ${n},
|
|
7
7
|
depsCount: ${t},
|
|
8
8
|
deps: ${r}}`};var qb={keyword:"dependencies",type:"object",schemaType:"object",error:Nt.error,code(e){let[t,r]=Bb(e);ju(e,t),$u(e,r)}};function Bb({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function ju(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let c=(0,oo.propertyInData)(r,n,a,o.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),o.allErrors?r.if(c,()=>{for(let l of s)(0,oo.checkReportMissingProp)(e,l)}):(r.if((0,fc._)`${c} && (${(0,oo.checkMissingProp)(e,s,i)})`),(0,oo.reportMissingProp)(e,i),r.else())}}Nt.validatePropertyDeps=ju;function $u(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,a=r.name("valid");for(let s in t)(0,Fb.alwaysValidSchema)(i,t[s])||(r.if((0,oo.propertyInData)(r,n,s,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:s},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a))}Nt.validateSchemaDeps=$u;Nt.default=qb});var Tu=E(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});var Cu=x(),zb=q(),Jb={message:"property name must be valid",params:({params:e})=>(0,Cu._)`{propertyName: ${e.propertyName}}`},Gb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Jb,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,zb.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),t.if((0,Cu.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};mc.default=Gb});var hc=E(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});var Ri=it(),yt=x(),Wb=ot(),_i=q(),Kb={message:"must NOT have additional properties",params:({params:e})=>(0,yt._)`{additionalProperty: ${e.additionalProperty}}`},Yb={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Kb,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:a}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:s,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,_i.alwaysValidSchema)(a,r))return;let l=(0,Ri.allSchemaProperties)(n.properties),d=(0,Ri.allSchemaProperties)(n.patternProperties);p(),e.ok((0,yt._)`${i} === ${Wb.default.errors}`);function p(){t.forIn("key",o,h=>{!l.length&&!d.length?m(h):t.if(f(h),()=>m(h))})}function f(h){let w;if(l.length>8){let _=(0,_i.schemaRefOrVal)(a,n.properties,"properties");w=(0,Ri.isOwnProperty)(t,_,h)}else l.length?w=(0,yt.or)(...l.map(_=>(0,yt._)`${h} === ${_}`)):w=yt.nil;return d.length&&(w=(0,yt.or)(w,...d.map(_=>(0,yt._)`${(0,Ri.usePattern)(e,_)}.test(${h})`))),(0,yt.not)(w)}function u(h){t.code((0,yt._)`delete ${o}[${h}]`)}function m(h){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){u(h);return}if(r===!1){e.setParams({additionalProperty:h}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,_i.alwaysValidSchema)(a,r)){let w=t.name("valid");c.removeAdditional==="failing"?(g(h,w,!1),t.if((0,yt.not)(w),()=>{e.reset(),u(h)})):(g(h,w),s||t.if((0,yt.not)(w),()=>t.break()))}}function g(h,w,_){let b={keyword:"additionalProperties",dataProp:h,dataPropType:_i.Type.Str};_===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(b,w)}}};gc.default=Yb});var Vu=E(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});var Hb=Bn(),Lu=it(),yc=q(),xu=hc(),Xb={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&xu.default.code(new Hb.KeywordCxt(i,xu.default,"additionalProperties"));let a=(0,Lu.allSchemaProperties)(r);for(let p of a)i.definedProperties.add(p);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=yc.mergeEvaluated.props(t,(0,yc.toHash)(a),i.props));let s=a.filter(p=>!(0,yc.alwaysValidSchema)(i,r[p]));if(s.length===0)return;let c=t.name("valid");for(let p of s)l(p)?d(p):(t.if((0,Lu.propertyInData)(t,o,p,i.opts.ownProperties)),d(p),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(c);function l(p){return i.opts.useDefaults&&!i.compositeRule&&r[p].default!==void 0}function d(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},c)}}};wc.default=Xb});var qu=E(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});var Mu=it(),Ai=x(),Uu=q(),Fu=q(),Zb={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:a}=i,s=(0,Mu.allSchemaProperties)(r),c=s.filter(g=>(0,Uu.alwaysValidSchema)(i,r[g]));if(s.length===0||c.length===s.length&&(!i.opts.unevaluated||i.props===!0))return;let l=a.strictSchema&&!a.allowMatchingProperties&&o.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof Ai.Name)&&(i.props=(0,Fu.evaluatedPropsToName)(t,i.props));let{props:p}=i;f();function f(){for(let g of s)l&&u(g),i.allErrors?m(g):(t.var(d,!0),m(g),t.if(d))}function u(g){for(let h in l)new RegExp(g).test(h)&&(0,Uu.checkStrictMode)(i,`property ${h} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){t.forIn("key",n,h=>{t.if((0,Ai._)`${(0,Mu.usePattern)(e,g)}.test(${h})`,()=>{let w=c.includes(g);w||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:h,dataPropType:Fu.Type.Str},d),i.opts.unevaluated&&p!==!0?t.assign((0,Ai._)`${p}[${h}]`,!0):!w&&!i.allErrors&&t.if((0,Ai.not)(d),()=>t.break())})})}}};Ic.default=Zb});var Bu=E(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});var Qb=q(),ek={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,Qb.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};vc.default=ek});var zu=E(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var tk=it(),rk={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:tk.validateUnion,error:{message:"must match a schema in anyOf"}};bc.default=rk});var Ju=E(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var Ei=x(),nk=q(),ok={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Ei._)`{passingSchemas: ${e.passing}}`},ik={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:ok,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block(l),e.result(a,()=>e.reset(),()=>e.error(!0));function l(){i.forEach((d,p)=>{let f;(0,nk.alwaysValidSchema)(o,d)?t.var(c,!0):f=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},c),p>0&&t.if((0,Ei._)`${c} && ${a}`).assign(a,!1).assign(s,(0,Ei._)`[${s}, ${p}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,p),f&&e.mergeEvaluated(f,Ei.Name)})})}}};kc.default=ik});var Gu=E(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});var ak=q(),sk={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,a)=>{if((0,ak.alwaysValidSchema)(n,i))return;let s=e.subschema({keyword:"allOf",schemaProp:a},o);e.ok(o),e.mergeEvaluated(s)})}};Rc.default=sk});var Yu=E(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});var Pi=x(),Ku=q(),ck={message:({params:e})=>(0,Pi.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Pi._)`{failingKeyword: ${e.ifClause}}`},lk={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ck,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Ku.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Wu(n,"then"),i=Wu(n,"else");if(!o&&!i)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),o&&i){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(s,l("then",d),l("else",d))}else o?t.if(s,l("then")):t.if((0,Pi.not)(s),l("else"));e.pass(a,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(d)}function l(d,p){return()=>{let f=e.subschema({keyword:d},s);t.assign(a,s),e.mergeValidEvaluated(f,a),p?t.assign(p,(0,Pi._)`${d}`):e.setParams({ifClause:d})}}}};function Wu(e,t){let r=e.schema[t];return r!==void 0&&!(0,Ku.alwaysValidSchema)(e,r)}_c.default=lk});var Hu=E(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});var dk=q(),pk={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,dk.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Ac.default=pk});var Xu=E(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});var uk=cc(),fk=Nu(),mk=lc(),gk=Su(),hk=Du(),yk=ki(),wk=Tu(),Ik=hc(),vk=Vu(),bk=qu(),kk=Bu(),Rk=zu(),_k=Ju(),Ak=Gu(),Ek=Yu(),Pk=Hu();function Nk(e=!1){let t=[kk.default,Rk.default,_k.default,Ak.default,Ek.default,Pk.default,wk.default,Ik.default,yk.default,vk.default,bk.default];return e?t.push(fk.default,gk.default):t.push(uk.default,mk.default),t.push(hk.default),t}Ec.default=Nk});var Nc=E(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.dynamicAnchor=void 0;var Pc=x(),Ok=ot(),Zu=Jn(),Sk=hi(),Dk={keyword:"$dynamicAnchor",schemaType:"string",code:e=>Qu(e,e.schema)};function Qu(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let o=(0,Pc._)`${Ok.default.dynamicAnchors}${(0,Pc.getProperty)(t)}`,i=n.errSchemaPath==="#"?n.validateName:jk(e);r.if((0,Pc._)`!${o}`,()=>r.assign(o,i))}io.dynamicAnchor=Qu;function jk(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:o,baseId:i,localRefs:a,meta:s}=t.root,{schemaId:c}=n.opts,l=new Zu.SchemaEnv({schema:r,schemaId:c,root:o,baseId:i,localRefs:a,meta:s});return Zu.compileSchema.call(n,l),(0,Sk.getValidate)(e,l)}io.default=Dk});var Oc=E(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.dynamicRef=void 0;var ef=x(),$k=ot(),tf=hi(),Ck={keyword:"$dynamicRef",schemaType:"string",code:e=>rf(e,e.schema)};function rf(e,t){let{gen:r,keyword:n,it:o}=e;if(t[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let i=t.slice(1);if(o.allErrors)a();else{let c=r.let("valid",!1);a(c),e.ok(c)}function a(c){if(o.schemaEnv.root.dynamicAnchors[i]){let l=r.let("_v",(0,ef._)`${$k.default.dynamicAnchors}${(0,ef.getProperty)(i)}`);r.if(l,s(l,c),s(o.validateName,c))}else s(o.validateName,c)()}function s(c,l){return l?()=>r.block(()=>{(0,tf.callRef)(e,c),r.let(l,!0)}):()=>(0,tf.callRef)(e,c)}}ao.dynamicRef=rf;ao.default=Ck});var nf=E(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var Tk=Nc(),Lk=q(),xk={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,Tk.dynamicAnchor)(e,""):(0,Lk.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Sc.default=xk});var of=E(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});var Vk=Oc(),Mk={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,Vk.dynamicRef)(e,e.schema)};Dc.default=Mk});var af=E(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});var Uk=Nc(),Fk=Oc(),qk=nf(),Bk=of(),zk=[Uk.default,Fk.default,qk.default,Bk.default];jc.default=zk});var cf=E($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});var sf=ki(),Jk={keyword:"dependentRequired",type:"object",schemaType:"object",error:sf.error,code:e=>(0,sf.validatePropertyDeps)(e)};$c.default=Jk});var lf=E(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});var Gk=ki(),Wk={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,Gk.validateSchemaDeps)(e)};Cc.default=Wk});var df=E(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});var Kk=q(),Yk={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){t.contains===void 0&&(0,Kk.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}};Tc.default=Yk});var pf=E(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});var Hk=cf(),Xk=lf(),Zk=df(),Qk=[Hk.default,Xk.default,Zk.default];Lc.default=Qk});var ff=E(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});var er=x(),uf=q(),eR=ot(),tR={message:"must NOT have unevaluated properties",params:({params:e})=>(0,er._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},rR={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:tR,code(e){let{gen:t,schema:r,data:n,errsCount:o,it:i}=e;if(!o)throw new Error("ajv implementation error");let{allErrors:a,props:s}=i;s instanceof er.Name?t.if((0,er._)`${s} !== true`,()=>t.forIn("key",n,p=>t.if(l(s,p),()=>c(p)))):s!==!0&&t.forIn("key",n,p=>s===void 0?c(p):t.if(d(s,p),()=>c(p))),i.props=!0,e.ok((0,er._)`${o} === ${eR.default.errors}`);function c(p){if(r===!1){e.setParams({unevaluatedProperty:p}),e.error(),a||t.break();return}if(!(0,uf.alwaysValidSchema)(i,r)){let f=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:uf.Type.Str},f),a||t.if((0,er.not)(f),()=>t.break())}}function l(p,f){return(0,er._)`!${p} || !${p}[${f}]`}function d(p,f){let u=[];for(let m in p)p[m]===!0&&u.push((0,er._)`${f} !== ${m}`);return(0,er.and)(...u)}}};xc.default=rR});var gf=E(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});var Rr=x(),mf=q(),nR={message:({params:{len:e}})=>(0,Rr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Rr._)`{limit: ${e}}`},oR={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:nR,code(e){let{gen:t,schema:r,data:n,it:o}=e,i=o.items||0;if(i===!0)return;let a=t.const("len",(0,Rr._)`${n}.length`);if(r===!1)e.setParams({len:i}),e.fail((0,Rr._)`${a} > ${i}`);else if(typeof r=="object"&&!(0,mf.alwaysValidSchema)(o,r)){let c=t.var("valid",(0,Rr._)`${a} <= ${i}`);t.if((0,Rr.not)(c),()=>s(c,i)),e.ok(c)}o.items=!0;function s(c,l){t.forRange("i",l,a,d=>{e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:mf.Type.Num},c),o.allErrors||t.if((0,Rr.not)(c),()=>t.break())})}}};Vc.default=oR});var hf=E(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});var iR=ff(),aR=gf(),sR=[iR.default,aR.default];Mc.default=sR});var yf=E(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});var we=x(),cR={message:({schemaCode:e})=>(0,we.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,we._)`{format: ${e}}`},lR={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:cR,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:l,schemaEnv:d,self:p}=s;if(!c.validateFormats)return;o?f():u();function f(){let m=r.scopeValue("formats",{ref:p.formats,code:c.code.formats}),g=r.const("fDef",(0,we._)`${m}[${a}]`),h=r.let("fType"),w=r.let("format");r.if((0,we._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(h,(0,we._)`${g}.type || "string"`).assign(w,(0,we._)`${g}.validate`),()=>r.assign(h,(0,we._)`"string"`).assign(w,g)),e.fail$data((0,we.or)(_(),b()));function _(){return c.strictSchema===!1?we.nil:(0,we._)`${a} && !${w}`}function b(){let A=d.$async?(0,we._)`(${g}.async ? await ${w}(${n}) : ${w}(${n}))`:(0,we._)`${w}(${n})`,I=(0,we._)`(typeof ${w} == "function" ? ${A} : ${w}.test(${n}))`;return(0,we._)`${w} && ${w} !== true && ${h} === ${t} && !${I}`}}function u(){let m=p.formats[i];if(!m){_();return}if(m===!0)return;let[g,h,w]=b(m);g===t&&e.pass(A());function _(){if(c.strictSchema===!1){p.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function b(I){let R=I instanceof RegExp?(0,we.regexpCode)(I):c.code.formats?(0,we._)`${c.code.formats}${(0,we.getProperty)(i)}`:void 0,S=r.scopeValue("formats",{key:i,ref:I,code:R});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,we._)`${S}.validate`]:["string",I,S]}function A(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!d.$async)throw new Error("async format in sync schema");return(0,we._)`await ${w}(${n})`}return typeof h=="function"?(0,we._)`${w}(${n})`:(0,we._)`${w}.test(${n})`}}}};Uc.default=lR});var wf=E(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});var dR=yf(),pR=[dR.default];Fc.default=pR});var If=E(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.contentVocabulary=sn.metadataVocabulary=void 0;sn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];sn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var bf=E(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var uR=du(),fR=_u(),mR=Xu(),gR=af(),hR=pf(),yR=hf(),wR=wf(),vf=If(),IR=[gR.default,uR.default,fR.default,(0,mR.default)(!0),wR.default,vf.metadataVocabulary,vf.contentVocabulary,hR.default,yR.default];qc.default=IR});var Rf=E(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.DiscrError=void 0;var kf;(function(e){e.Tag="tag",e.Mapping="mapping"})(kf||(Ni.DiscrError=kf={}))});var Af=E(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});var cn=x(),Bc=Rf(),_f=Jn(),vR=zn(),bR=q(),kR={message:({params:{discrError:e,tagName:t}})=>e===Bc.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,cn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},RR={keyword:"discriminator",type:"object",schemaType:"object",error:kR,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:a}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=n.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",(0,cn._)`${r}${(0,cn.getProperty)(s)}`);t.if((0,cn._)`typeof ${l} == "string"`,()=>d(),()=>e.error(!1,{discrError:Bc.DiscrError.Tag,tag:l,tagName:s})),e.ok(c);function d(){let u=f();t.if(!1);for(let m in u)t.elseIf((0,cn._)`${l} === ${m}`),t.assign(c,p(u[m]));t.else(),e.error(!1,{discrError:Bc.DiscrError.Mapping,tag:l,tagName:s}),t.endIf()}function p(u){let m=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:u},m);return e.mergeEvaluated(g,cn.Name),m}function f(){var u;let m={},g=w(o),h=!0;for(let A=0;A<a.length;A++){let I=a[A];if(I?.$ref&&!(0,bR.schemaHasRulesButRef)(I,i.self.RULES)){let S=I.$ref;if(I=_f.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,S),I instanceof _f.SchemaEnv&&(I=I.schema),I===void 0)throw new vR.default(i.opts.uriResolver,i.baseId,S)}let R=(u=I?.properties)===null||u===void 0?void 0:u[s];if(typeof R!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);h=h&&(g||w(I)),_(R,A)}if(!h)throw new Error(`discriminator: "${s}" must be required`);return m;function w({required:A}){return Array.isArray(A)&&A.includes(s)}function _(A,I){if(A.const)b(A.const,I);else if(A.enum)for(let R of A.enum)b(R,I);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function b(A,I){if(typeof A!="string"||A in m)throw new Error(`discriminator: "${s}" values must be unique strings`);m[A]=I}}}};zc.default=RR});var Ef=E((EO,_R)=>{_R.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Pf=E((PO,AR)=>{AR.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Nf=E((NO,ER)=>{ER.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Of=E((OO,PR)=>{PR.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Sf=E((SO,NR)=>{NR.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var Df=E((DO,OR)=>{OR.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var jf=E((jO,SR)=>{SR.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var $f=E(($O,DR)=>{DR.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var Cf=E(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var jR=Ef(),$R=Pf(),CR=Nf(),TR=Of(),LR=Sf(),xR=Df(),VR=jf(),MR=$f(),UR=["/properties"];function FR(e){return[jR,$R,CR,TR,LR,t(this,xR),VR,t(this,MR)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,UR):n}}Jc.default=FR});var _r=E((pe,Wc)=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.MissingRefError=pe.ValidationError=pe.CodeGen=pe.Name=pe.nil=pe.stringify=pe.str=pe._=pe.KeywordCxt=pe.Ajv2020=void 0;var qR=iu(),BR=bf(),zR=Af(),JR=Cf(),Gc="https://json-schema.org/draft/2020-12/schema",ln=class extends qR.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),BR.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(zR.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(JR.default.call(this,t),this.refs["http://json-schema.org/schema"]=Gc)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Gc)?Gc:void 0)}};pe.Ajv2020=ln;Wc.exports=pe=ln;Wc.exports.Ajv2020=ln;Object.defineProperty(pe,"__esModule",{value:!0});pe.default=ln;var GR=Bn();Object.defineProperty(pe,"KeywordCxt",{enumerable:!0,get:function(){return GR.KeywordCxt}});var dn=x();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return dn._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return dn.str}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return dn.stringify}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return dn.nil}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return dn.Name}});Object.defineProperty(pe,"CodeGen",{enumerable:!0,get:function(){return dn.CodeGen}});var WR=ai();Object.defineProperty(pe,"ValidationError",{enumerable:!0,get:function(){return WR.default}});var KR=zn();Object.defineProperty(pe,"MissingRefError",{enumerable:!0,get:function(){return KR.default}})});import je from"node:process";import jt from"node:path";import{spawnSync as Q0}from"node:child_process";var Z="^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$",At="^sha256:[a-f0-9]{64}$";import{constants as Wi}from"node:fs";import{lstat as __,mkdir as In,open as Xf,readFile as go,realpath as Dr,rename as A_,unlink as dl}from"node:fs/promises";import{randomUUID as pl}from"node:crypto";import Re from"node:path";var Tf=Kr(_r(),1);var Pe={type:"string",pattern:At},YR={type:"string",pattern:"^[a-z][a-z0-9.-]{2,127}$"},Kc={type:"string",format:"date-time"},Yc={enum:["typescript.typecheck","vitest.run","typescript.build","npm.pack-dry-run","workspace.structure","capability.assets","node.application-smoke","web.application-build","web.application-smoke","expo.application-config","expo.application-export","react.library-build","next.application-test","next.application-build","next.application-package","next.application-smoke","application.config-contract"]},Lf={type:"object",additionalProperties:!1,required:["node","pnpm","typescript"],properties:{node:{type:"string",minLength:1,maxLength:64},pnpm:{type:"string",minLength:1,maxLength:64},typescript:{type:"string",minLength:1,maxLength:64}}},Hc={$id:"https://schemas.dyyto.dev/platform/capability-bundle-release-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","capabilityId","version","integrity","consumerProfile","compatibility","assets","verifiers","exit"],properties:{schemaVersion:{const:1},capabilityId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},integrity:Pe,consumerProfile:{enum:["blank-typescript-library","standalone-npm-package","react-component-library","nextjs-full-stack-application","workspace-root","workspace-npm-package","workspace-node-application","workspace-web-application","workspace-expo-application","any-project"]},kind:{enum:["profile","engineering-feature","integration-feature","domain-extension"]},dependencies:{type:"object",additionalProperties:!1,required:["profiles"],properties:{profiles:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",minLength:1,maxLength:128}},capabilities:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:Z}}}},compatibility:Lf,integration:{type:"object",additionalProperties:!1,required:["title","purpose","packages","codeAssets"],properties:{title:{type:"string",minLength:1,maxLength:128},purpose:{type:"string",minLength:1,maxLength:512},packages:{type:"array",items:{type:"object",additionalProperties:!1,required:["packageName","version","usage","imports"],properties:{packageName:{type:"string",minLength:1,maxLength:214},version:{type:"string",minLength:1,maxLength:128},usage:{enum:["runtime","development","build","test"]},imports:{type:"array",items:{type:"object",additionalProperties:!1,required:["importFrom","symbol"],properties:{importFrom:{type:"string",minLength:1,maxLength:214},symbol:{type:"string",minLength:1,maxLength:128},referencePath:{type:"string",minLength:1,maxLength:512}}}}}}},codeAssets:{type:"array",items:{type:"object",additionalProperties:!1,required:["sourcePath","targetPath","ownership"],properties:{sourcePath:{type:"string",minLength:1,maxLength:512},targetPath:{type:"string",minLength:1,maxLength:512},ownership:{enum:["owned-file","managed-region","seed-file"]}}}}}},assets:{type:"array",minItems:1,items:{type:"object",additionalProperties:!1,required:["path","ownership","digest","mode"],properties:{path:{type:"string",minLength:1,maxLength:512},ownership:{enum:["owned-file","managed-region","seed-file"]},digest:Pe,mode:{type:"integer",minimum:0,maximum:511},regionId:{type:"string",pattern:Z},renderer:{enum:["npm-package-json-v1","npm-package-json-v2","react-component-package-json-v1","nextjs-application-package-json-v1","workspace-root-package-json-v1","node-application-package-json-v1","web-application-package-json-v1","expo-application-package-json-v1","application-config-contract-v1","application-config-binding-v1"]}},allOf:[{if:{properties:{ownership:{const:"managed-region"}},required:["ownership"]},then:{properties:{regionId:{type:"string",pattern:Z}},required:["regionId"]},else:{not:{required:["regionId"]}}}]}},verifiers:{type:"array",minItems:1,items:{type:"object",additionalProperties:!1,required:["id"],properties:{id:Yc}}},exit:{type:"object",additionalProperties:!1,required:["ownedAssets"],properties:{ownedAssets:{type:"array",items:{type:"string",minLength:1,maxLength:512}}}}}},xf={type:"object",additionalProperties:!1,required:["registryId","packageName","version","integrity","tarballDigest","deliveryReceiptId","usage"],properties:{registryId:{type:"string",pattern:"^registry\\.[a-z0-9][a-z0-9.-]{1,126}$"},packageName:{type:"string",pattern:"^@[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$",maxLength:214},version:{type:"string",pattern:"^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$",maxLength:64},integrity:{type:"string",pattern:"^sha512-[A-Za-z0-9+/]{86}==$"},tarballDigest:Pe,deliveryReceiptId:Pe,usage:{enum:["runtime","development"]}}},{$id:LO,...Vf}=Hc,HR={...Vf,$id:"https://schemas.dyyto.dev/platform/capability-bundle-release-v2.json",required:[...Hc.required,"availability","packageSources"],properties:{...Hc.properties,schemaVersion:{const:2},availability:{oneOf:[{type:"object",additionalProperties:!1,required:["maturity","visibility","sourceState"],properties:{maturity:{const:"candidate"},visibility:{const:"maintainers-only"},sourceState:{const:"local-artifact"}}},{type:"object",additionalProperties:!1,required:["maturity","visibility","sourceState"],properties:{maturity:{const:"candidate"},visibility:{const:"maintainers-only"},sourceState:{const:"development-registry"}}},{type:"object",additionalProperties:!1,required:["maturity","visibility","sourceState"],properties:{maturity:{const:"available"},visibility:{const:"catalog-consumers"},sourceState:{const:"registry-verified"}}},{type:"object",additionalProperties:!1,required:["maturity","visibility","reasonCode"],properties:{maturity:{const:"withdrawn"},visibility:{const:"existing-locks-only"},reasonCode:{type:"string",pattern:"^[A-Z][A-Z0-9_]{2,63}$"}}}]},packageSources:{type:"array",maxItems:128,items:xf}}},XR={$id:"https://schemas.dyyto.dev/platform/capability-bundle-release.json",oneOf:[Vf,(()=>{let{$id:e,...t}=HR;return t})()]},Oi={$id:"https://schemas.dyyto.dev/platform/verification-result-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","verifierId","result","issuer","commandId","exitCode","stdoutDigest","stderrDigest","startedAt","completedAt","projectStateDigest","runtime"],properties:{schemaVersion:{const:1},verifierId:Yc,result:{enum:["passed","failed"]},issuer:{enum:["dyyto-cli","test-harness","external-ci"]},commandId:Yc,exitCode:{type:"integer",minimum:0,maximum:255},stdoutDigest:Pe,stderrDigest:Pe,startedAt:Kc,completedAt:Kc,projectStateDigest:Pe,runtime:Lf}},ZR={...Oi,$id:"https://schemas.dyyto.dev/platform/adoption-evidence-v1.json",required:[...Oi.required,"evidenceId","capabilityId","capabilityVersion","capabilityIntegrity"],properties:{...Oi.properties,evidenceId:Pe,capabilityId:{type:"string",pattern:Z},capabilityVersion:{type:"string",minLength:1,maxLength:128},capabilityIntegrity:Pe}},QR={$id:"https://schemas.dyyto.dev/platform/project-adoption-lock.json",type:"object",additionalProperties:!1,required:["schemaVersion","capabilities"],properties:{schemaVersion:{enum:[1,2]},capabilities:{type:"array",items:{type:"object",additionalProperties:!1,required:["capabilityId","version","integrity","consumerProfile","appliedPlanId","projectStateDigest","assets","evidenceIds","committedAt"],properties:{capabilityId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},integrity:Pe,consumerProfile:{type:"string",minLength:1,maxLength:128},appliedPlanId:Pe,projectStateDigest:Pe,assets:{type:"array",items:{type:"object",additionalProperties:!1,required:["path","digest"],properties:{path:{type:"string",minLength:1,maxLength:512},digest:Pe,ownership:{enum:["owned-file","managed-region","seed-file"]},regionId:{type:"string",pattern:Z}},allOf:[{if:{properties:{ownership:{const:"managed-region"}},required:["ownership"]},then:{properties:{regionId:{type:"string",pattern:Z}},required:["regionId"]}}]}},evidenceIds:{type:"array",items:Pe},committedAt:Kc,packageAdoption:{type:"object",additionalProperties:!1,required:["registryRevisions","sources","packageJsonDigest","lockfileDigest"],properties:{sourceChannel:{enum:["production","development"]},registryRevisions:{type:"array",items:{type:"object",additionalProperties:!1,required:["registryId","revision"],properties:{registryId:YR,revision:Pe}}},sources:{type:"array",minItems:1,maxItems:128,items:xf},packageJsonDigest:Pe,lockfileDigest:Pe}}}}}},allOf:[{if:{properties:{schemaVersion:{const:1}},required:["schemaVersion"]},then:{properties:{capabilities:{type:"array",items:{type:"object",not:{type:"object",properties:{packageAdoption:{}},required:["packageAdoption"]}}}}}}]},so=new Tf.Ajv2020({allErrors:!0,strict:!0});so.addFormat("date-time",{type:"string",validate:e=>!Number.isNaN(Date.parse(e))});var Di={capabilityBundleRelease:so.compile(XR),verificationResult:so.compile(Oi),adoptionEvidence:so.compile(ZR),projectAdoptionLock:so.compile(QR)},Si=class extends Error{contract;issues;code="ADOPTION_CONTRACT_INVALID";constructor(t,r){super(`Invalid ${t} contract`),this.contract=t,this.issues=r}};function ji(e,t,r){if(!t(r))throw new Si(e,t.errors??[]);return r}var Mf=e=>{let t=ji("capabilityBundleRelease",Di.capabilityBundleRelease,e);if(t.schemaVersion===2){let r=()=>{throw new Si("capabilityBundleRelease",[])},n=t.packageSources;(t.availability.maturity==="candidate"&&t.availability.sourceState==="local-artifact"&&n.length!==0||t.availability.maturity==="candidate"&&t.availability.sourceState==="development-registry"&&n.length===0||t.availability.maturity!=="candidate"&&n.length===0)&&r();let o="",i=new Set;for(let s of n){let c=`${s.packageName}@${s.version}`;(c.localeCompare(o)<=0||i.has(c))&&r(),o=c,i.add(c)}let a=t.integration?.packages??[];(t.availability.maturity!=="candidate"||t.availability.sourceState==="development-registry")&&(a.length!==n.length||a.some(s=>!n.some(c=>c.packageName===s.packageName&&c.version===s.version&&c.usage===s.usage)))&&r()}return t},Uf=e=>ji("verificationResult",Di.verificationResult,e),co=e=>ji("adoptionEvidence",Di.adoptionEvidence,e),qe=e=>ji("projectAdoptionLock",Di.projectAdoptionLock,e);import{lstat as c_,readFile as el,realpath as tl}from"node:fs/promises";import un from"node:path";import{createHash as e_}from"node:crypto";function y(e){return`sha256:${e_("sha256").update(e).digest("hex")}`}function k(e){return Array.isArray(e)?`[${e.map(k).join(",")}]`:e!==null&&typeof e=="object"?`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${JSON.stringify(r)}:${k(n)}`).join(",")}}`:JSON.stringify(e)}var Ot=class extends Error{code="MANAGED_REGION_INVALID";constructor(t){super(t)}};function Ff(e){if(!new RegExp(Z).test(e))throw new Ot("Region identity is invalid");return{begin:`<!-- dyyto:begin ${e} -->`,end:`<!-- dyyto:end ${e} -->`}}function $i(e,t){if(e.includes("\r"))throw new Ot("Managed regions require LF newlines");let{begin:r,end:n}=Ff(t),o=e.split(r).length-1,i=e.split(n).length-1;if(o!==1||i!==1)throw new Ot("Managed region markers are unavailable or ambiguous");let a=e.indexOf(r)+r.length,s=e.indexOf(n,a),c=e.slice(a,s);if(/<!-- dyyto:(?:begin|end) /.test(c))throw new Ot("Managed regions cannot overlap");return`${c.replace(/^\n+|\n+$/g,"")}
|
|
@@ -42,7 +42,7 @@ ${r}`;if(n===0){let d=e.source.replace(/\n*$/g,"");return`${d}${d.length===0?"":
|
|
|
42
42
|
`),await c.sync()}finally{await c.close()}return await Ra(`${a}.tmp`,a),await this.resymbolicate(t.releaseId),s}async resymbolicate(t){let r=await Wl(ye.join(this.releases(),t)).catch(()=>[]),n=[];for(let o of r)try{n.push(JSON.parse(await Do(ye.join(this.releases(),t,o),"utf8")))}catch{}for(let o of(await this.all()).filter(i=>i.releaseId===t&&i.state==="map-missing")){let i=!1,a=o.error.frames.map(d=>{let p=n.find(f=>new URL(d.file,"http://local").pathname.endsWith(`/${f.registration.asset}`));if(!p||d.line===void 0||d.column===void 0)return d;try{let f=vg(new Ig(p.map),{line:d.line,column:Math.max(0,d.column-1)});return f.source===null||f.line===null||f.column===null?d:(i=!0,{...d,source:f.source.replace(/^file:\/\//,""),sourceLine:f.line,sourceColumn:f.column+1})}catch{return d}});if(!i)continue;let s={...o,error:{...o.error,frames:a},state:"symbolicated"},c=ye.join(this.directory(),`${o.eventId}.json`),l=await ka(`${c}.tmp`,"w",384);try{await l.writeFile(`${k(s)}
|
|
43
43
|
`),await l.sync()}finally{await l.close()}await Ra(`${c}.tmp`,c)}}};var Ze=(e,t,r,n,o)=>({code:e,severity:t,fact:r,message:n,...o===void 0?{}:{action:o}});async function $o(e){if(e.lock.capabilities.length===0||e.lock.capabilities.some(r=>r.evidenceIds.length===0))return[Ze("EVIDENCE_INVALID","critical","evidence","\u5DF2\u9A8C\u8BC1\u9501\u7F3A\u5C11\u5B8C\u6574\u8BC1\u636E\u5F15\u7528\u3002","\u91CD\u65B0\u8FD0\u884C\u9A8C\u8BC1\uFF1B\u82E5\u4E8B\u52A1\u672A\u5B8C\u6210\uFF0C\u5148\u6267\u884C\u5B89\u5168\u6062\u590D\u3002")];for(let r of e.lock.capabilities)for(let n of r.evidenceIds)try{let o=co(JSON.parse(await _g(Yl.join(e.projectRoot,".dyyto","evidence",`${n}.json`),"utf8")));if(o.evidenceId!==n||o.capabilityId!==r.capabilityId||o.capabilityVersion!==r.version||o.capabilityIntegrity!==r.integrity||o.projectStateDigest!==r.projectStateDigest||o.result!=="passed")return[Ze("EVIDENCE_INVALID","critical","evidence","\u91C7\u7528\u8BC1\u636E\u4E0E\u5DF2\u9A8C\u8BC1\u9501\u7684\u8EAB\u4EFD\u6216\u5DE5\u7A0B\u72B6\u6001\u4E0D\u4E00\u81F4\u3002","\u91CD\u65B0\u8FD0\u884C\u9A8C\u8BC1\uFF1B\u82E5\u73B0\u573A\u5DF2\u53D8\u5316\uFF0C\u5148\u68C0\u67E5\u5E76\u91CD\u65B0\u89C4\u5212\u3002")]}catch{return[Ze("EVIDENCE_INVALID","critical","evidence","\u91C7\u7528\u8BC1\u636E\u7F3A\u5931\u3001\u635F\u574F\u6216\u4E0D\u7B26\u5408\u5951\u7EA6\u3002","\u91CD\u65B0\u8FD0\u884C\u9A8C\u8BC1\uFF1B\u82E5\u4E8B\u52A1\u672A\u5B8C\u6210\uFF0C\u5148\u6267\u884C\u5B89\u5168\u6062\u590D\u3002")]}let t=e.lock.capabilities.reduce((r,n)=>r+n.evidenceIds.length,0);return[Ze("EVIDENCE_VALID","info","evidence",`\u5DF2\u6838\u9A8C ${e.lock.capabilities.length} \u9879\u80FD\u529B\u7684 ${t} \u6761\u91C7\u7528\u8BC1\u636E\u3002`)]}function Hl(e){return e==="adopted"?[]:e==="planned"?[Ze("ADOPTION_PLANNED","warning","lock","\u80FD\u529B\u91C7\u7528\u4ECD\u5904\u4E8E\u8BA1\u5212\u9636\u6BB5\u3002","\u5BA1\u9605\u5E76\u6279\u51C6\u7CBE\u786E Plan\u3002")]:e==="applied-unverified"?[Ze("VERIFICATION_REQUIRED","warning","evidence","\u53D8\u66F4\u5DF2\u5E94\u7528\u4F46\u5C1A\u672A\u5F62\u6210\u9A8C\u8BC1\u8BC1\u636E\u3002","\u8FD0\u884C\u9A8C\u8BC1\u5E76\u63D0\u4EA4\u91C7\u7528\u9501\u3002")]:e==="drifted"?[Ze("REPOSITORY_DRIFT","warning","repository","\u5DE5\u7A0B\u73B0\u573A\u4E0E\u5DF2\u9501\u5B9A\u4E8B\u5B9E\u4E0D\u4E00\u81F4\u3002","\u68C0\u67E5\u5DEE\u5F02\u5E76\u91CD\u65B0\u89C4\u5212\uFF0C\u5E73\u53F0\u4E0D\u4F1A\u8986\u76D6\u7528\u6237\u4FEE\u6539\u3002")]:e==="recovery-required"?[Ze("RECOVERY_REQUIRED","critical","recovery","\u68C0\u6D4B\u5230\u672A\u5B8C\u6210\u7684\u6301\u4E45\u5316\u4E8B\u52A1\u3002","\u5148\u6267\u884C\u5B89\u5168\u6062\u590D\uFF0C\u518D\u7EE7\u7EED\u5176\u4ED6\u64CD\u4F5C\u3002")]:[Ze("FACT_INVALID","critical","manifest","\u5DE5\u7A0B\u5355\u5143\u4E8B\u5B9E\u65E0\u6CD5\u5B89\u5168\u8BFB\u53D6\u3002","\u4FEE\u590D\u8BE5\u5355\u5143\u7684 Manifest \u6216\u5143\u6570\u636E\u540E\u91CD\u65B0\u8BCA\u65AD\u3002")]}async function Ag(e){try{let r=JSON.parse(await _g(Yl.join(e.workspaceRoot,".dyyto","observability","config.json"),"utf8"));if(!Array.isArray(r.applications)||!r.applications.includes(e.applicationId))return[Ze("OBSERVABILITY_NOT_CONFIGURED","warning","repository","\u5F53\u524D Web \u5E94\u7528\u5C1A\u672A\u914D\u7F6E\u8FD0\u884C\u65F6\u9519\u8BEF\u91C7\u96C6\u3002","\u767B\u8BB0\u5E94\u7528 Origin\uFF0C\u5E76\u542F\u52A8\u672C\u5730\u91C7\u96C6\u7AEF\u3002")]}catch{return[Ze("OBSERVABILITY_NOT_CONFIGURED","warning","repository","\u5F53\u524D Web \u5E94\u7528\u5C1A\u672A\u914D\u7F6E\u8FD0\u884C\u65F6\u9519\u8BEF\u91C7\u96C6\u3002","\u767B\u8BB0\u5E94\u7528 Origin\uFF0C\u5E76\u542F\u52A8\u672C\u5730\u91C7\u96C6\u7AEF\u3002")]}await new Bt(e.workspaceRoot).list({applicationId:e.applicationId});let t=(await yE(Yl.join(e.workspaceRoot,".dyyto","observability","quarantine")).catch(()=>[])).length;return t>0?[Ze("OBSERVABILITY_STORE_DAMAGED","critical","repository",`\u8FD0\u884C\u65F6\u9519\u8BEF\u672C\u5730\u5B58\u50A8\u5DF2\u9694\u79BB ${t} \u6761\u635F\u574F\u8BB0\u5F55\uFF0C\u5065\u5EB7\u4E8B\u4EF6\u4ECD\u53EF\u67E5\u8BE2\u3002`,"\u68C0\u67E5\u672C\u673A\u78C1\u76D8\u72B6\u6001\uFF0C\u5E76\u663E\u5F0F\u5904\u7406\u9694\u79BB\u8BB0\u5F55\u3002")]:[Ze("OBSERVABILITY_CONFIGURED","info","repository","\u8FD0\u884C\u65F6\u9519\u8BEF\u91C7\u96C6\u914D\u7F6E\u4E0E\u672C\u5730\u5B58\u50A8\u53EF\u8BFB\u53D6\u3002")]}function Eg(e){let t=e.units.map(n=>{let o=n.findings.some(i=>i.severity==="critical")?"blocked":n.findings.some(i=>i.severity==="warning")?"attention":"healthy";return{...n,status:o}}),r={total:t.length,healthy:t.filter(n=>n.status==="healthy").length,attention:t.filter(n=>n.status==="attention").length,blocked:t.filter(n=>n.status==="blocked").length};return{schemaVersion:1,workspace:e.workspace,generatedAt:e.generatedAt,status:r.blocked>0?"blocked":r.attention>0?"attention":"healthy",summary:r,units:t}}import{readFile as Co,realpath as Pg}from"node:fs/promises";import Ur from"node:path";var se=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Ng(e){let t=await Pg(Ur.resolve(e.projectRoot)),r=Y(e.manifest),n=e.release.release,o=e.currentLock.capabilities.find(f=>f.capabilityId===n.capabilityId&&f.version===n.version);if(!o||o.packageAdoption!==void 0)throw new se("CAPABILITY_RELEASE_VERSION_UNSUPPORTED","Asset-only removal requires an adopted Capability without package ownership");let i=Y({...r,capabilities:r.capabilities.filter(f=>f.capabilityId!==n.capabilityId)}),a=Buffer.from(`${JSON.stringify(i,null,2)}
|
|
44
44
|
`),s=await To(t,"project-capabilities.json");if(!s.exists||s.digest===void 0)throw new se("CAPABILITY_DEPENDENCY_UNSATISFIED","Project manifest is unavailable");let c=[{path:"project-capabilities.json",kind:"replace",ownership:"owned-file",baseDigest:s.digest,desiredDigest:y(a)},...o.assets.map(f=>({path:f.path,kind:"remove",ownership:f.ownership??"owned-file",baseDigest:f.digest}))],l=await Promise.all(c.map(f=>To(t,f.path))),d={schemaVersion:1,capabilityId:n.capabilityId,version:n.version,integrity:n.integrity,assets:o.assets.map(f=>({path:f.path,ownership:f.ownership??"owned-file",desiredDigest:f.digest})),verifiers:n.verifiers.map(f=>({id:f.id,kind:"file-digest"}))};return{plan:ke({action:"remove",capability:d,changes:c,observedAssets:l,generatedAt:e.generatedAt,expiresAt:e.expiresAt}),manifest:i,desiredContents:new Map([["project-capabilities.json",a]]),transactionRoot:t,removedSources:[]}}async function To(e,t){try{let r=await Co(Ur.join(e,...t.split("/")));return{path:t,exists:!0,digest:y(r)}}catch(r){if(r.code==="ENOENT")return{path:t,exists:!1};throw r}}async function Xl(e){if(e.release.release.schemaVersion===2&&e.release.release.packageSources.length>0&&e.packageSource===void 0)throw new se("CAPABILITY_RELEASE_VERSION_UNSUPPORTED","Capability Release v2 requires verified package source facts");let t=await Pg(Ur.resolve(e.projectRoot)),r=Y(e.manifest),n=e.release.release,o=e.packageSource?.topology,i=o?.transactionRoot??t,a=R=>o?.mode==="pnpm-shared-lockfile"?`${o.unitRelativeRoot}/${R}`:R;if(n.kind!=="engineering-feature"||n.consumerProfile!=="any-project")throw new se("CAPABILITY_KIND_UNSUPPORTED","Only an addable engineering feature can use this lifecycle");if(r.capabilities.some(R=>R.capabilityId===n.capabilityId))throw new se("CAPABILITY_ALREADY_SELECTED","The capability is already selected by this project");let s=r.profile?.id,c=s==="typescript-library"?"blank-typescript-library":s,l=n.dependencies?.profiles??[],d=e.currentLock.capabilities.find(R=>R.consumerProfile===c);if(c===void 0||!l.includes(c)||d===void 0)throw new se("CAPABILITY_DEPENDENCY_UNSATISFIED","The project profile does not satisfy this capability dependency");if((n.dependencies?.capabilities??[]).some(R=>!r.capabilities.some(S=>S.capabilityId===R)||!e.currentLock.capabilities.some(S=>S.capabilityId===R)))throw new se("CAPABILITY_DEPENDENCY_UNSATISFIED","A required project capability is not adopted and verified");let f=Y({...r,capabilities:[...r.capabilities,{capabilityId:n.capabilityId,version:n.version}]}),u=a("project-capabilities.json"),m=Buffer.from(`${JSON.stringify(f,null,2)}
|
|
45
|
-
`),g=await To(i,u);if(!g.exists||g.digest===void 0)throw new se("CAPABILITY_DEPENDENCY_UNSATISFIED","The project manifest is unavailable");let h=[{path:u,kind:"replace",ownership:"owned-file",baseDigest:g.digest,desiredDigest:y(m)}],w=new Map([[u,m]]),_;if(n.schemaVersion===2&&n.packageSources.length>0){if(e.packageSource===void 0)throw new se("CAPABILITY_RELEASE_VERSION_UNSUPPORTED","Capability Release v2 requires verified package source facts");let R;try{R=await Co(Ur.join(t,"package.json"))}catch{throw new se("CAPABILITY_PACKAGE_SOURCE_INVALID","\u9879\u76EE package.json \u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u751F\u6210\u5305\u91C7\u7528\u8BA1\u5212")}try{let S=e.packageSource.currentLockfile??await Co(Ur.join(t,"pnpm-lock.yaml")).catch(ie=>ie.code==="ENOENT"?void 0:Promise.reject(ie)),C=e.packageSource.topology??{schemaVersion:1,mode:"standalone",transactionRoot:t,unitRoot:t,unitRelativeRoot:".",unitImporterId:".",lockfilePath:"pnpm-lock.yaml"},le=C.mode==="pnpm-shared-lockfile",$={mode:C.mode,unitRelativeRoot:C.unitRelativeRoot,unitImporterId:C.unitImporterId,lockfilePath:C.lockfilePath,...C.workspaceManifestPath?{workspaceManifestPath:C.workspaceManifestPath,workspaceManifestDigest:C.workspaceManifestDigest}:{}},P={registryConfigs:e.packageSource.registryConfigs,endpointBindings:e.packageSource.endpointBindings,receipts:e.packageSource.receipts,inspections:e.packageSource.inspections};if(le&&(!e.packageSource.resolutionEvidence||!e.packageSource.resolutionWorkerReleaseId))throw new H("PACKAGE_SOURCE_POLICY_VIOLATION");let X=le?(e.packageChannel==="development"?pa:da)({release:n,...P,consumerProfile:c,packageJson:R,currentLockfile:S,generatedAt:e.generatedAt,expiresAt:e.expiresAt,topology:$,preservedImporterDigests:e.packageSource.preservedImporterDigests??[],resolutionEvidence:e.packageSource.resolutionEvidence,resolutionWorkerReleaseId:e.packageSource.resolutionWorkerReleaseId}):(e.packageChannel==="development"?la:ca)({release:n,...P,lockResolution:e.packageSource.lockResolution,consumerProfile:c,packageJson:R,...S===void 0?{}:{currentLockfile:S},generatedAt:e.generatedAt,expiresAt:e.expiresAt});_=ia(X),h.push({path:a("package.json"),kind:"replace",ownership:"owned-file",baseDigest:X.packageJsonPreimageDigest,desiredDigest:X.desiredPackageJsonDigest}),w.set(a("package.json"),X.desiredPackageJson),h.push({path:C.lockfilePath,kind:S===void 0?"create":"replace",ownership:"owned-file",...S===void 0?{}:{baseDigest:y(S)},desiredDigest:X.desiredLockfileDigest}),w.set(C.lockfilePath,X.desiredLockfile)}catch(S){throw S instanceof H?new se("CAPABILITY_PACKAGE_SOURCE_INVALID",S.code):S}}for(let R of n.assets){let S=e.release.contents.get(R.path);if(S===void 0)throw new se("CAPABILITY_KIND_UNSUPPORTED","Capability asset content is unavailable");let C=R.renderer==="application-config-contract-v1"?ua(r):R.renderer==="application-config-binding-v1"?fa(r):S;if(R.ownership==="managed-region"){if(R.regionId===void 0)throw new se("CAPABILITY_KIND_UNSUPPORTED","Managed region identity is unavailable");let le;try{le=await Co(Ur.join(t,...R.path.split("/")))}catch{throw new se("CAPABILITY_DEPENDENCY_UNSATISFIED","The managed shared file is unavailable")}let $=Buffer.from(qf({source:le.toString("utf8"),regionId:R.regionId,content:Buffer.from(C).toString("utf8")}));h.push({path:a(R.path),kind:"merge",ownership:"managed-region",regionId:R.regionId,baseDigest:y(le),desiredDigest:y($)}),w.set(a(R.path),$)}else{let le=await To(t,R.path);if(R.ownership==="seed-file"&&le.exists){let $=await Co(Ur.join(t,...R.path.split("/")));h.push({path:a(R.path),kind:"create",ownership:"seed-file",desiredDigest:y($)}),w.set(a(R.path),$)}else h.push({path:a(R.path),kind:"create",ownership:R.ownership,desiredDigest:y(C)}),w.set(a(R.path),C)}}let b=await Promise.all(h.map(R=>To(i,R.path))),A={schemaVersion:1,capabilityId:n.capabilityId,version:n.version,integrity:n.integrity,assets:h.filter(R=>R.path!==u&&R.path!==o?.lockfilePath).map(R=>({path:o?.mode==="pnpm-shared-lockfile"?R.path.slice(o.unitRelativeRoot.length+1):R.path,ownership:R.ownership,desiredDigest:R.desiredDigest})),verifiers:n.verifiers.map(R=>({id:R.id,kind:"file-digest"}))};return{plan:ke({action:"adopt",capability:A,changes:h,observedAssets:b,generatedAt:e.generatedAt,expiresAt:e.expiresAt,..._===void 0?{}:{packageAdoption:_}}),manifest:f,desiredContents:w,transactionRoot:i,dependency:{profile:c,satisfied:!0}}}var Og=Kr(_r(),1);var wE={$id:"https://schemas.dyyto.dev/platform/solution-catalog-entry-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","solutionId","version","integrity","title","summary","maturity","members","integration","exit"],properties:{schemaVersion:{const:1},solutionId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:At},title:{type:"string",minLength:1,maxLength:80},summary:{type:"string",minLength:1,maxLength:240},maturity:{enum:["guided","automated"]},members:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["capabilityId","version","role","required"],properties:{capabilityId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},role:{type:"string",minLength:1,maxLength:80},required:{type:"boolean"}}}},integration:{type:"object",additionalProperties:!1,required:["prerequisites","steps","verification","result"],properties:{prerequisites:{type:"array",minItems:1,maxItems:16,items:{type:"string",minLength:1,maxLength:200}},steps:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["label","command"],properties:{label:{type:"string",minLength:1,maxLength:80},command:{type:"string",minLength:1,maxLength:2e3}}}},verification:{type:"array",minItems:1,maxItems:32,items:{type:"string",minLength:1,maxLength:1e3}},result:{type:"string",minLength:1,maxLength:400}}},exit:{type:"object",additionalProperties:!1,required:["summary"],properties:{summary:{type:"string",minLength:1,maxLength:400}}}}},Ij=new Og.Ajv2020({allErrors:!0,strict:!0}).compile(wE);var Cg=Kr(_r(),1);import{readFile as IE,realpath as vE}from"node:fs/promises";import Sg from"node:path";var Dg="^[a-z0-9]+(?:[.-][a-z0-9]+)*$",jg="^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[^\\u0000]+$",bE={$id:"https://schemas.dyyto.dev/platform/example-recipe-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","recipeId","version","integrity","title","locale","rootProfile","capabilities","expectedEntrypoint","verifiers","manualAcceptance","cleanup"],properties:{schemaVersion:{const:1},recipeId:{type:"string",pattern:Dg},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:At},title:{type:"string",minLength:1,maxLength:80},locale:{const:"zh-CN"},rootProfile:{type:"object",additionalProperties:!1,required:["capabilityId","version"],properties:{capabilityId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128}}},capabilities:{type:"array",minItems:1,maxItems:16,items:{type:"object",additionalProperties:!1,required:["capabilityId","version","channel"],properties:{capabilityId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},channel:{const:"development"}}}},expectedEntrypoint:{type:"string",pattern:jg,maxLength:240},verifiers:{type:"array",minItems:1,maxItems:16,uniqueItems:!0,items:{type:"string",pattern:Dg}},manualAcceptance:{type:"array",minItems:1,maxItems:32,items:{type:"string",minLength:1,maxLength:240}},cleanup:{type:"object",additionalProperties:!1,required:["ownedStateDirectories"],properties:{ownedStateDirectories:{type:"array",maxItems:8,uniqueItems:!0,items:{type:"string",pattern:jg,maxLength:240}}}}}},$g=new Cg.Ajv2020({allErrors:!0,strict:!0}).compile(bE),Fr=class extends Error{code;issues;constructor(t,r=[]){super(t),this.code=t,this.issues=r}};function kE(e){return y(k(e))}function RE(e){if(!$g(e))throw new Fr("EXAMPLE_RECIPE_INVALID",$g.errors??[]);let t=e,r=[t.rootProfile.capabilityId,...t.capabilities.map(n=>n.capabilityId)];if(new Set(r).size!==r.length||t.capabilities.some(n=>n.version.includes("workspace:")||n.capabilityId.includes("ai-education-poc")))throw new Fr("EXAMPLE_RECIPE_INVALID");return t}async function Tg(e){let t=await vE(Sg.resolve(e)),r;try{r=RE(JSON.parse(await IE(Sg.join(t,"recipe.json"),"utf8")))}catch(i){throw i instanceof Fr?i:new Fr("EXAMPLE_RECIPE_INVALID")}let{integrity:n,...o}=r;if(kE(o)!==n)throw new Fr("EXAMPLE_RECIPE_INTEGRITY_MISMATCH");return r}var Vg=Kr(_r(),1);import{readFile as _E,realpath as AE}from"node:fs/promises";import Lg from"node:path";var EE={$id:"https://schemas.dyyto.dev/platform/engineering-template-release-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","templateId","version","integrity","title","summary","status","profile","parameters","commands","technology","support","integration","metrics"],properties:{schemaVersion:{const:1},templateId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:At},title:{type:"string",minLength:1,maxLength:80},summary:{type:"string",minLength:1,maxLength:240},status:{enum:["candidate","recommended","deprecated"]},profile:{type:"object",additionalProperties:!1,required:["id","capability"],properties:{id:{type:"string",pattern:Z},capability:{type:"string",pattern:`${Z.slice(1,-1)}@[0-9]+\\.[0-9]+\\.[0-9]+$`}}},parameters:{type:"array",minItems:0,maxItems:32,items:{type:"object",additionalProperties:!1,required:["id","required","description"],properties:{id:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$"},required:{type:"boolean"},description:{type:"string",minLength:1,maxLength:160}}}},commands:{type:"object",minProperties:1,additionalProperties:!1,properties:{dev:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},build:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},test:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},package:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"}}},technology:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["id","version","policy","verifiedAt","rationale","alternative","exit"],properties:{id:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:64},policy:{enum:["recommended","allowed"]},verifiedAt:{type:"string",format:"date"},rationale:{type:"string",minLength:1,maxLength:240},alternative:{type:"string",minLength:1,maxLength:160},exit:{type:"string",minLength:1,maxLength:240}}}},support:{type:"object",additionalProperties:!1,required:["owner","tier","supportedFrom","supportedUntil","upgradeCadence","eolNoticeDays"],properties:{owner:{type:"string",pattern:Z},tier:{const:"production"},supportedFrom:{type:"string",format:"date"},supportedUntil:{type:"string",format:"date"},upgradeCadence:{type:"string",minLength:1,maxLength:80},eolNoticeDays:{type:"integer",minimum:30,maximum:730}}},integration:{type:"object",additionalProperties:!1,required:["prerequisites","createCommand","result"],properties:{prerequisites:{type:"array",minItems:1,maxItems:16,items:{type:"string",minLength:1,maxLength:200}},createCommand:{type:"string",minLength:1,maxLength:2e3},result:{type:"string",minLength:1,maxLength:400}}},metrics:{type:"array",minItems:1,uniqueItems:!0,items:{enum:["time-to-green-build","time-to-first-business-commit","manual-engineering-edits","upgrade-conflicts"]}}}},xg=new Vg.Ajv2020({allErrors:!0,strict:!0,formats:{date:/^\d{4}-\d{2}-\d{2}$/}}).compile(EE),zt=class extends Error{code;issues;constructor(t,r=[]){super(t),this.code=t,this.issues=r}};function PE(e){return y(k(e))}function NE(e){if(!xg(e))throw new zt("TEMPLATE_INVALID",xg.errors??[]);let t=e;if(new Set(t.parameters.map(r=>r.id)).size!==t.parameters.length||new Set(t.technology.map(r=>r.id)).size!==t.technology.length)throw new zt("TEMPLATE_INVALID");if(Date.parse(t.support.supportedUntil)<=Date.parse(t.support.supportedFrom))throw new zt("TEMPLATE_INVALID");return t}async function Lo(e,t=new Date){let r=await AE(Lg.resolve(e)),n;try{n=NE(JSON.parse(await _E(Lg.join(r,"template.json"),"utf8")))}catch(a){throw a instanceof zt?a:new zt("TEMPLATE_INVALID")}let{integrity:o,...i}=n;if(PE(i)!==o)throw new zt("TEMPLATE_INTEGRITY_MISMATCH");if(n.status==="recommended"&&Date.parse(n.support.supportedUntil)<t.getTime())throw new zt("TEMPLATE_SUPPORT_EXPIRED");return n}import{readFile as Mg}from"node:fs/promises";import Ug from"node:path";var OE=/^[A-Z][A-Z0-9_]*$/u,SE=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|PASSWORD|PRIVATE_KEY|DATABASE_URL|POSTGRES_URL)$/u;function DE(e){let t=new Map;for(let r of e.split(/\r?\n/u)){let n=/^([A-Z][A-Z0-9_]*)=(.*)$/u.exec(r.trim());if(!n||!OE.test(n[1]))continue;let o=n[1],i=n[2].trim();t.set(o,{name:o,requirement:i.length===0?"conditional":"optional",secret:SE.test(o),configured:!1,source:".env.example",configuredSource:null})}return[...t.values()]}async function Fg(e){let t=await Mg(Ug.join(e.projectRoot,".env.example"),"utf8").then(()=>".env.example").catch(()=>null),r=t?await Mg(Ug.join(e.projectRoot,t),"utf8"):"",n=await ma({projectRoot:e.projectRoot}).catch(()=>null);return{commands:["dev","build","test","package"].flatMap(i=>e.commands[i]?[{id:i,script:e.commands[i],mode:i==="dev"?"managed-process":"foreground-task"}]:[]),environment:n?n.entries.map(i=>({name:i.name,requirement:i.required?"conditional":"optional",secret:i.kind!=="value",configured:i.configured,source:"application-config-contract",configuredSource:"APP_CONFIG_DIR",display:i.display,...i.fingerprint?{fingerprint:i.fingerprint}:{}})):DE(r),environmentExample:t,productionValidation:{contract:!0,live:["provider-read","oss-write-read-delete"]}}}var qg={change:new Set(["plan","apply","upgrade","recover","baseline-next","add-package","add-application","add-feature"]),quality:new Set(["inspect","verify","doctor","maintenance","test","build"]),delivery:new Set(["package","delivery-plan","delivery-apply","delivery-inspect"])},Bg=new Set(["queued","running","succeeded","failed","outcome-unknown","cancelled"]);function zg(e,t){if(!qg[t.plane]||t.state&&!Bg.has(t.state)||t.limit!==void 0&&(!Number.isSafeInteger(t.limit)||t.limit<1||t.limit>200))throw new Error("OPERATION_FILTER_INVALID");let r=qg[t.plane],n=t.from?Date.parse(t.from):null,o=t.to?Date.parse(t.to):null;if(n!==null&&Number.isNaN(n)||o!==null&&Number.isNaN(o)||n!==null&&o!==null&&n>o)throw new Error("OPERATION_FILTER_INVALID");let i=e.filter(l=>r.has(l.operation)),a=[...new Map(i.map(l=>[l.projectId,{id:l.projectId,name:l.projectName}])).values()].sort((l,d)=>l.name.localeCompare(d.name)),s=i.filter(l=>(!t.projectId||l.projectId===t.projectId)&&(!t.state||l.state===t.state)&&(!t.kind||l.operation===t.kind)&&(n===null||Date.parse(l.createdAt)>=n)&&(o===null||Date.parse(l.createdAt)<=o)).sort((l,d)=>d.updatedAt.localeCompare(l.updatedAt)),c={total:s.length,running:s.filter(l=>l.state==="running"||l.state==="queued").length,succeeded:s.filter(l=>l.state==="succeeded").length,attention:s.filter(l=>l.state==="failed"||l.state==="outcome-unknown").length};return Object.freeze({schemaVersion:1,plane:t.plane,summary:Object.freeze(c),facets:Object.freeze({projects:Object.freeze(a),states:Object.freeze([...Bg]),kinds:Object.freeze([...r])}),items:Object.freeze(s.slice(0,t.limit??50).map(Object.freeze)),hasMore:s.length>(t.limit??50)})}var Qe=class extends Error{code;constructor(t){super(t),this.code=t}},jE=/^@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*$/u,Jg=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/u,$E=/^sha512-[A-Za-z0-9+/]{86}==$/u,Aa=/^sha256:[a-f0-9]{64}$/u,CE=/^[a-z0-9][a-z0-9._-]{1,214}\.tgz$/u,TE=/^(?:workspace:|file:|link:|git(?:\+|:)|https?:|ssh:|github:)/u,LE=new Set(["preinstall","install","postinstall","prepublish","prepare"]);function qr(e,t){let r=Object.keys(e).sort(),n=[...t].sort();return r.length===n.length&&r.every((o,i)=>o===n[i])}function xE(e){if(!qr(e,["packageName","version","assetName","integrity","tarballDigest","dependencies","lifecycleScripts"])||!jE.test(e.packageName)||!Jg.test(e.version)||!CE.test(e.assetName)||!$E.test(e.integrity)||!Aa.test(e.tarballDigest)||typeof e.dependencies!="object"||e.dependencies===null||Array.isArray(e.dependencies)||e.lifecycleScripts.length>0)return!1;let t=Object.entries(e.dependencies);return t.length>256||t.some(([r,n])=>!/^(@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u.test(r)||!Jg.test(n)||TE.test(n))?!1:e.lifecycleScripts.every(r=>LE.has(r))}function Zl(e){if(!qr(e,["artifacts"])||e.artifacts.length===0||e.artifacts.length>128)throw new Qe("LOCAL_ARTIFACT_BUNDLE_INVALID");let t=e.artifacts.map(i=>Object.freeze({...i,dependencies:Object.freeze({...i.dependencies}),lifecycleScripts:Object.freeze([...i.lifecycleScripts])}));if(t.some(i=>!xE(i)))throw new Qe("LOCAL_ARTIFACT_POLICY_VIOLATION");let r=t.map(i=>i.packageName+"@"+i.version);if(new Set(r).size!==r.length||r.some((i,a)=>a>0&&i.localeCompare(r[a-1])<=0))throw new Qe("LOCAL_ARTIFACT_BUNDLE_INVALID");let n=new Set(t.map(i=>i.packageName));for(let i of t)for(let[a,s]of Object.entries(i.dependencies))if(a.startsWith("@aipt/")&&(!n.has(a)||!t.some(c=>c.packageName===a&&c.version===s)))throw new Qe("LOCAL_ARTIFACT_POLICY_VIOLATION");let o={schemaVersion:1,channel:"development",artifacts:t};return Object.freeze({...o,bundleId:y(k(o))})}function Br(e){let t=e;if(typeof t!="object"||t===null||!qr(t,["schemaVersion","bundleId","channel","artifacts"])||t.schemaVersion!==1||t.channel!=="development"||!Aa.test(t.bundleId)||!Array.isArray(t.artifacts))throw new Qe("LOCAL_ARTIFACT_BUNDLE_INVALID");if(Zl({artifacts:t.artifacts}).bundleId!==t.bundleId)throw new Qe("LOCAL_ARTIFACT_BUNDLE_INVALID");return t}function Ql(e){if(!qr(e,["packageInputs","bundle","generatedAt","expiresAt"])||e.packageInputs.length!==e.bundle.artifacts.length||e.packageInputs.length===0||Number.isNaN(Date.parse(e.generatedAt))||Number.isNaN(Date.parse(e.expiresAt))||Date.parse(e.expiresAt)<=Date.parse(e.generatedAt))throw new Qe("LOCAL_ARTIFACT_PLAN_INVALID");let t=e.packageInputs.map(o=>Object.freeze({...o}));if(t.some(o=>!qr(o,["relativeRoot","manifestDigest"])||!/^(?:packages|fixtures)\/[a-z0-9][a-z0-9._-]{1,127}$/u.test(o.relativeRoot)||!Aa.test(o.manifestDigest))||new Set(t.map(o=>o.relativeRoot)).size!==t.length)throw new Qe("LOCAL_ARTIFACT_PLAN_INVALID");let r=Br(e.bundle),n={schemaVersion:1,state:"awaiting-approval",packageInputs:t,bundle:r,targetPreimage:{kind:"absent"},generatedAt:e.generatedAt,expiresAt:e.expiresAt};return Object.freeze({...n,planId:y(k(n))})}function Gg(e){let t=e;if(typeof t!="object"||t===null||!qr(t,["schemaVersion","planId","state","packageInputs","bundle","targetPreimage","generatedAt","expiresAt"])||t.schemaVersion!==1||t.state!=="awaiting-approval"||!Aa.test(t.planId)||!qr(t.targetPreimage,["kind"])||t.targetPreimage.kind!=="absent")throw new Qe("LOCAL_ARTIFACT_PLAN_INVALID");if(Ql({packageInputs:t.packageInputs,bundle:t.bundle,generatedAt:t.generatedAt,expiresAt:t.expiresAt}).planId!==t.planId)throw new Qe("LOCAL_ARTIFACT_PLAN_INVALID");return t}function Wg(e){let t=Br(e.bundle),r=Ao(e.registry);if(r.authentication.kind!=="anonymous-test"||r.status!=="enabled"||!r.capabilities.read||Number.isNaN(Date.parse(e.verifiedAt)))throw new Qe("LOCAL_ARTIFACT_POLICY_VIOLATION");return Object.freeze(t.artifacts.map(n=>Ol({registryId:r.registryId,registryConfigRevision:r.revision,packageName:n.packageName,version:n.version,integrity:n.integrity,tarballDigest:n.tarballDigest,access:"private",provenance:"development-readback-verified",verificationIdentityDigest:t.bundleId,sourceDeliveryReceiptId:t.bundleId,verifiedAt:e.verifiedAt})))}var Ke=class extends Error{code;constructor(t){super(t),this.code=t,this.name="ResolutionWorkerBuildError"}},Kg=/^sha256:[a-f0-9]{64}$/u,Ea=/^[a-z0-9][a-z0-9._/-]{0,255}$/u;function ed(e){if(!Ea.test(e.workerReleaseId)||e.pnpmVersion!=="11.21.0"||![e.workspaceManifestDigest,e.rootLockDigest].every(r=>Kg.test(r))||!Ea.test(e.cacheNamespace)||!Number.isSafeInteger(e.maximumBytes)||e.maximumBytes<1||Number.isNaN(Date.parse(e.generatedAt))||Date.parse(e.expiresAt)<=Date.parse(e.generatedAt))throw new Ke("RESOLUTION_WORKER_BUILD_INVALID");let t={schemaVersion:1,...e};return Object.freeze({...t,planId:y(k(t))})}function Yg(e){let t=e;if(!t||typeof t!="object"||Object.keys(t).length!==10)throw new Ke("RESOLUTION_WORKER_BUILD_INVALID");let r=ed({workerReleaseId:t.workerReleaseId,pnpmVersion:t.pnpmVersion,workspaceManifestDigest:t.workspaceManifestDigest,rootLockDigest:t.rootLockDigest,cacheNamespace:t.cacheNamespace,maximumBytes:t.maximumBytes,generatedAt:t.generatedAt,expiresAt:t.expiresAt});if(t.schemaVersion!==1||t.planId!==r.planId)throw new Ke("RESOLUTION_WORKER_BUILD_INVALID");return r}function td(e){if(![e.planId,e.cacheDigest,e.commandDigest].every(r=>Kg.test(r))||!Ea.test(e.workerReleaseId)||!Ea.test(e.cacheNamespace)||e.pnpmVersion!=="11.21.0"||!Number.isSafeInteger(e.cacheBytes)||e.cacheBytes<0||Number.isNaN(Date.parse(e.completedAt)))throw new Ke("RESOLUTION_WORKER_BUILD_INVALID");let t={schemaVersion:1,...e};return Object.freeze({...t,receiptId:y(k(t))})}function Pa(e){let t=e;if(!t||typeof t!="object"||Object.keys(t).length!==10)throw new Ke("RESOLUTION_WORKER_BUILD_INVALID");let r=td({planId:t.planId,workerReleaseId:t.workerReleaseId,pnpmVersion:t.pnpmVersion,cacheNamespace:t.cacheNamespace,cacheDigest:t.cacheDigest,cacheBytes:t.cacheBytes,commandDigest:t.commandDigest,completedAt:t.completedAt});if(t.schemaVersion!==1||t.receiptId!==r.receiptId)throw new Ke("RESOLUTION_WORKER_BUILD_INVALID");return r}var xo=class extends Error{code;constructor(t){super(t),this.code=t,this.name="RecoveryOverrideError"}},rd=/^sha256:[a-f0-9]{64}$/u,VE=/^(?!\/)(?!.*(?:^|\/)\.\.(?:\/|$))[a-zA-Z0-9._@:/-]+$/u;function nd(e){if(![e.transactionPlanId,e.transactionRootDigest].every(r=>rd.test(r))||e.conflicts.length===0||new Set(e.conflicts.map(r=>r.path)).size!==e.conflicts.length||e.conflicts.some(r=>!VE.test(r.path)||!rd.test(r.currentDigest)||!rd.test(r.preimageDigest))||Number.isNaN(Date.parse(e.generatedAt))||Date.parse(e.expiresAt)<=Date.parse(e.generatedAt))throw new xo("RECOVERY_OVERRIDE_INVALID");let t={schemaVersion:1,...e,conflicts:e.conflicts.map(r=>({...r})).sort((r,n)=>r.path.localeCompare(n.path))};return Object.freeze({...t,planId:y(k(t))})}function Hg(e){let t=e;if(!t||typeof t!="object"||Object.keys(t).length!==7)throw new xo("RECOVERY_OVERRIDE_INVALID");let r=nd({transactionPlanId:t.transactionPlanId,transactionRootDigest:t.transactionRootDigest,conflicts:t.conflicts,generatedAt:t.generatedAt,expiresAt:t.expiresAt});if(t.schemaVersion!==1||t.planId!==r.planId)throw new xo("RECOVERY_OVERRIDE_INVALID");return r}var Vo=class extends Error{code;constructor(t,r){super(r),this.code=t}},id=/^sha256:[a-f0-9]{64}$/u,ME=/^sha512-[A-Za-z0-9+/]{86}==$/u,UE=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u,FE=/^(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?$/u,qE=/[\u0000-\u001f\u007f]/u;function _n(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function An(e,t){let r=Object.keys(e).sort(),n=[...t].sort();return r.length===n.length&&r.every((o,i)=>o===n[i])}function Jt(e,t=500){return typeof e=="string"&&e.length>0&&e.length<=t&&!qE.test(e)}function od(e){return Jt(e,500)&&!e.startsWith("/")&&!e.startsWith("../")&&!e.includes("/../")&&!e.includes("\\")}function Xg(e,t=128){return Array.isArray(e)&&e.length<=t&&e.every(r=>Jt(r,500))&&e.every((r,n)=>n===0||e[n-1]<r)}function BE(e){return e===null?!0:!_n(e)||!An(e,["fileName","digest","integrity","fileCount","unpackedBytes"])?!1:od(e.fileName)&&id.test(String(e.digest))&&ME.test(String(e.integrity))&&Number.isSafeInteger(e.fileCount)&&Number(e.fileCount)>0&&Number.isSafeInteger(e.unpackedBytes)&&Number(e.unpackedBytes)>0}function zE(e){if(!_n(e)||!An(e,["schemaVersion","kind","packageName","version","title","summary","maturity","source","artifact","compatibility","exports","documentation","consumerEvidence"])||e.schemaVersion!==1||e.kind!=="PackageRelease"||!UE.test(e.packageName)||!FE.test(e.version)||!Jt(e.title,120)||!Jt(e.summary,1e3)||!["candidate","stable","deprecated"].includes(e.maturity)||!_n(e.source)||!An(e.source,["repository","path","revision","treeDigest"])||!Jt(e.source.repository)||!od(e.source.path)||!Jt(e.source.revision,200)||!id.test(String(e.source.treeDigest))||!BE(e.artifact)||!_n(e.compatibility)||!An(e.compatibility,["node","packageManager"])||!Jt(e.compatibility.node,100)||!Jt(e.compatibility.packageManager,100)||!Xg(e.exports)||!Xg(e.consumerEvidence)||!_n(e.documentation))return!1;let t=e.documentation.knowledgeRef===void 0?["readme"]:["readme","knowledgeRef"];return!An(e.documentation,t)||!od(e.documentation.readme)||e.documentation.knowledgeRef!==void 0&&!Jt(e.documentation.knowledgeRef,500)?!1:e.artifact!==null||e.maturity!=="stable"}function JE(e){let t={schemaVersion:1,kind:"PackageRelease",...e,source:Object.freeze({...e.source}),artifact:e.artifact===null?null:Object.freeze({...e.artifact}),compatibility:Object.freeze({...e.compatibility}),exports:Object.freeze([...e.exports]),documentation:Object.freeze({...e.documentation}),consumerEvidence:Object.freeze([...e.consumerEvidence])};if(!zE(t))throw new Vo("PACKAGE_RELEASE_INVALID","PackageRelease \u5185\u5BB9\u65E0\u6548");return Object.freeze({...t,releaseDigest:y(k(t))})}function Zg(e){if(!_n(e)||!An(e,["schemaVersion","kind","packageName","version","title","summary","maturity","source","artifact","compatibility","exports","documentation","consumerEvidence","releaseDigest"])||!id.test(String(e.releaseDigest)))throw new Vo("PACKAGE_RELEASE_INVALID","PackageRelease \u7ED3\u6784\u65E0\u6548");let{releaseDigest:t,schemaVersion:r,kind:n,...o}=e,i=JE(o);if(i.releaseDigest!==t)throw new Vo("PACKAGE_RELEASE_MODIFIED","PackageRelease \u5DF2\u88AB\u4FEE\u6539");return i}import{lstat as GE,readFile as WE,realpath as KE}from"node:fs/promises";import Qg from"node:path";async function eh(e){let t=await KE(Qg.resolve(e.projectRoot)),r=new Set(e.excludeCapabilityIds??[]),n=new Map,o=[...e.lock.capabilities].sort((a,s)=>a.committedAt.localeCompare(s.committedAt)||a.capabilityId.localeCompare(s.capabilityId));for(let a of o)if(!r.has(a.capabilityId))for(let s of a.assets){let c=s.ownership??"owned-file",l=`${s.path}\0`;if(c==="managed-region")n.delete(l);else for(let p of n.keys())p.startsWith(l)&&n.delete(p);let d=c==="managed-region"?`${l}${s.regionId??""}`:l;n.set(d,{capabilityId:a.capabilityId,path:s.path,digest:s.digest,ownership:c,...s.regionId===void 0?{}:{regionId:s.regionId}})}let i=[];for(let a of[...n.values()].sort((s,c)=>s.path.localeCompare(c.path)||(s.regionId??"").localeCompare(c.regionId??"")||s.capabilityId.localeCompare(c.capabilityId))){let s=Qg.join(t,...a.path.split("/")),l=await GE(s).then(async d=>{if(!d.isFile()||d.isSymbolicLink())return;let p=await WE(s);if(a.ownership!=="managed-region")return y(p);if(a.regionId!==void 0)try{return y($i(p.toString("utf8"),a.regionId))}catch{return}}).catch(d=>d.code==="ENOENT"?void 0:Promise.reject(d))===a.digest;i.push({capabilityId:a.capabilityId,path:a.path,kind:"create",ownership:a.ownership,...a.regionId===void 0?{}:{regionId:a.regionId},desiredDigest:a.digest,disposition:l?"noop":"conflict",...l?{}:{conflictCode:"BASE_DIGEST_MISMATCH"}})}return i}import{readFile as re,readdir as gh,realpath as Rt}from"node:fs/promises";import{execFile as lP,spawn as dP}from"node:child_process";import N from"node:path";import{parseArgs as ue,promisify as pP}from"node:util";import{lstat as th,mkdir as sd,readFile as rh,realpath as ad,rm as YE,writeFile as nh}from"node:fs/promises";import et from"node:path";var tt=class extends Error{constructor(r,n){super(r,n===void 0?void 0:{cause:n});this.code=r}code},HE=e=>k(e),oh=e=>y(HE(e));async function ih(e,t){let r=await ad(et.resolve(e)),n=et.join(r,".examples");await sd(n,{recursive:!0});let o=await ad(n),i=et.resolve(r,t);if(et.dirname(i)!==o||et.basename(i).startsWith(".")||et.basename(i).length<1)throw new tt("SCAFFOLD_ARGUMENT_INVALID");if(await th(i).then(()=>!0).catch(a=>a.code==="ENOENT"?!1:Promise.reject(a)))throw new tt("SCAFFOLD_TARGET_CONFLICT");return{workspaceRoot:r,output:i,outputRelativePath:et.relative(r,i)}}async function ah(e){let t=e.artifactFallbackBundles??[];if(!/^sha256:[a-f0-9]{64}$/u.test(e.artifactBundle)||t.some(c=>!/^sha256:[a-f0-9]{64}$/u.test(c))||new Set([e.artifactBundle,...t]).size!==1+t.length||!Number.isSafeInteger(e.artifactPort)||e.artifactPort<1||e.artifactPort>65535)throw new tt("SCAFFOLD_ARGUMENT_INVALID");let r=await ih(e.workspaceRoot,e.output),n=e.now??new Date().toISOString(),o={schemaVersion:1,state:"reviewable",recipeId:e.recipe.recipeId,recipeVersion:e.recipe.version,recipeIntegrity:e.recipe.integrity,workspaceRoot:r.workspaceRoot,outputRelativePath:r.outputRelativePath,locale:e.recipe.locale,channel:"development",artifactBundle:e.artifactBundle,artifactFallbackBundles:t,artifactPort:e.artifactPort,generatedAt:n,expiresAt:new Date(Date.parse(n)+30*6e4).toISOString()},i={...o,planId:oh(o)},a=et.join(r.workspaceRoot,".dyyto","scaffold-plans");await sd(a,{recursive:!0});let s=et.join(a,`${i.planId}.json`);return await nh(s,`${k(i)}
|
|
45
|
+
`),g=await To(i,u);if(!g.exists||g.digest===void 0)throw new se("CAPABILITY_DEPENDENCY_UNSATISFIED","The project manifest is unavailable");let h=[{path:u,kind:"replace",ownership:"owned-file",baseDigest:g.digest,desiredDigest:y(m)}],w=new Map([[u,m]]),_;if(n.schemaVersion===2&&n.packageSources.length>0){if(e.packageSource===void 0)throw new se("CAPABILITY_RELEASE_VERSION_UNSUPPORTED","Capability Release v2 requires verified package source facts");let R;try{R=await Co(Ur.join(t,"package.json"))}catch{throw new se("CAPABILITY_PACKAGE_SOURCE_INVALID","\u9879\u76EE package.json \u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u751F\u6210\u5305\u91C7\u7528\u8BA1\u5212")}try{let S=e.packageSource.currentLockfile??await Co(Ur.join(t,"pnpm-lock.yaml")).catch(ie=>ie.code==="ENOENT"?void 0:Promise.reject(ie)),C=e.packageSource.topology??{schemaVersion:1,mode:"standalone",transactionRoot:t,unitRoot:t,unitRelativeRoot:".",unitImporterId:".",lockfilePath:"pnpm-lock.yaml"},le=C.mode==="pnpm-shared-lockfile",$={mode:C.mode,unitRelativeRoot:C.unitRelativeRoot,unitImporterId:C.unitImporterId,lockfilePath:C.lockfilePath,...C.workspaceManifestPath?{workspaceManifestPath:C.workspaceManifestPath,workspaceManifestDigest:C.workspaceManifestDigest}:{}},P={registryConfigs:e.packageSource.registryConfigs,endpointBindings:e.packageSource.endpointBindings,receipts:e.packageSource.receipts,inspections:e.packageSource.inspections};if(le&&(!e.packageSource.resolutionEvidence||!e.packageSource.resolutionWorkerReleaseId))throw new H("PACKAGE_SOURCE_POLICY_VIOLATION");let X=le?(e.packageChannel==="development"?pa:da)({release:n,...P,consumerProfile:c,packageJson:R,currentLockfile:S,generatedAt:e.generatedAt,expiresAt:e.expiresAt,topology:$,preservedImporterDigests:e.packageSource.preservedImporterDigests??[],resolutionEvidence:e.packageSource.resolutionEvidence,resolutionWorkerReleaseId:e.packageSource.resolutionWorkerReleaseId}):(e.packageChannel==="development"?la:ca)({release:n,...P,lockResolution:e.packageSource.lockResolution,consumerProfile:c,packageJson:R,...S===void 0?{}:{currentLockfile:S},generatedAt:e.generatedAt,expiresAt:e.expiresAt});_=ia(X),h.push({path:a("package.json"),kind:"replace",ownership:"owned-file",baseDigest:X.packageJsonPreimageDigest,desiredDigest:X.desiredPackageJsonDigest}),w.set(a("package.json"),X.desiredPackageJson),h.push({path:C.lockfilePath,kind:S===void 0?"create":"replace",ownership:"owned-file",...S===void 0?{}:{baseDigest:y(S)},desiredDigest:X.desiredLockfileDigest}),w.set(C.lockfilePath,X.desiredLockfile)}catch(S){throw S instanceof H?new se("CAPABILITY_PACKAGE_SOURCE_INVALID",S.code):S}}for(let R of n.assets){let S=e.release.contents.get(R.path);if(S===void 0)throw new se("CAPABILITY_KIND_UNSUPPORTED","Capability asset content is unavailable");let C=R.renderer==="application-config-contract-v1"?ua(r):R.renderer==="application-config-binding-v1"?fa(r):S;if(R.ownership==="managed-region"){if(R.regionId===void 0)throw new se("CAPABILITY_KIND_UNSUPPORTED","Managed region identity is unavailable");let le;try{le=await Co(Ur.join(t,...R.path.split("/")))}catch{throw new se("CAPABILITY_DEPENDENCY_UNSATISFIED","The managed shared file is unavailable")}let $=Buffer.from(qf({source:le.toString("utf8"),regionId:R.regionId,content:Buffer.from(C).toString("utf8")}));h.push({path:a(R.path),kind:"merge",ownership:"managed-region",regionId:R.regionId,baseDigest:y(le),desiredDigest:y($)}),w.set(a(R.path),$)}else{let le=await To(t,R.path);if(R.ownership==="seed-file"&&le.exists){let $=await Co(Ur.join(t,...R.path.split("/")));h.push({path:a(R.path),kind:"create",ownership:"seed-file",desiredDigest:y($)}),w.set(a(R.path),$)}else h.push({path:a(R.path),kind:"create",ownership:R.ownership,desiredDigest:y(C)}),w.set(a(R.path),C)}}let b=await Promise.all(h.map(R=>To(i,R.path))),A={schemaVersion:1,capabilityId:n.capabilityId,version:n.version,integrity:n.integrity,assets:h.filter(R=>R.path!==u&&R.path!==o?.lockfilePath).map(R=>({path:o?.mode==="pnpm-shared-lockfile"?R.path.slice(o.unitRelativeRoot.length+1):R.path,ownership:R.ownership,desiredDigest:R.desiredDigest})),verifiers:n.verifiers.map(R=>({id:R.id,kind:"file-digest"}))};return{plan:ke({action:"adopt",capability:A,changes:h,observedAssets:b,generatedAt:e.generatedAt,expiresAt:e.expiresAt,..._===void 0?{}:{packageAdoption:_}}),manifest:f,desiredContents:w,transactionRoot:i,dependency:{profile:c,satisfied:!0}}}var Og=Kr(_r(),1);var wE={$id:"https://schemas.dyyto.dev/platform/solution-catalog-entry-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","solutionId","version","integrity","title","summary","maturity","members","integration","exit"],properties:{schemaVersion:{const:1},solutionId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:At},title:{type:"string",minLength:1,maxLength:80},summary:{type:"string",minLength:1,maxLength:240},maturity:{enum:["guided","automated"]},members:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["capabilityId","version","role","required"],properties:{capabilityId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},role:{type:"string",minLength:1,maxLength:80},required:{type:"boolean"}}}},integration:{type:"object",additionalProperties:!1,required:["prerequisites","steps","verification","result"],properties:{prerequisites:{type:"array",minItems:1,maxItems:16,items:{type:"string",minLength:1,maxLength:200}},steps:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["label","command"],properties:{label:{type:"string",minLength:1,maxLength:80},command:{type:"string",minLength:1,maxLength:2e3}}}},verification:{type:"array",minItems:1,maxItems:32,items:{type:"string",minLength:1,maxLength:1e3}},result:{type:"string",minLength:1,maxLength:400}}},exit:{type:"object",additionalProperties:!1,required:["summary"],properties:{summary:{type:"string",minLength:1,maxLength:400}}}}},Ij=new Og.Ajv2020({allErrors:!0,strict:!0}).compile(wE);var Cg=Kr(_r(),1);import{readFile as IE,realpath as vE}from"node:fs/promises";import Sg from"node:path";var Dg="^[a-z0-9]+(?:[.-][a-z0-9]+)*$",jg="^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[^\\u0000]+$",bE={$id:"https://schemas.dyyto.dev/platform/example-recipe-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","recipeId","version","integrity","title","locale","rootProfile","capabilities","expectedEntrypoint","verifiers","manualAcceptance","cleanup"],properties:{schemaVersion:{const:1},recipeId:{type:"string",pattern:Dg},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:At},title:{type:"string",minLength:1,maxLength:80},locale:{const:"zh-CN"},rootProfile:{type:"object",additionalProperties:!1,required:["capabilityId","version"],properties:{capabilityId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128}}},capabilities:{type:"array",minItems:1,maxItems:16,items:{type:"object",additionalProperties:!1,required:["capabilityId","version","channel"],properties:{capabilityId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},channel:{const:"development"}}}},expectedEntrypoint:{type:"string",pattern:jg,maxLength:240},verifiers:{type:"array",minItems:1,maxItems:16,uniqueItems:!0,items:{type:"string",pattern:Dg}},manualAcceptance:{type:"array",minItems:1,maxItems:32,items:{type:"string",minLength:1,maxLength:240}},cleanup:{type:"object",additionalProperties:!1,required:["ownedStateDirectories"],properties:{ownedStateDirectories:{type:"array",maxItems:8,uniqueItems:!0,items:{type:"string",pattern:jg,maxLength:240}}}}}},$g=new Cg.Ajv2020({allErrors:!0,strict:!0}).compile(bE),Fr=class extends Error{code;issues;constructor(t,r=[]){super(t),this.code=t,this.issues=r}};function kE(e){return y(k(e))}function RE(e){if(!$g(e))throw new Fr("EXAMPLE_RECIPE_INVALID",$g.errors??[]);let t=e,r=[t.rootProfile.capabilityId,...t.capabilities.map(n=>n.capabilityId)];if(new Set(r).size!==r.length||t.capabilities.some(n=>n.version.includes("workspace:")||n.capabilityId.includes("ai-education-poc")))throw new Fr("EXAMPLE_RECIPE_INVALID");return t}async function Tg(e){let t=await vE(Sg.resolve(e)),r;try{r=RE(JSON.parse(await IE(Sg.join(t,"recipe.json"),"utf8")))}catch(i){throw i instanceof Fr?i:new Fr("EXAMPLE_RECIPE_INVALID")}let{integrity:n,...o}=r;if(kE(o)!==n)throw new Fr("EXAMPLE_RECIPE_INTEGRITY_MISMATCH");return r}var Vg=Kr(_r(),1);import{readFile as _E,realpath as AE}from"node:fs/promises";import Lg from"node:path";var EE={$id:"https://schemas.dyyto.dev/platform/engineering-template-release-v1.json",type:"object",additionalProperties:!1,required:["schemaVersion","templateId","version","integrity","title","summary","status","profile","parameters","commands","technology","support","integration","metrics"],properties:{schemaVersion:{const:1},templateId:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:128},integrity:{type:"string",pattern:At},title:{type:"string",minLength:1,maxLength:80},summary:{type:"string",minLength:1,maxLength:240},status:{enum:["candidate","recommended","deprecated"]},profile:{type:"object",additionalProperties:!1,required:["id","capability"],properties:{id:{type:"string",pattern:Z},capability:{type:"string",pattern:`${Z.slice(1,-1)}@[0-9]+\\.[0-9]+\\.[0-9]+$`}}},parameters:{type:"array",minItems:0,maxItems:32,items:{type:"object",additionalProperties:!1,required:["id","required","description"],properties:{id:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$"},required:{type:"boolean"},description:{type:"string",minLength:1,maxLength:160}}}},commands:{type:"object",minProperties:1,additionalProperties:!1,properties:{dev:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},build:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},test:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"},package:{type:"string",pattern:"^[a-z][a-z0-9.:-]*$"}}},technology:{type:"array",minItems:1,maxItems:32,items:{type:"object",additionalProperties:!1,required:["id","version","policy","verifiedAt","rationale","alternative","exit"],properties:{id:{type:"string",pattern:Z},version:{type:"string",minLength:1,maxLength:64},policy:{enum:["recommended","allowed"]},verifiedAt:{type:"string",format:"date"},rationale:{type:"string",minLength:1,maxLength:240},alternative:{type:"string",minLength:1,maxLength:160},exit:{type:"string",minLength:1,maxLength:240}}}},support:{type:"object",additionalProperties:!1,required:["owner","tier","supportedFrom","supportedUntil","upgradeCadence","eolNoticeDays"],properties:{owner:{type:"string",pattern:Z},tier:{const:"production"},supportedFrom:{type:"string",format:"date"},supportedUntil:{type:"string",format:"date"},upgradeCadence:{type:"string",minLength:1,maxLength:80},eolNoticeDays:{type:"integer",minimum:30,maximum:730}}},integration:{type:"object",additionalProperties:!1,required:["prerequisites","createCommand","result"],properties:{prerequisites:{type:"array",minItems:1,maxItems:16,items:{type:"string",minLength:1,maxLength:200}},createCommand:{type:"string",minLength:1,maxLength:2e3},result:{type:"string",minLength:1,maxLength:400}}},metrics:{type:"array",minItems:1,uniqueItems:!0,items:{enum:["time-to-green-build","time-to-first-business-commit","manual-engineering-edits","upgrade-conflicts"]}}}},xg=new Vg.Ajv2020({allErrors:!0,strict:!0,formats:{date:/^\d{4}-\d{2}-\d{2}$/}}).compile(EE),zt=class extends Error{code;issues;constructor(t,r=[]){super(t),this.code=t,this.issues=r}};function PE(e){return y(k(e))}function NE(e){if(!xg(e))throw new zt("TEMPLATE_INVALID",xg.errors??[]);let t=e;if(new Set(t.parameters.map(r=>r.id)).size!==t.parameters.length||new Set(t.technology.map(r=>r.id)).size!==t.technology.length)throw new zt("TEMPLATE_INVALID");if(Date.parse(t.support.supportedUntil)<=Date.parse(t.support.supportedFrom))throw new zt("TEMPLATE_INVALID");return t}async function Lo(e,t=new Date){let r=await AE(Lg.resolve(e)),n;try{n=NE(JSON.parse(await _E(Lg.join(r,"template.json"),"utf8")))}catch(a){throw a instanceof zt?a:new zt("TEMPLATE_INVALID")}let{integrity:o,...i}=n;if(PE(i)!==o)throw new zt("TEMPLATE_INTEGRITY_MISMATCH");if(n.status==="recommended"&&Date.parse(n.support.supportedUntil)<t.getTime())throw new zt("TEMPLATE_SUPPORT_EXPIRED");return n}import{readFile as Mg}from"node:fs/promises";import Ug from"node:path";var OE=/^[A-Z][A-Z0-9_]*$/u,SE=/(?:API_KEY|ACCESS_KEY|SECRET|TOKEN|PASSWORD|PRIVATE_KEY|DATABASE_URL|POSTGRES_URL)$/u;function DE(e){let t=new Map;for(let r of e.split(/\r?\n/u)){let n=/^([A-Z][A-Z0-9_]*)=(.*)$/u.exec(r.trim());if(!n||!OE.test(n[1]))continue;let o=n[1],i=n[2].trim();t.set(o,{name:o,requirement:i.length===0?"conditional":"optional",secret:SE.test(o),configured:!1,source:".env.example",configuredSource:null})}return[...t.values()]}async function Fg(e){let t=await Mg(Ug.join(e.projectRoot,".env.example"),"utf8").then(()=>".env.example").catch(()=>null),r=t?await Mg(Ug.join(e.projectRoot,t),"utf8"):"",n=await ma({projectRoot:e.projectRoot}).catch(()=>null);return{commands:["dev","build","test","package"].flatMap(i=>e.commands[i]?[{id:i,script:e.commands[i],mode:i==="dev"?"managed-process":"foreground-task"}]:[]),environment:n?n.entries.map(i=>({name:i.name,requirement:i.required?"conditional":"optional",secret:i.kind!=="value",configured:i.configured,source:"application-config-contract",configuredSource:"APP_CONFIG_DIR",display:i.display,...i.fingerprint?{fingerprint:i.fingerprint}:{}})):DE(r),environmentExample:t,productionValidation:{contract:!0,live:["provider-read","oss-write-read-delete"]}}}var qg={change:new Set(["plan","apply","upgrade","recover","baseline-next","add-package","add-application","add-feature"]),quality:new Set(["inspect","verify","doctor","maintenance","test","build"]),delivery:new Set(["package","delivery-plan","delivery-apply","delivery-inspect"])},Bg=new Set(["queued","running","succeeded","failed","outcome-unknown","cancelled"]);function zg(e,t){if(!qg[t.plane]||t.state&&!Bg.has(t.state)||t.limit!==void 0&&(!Number.isSafeInteger(t.limit)||t.limit<1||t.limit>200))throw new Error("OPERATION_FILTER_INVALID");let r=qg[t.plane],n=t.from?Date.parse(t.from):null,o=t.to?Date.parse(t.to):null;if(n!==null&&Number.isNaN(n)||o!==null&&Number.isNaN(o)||n!==null&&o!==null&&n>o)throw new Error("OPERATION_FILTER_INVALID");let i=e.filter(l=>r.has(l.operation)),a=[...new Map(i.map(l=>[l.projectId,{id:l.projectId,name:l.projectName}])).values()].sort((l,d)=>l.name.localeCompare(d.name)),s=i.filter(l=>(!t.projectId||l.projectId===t.projectId)&&(!t.state||l.state===t.state)&&(!t.kind||l.operation===t.kind)&&(n===null||Date.parse(l.createdAt)>=n)&&(o===null||Date.parse(l.createdAt)<=o)).sort((l,d)=>d.updatedAt.localeCompare(l.updatedAt)),c={total:s.length,running:s.filter(l=>l.state==="running"||l.state==="queued").length,succeeded:s.filter(l=>l.state==="succeeded").length,attention:s.filter(l=>l.state==="failed"||l.state==="outcome-unknown").length};return Object.freeze({schemaVersion:1,plane:t.plane,summary:Object.freeze(c),facets:Object.freeze({projects:Object.freeze(a),states:Object.freeze([...Bg]),kinds:Object.freeze([...r])}),items:Object.freeze(s.slice(0,t.limit??50).map(Object.freeze)),hasMore:s.length>(t.limit??50)})}var Qe=class extends Error{code;constructor(t){super(t),this.code=t}},jE=/^@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*$/u,Jg=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/u,$E=/^sha512-[A-Za-z0-9+/]{86}==$/u,Aa=/^sha256:[a-f0-9]{64}$/u,CE=/^[a-z0-9][a-z0-9._-]{1,214}\.tgz$/u,TE=/^(?:workspace:|file:|link:|git(?:\+|:)|https?:|ssh:|github:)/u,LE=new Set(["preinstall","install","postinstall","prepublish","prepare"]);function qr(e,t){let r=Object.keys(e).sort(),n=[...t].sort();return r.length===n.length&&r.every((o,i)=>o===n[i])}function xE(e){if(!qr(e,["packageName","version","assetName","integrity","tarballDigest","dependencies","lifecycleScripts"])||!jE.test(e.packageName)||!Jg.test(e.version)||!CE.test(e.assetName)||!$E.test(e.integrity)||!Aa.test(e.tarballDigest)||typeof e.dependencies!="object"||e.dependencies===null||Array.isArray(e.dependencies)||e.lifecycleScripts.length>0)return!1;let t=Object.entries(e.dependencies);return t.length>256||t.some(([r,n])=>!/^(@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u.test(r)||!Jg.test(n)||TE.test(n))?!1:e.lifecycleScripts.every(r=>LE.has(r))}function Zl(e){if(!qr(e,["artifacts"])||e.artifacts.length===0||e.artifacts.length>128)throw new Qe("LOCAL_ARTIFACT_BUNDLE_INVALID");let t=e.artifacts.map(i=>Object.freeze({...i,dependencies:Object.freeze({...i.dependencies}),lifecycleScripts:Object.freeze([...i.lifecycleScripts])}));if(t.some(i=>!xE(i)))throw new Qe("LOCAL_ARTIFACT_POLICY_VIOLATION");let r=t.map(i=>i.packageName+"@"+i.version);if(new Set(r).size!==r.length||r.some((i,a)=>a>0&&i.localeCompare(r[a-1])<=0))throw new Qe("LOCAL_ARTIFACT_BUNDLE_INVALID");let n=new Set(t.map(i=>i.packageName));for(let i of t)for(let[a,s]of Object.entries(i.dependencies))if(a.startsWith("@aipt/")&&(!n.has(a)||!t.some(c=>c.packageName===a&&c.version===s)))throw new Qe("LOCAL_ARTIFACT_POLICY_VIOLATION");let o={schemaVersion:1,channel:"development",artifacts:t};return Object.freeze({...o,bundleId:y(k(o))})}function Br(e){let t=e;if(typeof t!="object"||t===null||!qr(t,["schemaVersion","bundleId","channel","artifacts"])||t.schemaVersion!==1||t.channel!=="development"||!Aa.test(t.bundleId)||!Array.isArray(t.artifacts))throw new Qe("LOCAL_ARTIFACT_BUNDLE_INVALID");if(Zl({artifacts:t.artifacts}).bundleId!==t.bundleId)throw new Qe("LOCAL_ARTIFACT_BUNDLE_INVALID");return t}function Ql(e){if(!qr(e,["packageInputs","bundle","generatedAt","expiresAt"])||e.packageInputs.length!==e.bundle.artifacts.length||e.packageInputs.length===0||Number.isNaN(Date.parse(e.generatedAt))||Number.isNaN(Date.parse(e.expiresAt))||Date.parse(e.expiresAt)<=Date.parse(e.generatedAt))throw new Qe("LOCAL_ARTIFACT_PLAN_INVALID");let t=e.packageInputs.map(o=>Object.freeze({...o}));if(t.some(o=>!qr(o,["relativeRoot","manifestDigest"])||!/^(?:packages|fixtures)\/[a-z0-9][a-z0-9._-]{1,127}$/u.test(o.relativeRoot)||!Aa.test(o.manifestDigest))||new Set(t.map(o=>o.relativeRoot)).size!==t.length)throw new Qe("LOCAL_ARTIFACT_PLAN_INVALID");let r=Br(e.bundle),n={schemaVersion:1,state:"awaiting-approval",packageInputs:t,bundle:r,targetPreimage:{kind:"absent"},generatedAt:e.generatedAt,expiresAt:e.expiresAt};return Object.freeze({...n,planId:y(k(n))})}function Gg(e){let t=e;if(typeof t!="object"||t===null||!qr(t,["schemaVersion","planId","state","packageInputs","bundle","targetPreimage","generatedAt","expiresAt"])||t.schemaVersion!==1||t.state!=="awaiting-approval"||!Aa.test(t.planId)||!qr(t.targetPreimage,["kind"])||t.targetPreimage.kind!=="absent")throw new Qe("LOCAL_ARTIFACT_PLAN_INVALID");if(Ql({packageInputs:t.packageInputs,bundle:t.bundle,generatedAt:t.generatedAt,expiresAt:t.expiresAt}).planId!==t.planId)throw new Qe("LOCAL_ARTIFACT_PLAN_INVALID");return t}function Wg(e){let t=Br(e.bundle),r=Ao(e.registry);if(r.authentication.kind!=="anonymous-test"||r.status!=="enabled"||!r.capabilities.read||Number.isNaN(Date.parse(e.verifiedAt)))throw new Qe("LOCAL_ARTIFACT_POLICY_VIOLATION");return Object.freeze(t.artifacts.map(n=>Ol({registryId:r.registryId,registryConfigRevision:r.revision,packageName:n.packageName,version:n.version,integrity:n.integrity,tarballDigest:n.tarballDigest,access:"private",provenance:"development-readback-verified",verificationIdentityDigest:t.bundleId,sourceDeliveryReceiptId:t.bundleId,verifiedAt:e.verifiedAt})))}var Ye=class extends Error{code;constructor(t){super(t),this.code=t,this.name="ResolutionWorkerBuildError"}},Kg=/^sha256:[a-f0-9]{64}$/u,Ea=/^[a-z0-9][a-z0-9._/-]{0,255}$/u;function ed(e){if(!Ea.test(e.workerReleaseId)||e.pnpmVersion!=="11.21.0"||![e.workspaceManifestDigest,e.rootLockDigest].every(r=>Kg.test(r))||!Ea.test(e.cacheNamespace)||!Number.isSafeInteger(e.maximumBytes)||e.maximumBytes<1||Number.isNaN(Date.parse(e.generatedAt))||Date.parse(e.expiresAt)<=Date.parse(e.generatedAt))throw new Ye("RESOLUTION_WORKER_BUILD_INVALID");let t={schemaVersion:1,...e};return Object.freeze({...t,planId:y(k(t))})}function Yg(e){let t=e;if(!t||typeof t!="object"||Object.keys(t).length!==10)throw new Ye("RESOLUTION_WORKER_BUILD_INVALID");let r=ed({workerReleaseId:t.workerReleaseId,pnpmVersion:t.pnpmVersion,workspaceManifestDigest:t.workspaceManifestDigest,rootLockDigest:t.rootLockDigest,cacheNamespace:t.cacheNamespace,maximumBytes:t.maximumBytes,generatedAt:t.generatedAt,expiresAt:t.expiresAt});if(t.schemaVersion!==1||t.planId!==r.planId)throw new Ye("RESOLUTION_WORKER_BUILD_INVALID");return r}function td(e){if(![e.planId,e.cacheDigest,e.commandDigest].every(r=>Kg.test(r))||!Ea.test(e.workerReleaseId)||!Ea.test(e.cacheNamespace)||e.pnpmVersion!=="11.21.0"||!Number.isSafeInteger(e.cacheBytes)||e.cacheBytes<0||Number.isNaN(Date.parse(e.completedAt)))throw new Ye("RESOLUTION_WORKER_BUILD_INVALID");let t={schemaVersion:1,...e};return Object.freeze({...t,receiptId:y(k(t))})}function Pa(e){let t=e;if(!t||typeof t!="object"||Object.keys(t).length!==10)throw new Ye("RESOLUTION_WORKER_BUILD_INVALID");let r=td({planId:t.planId,workerReleaseId:t.workerReleaseId,pnpmVersion:t.pnpmVersion,cacheNamespace:t.cacheNamespace,cacheDigest:t.cacheDigest,cacheBytes:t.cacheBytes,commandDigest:t.commandDigest,completedAt:t.completedAt});if(t.schemaVersion!==1||t.receiptId!==r.receiptId)throw new Ye("RESOLUTION_WORKER_BUILD_INVALID");return r}var xo=class extends Error{code;constructor(t){super(t),this.code=t,this.name="RecoveryOverrideError"}},rd=/^sha256:[a-f0-9]{64}$/u,VE=/^(?!\/)(?!.*(?:^|\/)\.\.(?:\/|$))[a-zA-Z0-9._@:/-]+$/u;function nd(e){if(![e.transactionPlanId,e.transactionRootDigest].every(r=>rd.test(r))||e.conflicts.length===0||new Set(e.conflicts.map(r=>r.path)).size!==e.conflicts.length||e.conflicts.some(r=>!VE.test(r.path)||!rd.test(r.currentDigest)||!rd.test(r.preimageDigest))||Number.isNaN(Date.parse(e.generatedAt))||Date.parse(e.expiresAt)<=Date.parse(e.generatedAt))throw new xo("RECOVERY_OVERRIDE_INVALID");let t={schemaVersion:1,...e,conflicts:e.conflicts.map(r=>({...r})).sort((r,n)=>r.path.localeCompare(n.path))};return Object.freeze({...t,planId:y(k(t))})}function Hg(e){let t=e;if(!t||typeof t!="object"||Object.keys(t).length!==7)throw new xo("RECOVERY_OVERRIDE_INVALID");let r=nd({transactionPlanId:t.transactionPlanId,transactionRootDigest:t.transactionRootDigest,conflicts:t.conflicts,generatedAt:t.generatedAt,expiresAt:t.expiresAt});if(t.schemaVersion!==1||t.planId!==r.planId)throw new xo("RECOVERY_OVERRIDE_INVALID");return r}var Vo=class extends Error{code;constructor(t,r){super(r),this.code=t}},id=/^sha256:[a-f0-9]{64}$/u,ME=/^sha512-[A-Za-z0-9+/]{86}==$/u,UE=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u,FE=/^(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?$/u,qE=/[\u0000-\u001f\u007f]/u;function _n(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function An(e,t){let r=Object.keys(e).sort(),n=[...t].sort();return r.length===n.length&&r.every((o,i)=>o===n[i])}function Jt(e,t=500){return typeof e=="string"&&e.length>0&&e.length<=t&&!qE.test(e)}function od(e){return Jt(e,500)&&!e.startsWith("/")&&!e.startsWith("../")&&!e.includes("/../")&&!e.includes("\\")}function Xg(e,t=128){return Array.isArray(e)&&e.length<=t&&e.every(r=>Jt(r,500))&&e.every((r,n)=>n===0||e[n-1]<r)}function BE(e){return e===null?!0:!_n(e)||!An(e,["fileName","digest","integrity","fileCount","unpackedBytes"])?!1:od(e.fileName)&&id.test(String(e.digest))&&ME.test(String(e.integrity))&&Number.isSafeInteger(e.fileCount)&&Number(e.fileCount)>0&&Number.isSafeInteger(e.unpackedBytes)&&Number(e.unpackedBytes)>0}function zE(e){if(!_n(e)||!An(e,["schemaVersion","kind","packageName","version","title","summary","maturity","source","artifact","compatibility","exports","documentation","consumerEvidence"])||e.schemaVersion!==1||e.kind!=="PackageRelease"||!UE.test(e.packageName)||!FE.test(e.version)||!Jt(e.title,120)||!Jt(e.summary,1e3)||!["candidate","stable","deprecated"].includes(e.maturity)||!_n(e.source)||!An(e.source,["repository","path","revision","treeDigest"])||!Jt(e.source.repository)||!od(e.source.path)||!Jt(e.source.revision,200)||!id.test(String(e.source.treeDigest))||!BE(e.artifact)||!_n(e.compatibility)||!An(e.compatibility,["node","packageManager"])||!Jt(e.compatibility.node,100)||!Jt(e.compatibility.packageManager,100)||!Xg(e.exports)||!Xg(e.consumerEvidence)||!_n(e.documentation))return!1;let t=e.documentation.knowledgeRef===void 0?["readme"]:["readme","knowledgeRef"];return!An(e.documentation,t)||!od(e.documentation.readme)||e.documentation.knowledgeRef!==void 0&&!Jt(e.documentation.knowledgeRef,500)?!1:e.artifact!==null||e.maturity!=="stable"}function JE(e){let t={schemaVersion:1,kind:"PackageRelease",...e,source:Object.freeze({...e.source}),artifact:e.artifact===null?null:Object.freeze({...e.artifact}),compatibility:Object.freeze({...e.compatibility}),exports:Object.freeze([...e.exports]),documentation:Object.freeze({...e.documentation}),consumerEvidence:Object.freeze([...e.consumerEvidence])};if(!zE(t))throw new Vo("PACKAGE_RELEASE_INVALID","PackageRelease \u5185\u5BB9\u65E0\u6548");return Object.freeze({...t,releaseDigest:y(k(t))})}function Zg(e){if(!_n(e)||!An(e,["schemaVersion","kind","packageName","version","title","summary","maturity","source","artifact","compatibility","exports","documentation","consumerEvidence","releaseDigest"])||!id.test(String(e.releaseDigest)))throw new Vo("PACKAGE_RELEASE_INVALID","PackageRelease \u7ED3\u6784\u65E0\u6548");let{releaseDigest:t,schemaVersion:r,kind:n,...o}=e,i=JE(o);if(i.releaseDigest!==t)throw new Vo("PACKAGE_RELEASE_MODIFIED","PackageRelease \u5DF2\u88AB\u4FEE\u6539");return i}import{lstat as GE,readFile as WE,realpath as KE}from"node:fs/promises";import Qg from"node:path";async function eh(e){let t=await KE(Qg.resolve(e.projectRoot)),r=new Set(e.excludeCapabilityIds??[]),n=new Map,o=[...e.lock.capabilities].sort((a,s)=>a.committedAt.localeCompare(s.committedAt)||a.capabilityId.localeCompare(s.capabilityId));for(let a of o)if(!r.has(a.capabilityId))for(let s of a.assets){let c=s.ownership??"owned-file",l=`${s.path}\0`;if(c==="managed-region")n.delete(l);else for(let p of n.keys())p.startsWith(l)&&n.delete(p);let d=c==="managed-region"?`${l}${s.regionId??""}`:l;n.set(d,{capabilityId:a.capabilityId,path:s.path,digest:s.digest,ownership:c,...s.regionId===void 0?{}:{regionId:s.regionId}})}let i=[];for(let a of[...n.values()].sort((s,c)=>s.path.localeCompare(c.path)||(s.regionId??"").localeCompare(c.regionId??"")||s.capabilityId.localeCompare(c.capabilityId))){let s=Qg.join(t,...a.path.split("/")),l=await GE(s).then(async d=>{if(!d.isFile()||d.isSymbolicLink())return;let p=await WE(s);if(a.ownership!=="managed-region")return y(p);if(a.regionId!==void 0)try{return y($i(p.toString("utf8"),a.regionId))}catch{return}}).catch(d=>d.code==="ENOENT"?void 0:Promise.reject(d))===a.digest;i.push({capabilityId:a.capabilityId,path:a.path,kind:"create",ownership:a.ownership,...a.regionId===void 0?{}:{regionId:a.regionId},desiredDigest:a.digest,disposition:l?"noop":"conflict",...l?{}:{conflictCode:"BASE_DIGEST_MISMATCH"}})}return i}import{readFile as re,readdir as gh,realpath as Rt}from"node:fs/promises";import{execFile as lP,spawn as dP}from"node:child_process";import N from"node:path";import{parseArgs as ue,promisify as pP}from"node:util";import{lstat as th,mkdir as sd,readFile as rh,realpath as ad,rm as YE,writeFile as nh}from"node:fs/promises";import et from"node:path";var tt=class extends Error{constructor(r,n){super(r,n===void 0?void 0:{cause:n});this.code=r}code},HE=e=>k(e),oh=e=>y(HE(e));async function ih(e,t){let r=await ad(et.resolve(e)),n=et.join(r,".examples");await sd(n,{recursive:!0});let o=await ad(n),i=et.resolve(r,t);if(et.dirname(i)!==o||et.basename(i).startsWith(".")||et.basename(i).length<1)throw new tt("SCAFFOLD_ARGUMENT_INVALID");if(await th(i).then(()=>!0).catch(a=>a.code==="ENOENT"?!1:Promise.reject(a)))throw new tt("SCAFFOLD_TARGET_CONFLICT");return{workspaceRoot:r,output:i,outputRelativePath:et.relative(r,i)}}async function ah(e){let t=e.artifactFallbackBundles??[];if(!/^sha256:[a-f0-9]{64}$/u.test(e.artifactBundle)||t.some(c=>!/^sha256:[a-f0-9]{64}$/u.test(c))||new Set([e.artifactBundle,...t]).size!==1+t.length||!Number.isSafeInteger(e.artifactPort)||e.artifactPort<1||e.artifactPort>65535)throw new tt("SCAFFOLD_ARGUMENT_INVALID");let r=await ih(e.workspaceRoot,e.output),n=e.now??new Date().toISOString(),o={schemaVersion:1,state:"reviewable",recipeId:e.recipe.recipeId,recipeVersion:e.recipe.version,recipeIntegrity:e.recipe.integrity,workspaceRoot:r.workspaceRoot,outputRelativePath:r.outputRelativePath,locale:e.recipe.locale,channel:"development",artifactBundle:e.artifactBundle,artifactFallbackBundles:t,artifactPort:e.artifactPort,generatedAt:n,expiresAt:new Date(Date.parse(n)+30*6e4).toISOString()},i={...o,planId:oh(o)},a=et.join(r.workspaceRoot,".dyyto","scaffold-plans");await sd(a,{recursive:!0});let s=et.join(a,`${i.planId}.json`);return await nh(s,`${k(i)}
|
|
46
46
|
`,{flag:"wx",mode:384}).catch(async c=>{if(c.code!=="EEXIST"||await rh(s,"utf8")!==`${k(i)}
|
|
47
47
|
`)throw new tt("SCAFFOLD_PLAN_INVALID")}),i}async function XE(e,t){if(!/^sha256:[a-f0-9]{64}$/u.test(t))throw new tt("SCAFFOLD_PLAN_INVALID");let r=await ad(et.resolve(e)),n;try{n=JSON.parse(await rh(et.join(r,".dyyto","scaffold-plans",`${t}.json`),"utf8"))}catch{throw new tt("SCAFFOLD_PLAN_NOT_FOUND")}let{planId:o,...i}=n;if(o!==t||oh(i)!==t||n.workspaceRoot!==r||Date.parse(n.expiresAt)<=Date.now())throw new tt("SCAFFOLD_PLAN_INVALID");return n}async function sh(e){let t=await XE(e.workspaceRoot,e.approvedPlanId);if(t.recipeId!==e.recipe.recipeId||t.recipeVersion!==e.recipe.version||t.recipeIntegrity!==e.recipe.integrity)throw new tt("SCAFFOLD_PLAN_INVALID");let r=await ih(t.workspaceRoot,t.outputRelativePath),n;try{n=await e.execute(r.output,t)}catch(s){throw await th(r.output).then(()=>!0).catch(()=>!1)&&await YE(r.output,{recursive:!0,force:!0}),new tt("SCAFFOLD_APPLY_FAILED",s)}let o={schemaVersion:1,scaffoldPlanId:t.planId,recipeIntegrity:t.recipeIntegrity,outputRelativePath:t.outputRelativePath,state:"adopted",receipts:n},i=y(k(o)),a=et.join(t.workspaceRoot,".dyyto","scaffold-evidence");return await sd(a,{recursive:!0}),await nh(et.join(a,`${i}.json`),`${k({...o,evidenceId:i})}
|
|
48
48
|
`,{flag:"wx",mode:384}),{evidenceId:i,output:r.output,receipts:n}}import{lstat as Mo,readFile as cd,readdir as ZE,realpath as ld}from"node:fs/promises";import me from"node:path";var ch={capabilities:me.resolve(import.meta.dirname,"catalog"),packages:me.resolve(import.meta.dirname,"package-releases")};function dh(e,t){return e<t?-1:e>t?1:0}function Oa(e){return Array.isArray(e)?`[${e.filter(t=>t!==void 0).map(Oa).join(",")}]`:e!==null&&typeof e=="object"?`{${Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>dh(t,r)).map(([t,r])=>`${JSON.stringify(t)}:${Oa(r)}`).join(",")}}`:JSON.stringify(e)??"null"}function QE(e){let t=new Map;for(let[r,n]of e.split(/\r?\n/u).entries()){let o=n.trim();if(o===""||o.startsWith("#"))continue;if(o.startsWith("export "))throw new Error(`Dyyto \u7EC4\u4EF6 .env:${r+1} \u4E0D\u5141\u8BB8\u4F7F\u7528 export`);let i=/^([A-Z][A-Z0-9_]*)=(.*)$/u.exec(o);if(!i)throw new Error(`Dyyto \u7EC4\u4EF6 .env:${r+1} \u4E0D\u662F\u4E25\u683C KEY=VALUE \u683C\u5F0F`);if(t.has(i[1]))throw new Error(`Dyyto \u7EC4\u4EF6 .env:${r+1} \u5305\u542B\u91CD\u590D\u53D8\u91CF ${i[1]}`);let a=i[2].trim();if((a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),/[`$][({]?/u.test(a))throw new Error(`Dyyto \u7EC4\u4EF6 .env:${r+1} \u4E0D\u5141\u8BB8\u547D\u4EE4\u6216\u53D8\u91CF\u5C55\u5F00`);t.set(i[1],a)}return t}async function lh(e,t){let r=await Mo(e);if(!r.isFile()||r.isSymbolicLink()||r.nlink!==1)throw new Error(`${t}\u5FC5\u987B\u662F\u666E\u901A\u975E\u94FE\u63A5\u6587\u4EF6`);if(typeof process.getuid=="function"&&r.uid!==process.getuid())throw new Error(`${t}\u5FC5\u987B\u7531\u5F53\u524D\u7528\u6237\u62E5\u6709`);if((r.mode&511&-385)!==0)throw new Error(`${t}\u6743\u9650\u8FC7\u5BBD\uFF0C\u6700\u5927\u5141\u8BB80600`)}async function Na(e,t){let r=await Mo(e);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${t}\u5FC5\u987B\u662F\u666E\u901A\u76EE\u5F55\u4E14\u4E0D\u80FD\u662F\u7B26\u53F7\u94FE\u63A5`);if(typeof process.getuid=="function"&&r.uid!==process.getuid())throw new Error(`${t}\u5FC5\u987B\u7531\u5F53\u524D\u7528\u6237\u62E5\u6709`);if((r.mode&511&-449)!==0)throw new Error(`${t}\u6743\u9650\u8FC7\u5BBD\uFF0C\u6700\u5927\u5141\u8BB80700`);return ld(e)}async function eP(e){let t=e;for(;;){if(await Mo(me.join(t,".git")).then(()=>!0).catch(n=>n.code==="ENOENT"?!1:Promise.reject(n)))throw new Error(`IDP_CONFIG_DIR \u5FC5\u987B\u4F4D\u4E8E Git \u4ED3\u5E93\u5916\uFF1A${t}`);let r=me.dirname(t);if(r===t)return;t=r}}async function tP(e){if(!me.isAbsolute(e))throw new Error("IDP_CONFIG_DIR \u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84");let t=await Na(e,"IDP_CONFIG_DIR");await eP(t);let r=await Na(me.join(t,"components"),"components"),n=await Na(me.join(r,"dyyto"),"Dyyto \u914D\u7F6E\u76EE\u5F55"),o=me.relative(t,n);if(o.startsWith("..")||me.isAbsolute(o))throw new Error("Dyyto \u914D\u7F6E\u76EE\u5F55\u8D8A\u8FC7 IDP_CONFIG_DIR");let i=me.join(n,".env");await lh(i,"Dyyto \u7EC4\u4EF6 .env");let a=QE(await cd(i,"utf8")).get("DYYTO_PACKAGE_CATALOG_DIRS_FILE");if(a===void 0||a==="")return[];if(me.isAbsolute(a)||a.includes("\0")||/[*?{}[\]]/u.test(a))throw new Error("DYYTO_PACKAGE_CATALOG_DIRS_FILE \u5FC5\u987B\u662F\u7EC4\u4EF6\u76EE\u5F55\u5185\u7684\u666E\u901A\u76F8\u5BF9\u6587\u4EF6\u8DEF\u5F84");let s=me.resolve(n,a),c=me.relative(n,s);if(c===""||c.startsWith("..")||me.isAbsolute(c))throw new Error("DYYTO_PACKAGE_CATALOG_DIRS_FILE \u5FC5\u987B\u4F4D\u4E8E\u7EC4\u4EF6\u914D\u7F6E\u76EE\u5F55\u5185");let l=n;for(let u of c.split(me.sep).slice(0,-1))l=await Na(me.join(l,u),"Package Catalog Binding \u7236\u76EE\u5F55");let d=await ld(me.dirname(s)),p=me.relative(n,d);if(p.startsWith("..")||me.isAbsolute(p))throw new Error("Package Catalog Binding \u89E3\u6790\u540E\u8D8A\u8FC7\u7EC4\u4EF6\u914D\u7F6E\u76EE\u5F55");await lh(s,"Package Catalog Binding");let f=[];for(let u of(await cd(s,"utf8")).split(/\r?\n/u)){let m=u.trim();if(m===""||m.startsWith("#"))continue;if(!me.isAbsolute(m))throw new Error("Package Catalog Binding \u4E2D\u7684\u8DEF\u5F84\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84");let g=await Mo(m);if(!g.isDirectory()||g.isSymbolicLink())throw new Error("Package Catalog Binding \u5FC5\u987B\u6307\u5411\u666E\u901A\u76EE\u5F55");let h=await ld(m),w=await Mo(h);if(!w.isDirectory()||w.isSymbolicLink())throw new Error("Package Catalog Binding \u5FC5\u987B\u6307\u5411\u666E\u901A\u76EE\u5F55");f.includes(h)||f.push(h)}return f.sort()}async function rP(){let e=process.env.IDP_CONFIG_DIR,t=e===void 0?[]:await tP(e);return{capabilities:ch.capabilities,packages:[ch.packages,...t]}}async function Sa(e){return(await ZE(e,{withFileTypes:!0})).filter(t=>t.isDirectory()&&!t.isSymbolicLink()).map(t=>t.name).sort()}function nP(e,t){let r=i=>i.split("-",1)[0].split(".").map(Number),n=r(e),o=r(t);for(let i=0;i<3;i+=1){let a=(n[i]??0)-(o[i]??0);if(a!==0)return a}return e.localeCompare(t)}function oP(e){let t=e.schemaVersion===2?e.availability.maturity:"legacy-unverified",r="consumerProfile"in e?e.consumerProfile:"\u591A\u79CD\u5DE5\u7A0B Profile";return{kind:"capability",ref:`capability:${e.capabilityId}@${e.version}`,id:e.capabilityId,version:e.version,title:e.capabilityId,summary:`\u9002\u7528\u4E8E ${r} \u7684\u5DE5\u7A0B\u80FD\u529B\u53D1\u884C\u3002`,maturity:t,integrity:e.integrity}}function iP(e){return{kind:"package",ref:`package:${e.packageName}@${e.version}`,id:e.packageName,version:e.version,title:e.title,summary:e.summary,maturity:e.maturity,integrity:e.releaseDigest}}async function aP(e){let t=[];for(let r of await Sa(e))for(let n of await Sa(me.join(e,r))){let o=`capability:${r}@${n}`;t.push(ve(me.join(e,r,n)).then(i=>({entry:{item:oP(i.release),release:i.release}})).catch(()=>({diagnostic:{ref:o,code:"CATALOG_RELEASE_INVALID",message:"Capability \u53D1\u884C\u672A\u901A\u8FC7\u5B8C\u6574\u6027\u6821\u9A8C"}})))}return(await Promise.all(t)).reduce((r,n)=>(n.entry!==void 0&&r.entries.push(n.entry),n.diagnostic!==void 0&&r.diagnostics.push(n.diagnostic),r),{entries:[],diagnostics:[]})}async function sP(e){let t=[];for(let r of await Sa(e))for(let n of await Sa(me.join(e,r))){let o=me.join(e,r,n,"release.json"),i=`package:${r}@${n}`;t.push(cd(o,"utf8").then(a=>{let s=Zg(JSON.parse(a));return{entry:{item:iP(s),release:s}}}).catch(()=>({diagnostic:{ref:i,code:"CATALOG_RELEASE_INVALID",message:"PackageRelease \u672A\u901A\u8FC7\u5B8C\u6574\u6027\u6821\u9A8C"}})))}return(await Promise.all(t)).reduce((r,n)=>(n.entry!==void 0&&r.entries.push(n.entry),n.diagnostic!==void 0&&r.diagnostics.push(n.diagnostic),r),{entries:[],diagnostics:[]})}async function dd(e){let t=e??await rP(),r=typeof t.packages=="string"?[t.packages]:[...t.packages],[n,...o]=await Promise.all([aP(t.capabilities),...r.map(sP)]),i=[...n.entries,...o.flatMap(l=>l.entries)].sort((l,d)=>l.item.ref.localeCompare(d.item.ref)),a=[],s=new Set,c=[];for(let l of i)s.has(l.item.ref)?c.push({ref:l.item.ref,code:"CATALOG_RELEASE_DUPLICATE",message:"\u591A\u4E2A Catalog Source \u58F0\u660E\u4E86\u540C\u4E00\u4E0D\u53EF\u53D8\u53D1\u884C ref"}):(s.add(l.item.ref),a.push(l));return{entries:a,diagnostics:[...n.diagnostics,...o.flatMap(l=>l.diagnostics),...c].sort((l,d)=>l.ref.localeCompare(d.ref))}}async function Da(e){let t=(e.query??"").trim().toLocaleLowerCase("zh-CN"),r=await dd(e.roots),n=new Map;for(let{item:a}of r.entries){if(e.kind!==void 0&&a.kind!==e.kind)continue;let s=[a.id,a.version,a.title,a.summary,a.maturity].join(" ").toLocaleLowerCase("zh-CN");if(t!==""&&!s.includes(t))continue;let c=`${a.kind}:${a.id}`,l=n.get(c);(l===void 0||nP(l.version,a.version)<0)&&n.set(c,a)}let o=[...n.values()].sort((a,s)=>a.ref.localeCompare(s.ref)),i=e.limit??50;return{query:t,total:o.length,items:o.slice(0,i),diagnostics:r.diagnostics}}async function ja(e){let t=e.ref.startsWith("package:")||e.ref.startsWith("capability:")?e.ref:`${e.ref.startsWith("@")?"package":"capability"}:${e.ref}`,r=await dd(e.roots),n=r.entries.find(({item:i})=>i.ref===t),o=r.diagnostics.find(i=>i.ref===t);if(o?.code==="CATALOG_RELEASE_DUPLICATE")throw new Error(`\u53D1\u884C ref \u5728\u591A\u4E2A Catalog Source \u4E2D\u91CD\u590D\uFF1A${e.ref}`);if(n===void 0&&o!==void 0)throw new Error(`\u53D1\u884C\u672A\u901A\u8FC7\u5B8C\u6574\u6027\u6821\u9A8C\uFF1A${e.ref}`);if(n===void 0)throw new Error(`\u76EE\u5F55\u4E2D\u4E0D\u5B58\u5728\u53D1\u884C\uFF1A${e.ref}`);return n}function cP(e){let t=new Map;for(let{item:r,release:n}of e){if(r.kind!=="capability"||typeof n!="object"||n===null)continue;let o=n;if(typeof o.capabilityId!="string"||typeof o.version!="string"||!Array.isArray(o.integration?.packages))continue;let i=`capability:${o.capabilityId}@${o.version}`;for(let a of o.integration.packages){if(typeof a!="object"||a===null)continue;let s=a;if(typeof s.packageName!="string"||typeof s.version!="string")continue;let c=`${s.packageName}@${s.version}`,l=t.get(c)??new Set;l.add(i),t.set(c,l)}}return t}async function ph(e){let t=new Date(e.generatedAt);if(Number.isNaN(t.getTime())||t.toISOString()!==e.generatedAt)throw new Error("generatedAt \u5FC5\u987B\u662F\u89C4\u8303 ISO-8601 UTC \u65F6\u95F4");let r=await dd(e.roots);if(r.diagnostics.length>0)throw new Error(`Catalog \u5B58\u5728 ${r.diagnostics.length} \u4E2A\u65E0\u6548\u6216\u91CD\u590D\u53D1\u884C\uFF0C\u7981\u6B62\u5BFC\u51FA\u751F\u4EA7\u6295\u5F71`);let n=cP(r.entries),o=r.entries.filter(({item:a})=>a.kind==="package").map(({release:a})=>{let s=a;return Object.freeze({kind:"package",ref:`package:${s.packageName}@${s.version}`,packageName:s.packageName,version:s.version,releaseDigest:s.releaseDigest,capabilities:Object.freeze([...n.get(`${s.packageName}@${s.version}`)??[]].sort())})}).sort((a,s)=>dh(a.ref,s.ref)),i={schemaVersion:1,generatedAt:e.generatedAt,items:Object.freeze(o)};return Object.freeze({...i,sourceDigest:y(Oa(i))})}function uh(e){let{sourceDigest:t,...r}=e;if(!/^sha256:[a-f0-9]{64}$/u.test(t)||y(Oa(r))!==t)throw new Error("Dyyto Package Catalog Snapshot \u6458\u8981\u65E0\u6548");return`${JSON.stringify(e,null,2)}
|
|
@@ -218,7 +218,7 @@ ${r.item.summary}
|
|
|
218
218
|
strict-peer-dependencies=true
|
|
219
219
|
manage-package-manager-versions=false
|
|
220
220
|
`,{mode:384});let a=ce.join(t,"store","shared"),s=ce.join(t,"cache");await Pn(a,{recursive:!0}),await Pn(s,{recursive:!0});let c=["pnpm@11.21.0","fetch","--frozen-lockfile","--ignore-scripts","--reporter","ndjson"],l=await C0("corepack",c,{cwd:r,env:{PATH:process.env.PATH,CI:"1",NO_COLOR:"1",HOME:n,XDG_CACHE_HOME:s,COREPACK_HOME:process.env.COREPACK_HOME,COREPACK_ENABLE_PROJECT_SPEC:"0",NPM_CONFIG_USERCONFIG:i,pnpm_config_store_dir:a},timeout:9e5,maxBuffer:8*1024*1024});return{...await T0(t),commandDigest:y(k({executable:"corepack",args:c,stdoutDigest:y(l.stdout),stderrDigest:y(l.stderr)}))}}finally{await Mh(r,{recursive:!0,force:!0})}}}async function Bh(e){let t=await kd(e.workspaceRoot),r=e.now??new Date,[n,o]=await Promise.all([_t(ce.join(t,"pnpm-workspace.yaml")),_t(ce.join(t,"pnpm-lock.yaml"))]),i=y(k({workerReleaseId:e.workerReleaseId??"reference.pnpm-resolution-worker.v1",pnpmVersion:"11.21.0",workspaceManifestDigest:y(n)})),a=ed({workerReleaseId:e.workerReleaseId??"reference.pnpm-resolution-worker.v1",pnpmVersion:"11.21.0",workspaceManifestDigest:y(n),rootLockDigest:y(o),cacheNamespace:`pnpm11-node24-${i.slice(7)}`,maximumBytes:e.maximumBytes,generatedAt:r.toISOString(),expiresAt:new Date(r.getTime()+30*6e4).toISOString()}),s=Uh(t,a.planId);await Pn(ce.dirname(s),{recursive:!0});let c=`${JSON.stringify(a,null,2)}
|
|
221
|
-
`;return await zr(s,c,{flag:"wx",mode:384}).catch(async l=>{if(l.code!=="EEXIST"||await _t(s,"utf8")!==c)throw l}),a}async function zh(e){let t=await kd(e.workspaceRoot),r=Yg(JSON.parse(await _t(Uh(t,e.approvedPlanId),"utf8")));if(r.planId!==e.approvedPlanId||(e.now??new Date).getTime()>Date.parse(r.expiresAt))throw new
|
|
221
|
+
`;return await zr(s,c,{flag:"wx",mode:384}).catch(async l=>{if(l.code!=="EEXIST"||await _t(s,"utf8")!==c)throw l}),a}async function zh(e){let t=await kd(e.workspaceRoot),r=Yg(JSON.parse(await _t(Uh(t,e.approvedPlanId),"utf8")));if(r.planId!==e.approvedPlanId||(e.now??new Date).getTime()>Date.parse(r.expiresAt))throw new Ye("RESOLUTION_WORKER_BUILD_EXPIRED");let[n,o]=await Promise.all([_t(ce.join(t,"pnpm-workspace.yaml")),_t(ce.join(t,"pnpm-lock.yaml"))]);if(y(n)!==r.workspaceManifestDigest||y(o)!==r.rootLockDigest)throw new Ye("RESOLUTION_WORKER_BUILD_PREIMAGE_CONFLICT");let i=Fh(t),a=await _t(bd(t),"utf8").catch(s=>s.code==="ENOENT"?void 0:Promise.reject(s));if(a)return Pa(JSON.parse(a));await Pn(i,{recursive:!0});try{let s=await e.warmup({workspaceRoot:t,stateRoot:i,cacheNamespace:r.cacheNamespace});if(s.cacheBytes>r.maximumBytes)throw new Ye("RESOLUTION_WORKER_BUILD_LIMIT_EXCEEDED");let c=td({planId:r.planId,workerReleaseId:r.workerReleaseId,pnpmVersion:r.pnpmVersion,cacheNamespace:r.cacheNamespace,cacheDigest:s.cacheDigest,cacheBytes:s.cacheBytes,commandDigest:s.commandDigest,completedAt:(e.now??new Date).toISOString()}),l=ce.join(i,`build-receipt.${r.planId.slice(7)}.tmp`);return await zr(l,`${JSON.stringify(c,null,2)}
|
|
222
222
|
`,{mode:384}),await S0(l,bd(t)),c}catch(s){throw await D0(bd(t)).then(()=>!0).catch(()=>!1)||await Mh(ce.join(i,"store",r.cacheNamespace),{recursive:!0,force:!0}),s}}import{mkdir as L0,readFile as Jr,realpath as Jh,writeFile as x0}from"node:fs/promises";import Gr from"node:path";function Gh(e,t){return Gr.join(e,".dyyto","recovery-override-plans",`${t}.json`)}async function Wh(e){let t=await Jh(e.projectRoot),r=await Ut(t);if(r.mode!=="pnpm-shared-lockfile")throw new Error("RECOVERY_OVERRIDE_INVALID");let n=JSON.parse(await Jr(Gr.join(r.transactionRoot,".dyyto","transaction-lock.json"),"utf8"));if(typeof n.planId!="string")throw new Error("RECOVERY_OVERRIDE_INVALID");await Jr(Gr.join(t,".dyyto","plans",`${n.planId}.json`));let o=JSON.parse(await Jr(Gr.join(r.transactionRoot,".dyyto","transactions",n.planId,"journal.json"),"utf8"));if(o.state!=="recovery-required"&&o.state!=="recovering"||!Array.isArray(o.operations))throw new Error("RECOVERY_OVERRIDE_INVALID");let i=[];for(let d of o.operations){if(d.before.kind!=="present"||!d.before.preimageDigest)continue;let p=await Jr(Gr.join(r.transactionRoot,...d.path.split("/"))).catch(u=>u.code==="ENOENT"?void 0:Promise.reject(u));if(!p)continue;let f=y(p);f!==d.before.digest&&f!==d.desiredDigest&&i.push({path:d.path,currentDigest:f,preimageDigest:d.before.preimageDigest})}let a=e.now??new Date,s=nd({transactionPlanId:n.planId,transactionRootDigest:y(r.transactionRoot),conflicts:i,generatedAt:a.toISOString(),expiresAt:new Date(a.getTime()+30*6e4).toISOString()}),c=Gh(t,s.planId);await L0(Gr.dirname(c),{recursive:!0});let l=`${JSON.stringify(s,null,2)}
|
|
223
223
|
`;return await x0(c,l,{flag:"wx",mode:384}).catch(async d=>{if(d.code!=="EEXIST"||await Jr(c,"utf8")!==l)throw d}),s}async function Kh(e){let t=await Jh(e.projectRoot),r=await Ut(t),n=Hg(JSON.parse(await Jr(Gh(t,e.approvedPlanId),"utf8")));if(n.planId!==e.approvedPlanId||Date.now()>Date.parse(n.expiresAt)||r.mode!=="pnpm-shared-lockfile"||y(r.transactionRoot)!==n.transactionRootDigest)throw new Error("RECOVERY_OVERRIDE_PREIMAGE_CONFLICT");for(let o of n.conflicts){let i=await Jr(Gr.join(r.transactionRoot,...o.path.split("/")));if(y(i)!==o.currentDigest)throw new Error("RECOVERY_OVERRIDE_PREIMAGE_CONFLICT")}return cl({projectRoot:r.transactionRoot,planId:n.transactionPlanId,now:(e.now??new Date).toISOString(),approvedConflicts:n.conflicts.map(({path:o,currentDigest:i})=>({path:o,currentDigest:i}))})}function qa(e){return e.endsWith(`
|
|
224
224
|
`)?e:`${e}
|
|
@@ -237,7 +237,7 @@ ${c.map(l=>` ${l}`).join(`
|
|
|
237
237
|
`)}async function ey(e){let t=await Xh(Ve.resolve(e.projectRoot)),r=await Zh(t),n=Ve.relative(r,t).split(Ve.sep).join("/");if(!n||n.startsWith("../"))throw new ut("WORKSPACE_TOPOLOGY_OWNER_MISSING");let o=await zo(Ve.join(t,"pnpm-lock.yaml")),i=await zo(Ve.join(t,"pnpm-workspace.yaml"));if(!o&&!i)throw new ut("WORKSPACE_TOPOLOGY_MIGRATION_REQUIRED");let a=await Jo(Ve.join(r,"pnpm-lock.yaml")),s=await Jo(Ve.join(r,"pnpm-workspace.yaml"));if(!M0(a.toString("utf8"),n))throw new ut("WORKSPACE_TOPOLOGY_IMPORTER_MISSING");if(i&&!/^packages:\s*\[\]/mu.test(i.toString("utf8")))throw new ut("WORKSPACE_TOPOLOGY_PREIMAGE_CONFLICT");let c=i?Qh(s,i):s,l=[...y(c)!==y(s)?[{path:"pnpm-workspace.yaml",kind:"replace",ownership:"owned-file",baseDigest:y(s),desiredDigest:y(c)}]:[],...o?[{path:`${n}/pnpm-lock.yaml`,kind:"remove",ownership:"owned-file",baseDigest:y(o)}]:[],...i?[{path:`${n}/pnpm-workspace.yaml`,kind:"remove",ownership:"owned-file",baseDigest:y(i)}]:[]],d=e.generatedAt??new Date().toISOString(),p=e.expiresAt??new Date(Date.parse(d)+30*6e4).toISOString(),f=ke({action:"upgrade",capability:{schemaVersion:1,capabilityId:"foundation.workspace-topology-migration",version:"1.0.0",integrity:y("foundation.workspace-topology-migration@1.0.0"),assets:[],verifiers:[]},changes:l,observedAssets:l.map(m=>({path:m.path,exists:!0,digest:m.baseDigest})),generatedAt:d,expiresAt:p});return{plan:await Mt({projectRoot:t,transactionRoot:r,plan:f,now:d}),transactionRoot:r}}async function ty(e){let t=await Xh(Ve.resolve(e.projectRoot)),r=await Zh(t),n=await jr({projectRoot:t,planId:e.approvedPlanId});if(n.capability.capabilityId!=="foundation.workspace-topology-migration"||n.state!=="reviewable")throw new ut("WORKSPACE_TOPOLOGY_PREIMAGE_CONFLICT");let o=new Map,i=n.operations.find(c=>c.path==="pnpm-workspace.yaml"&&c.kind==="replace");if(i){let c=await Jo(Ve.join(t,"pnpm-workspace.yaml")),l=await Jo(Ve.join(r,"pnpm-workspace.yaml")),d=Qh(l,c);if(y(d)!==i.desiredDigest)throw new ut("WORKSPACE_TOPOLOGY_PREIMAGE_CONFLICT");o.set("pnpm-workspace.yaml",d)}let a=await ir({projectRoot:r,plan:n,approvedPlanId:e.approvedPlanId,desiredContents:o,now:e.now??new Date().toISOString()}),s=await ar(a);return{planId:n.planId,transactionRoot:r,transaction:s}}import{createInterface as U0}from"node:readline";import Ba from"node:process";var F0=[{name:"dyyto_catalog_search",title:"\u641C\u7D22 Dyyto \u5DE5\u7A0B\u80FD\u529B\u76EE\u5F55",description:"\u641C\u7D22\u7ECF\u8FC7\u5B8C\u6574\u6027\u6821\u9A8C\u7684\u6700\u65B0 Capability \u4E0E PackageRelease\uFF1B\u4E0D\u4F1A\u4FEE\u6539\u9879\u76EE\u3002",inputSchema:{type:"object",properties:{query:{type:"string",description:"\u540D\u79F0\u3001\u8BF4\u660E\u6216\u6210\u719F\u5EA6\u5173\u952E\u8BCD\uFF1B\u7559\u7A7A\u65F6\u5217\u51FA\u5168\u90E8\u3002"},kind:{type:"string",enum:["package","capability"],description:"\u53EF\u9009\u7684\u8D44\u4EA7\u7C7B\u578B\u3002"},limit:{type:"integer",minimum:1,maximum:200,default:50}},additionalProperties:!1}},{name:"dyyto_catalog_show",title:"\u8BFB\u53D6 Dyyto \u53D1\u884C\u4E8B\u5B9E",description:"\u6309\u4E0D\u53EF\u53D8 ref \u8BFB\u53D6\u5B8C\u6574 Capability \u6216 PackageRelease\u3002",inputSchema:{type:"object",properties:{ref:{type:"string",description:"\u4F8B\u5982 package:@aipt/platform-kernel@0.1.0\u3002"}},required:["ref"],additionalProperties:!1}}];function Rd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function za(e,t){return{jsonrpc:"2.0",id:e,result:t}}function Go(e,t,r){return{jsonrpc:"2.0",id:e,error:{code:t,message:r}}}async function q0(e,t){let r=e.id??null;if(e.method==="notifications/initialized")return null;if(e.method==="initialize")return za(r,{protocolVersion:"2025-06-18",capabilities:{tools:{listChanged:!1}},serverInfo:{name:"dyyto-catalog",version:On},instructions:"\u8FD9\u662F\u53EA\u8BFB\u5DE5\u7A0B\u80FD\u529B\u76EE\u5F55\u3002\u5148\u641C\u7D22\uFF0C\u518D\u7528\u4E0D\u53EF\u53D8 ref \u8BFB\u53D6\u53D1\u884C\u4E8B\u5B9E\u3002"});if(e.method==="tools/list")return za(r,{tools:F0});if(e.method!=="tools/call")return Go(r,-32601,`\u4E0D\u652F\u6301\u7684\u65B9\u6CD5\uFF1A${e.method}`);if(!Rd(e.params)||typeof e.params.name!="string"||e.params.arguments!==void 0&&!Rd(e.params.arguments))return Go(r,-32602,"tools/call \u53C2\u6570\u65E0\u6548");let n=e.params.arguments??{};try{let o;if(e.params.name==="dyyto_catalog_search"){if(n.query!==void 0&&typeof n.query!="string")throw new Error("query \u5FC5\u987B\u662F\u5B57\u7B26\u4E32");if(n.kind!==void 0&&n.kind!=="package"&&n.kind!=="capability")throw new Error("kind \u53EA\u63A5\u53D7 package \u6216 capability");if(n.limit!==void 0&&(!Number.isSafeInteger(n.limit)||Number(n.limit)<1||Number(n.limit)>200))throw new Error("limit \u5FC5\u987B\u662F 1 \u5230 200 \u7684\u6574\u6570");o=await Da({...typeof n.query=="string"?{query:n.query}:{},...n.kind==="package"||n.kind==="capability"?{kind:n.kind}:{},...typeof n.limit=="number"?{limit:n.limit}:{},...t===void 0?{}:{roots:t}})}else if(e.params.name==="dyyto_catalog_show"){if(typeof n.ref!="string"||n.ref.trim()==="")throw new Error("ref \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32");o=await ja({ref:n.ref,...t===void 0?{}:{roots:t}})}else return Go(r,-32602,`\u672A\u77E5\u5DE5\u5177\uFF1A${e.params.name}`);return za(r,{content:[{type:"text",text:JSON.stringify(o)}],structuredContent:o})}catch(o){let i=o instanceof Error?o.message:"Catalog \u5DE5\u5177\u6267\u884C\u5931\u8D25";return za(r,{isError:!0,content:[{type:"text",text:i}]})}}async function ry(){let e=U0({input:Ba.stdin,crlfDelay:1/0,terminal:!1});for await(let t of e){if(t.trim()==="")continue;let r;try{let o=JSON.parse(t);if(!Rd(o)||o.jsonrpc!=="2.0"||typeof o.method!="string"){Ba.stdout.write(`${JSON.stringify(Go(null,-32600,"JSON-RPC \u8BF7\u6C42\u65E0\u6548"))}
|
|
238
238
|
`);continue}r=o}catch{Ba.stdout.write(`${JSON.stringify(Go(null,-32700,"JSON \u89E3\u6790\u5931\u8D25"))}
|
|
239
239
|
`);continue}let n=await q0(r);n!==null&&Ba.stdout.write(`${JSON.stringify(n)}
|
|
240
|
-
`)}}import{createHash as B0}from"node:crypto";import{chmod as z0,lstat as J0,mkdir as G0,readFile as Ga,realpath as ny,rename as W0,unlink as K0,writeFile as Y0}from"node:fs/promises";import Be from"node:path";var _d="1.0.0",Gt=Object.freeze({"@aipt/cli":"0.1.
|
|
240
|
+
`)}}import{createHash as B0}from"node:crypto";import{chmod as z0,lstat as J0,mkdir as G0,readFile as Ga,realpath as ny,rename as W0,unlink as K0,writeFile as Y0}from"node:fs/promises";import Be from"node:path";var _d="1.0.0",Gt=Object.freeze({"@aipt/cli":"0.1.25","@aipt/idp-cli":"0.1.4","@aipt/idp-deploy":"0.1.7"}),oy=Object.entries(Gt).map(([e,t])=>`${e}@${t}`),Ed="<!-- dyyto:agent-policy:start -->",Wo="<!-- dyyto:agent-policy:end -->",ze=class extends Error{constructor(r,n){super(n);this.code=r}code},He=e=>`sha256:${B0("sha256").update(e).digest("hex")}`,Nn=e=>Array.isArray(e)?`[${e.map(Nn).join(",")}]`:e!==null&&typeof e=="object"?`{${Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>`${JSON.stringify(t)}:${Nn(r)}`).join(",")}}`:JSON.stringify(e),Ja=`${Ed}
|
|
241
241
|
## Dyyto \u5DE5\u7A0B\u80FD\u529B\u5E73\u53F0
|
|
242
242
|
|
|
243
243
|
\u672C\u9879\u76EE\u7531 Dyyto \u7EB3\u7BA1\u3002\u5F00\u59CB\u7F16\u7801\u524D\u6267\u884C \`dyyto context --project .\` \u4E0E \`dyyto doctor --project .\`\u3002
|
|
@@ -252,7 +252,7 @@ ${Ja}
|
|
|
252
252
|
`,n=e.indexOf(Ed),o=e.indexOf(Wo);if(n<0&&o<0)return e.length===0?r:`${e.trimEnd()}
|
|
253
253
|
|
|
254
254
|
${Ja}
|
|
255
|
-
`;if(n<0||o<n)throw new
|
|
255
|
+
`;if(n<0||o<n)throw new ze("AGENT_POLICY_REGION_INVALID",`${t}\u4E2D\u7684Dyyto\u53D7\u7BA1\u533A\u57DF\u635F\u574F\u3002`);return`${e.slice(0,n)}${Ja}${e.slice(o+Wo.length)}`}function X0(e){let t=e.indexOf(Ed),r=e.indexOf(Wo);if(t<0&&r<0)return e;if(t<0||r<t)throw new ze("AGENT_POLICY_REGION_INVALID","Dyyto\u53D7\u7BA1\u533A\u57DF\u635F\u574F\u3002");let n=`${e.slice(0,t)}${e.slice(r+Wo.length)}`.trim();return n===""||/^# (?:Agent Instructions|Claude Code Instructions|Antigravity Agent Rules)\s*$/u.test(n)||n.startsWith(`---
|
|
256
256
|
description: Dyyto\u5DE5\u7A0B\u80FD\u529B\u5E73\u53F0\u89C4\u5219`)||n.startsWith(`---
|
|
257
257
|
name: dyyto-engineering`)?null:`${n}
|
|
258
258
|
`}var Ad=[["AGENTS.md","# Agent Instructions"],["CLAUDE.md","# Claude Code Instructions"],[".cursor/rules/dyyto-engineering.mdc",`---
|
|
@@ -264,12 +264,12 @@ description: \u5728Dyyto\u7EB3\u7BA1\u9879\u76EE\u4E2D\u5F00\u53D1\u3001\u6539\u
|
|
|
264
264
|
---`],[".claude/skills/dyyto-engineering/SKILL.md",`---
|
|
265
265
|
name: dyyto-engineering
|
|
266
266
|
description: \u5728Dyyto\u7EB3\u7BA1\u9879\u76EE\u4E2D\u5F00\u53D1\u3001\u6539\u9020\u3001\u9A8C\u8BC1\u6216\u90E8\u7F72\u65F6\u4F7F\u7528\u3002
|
|
267
|
-
---`]];async function Pd(e){if(!Be.isAbsolute(e))throw new
|
|
268
|
-
`,o=`${JSON.stringify({schemaVersion:1,kind:"AgentPolicyLock",policy:{id:"dyyto.engineering",version:_d,digest:
|
|
267
|
+
---`]];async function Pd(e){if(!Be.isAbsolute(e))throw new ze("BOOTSTRAP_PROJECT_NOT_ABSOLUTE","--project\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");let t=await ny(e),r=await J0(t);if(!r.isDirectory()||r.isSymbolicLink())throw new ze("BOOTSTRAP_PROJECT_INVALID","\u9879\u76EE\u5FC5\u987B\u662F\u666E\u901A\u76EE\u5F55\u3002");return t}async function Wr(e){return Ga(e,"utf8").catch(t=>t.code==="ENOENT"?"":Promise.reject(t))}async function Wa(e,t){await G0(Be.dirname(e),{recursive:!0,mode:448});let r=`${e}.candidate-${process.pid}`;await Y0(r,t,{mode:384,flag:"wx"}),await W0(r,e),await z0(e,e.endsWith(".json")?384:420)}function Z0(){return[{id:"engineering-workflow",package:"@aipt/cli",version:Gt["@aipt/cli"],path:"docs/engineering-workflow.md",contentDigest:"sha256:2f3072966d33b97b69c528b9db8ecb0dee0b6d1a36e2841f15b535ec2c802abb"},{id:"vibe-coding-guide",package:"@aipt/cli",version:Gt["@aipt/cli"],path:"docs/vibe-coding-guide.md",contentDigest:"sha256:3c2f41dc06278340c66718a57d5c8ca064ad0aea0494750a46a6eaa4923ab3e7"},{id:"toolchain-troubleshooting",package:"@aipt/cli",version:Gt["@aipt/cli"],path:"docs/troubleshooting.md",contentDigest:"sha256:2040de770d2c2bd81eea709185e913afd6d6cf4c78f1e30c82e6bcb42b066de9"},{id:"idp-integration",package:"@aipt/idp-cli",version:Gt["@aipt/idp-cli"],path:"docs/integration.md",contentDigest:"sha256:5a69f99fd3dc6eee0c8d7af9663b1f1e0984aced240bf008c65418b478e2a65a"},{id:"local-deployment",package:"@aipt/idp-deploy",version:Gt["@aipt/idp-deploy"],path:"docs/local-deployment.md",contentDigest:"sha256:d6aec46bb077edf239a9708ae7852c6679d6b6ae5f1f810ba7fed5aadb8cf90e"},{id:"application-config-workspace",package:"@aipt/idp-deploy",version:Gt["@aipt/idp-deploy"],path:"docs/application-config-workspace.md",contentDigest:"sha256:9217b59ab06cc2039c5b0a95ef4628b89116df94cce7627c9892feb7d70cc798"},{id:"idpctl-troubleshooting",package:"@aipt/idp-deploy",version:Gt["@aipt/idp-deploy"],path:"docs/troubleshooting.md",contentDigest:"sha256:db2f18eb19fb98e81edf6ea2789fcd72c5158d733a7e93b9fe9f1c34c4632d10"}].map(e=>({...e,referenceDigest:He(Nn(e))}))}async function iy(e){let t=await Pd(e),r=[];for(let[p,f]of Ad){let u=await Wr(Be.join(t,p)),m=H0(u,f);r.push({path:p,preimageDigest:He(u),desired:m,desiredDigest:He(m)})}let n=`${JSON.stringify({schemaVersion:1,kind:"DyytoToolchainLock",packageManager:"pnpm",tools:Gt},null,2)}
|
|
268
|
+
`,o=`${JSON.stringify({schemaVersion:1,kind:"AgentPolicyLock",policy:{id:"dyyto.engineering",version:_d,digest:He(Ja)},adapters:Ad.map(([p])=>p)},null,2)}
|
|
269
269
|
`,i=`${JSON.stringify({schemaVersion:1,kind:"DocumentationLock",documents:Z0()},null,2)}
|
|
270
|
-
`;for(let[p,f]of[[".dyyto/toolchain.lock.json",n],[".dyyto/agent-policy.lock.json",o],[".dyyto/documentation.lock.json",i]]){let u=await Wr(Be.join(t,p));r.push({path:p,preimageDigest:
|
|
271
|
-
`;if(l&&l!==d)throw new
|
|
272
|
-
`),{plan:a,planFile:s,changed:r.filter(c=>c.preimageDigest!==c.desiredDigest).map(c=>c.path)}}async function Nd(e,t){if(!Be.isAbsolute(e))throw new
|
|
270
|
+
`;for(let[p,f]of[[".dyyto/toolchain.lock.json",n],[".dyyto/agent-policy.lock.json",o],[".dyyto/documentation.lock.json",i]]){let u=await Wr(Be.join(t,p));r.push({path:p,preimageDigest:He(u),desired:f,desiredDigest:He(f)})}let a={schemaVersion:1,kind:"DyytoBootstrapPlan",projectRoot:t,policyVersion:_d,files:r,createdAt:new Date().toISOString()},s={...a,planId:He(Nn(a))},c=Be.join(t,".dyyto/plans/bootstrap",`${s.planId.slice(7)}.json`),l=await Wr(c),d=`${JSON.stringify(s,null,2)}
|
|
271
|
+
`;if(l&&l!==d)throw new ze("BOOTSTRAP_PLAN_CONFLICT","\u76F8\u540CBootstrap Plan\u8DEF\u5F84\u5DF2\u6709\u4E0D\u540C\u5185\u5BB9\u3002");return l||await Wa(c,d),{plan:s,planFile:c,changed:r.filter(p=>p.preimageDigest!==p.desiredDigest).map(p=>p.path)}}async function ay(e){let t=await Pd(e),r=[];for(let[c]of Ad){let l=await Wr(Be.join(t,c)),d=X0(l);r.push({path:c,preimageDigest:He(l),desired:d,desiredDigest:He(d??"")})}let n=".dyyto/agent-policy.lock.json",o=await Wr(Be.join(t,n));r.push({path:n,preimageDigest:He(o),desired:null,desiredDigest:He("")});let i={schemaVersion:1,kind:"DyytoAgentRemovalPlan",projectRoot:t,policyVersion:_d,files:r,createdAt:new Date().toISOString()},a={...i,planId:He(Nn(i))},s=Be.join(t,".dyyto/plans/bootstrap",`${a.planId.slice(7)}.json`);return await Wa(s,`${JSON.stringify(a,null,2)}
|
|
272
|
+
`),{plan:a,planFile:s,changed:r.filter(c=>c.preimageDigest!==c.desiredDigest).map(c=>c.path)}}async function Nd(e,t){if(!Be.isAbsolute(e))throw new ze("BOOTSTRAP_PLAN_NOT_ABSOLUTE","Bootstrap Plan\u8DEF\u5F84\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");let r=JSON.parse(await Ga(await ny(e),"utf8")),{planId:n,...o}=r;if(n!==t||He(Nn(o))!==n)throw new ze("BOOTSTRAP_PLAN_NOT_APPROVED","\u5FC5\u987B\u6279\u51C6\u6458\u8981\u6709\u6548\u7684\u7CBE\u786EBootstrap Plan\u3002 ");for(let a of r.files)if(He(await Wr(Be.join(r.projectRoot,a.path)))!==a.preimageDigest)throw new ze("BOOTSTRAP_PREIMAGE_CHANGED",`${a.path}\u5728Plan\u540E\u5DF2\u88AB\u4FEE\u6539\u3002`);let i=Be.join(r.projectRoot,".dyyto/preimages/bootstrap",n.slice(7));for(let a of r.files){let s=Be.join(r.projectRoot,a.path),c=await Wr(s);c&&c!==a.desired&&await Wa(Be.join(i,a.path),c),a.desired===null?c&&await K0(s):c!==a.desired&&await Wa(s,a.desired)}return{schemaVersion:1,status:"verified",planId:n,projectRoot:r.projectRoot,changed:r.files.filter(a=>a.preimageDigest!==a.desiredDigest).map(a=>a.path),preimageDirectory:i}}async function sy(e){let t=await Pd(e),r=JSON.parse(await Ga(Be.join(t,".dyyto/toolchain.lock.json"),"utf8")),n=JSON.parse(await Ga(Be.join(t,".dyyto/documentation.lock.json"),"utf8"));return{schemaVersion:1,projectRoot:t,intent:"\u4F18\u5148\u590D\u7528Dyyto Catalog\u80FD\u529B\uFF0C\u901A\u8FC7Plan/Apply/Verify\u5B89\u5168\u6F14\u8FDB\uFF1B\u914D\u7F6E\u4E0E\u5BC6\u94A5\u4F4D\u4E8E\u4ED3\u5E93\u5916Config Dir\u3002",requiredBeforeCoding:["dyyto doctor --project .","dyyto catalog search"],toolchain:r.tools,documents:n.documents,prohibitions:["\u4E0D\u5F97\u5728\u4ED3\u5E93\u5185\u4FDD\u5B58Secret","\u4E0D\u5F97\u7ED5\u8FC7\u4E0D\u53EF\u53D8Plan\u5199\u5165\u5DE5\u7A0B\u8D44\u4EA7","\u4E0D\u5F97\u590D\u5236\u5E73\u53F0\u957F\u6587\u6863\u5230\u4E1A\u52A1\u4ED3\u5E93"]}}var cy=e=>({"engineering-workflow":`# \u5DE5\u7A0B\u5F00\u53D1\u5DE5\u4F5C\u6D41
|
|
273
273
|
|
|
274
274
|
\u672C\u5730 Sources \u5148\u8FD0\u884C idp-setup init \u5E76\u52A0\u8F7D\u751F\u6210\u7684\u73AF\u5883\u6587\u4EF6\u3002Workspace\u3001\u72EC\u7ACB\u9879\u76EE\u3001Package \u4E0E Application \u5747\u5148\u6267\u884C context \u4E0E doctor\uFF0C\u518D\u67E5\u8BE2 Catalog\u3001\u751F\u6210\u5E76\u5BA1\u6838 Plan\u3001Apply \u540E\u8FD0\u884C Verify\u3002\u914D\u7F6E\u548C\u5BC6\u94A5\u59CB\u7EC8\u4F4D\u4E8E\u4ED3\u5E93\u5916 Config Dir\uFF1B\u90E8\u7F72\u53EA\u4F7F\u7528 idp \u4E0E idpctl bin\u3002
|
|
275
275
|
`,"idp-integration":`# IDP \u96C6\u6210
|
|
@@ -290,9 +290,9 @@ APP_CONFIG_DIR \u662F\u4E1A\u52A1\u914D\u7F6E\u603B\u6839\uFF1B\u591A\u5E94\u752
|
|
|
290
290
|
`,"idpctl-troubleshooting":`# idpctl \u8BCA\u65AD
|
|
291
291
|
|
|
292
292
|
\u672A\u77E5\u53C2\u6570\u65F6\u5148\u8FD0\u884C type -a idpctl \u4E0E idpctl --version --json\uFF0C\u786E\u8BA4 PATH \u547D\u4E2D\u9879\u76EE\u9501\u5B9A\u7248\u672C\u3002
|
|
293
|
-
`})[e];function Me(e){e.stdout.length>0&&je.stdout.write(e.stdout),e.stderr.length>0&&je.stderr.write(e.stderr)}async function eN(e){let t=e.indexOf("--artifact-workspace"),r=e[t+1],n=e.indexOf("--artifact-bundle"),o=e[n+1],i=e.flatMap((p,f)=>p==="--artifact-fallback-bundle"&&e[f+1]!==void 0?[e[f+1]]:[]),a=e.indexOf("--artifact-port"),s=Number(e[a+1]),c=[t>=0,n>=0,a>=0];if(!c.some(Boolean))return{};if(!c.every(Boolean)||r===void 0||o===void 0||!/^sha256:[a-f0-9]{64}$/u.test(o)||i.some(p=>!/^sha256:[a-f0-9]{64}$/u.test(p))||!Number.isSafeInteger(s)||s<1||s>65535)throw new T({code:"CLI_ARGUMENT_INVALID",message:"Development Package Source requires exact --artifact-workspace, --artifact-bundle, optional --artifact-fallback-bundle and --artifact-port values.",exitCode:2,nextStep:"Start the approved local Artifact Bundle set and repeat the exact values."});let l=await qo(jt.resolve(r,".dyyto","package-artifacts",o)),d=await Promise.all(i.map(p=>qo(jt.resolve(r,".dyyto","package-artifacts",p))));if(l.bundle.bundleId!==o)throw new pr("LOCAL_ARTIFACT_SOURCE_INVALID");return{packageSourceProvider:Th({bundle:l.bundle,fallbackBundles:d.map(p=>p.bundle),origin:`http://127.0.0.1:${s}/`,resolvedAt:"2026-08-21T00:00:00.000Z",expiresAt:"2099-12-31T23:59:59.000Z"}),resolutionWorkerProvider:Vh({stateRoot:jt.resolve(r,".dyyto","resolution-worker"),engine:xh()}),packageStoreRoot:jt.resolve(r,".dyyto","resolution-worker","store")}}async function $T(e){let t=e.includes("--json")?"json":"human";try{if(e[0]==="agents"&&e[1]==="remove"){let n=e.indexOf("--project"),o=n<0?je.cwd():e[n+1];if(!o)throw new
|
|
293
|
+
`})[e];function Me(e){e.stdout.length>0&&je.stdout.write(e.stdout),e.stderr.length>0&&je.stderr.write(e.stderr)}async function eN(e){let t=e.indexOf("--artifact-workspace"),r=e[t+1],n=e.indexOf("--artifact-bundle"),o=e[n+1],i=e.flatMap((p,f)=>p==="--artifact-fallback-bundle"&&e[f+1]!==void 0?[e[f+1]]:[]),a=e.indexOf("--artifact-port"),s=Number(e[a+1]),c=[t>=0,n>=0,a>=0];if(!c.some(Boolean))return{};if(!c.every(Boolean)||r===void 0||o===void 0||!/^sha256:[a-f0-9]{64}$/u.test(o)||i.some(p=>!/^sha256:[a-f0-9]{64}$/u.test(p))||!Number.isSafeInteger(s)||s<1||s>65535)throw new T({code:"CLI_ARGUMENT_INVALID",message:"Development Package Source requires exact --artifact-workspace, --artifact-bundle, optional --artifact-fallback-bundle and --artifact-port values.",exitCode:2,nextStep:"Start the approved local Artifact Bundle set and repeat the exact values."});let l=await qo(jt.resolve(r,".dyyto","package-artifacts",o)),d=await Promise.all(i.map(p=>qo(jt.resolve(r,".dyyto","package-artifacts",p))));if(l.bundle.bundleId!==o)throw new pr("LOCAL_ARTIFACT_SOURCE_INVALID");return{packageSourceProvider:Th({bundle:l.bundle,fallbackBundles:d.map(p=>p.bundle),origin:`http://127.0.0.1:${s}/`,resolvedAt:"2026-08-21T00:00:00.000Z",expiresAt:"2099-12-31T23:59:59.000Z"}),resolutionWorkerProvider:Vh({stateRoot:jt.resolve(r,".dyyto","resolution-worker"),engine:xh()}),packageStoreRoot:jt.resolve(r,".dyyto","resolution-worker","store")}}async function $T(e){let t=e.includes("--json")?"json":"human";try{if(e[0]==="agents"&&e[1]==="remove"){let n=e.indexOf("--project"),o=n<0?je.cwd():e[n+1];if(!o)throw new ze("BOOTSTRAP_PROJECT_INVALID","\u7F3A\u5C11\u9879\u76EE\u76EE\u5F55\u3002");let i=await ay(jt.resolve(o)),a=e.includes("--apply")?await Nd(i.planFile,i.plan.planId):{status:"planned",planId:i.plan.planId,planFile:i.planFile,changed:i.changed};Me({stdout:e.includes("--json")?`${JSON.stringify({schemaVersion:1,ok:!0,command:"agents-remove",result:a})}
|
|
294
294
|
`:`Agent\u9002\u914D\u5668\u79FB\u9664${e.includes("--apply")?"\u5B8C\u6210":"Plan\u5DF2\u751F\u6210"}\uFF1A${i.plan.planId}
|
|
295
|
-
`,stderr:""});return}if(e[0]==="bootstrap"||e[0]==="agents"&&e[1]==="sync"){let n=e.indexOf("--project"),o=n<0?je.cwd():e[n+1];if(!o)throw new T({code:"CLI_ARGUMENT_INVALID",message:"bootstrap --project\u7F3A\u5C11\u76EE\u5F55\u3002",exitCode:2,nextStep:"\u4F20\u5165\u7EDD\u5BF9\u9879\u76EE\u6216Workspace\u76EE\u5F55\u3002"});let i=await iy(jt.resolve(o)),a=e.includes("--apply");if(a&&!e.includes("--skip-tool-install")){let c=Q0("corepack",["pnpm","add","--global","--global-bin-dir",
|
|
295
|
+
`,stderr:""});return}if(e[0]==="bootstrap"||e[0]==="agents"&&e[1]==="sync"){let n=e.indexOf("--project"),o=n<0?je.cwd():e[n+1];if(!o)throw new T({code:"CLI_ARGUMENT_INVALID",message:"bootstrap --project\u7F3A\u5C11\u76EE\u5F55\u3002",exitCode:2,nextStep:"\u4F20\u5165\u7EDD\u5BF9\u9879\u76EE\u6216Workspace\u76EE\u5F55\u3002"});let i=await iy(jt.resolve(o)),a=e.includes("--apply");if(a&&!e.includes("--skip-tool-install")){let c=je.env.PNPM_HOME;if(!c||!jt.isAbsolute(c))throw new ze("BOOTSTRAP_PNPM_HOME_REQUIRED","\u7F3A\u5C11\u7EDD\u5BF9PNPM_HOME\uFF1B\u5148\u8FD0\u884Cidp-setup init\uFF0C\u6216\u4F7F\u7528idp-setup bootstrap\u4F5C\u4E3A\u9879\u76EE\u9996\u6B21\u5165\u53E3\u3002");let l=Q0("corepack",["pnpm","add","--global","--global-bin-dir",c,...oy],{encoding:"utf8",shell:!1,env:je.env});if(l.error||l.status!==0)throw new ze("BOOTSTRAP_TOOLCHAIN_INSTALL_FAILED","\u7CBE\u786E\u5DE5\u5177\u94FE\u5B89\u88C5\u5931\u8D25\uFF0C\u9879\u76EE\u8D44\u4EA7\u5C1A\u672AApply\u3002")}let s=a?await Nd(i.planFile,i.plan.planId):{status:"planned",planId:i.plan.planId,planFile:i.planFile,changed:i.changed};Me({stdout:e.includes("--json")?`${JSON.stringify({schemaVersion:1,ok:!0,command:a?"bootstrap-apply":"bootstrap-plan",result:s})}
|
|
296
296
|
`:a?`\u5DE5\u7A0B\u4E0A\u4E0B\u6587\u5DF2\u521D\u59CB\u5316\u5E76\u9A8C\u8BC1\u3002
|
|
297
297
|
Plan\uFF1A${i.plan.planId}
|
|
298
298
|
\u53D8\u66F4\uFF1A${s.changed.join("\u3001")||"\u65E0"}
|
|
@@ -349,4 +349,4 @@ Channel\uFF1Adevelopment
|
|
|
349
349
|
`:`\u672C\u5730\u91C7\u96C6\u7AEF\u5DF2\u542F\u52A8\uFF1A${s.origin}
|
|
350
350
|
`,stderr:""});let c=async()=>{await s.close(),je.exit(0)};je.once("SIGINT",c),je.once("SIGTERM",c),await new Promise(()=>{})}let r=await _h(e,await eN(e));Me(Yh(r.value,r.outputMode,r.human))}catch(r){if(je.env.DYYTO_DEBUG==="1"&&r instanceof Error){let s=[],c=r.cause;for(;c instanceof Error;)s.push(c.stack??c.message),c=c.cause;je.stderr.write(`${r.stack??r.message}${s.map(l=>`
|
|
351
351
|
Cause: ${l}`).join("")}
|
|
352
|
-
`)}let n=r;if(r instanceof
|
|
352
|
+
`)}let n=r;if(r instanceof ze)n=new T({code:r.code,message:r.message,exitCode:3,nextStep:"\u91CD\u65B0\u751F\u6210Bootstrap Plan\u5E76\u68C0\u67E5\u7528\u6237\u4FEE\u6539\u3002"});else if(r instanceof he)n=new T({code:r.code,message:r.message,exitCode:3,nextStep:"Run dyyto plan and review the current project state."});else if(r instanceof j)n=new T({code:r.code,message:r.message,exitCode:r.code==="RECOVERY_REQUIRED"?5:3,nextStep:r.code==="RECOVERY_REQUIRED"?"Run dyyto recover for this project.":"Run dyyto plan and approve the exact reviewable plan."});else if(r instanceof M)n=new T({code:r.code,message:r.message,exitCode:3,nextStep:"Inspect the project profile and resolve conflicts before continuing."});else if(r instanceof Ie)n=new T({code:r.code,message:r.message,exitCode:r.code==="METADATA_RECOVERY_REQUIRED"?5:4,nextStep:r.code==="METADATA_RECOVERY_REQUIRED"?"Run dyyto recover for this project.":"Fix the verification failure, then run dyyto verify again."});else if(r instanceof H||r instanceof Error&&r.name==="PackageAdoptionError"&&"code"in r&&typeof r.code=="string"){let s=r.code,c=s==="PACKAGE_INSTALL_FAILED";n=new T({code:s,message:s,exitCode:c?5:4,nextStep:c?"\u68C0\u67E5\u9879\u76EE\u6062\u590D\u72B6\u6001\u548C\u53D7\u4FE1 Registry \u540E\u91CD\u65B0\u751F\u6210 Plan\u3002":"\u68C0\u67E5 Package Source\u3001Receipt \u4E0E\u6279\u51C6\u7684 Plan\uFF0C\u4FEE\u590D\u540E\u91CD\u65B0\u751F\u6210 Plan\u3002"})}else if(r instanceof xe)n=new T({code:r.code,message:r.code,exitCode:4,nextStep:"\u68C0\u67E5 Bundle index\u3001tarball \u6458\u8981\u548C\u672C\u5730\u53EA\u8BFB\u7AEF\u53E3\u540E\u91CD\u8BD5\u3002"});else if(r instanceof J)n=new T({code:r.code,message:r.code,exitCode:r.code==="LOCAL_ARTIFACT_PREIMAGE_CONFLICT"?5:4,nextStep:r.code==="LOCAL_ARTIFACT_PREIMAGE_CONFLICT"?"Package \u6216 Bundle preimage \u5DF2\u53D8\u5316\uFF1B\u8BF7\u91CD\u65B0\u751F\u6210\u5E76\u5BA1\u6838 Plan\u3002":"\u68C0\u67E5 package \u8F93\u5165\u548C Artifact Plan \u540E\u91CD\u8BD5\u3002"});else if(r instanceof pr)n=new T({code:r.code,message:r.code,exitCode:4,nextStep:"\u6838\u5BF9\u6279\u51C6\u7684 Bundle\u3001candidate Release \u4E0E loopback Registry \u53C2\u6570\u3002"});else if(r instanceof Ye)n=new T({code:r.code,message:r.code,exitCode:r.code==="RESOLUTION_WORKER_BUILD_PREIMAGE_CONFLICT"?5:4,nextStep:"\u68C0\u67E5 Worker Build Plan\u3001workspace preimage \u4E0E\u5BB9\u91CF\u9650\u5236\u540E\u91CD\u8BD5\u3002"});else if(r instanceof _e)n=new T({code:r.code,message:r.code,exitCode:4,nextStep:"Resolution Evidence \u672A\u901A\u8FC7\u4E25\u683C\u9A8C\u8BC1\uFF1B\u68C0\u67E5 importer\u3001package closure \u4E0E source binding\u3002"});else if(r instanceof ut)n=new T({code:r.code,message:r.code,exitCode:4,nextStep:"\u68C0\u67E5\u6839\u5171\u4EAB\u9501 importer\u3001\u5E94\u7528\u5C40\u90E8\u9501\u548C Plan preimage \u540E\u91CD\u65B0\u751F\u6210\u62D3\u6251\u8FC1\u79FB Plan\u3002"});else if(r instanceof Error&&/^RESOLUTION_WORKER_[A-Z_]+$/u.test(r.message))n=new T({code:r.message,message:r.message,exitCode:4,nextStep:"\u68C0\u67E5 Resolution Worker Receipt\u3001\u5171\u4EAB\u9501 trust facts \u4E0E persistent state\u3002"});else if(r instanceof D){let s={NPM_AUTHENTICATION_REQUIRED:"\u8BF7\u5728 Plan \u7ED1\u5B9A\u7684\u53D7\u4FE1 CI \u4E2D\u68C0\u67E5 Trusted Publishing \u914D\u7F6E\uFF1B\u4E0D\u8981\u5411 Dyyto \u63D0\u4F9B token\u3002",NPM_AUTHORIZATION_DENIED:"\u8BF7\u7531 npm \u5305\u7EF4\u62A4\u8005\u68C0\u67E5\u5305\u6743\u9650\u4E0E\u53D1\u5E03\u7B56\u7565\uFF0C\u7136\u540E\u91CD\u65B0\u751F\u6210 Plan\u3002",NPM_2FA_REQUIRED:"\u8BF7\u7531\u7EF4\u62A4\u8005\u5728 npmjs.com \u6216\u72EC\u7ACB\u4EA4\u4E92\u5F0F npm CLI \u5B8C\u6210\u53CC\u91CD\u9A8C\u8BC1\u3002",NPM_TRUSTED_PUBLISHER_MISMATCH:"\u8BF7\u6838\u5BF9 npm Trusted Publisher \u7684\u4ED3\u5E93\u3001\u5DE5\u4F5C\u6D41\u3001\u73AF\u5883\u4E0E stage-only action\u3002",NPM_TOKEN_POLICY_UNVERIFIED:"\u8BF7\u6539\u7528\u53D7\u652F\u6301\u7684 OIDC Trusted Publishing \u73AF\u5883\uFF1BProduction apply \u4E0D\u63A5\u53D7\u4F20\u7EDF token \u8DEF\u5F84\u3002",NPM_STAGE_UNSUPPORTED:"\u8BF7\u786E\u8BA4\u5305\u5DF2\u5B58\u5728\u3001\u8D26\u6237\u542F\u7528\u53CC\u91CD\u9A8C\u8BC1\uFF0C\u5E76\u4F7F\u7528 Node 24.18.0 \u4E0E npm 11.16.0\u3002",NPM_STAGE_CONFLICT:"\u8BF7\u5728 npmjs.com \u68C0\u67E5\u8BE5\u7CBE\u786E\u7248\u672C\uFF1B\u4E0D\u8981\u8986\u76D6\u6216\u91CD\u590D\u6682\u5B58\u3002",NPM_PROVENANCE_REQUIRED:"\u8BF7\u6062\u590D Trusted Publishing provenance\uFF0C\u5E76\u518D\u6B21\u8FD0\u884C\u53EA\u8BFB inspect\u3002",NPM_REGISTRY_PROPAGATION_PENDING:"\u8BF7\u7A0D\u540E\u518D\u6B21\u8FD0\u884C delivery inspect\uFF1B\u4E0D\u8981\u91CD\u590D\u6682\u5B58\u3002",NPM_REGISTRY_OUTCOME_UNKNOWN:"\u8BF7\u5148\u5728 npmjs.com \u68C0\u67E5\u8BE5\u7248\u672C\u4E0E stage \u72B6\u6001\uFF1B\u7ED3\u679C\u786E\u8BA4\u524D\u4E0D\u8981\u91CD\u8BD5\u5199\u64CD\u4F5C\u3002"},c=r.code==="DELIVERY_EXECUTION_UNKNOWN"||r.code==="NPM_REGISTRY_OUTCOME_UNKNOWN";n=new T({code:r.code,message:r.message,exitCode:c?5:4,nextStep:s[r.code]??(c?"Inspect the delivery target before retrying.":"Review the Delivery Plan and current project state.")})}let o=Od(n),i=n instanceof T?n:o===null?null:new T(o),a={schemaVersion:1,ok:!1,error:{code:i?.code??"CLI_INTERNAL_ERROR",message:i?.message??"The CLI could not complete the command.",...i?.nextStep===void 0?{}:{nextStep:i.nextStep}}};Me(Hh(a,t)),je.exitCode=i?.exitCode??1}}export{$T as runCommand};
|