@niwa-labs/ncode 0.1.0 → 0.1.1
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/CHANGELOG.md +5 -0
- package/CHANGELOG.zh-CN.md +5 -0
- package/README.md +2 -2
- package/chunks/{application-A3S2LMBY.js → application-6B6N6MDM.js} +1 -1
- package/chunks/{auth-command-QNQ32TBI.js → auth-command-L57HWPOO.js} +1 -1
- package/chunks/{chunk-6LDRLO4Y.js → chunk-3LRARE6Z.js} +1 -1
- package/chunks/{chunk-5R2PGOIA.js → chunk-3MLT4F77.js} +1 -1
- package/chunks/{chunk-NOGL6Y6L.js → chunk-7F3QKGB7.js} +1 -1
- package/chunks/{chunk-LFGHL5A2.js → chunk-ALZZ3WAV.js} +1 -1
- package/chunks/{chunk-RD7XROJD.js → chunk-CUPCI2YC.js} +1 -1
- package/chunks/{chunk-OOBSLGMR.js → chunk-DBSRTVJC.js} +1 -1
- package/chunks/{chunk-XSWWOH4F.js → chunk-GS7TCNDK.js} +1 -1
- package/chunks/{chunk-36COWQLE.js → chunk-GZPVFWYD.js} +1 -1
- package/chunks/{chunk-CAY2BP2G.js → chunk-JEHPL5Z6.js} +1 -1
- package/chunks/{chunk-R7NDEPS3.js → chunk-LC7ZI6EV.js} +1 -1
- package/chunks/{chunk-ELHMZ5OD.js → chunk-NWMN2FDO.js} +1 -1
- package/chunks/{chunk-MVI24MQ2.js → chunk-O5EROATK.js} +664 -664
- package/chunks/{chunk-UMGGEC4N.js → chunk-QIYZZJVO.js} +1 -1
- package/chunks/{chunk-PBGCNSGZ.js → chunk-QMBFFQPV.js} +1 -1
- package/chunks/{chunk-JLFN6WSO.js → chunk-RZDVNG5Z.js} +1 -1
- package/chunks/{chunk-MI4YWYJF.js → chunk-UEPKZSE6.js} +1 -1
- package/chunks/{chunk-V4IDVAIA.js → chunk-WHBWI5OQ.js} +1 -1
- package/chunks/{chunk-ZPIJSTUE.js → chunk-WUORF7YS.js} +1 -1
- package/chunks/{chunk-UNEPZJKK.js → chunk-XWNCITOR.js} +5 -5
- package/chunks/{data-dir-OKWMOLNQ.js → data-dir-6RWVCAMB.js} +1 -1
- package/chunks/{launcher-4QSNU24J.js → launcher-B3C4PQ6Q.js} +3 -3
- package/chunks/{lifecycle-ELQ2EYO3.js → lifecycle-56K655PJ.js} +1 -1
- package/chunks/main-W3SJ2POE.js +14 -0
- package/chunks/{plugin-command-NGTATXBX.js → plugin-command-EBSKJLM3.js} +1 -1
- package/chunks/{profile-command-ZHVREBWO.js → profile-command-HIJDJDEL.js} +1 -1
- package/chunks/{provider-command-BGKOLCUG.js → provider-command-VCCPLOXR.js} +1 -1
- package/chunks/{run-acp-command-2CJQDXHQ.js → run-acp-command-FBV27QBE.js} +13 -13
- package/chunks/run-daemon-command-PZ2TU524.js +2 -0
- package/chunks/run-exec-command-K7BC2HEI.js +16 -0
- package/chunks/src-7ZMHMWLX.js +2 -0
- package/chunks/{telemetry-command-6FE4WQ4Q.js → telemetry-command-ZYOF64Y4.js} +1 -1
- package/chunks/{update-4VPIX7FP.js → update-ZKUCGIOR.js} +1 -1
- package/cli.js +3 -3
- package/matrix-mcp-stdio.js +1 -1
- package/mcoded.js +1 -1
- package/package.json +1 -1
- package/release.json +4 -4
- package/chunks/main-TXP74KHK.js +0 -14
- package/chunks/run-daemon-command-NDOIPTKF.js +0 -2
- package/chunks/run-exec-command-VNT4IKOJ.js +0 -16
- package/chunks/src-ED5HBSWE.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{a as iE}from"./chunk-DSIZQTS3.js";import{a as fb}from"./chunk-NOGL6Y6L.js";import{s as pb}from"./chunk-YNDFGYGN.js";import{c as T,d as wo,e as qp,f as me,g as he,h as ge}from"./chunk-FK3SSGJE.js";var du=T(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae.regexpCode=Ae.getEsmExportName=Ae.getProperty=Ae.safeStringify=Ae.stringify=Ae.strConcat=Ae.addCodeArg=Ae.str=Ae._=Ae.nil=Ae._Code=Ae.Name=Ae.IDENTIFIER=Ae._CodeOrName=void 0;var uu=class{};Ae._CodeOrName=uu;Ae.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var os=class extends uu{constructor(t){super();if(!Ae.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}};Ae.Name=os;var sn=class extends uu{constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const 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)=>{if(n instanceof os)r[n.str]=(r[n.str]||0)+1;return r},{})}};Ae._Code=sn;Ae.nil=new sn("");function L0(e,...t){const r=[e[0]];let n=0;while(n<t.length){nh(r,t[n]);r.push(e[++n])}return new sn(r)}Ae._=L0;var rh=new sn("+");function Z0(e,...t){const r=[lu(e[0])];let n=0;while(n<t.length){r.push(rh);nh(r,t[n]);r.push(rh,lu(e[++n]))}qC(r);return new sn(r)}Ae.str=Z0;function nh(e,t){if(t instanceof sn)e.push(...t._items);else if(t instanceof os)e.push(t);else e.push(ZC(t))}Ae.addCodeArg=nh;function qC(e){let t=1;while(t<e.length-1){if(e[t]===rh){const r=UC(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function UC(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof os||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof os))return`"${e}${t.slice(1)}`;return}function LC(e,t){return t.emptyStr()?e:e.emptyStr()?t:Z0`${e}${t}`}Ae.strConcat=LC;function ZC(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:lu(Array.isArray(e)?e.join(","):e)}function VC(e){return new sn(lu(e))}Ae.stringify=VC;function lu(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ae.safeStringify=lu;function KC(e){return typeof e=="string"&&Ae.IDENTIFIER.test(e)?new sn(`.${e}`):L0`[${e}]`}Ae.getProperty=KC;function BC(e){if(typeof e=="string"&&Ae.IDENTIFIER.test(e)){return new sn(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Ae.getEsmExportName=BC;function GC(e){return new sn(e.toString())}Ae.regexpCode=GC});var sh=T(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:true});Sr.ValueScope=Sr.ValueScopeName=Sr.Scope=Sr.varKinds=Sr.UsedValueState=void 0;var Ir=du();var oh=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}};var bd;(function(e){e[e["Started"]=0]="Started";e[e["Completed"]=1]="Completed"})(bd||(Sr.UsedValueState=bd={}));Sr.varKinds={const:new Ir.Name("const"),let:new Ir.Name("let"),var:new Ir.Name("var")};var wd=class{constructor({prefixes:t,parent:r}={}){this._names={};this._prefixes=t;this._parent=r}toName(t){return t instanceof Ir.Name?t:this.name(t)}name(t){return new Ir.Name(this._newName(t))}_newName(t){const 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?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}}};Sr.Scope=wd;var vd=class extends Ir.Name{constructor(t,r){super(r);this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t;this.scopePath=(0,Ir._)`.${new Ir.Name(r)}[${n}]`}};Sr.ValueScopeName=vd;var HC=(0,Ir._)`\n`;var ih=class extends wd{constructor(t){super(t);this._values={};this._scope=t.scope;this.opts={...t,_n:t.lines?HC:Ir.nil}}get(){return this._scope}name(t){return new vd(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const o=this.toName(t);const{prefix:i}=o;const s=(n=r.key)!==null&&n!==void 0?n:r.ref;let a=this._values[i];if(a){const l=a.get(s);if(l)return l}else{a=this._values[i]=new Map}a.set(s,o);const c=this._scope[i]||(this._scope[i]=[]);const u=c.length;c[u]=r.ref;o.setValue(r,{property:i,itemIndex:u});return o}getValue(t,r){const n=this._values[t];if(!n)return;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,Ir._)`${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=Ir.nil;for(const s in t){const a=t[s];if(!a)continue;const c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,bd.Started);let l=r(u);if(l){const d=this.opts.es5?Sr.varKinds.var:Sr.varKinds.const;i=(0,Ir._)`${i}${d} ${u} = ${l};${this.opts._n}`}else if(l=o===null||o===void 0?void 0:o(u)){i=(0,Ir._)`${i}${l}${this.opts._n}`}else{throw new oh(u)}c.set(u,bd.Completed)})}return i}};Sr.ValueScope=ih});var se=T(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:true});ne.or=ne.and=ne.not=ne.CodeGen=ne.operators=ne.varKinds=ne.ValueScopeName=ne.ValueScope=ne.Scope=ne.Name=ne.regexpCode=ne.stringify=ne.getProperty=ne.nil=ne.strConcat=ne.str=ne._=void 0;var $e=du();var Tn=sh();var ti=du();Object.defineProperty(ne,"_",{enumerable:true,get:function(){return ti._}});Object.defineProperty(ne,"str",{enumerable:true,get:function(){return ti.str}});Object.defineProperty(ne,"strConcat",{enumerable:true,get:function(){return ti.strConcat}});Object.defineProperty(ne,"nil",{enumerable:true,get:function(){return ti.nil}});Object.defineProperty(ne,"getProperty",{enumerable:true,get:function(){return ti.getProperty}});Object.defineProperty(ne,"stringify",{enumerable:true,get:function(){return ti.stringify}});Object.defineProperty(ne,"regexpCode",{enumerable:true,get:function(){return ti.regexpCode}});Object.defineProperty(ne,"Name",{enumerable:true,get:function(){return ti.Name}});var Td=sh();Object.defineProperty(ne,"Scope",{enumerable:true,get:function(){return Td.Scope}});Object.defineProperty(ne,"ValueScope",{enumerable:true,get:function(){return Td.ValueScope}});Object.defineProperty(ne,"ValueScopeName",{enumerable:true,get:function(){return Td.ValueScopeName}});Object.defineProperty(ne,"varKinds",{enumerable:true,get:function(){return Td.varKinds}});ne.operators={GT:new $e._Code(">"),GTE:new $e._Code(">="),LT:new $e._Code("<"),LTE:new $e._Code("<="),EQ:new $e._Code("==="),NEQ:new $e._Code("!=="),NOT:new $e._Code("!"),OR:new $e._Code("||"),AND:new $e._Code("&&"),ADD:new $e._Code("+")};var Po=class{optimizeNodes(){return this}optimizeNames(t,r){return this}};var ah=class extends Po{constructor(t,r,n){super();this.varKind=t;this.name=r;this.rhs=n}render({es5:t,_n:r}){const n=t?Tn.varKinds.var:this.varKind;const o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(!t[this.name.str])return;if(this.rhs)this.rhs=Sa(this.rhs,t,r);return this}get names(){return this.rhs instanceof $e._CodeOrName?this.rhs.names:{}}};var $d=class extends Po{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 $e.Name&&!t[this.lhs.str]&&!this.sideEffects)return;this.rhs=Sa(this.rhs,t,r);return this}get names(){const t=this.lhs instanceof $e.Name?{}:{...this.lhs.names};return Sd(t,this.rhs)}};var ch=class extends $d{constructor(t,r,n,o){super(t,n,o);this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}};var uh=class extends Po{constructor(t){super();this.label=t;this.names={}}render({_n:t}){return`${this.label}:`+t}};var lh=class extends Po{constructor(t){super();this.label=t;this.names={}}render({_n:t}){const r=this.label?` ${this.label}`:"";return`break${r};`+t}};var dh=class extends Po{constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}};var fh=class extends Po{constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){this.code=Sa(this.code,t,r);return this}get names(){return this.code instanceof $e._CodeOrName?this.code.names:{}}};var fu=class extends Po{constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){const{nodes:t}=this;let r=t.length;while(r--){const n=t[r].optimizeNodes();if(Array.isArray(n))t.splice(r,1,...n);else if(n)t[r]=n;else t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){const{nodes:n}=this;let o=n.length;while(o--){const i=n[o];if(i.optimizeNames(t,r))continue;WC(t,i.names);n.splice(o,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>as(t,r.names),{})}};var Oo=class extends fu{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};var ph=class extends fu{};var Ia=class extends Oo{};Ia.kind="else";var is=class e extends Oo{constructor(t,r){super(r);this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);if(this.else)r+="else "+this.else.render(t);return r}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(t===true)return this.nodes;let r=this.else;if(r){const n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ia(n):n}if(r){if(t===false)return r instanceof e?r:r.nodes;if(this.nodes.length)return this;return new e(V0(t),r instanceof e?[r]:r.nodes)}if(t===false||!this.nodes.length)return void 0;return this}optimizeNames(t,r){var n;this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r);if(!(super.optimizeNames(t,r)||this.else))return;this.condition=Sa(this.condition,t,r);return this}get names(){const t=super.names;Sd(t,this.condition);if(this.else)as(t,this.else.names);return t}};is.kind="if";var ss=class extends Oo{};ss.kind="for";var mh=class extends ss{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=Sa(this.iteration,t,r);return this}get names(){return as(super.names,this.iteration.names)}};var hh=class extends ss{constructor(t,r,n,o){super();this.varKind=t;this.name=r;this.from=n;this.to=o}render(t){const r=t.es5?Tn.varKinds.var:this.varKind;const{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){const t=Sd(super.names,this.from);return Sd(t,this.to)}};var Id=class extends ss{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=Sa(this.iterable,t,r);return this}get names(){return as(super.names,this.iterable.names)}};var pu=class extends Oo{constructor(t,r,n){super();this.name=t;this.args=r;this.async=n}render(t){const r=this.async?"async ":"";return`${r}function ${this.name}(${this.args})`+super.render(t)}};pu.kind="func";var mu=class extends fu{render(t){return"return "+super.render(t)}};mu.kind="return";var gh=class extends Oo{render(t){let r="try"+super.render(t);if(this.catch)r+=this.catch.render(t);if(this.finally)r+=this.finally.render(t);return r}optimizeNodes(){var t,r;super.optimizeNodes();(t=this.catch)===null||t===void 0?void 0:t.optimizeNodes();(r=this.finally)===null||r===void 0?void 0:r.optimizeNodes();return this}optimizeNames(t,r){var n,o;super.optimizeNames(t,r);(n=this.catch)===null||n===void 0?void 0:n.optimizeNames(t,r);(o=this.finally)===null||o===void 0?void 0:o.optimizeNames(t,r);return this}get names(){const t=super.names;if(this.catch)as(t,this.catch.names);if(this.finally)as(t,this.finally.names);return t}};var hu=class extends Oo{constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};hu.kind="catch";var gu=class extends Oo{render(t){return"finally"+super.render(t)}};gu.kind="finally";var yh=class{constructor(t,r={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...r,_n:r.lines?"\n":""};this._extScope=t;this._scope=new Tn.Scope({parent:t});this._nodes=[new ph]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){const n=this._extScope.value(t,r);const o=this._values[n.prefix]||(this._values[n.prefix]=new Set);o.add(n);return 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){const i=this._scope.toName(r);if(n!==void 0&&o)this._constants[i.str]=n;this._leafNode(new ah(t,i,n));return i}const(t,r,n){return this._def(Tn.varKinds.const,t,r,n)}let(t,r,n){return this._def(Tn.varKinds.let,t,r,n)}var(t,r,n){return this._def(Tn.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new $d(t,r,n))}add(t,r){return this._leafNode(new ch(t,ne.operators.ADD,r))}code(t){if(typeof t=="function")t();else if(t!==$e.nil)this._leafNode(new fh(t));return this}object(...t){const r=["{"];for(const[n,o]of t){if(r.length>1)r.push(",");r.push(n);if(n!==o||this.opts.es5){r.push(":");(0,$e.addCodeArg)(r,o)}}r.push("}");return new $e._Code(r)}if(t,r,n){this._blockNode(new is(t));if(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 is(t))}else(){return this._elseNode(new Ia)}endIf(){return this._endBlockNode(is,Ia)}_for(t,r){this._blockNode(t);if(r)this.code(r).endFor();return this}for(t,r){return this._for(new mh(t),r)}forRange(t,r,n,o,i=this.opts.es5?Tn.varKinds.var:Tn.varKinds.let){const s=this._scope.toName(t);return this._for(new hh(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Tn.varKinds.const){const i=this._scope.toName(t);if(this.opts.es5){const s=r instanceof $e.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,$e._)`${s}.length`,a=>{this.var(i,(0,$e._)`${s}[${a}]`);n(i)})}return this._for(new Id("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Tn.varKinds.var:Tn.varKinds.const){if(this.opts.ownProperties){return this.forOf(t,(0,$e._)`Object.keys(${r})`,n)}const i=this._scope.toName(t);return this._for(new Id("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(ss)}label(t){return this._leafNode(new uh(t))}break(t){return this._leafNode(new lh(t))}return(t){const r=new mu;this._blockNode(r);this.code(t);if(r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(mu)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const o=new gh;this._blockNode(o);this.code(t);if(r){const i=this.name("e");this._currNode=o.catch=new hu(i);r(i)}if(n){this._currNode=o.finally=new gu;this.code(n)}return this._endBlockNode(hu,gu)}throw(t){return this._leafNode(new dh(t))}block(t,r){this._blockStarts.push(this._nodes.length);if(t)this.code(t).endBlock(r);return this}endBlock(t){const r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");const 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`)}this._nodes.length=r;return this}func(t,r=$e.nil,n,o){this._blockNode(new pu(t,r,n));if(o)this.code(o).endFunc();return this}endFunc(){return this._endBlockNode(pu)}optimize(t=1){while(t-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(t){this._currNode.nodes.push(t);return this}_blockNode(t){this._currNode.nodes.push(t);this._nodes.push(t)}_endBlockNode(t,r){const n=this._currNode;if(n instanceof t||r&&n instanceof r){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){const r=this._currNode;if(!(r instanceof is)){throw new Error('CodeGen: "else" without "if"')}this._currNode=r.else=t;return this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const r=this._nodes;r[r.length-1]=t}};ne.CodeGen=yh;function as(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Sd(e,t){return t instanceof $e._CodeOrName?as(e,t.names):e}function Sa(e,t,r){if(e instanceof $e.Name)return n(e);if(!o(e))return e;return new $e._Code(e._items.reduce((i,s)=>{if(s instanceof $e.Name)s=n(s);if(s instanceof $e._Code)i.push(...s._items);else i.push(s);return i},[]));function n(i){const s=r[i.str];if(s===void 0||t[i.str]!==1)return i;delete t[i.str];return s}function o(i){return i instanceof $e._Code&&i._items.some(s=>s instanceof $e.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function WC(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function V0(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,$e._)`!${_h(e)}`}ne.not=V0;var JC=K0(ne.operators.AND);function XC(...e){return e.reduce(JC)}ne.and=XC;var QC=K0(ne.operators.OR);function YC(...e){return e.reduce(QC)}ne.or=YC;function K0(e){return(t,r)=>t===$e.nil?r:r===$e.nil?t:(0,$e._)`${_h(t)} ${e} ${_h(r)}`}function _h(e){return e instanceof $e.Name?e:(0,$e._)`(${e})`}});var Te=T(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:true});ae.checkStrictMode=ae.getErrorPath=ae.Type=ae.useFunc=ae.setEvaluated=ae.evaluatedPropsToName=ae.mergeEvaluated=ae.eachItem=ae.unescapeJsonPointer=ae.escapeJsonPointer=ae.escapeFragment=ae.unescapeFragment=ae.schemaRefOrVal=ae.schemaHasRulesButRef=ae.schemaHasRules=ae.checkUnknownRules=ae.alwaysValidSchema=ae.toHash=void 0;var Ge=se();var eN=du();function tN(e){const t={};for(const r of e)t[r]=true;return t}ae.toHash=tN;function rN(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return true;H0(e,t);return!W0(t,e.self.RULES.all)}ae.alwaysValidSchema=rN;function H0(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;const o=n.RULES.keywords;for(const i in t){if(!o[i])Q0(e,`unknown keyword: "${i}"`)}}ae.checkUnknownRules=H0;function W0(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return true;return false}ae.schemaHasRules=W0;function nN(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return true;return false}ae.schemaHasRulesButRef=nN;function oN({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ge._)`${r}`}return(0,Ge._)`${e}${t}${(0,Ge.getProperty)(n)}`}ae.schemaRefOrVal=oN;function iN(e){return J0(decodeURIComponent(e))}ae.unescapeFragment=iN;function sN(e){return encodeURIComponent(bh(e))}ae.escapeFragment=sN;function bh(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}ae.escapeJsonPointer=bh;function J0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ae.unescapeJsonPointer=J0;function aN(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}ae.eachItem=aN;function B0({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{const c=s===void 0?i:s instanceof Ge.Name?(i instanceof Ge.Name?e(o,i,s):t(o,i,s),s):i instanceof Ge.Name?(t(o,s,i),i):r(i,s);return a===Ge.Name&&!(c instanceof Ge.Name)?n(o,c):c}}ae.mergeEvaluated={props:B0({mergeNames:(e,t,r)=>e.if((0,Ge._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Ge._)`${t} === true`,()=>e.assign(r,true),()=>e.assign(r,(0,Ge._)`${r} || {}`).code((0,Ge._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Ge._)`${r} !== true`,()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,Ge._)`${r} || {}`);wh(e,r,t)}}),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:X0}),items:B0({mergeNames:(e,t,r)=>e.if((0,Ge._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Ge._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Ge._)`${r} !== true`,()=>e.assign(r,t===true?true:(0,Ge._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function X0(e,t){if(t===true)return e.var("props",true);const r=e.var("props",(0,Ge._)`{}`);if(t!==void 0)wh(e,r,t);return r}ae.evaluatedPropsToName=X0;function wh(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Ge._)`${t}${(0,Ge.getProperty)(n)}`,true))}ae.setEvaluated=wh;var G0={};function cN(e,t){return e.scopeValue("func",{ref:t,code:G0[t.code]||(G0[t.code]=new eN._Code(t.code))})}ae.useFunc=cN;var xh;(function(e){e[e["Num"]=0]="Num";e[e["Str"]=1]="Str"})(xh||(ae.Type=xh={}));function uN(e,t,r){if(e instanceof Ge.Name){const n=t===xh.Num;return r?n?(0,Ge._)`"[" + ${e} + "]"`:(0,Ge._)`"['" + ${e} + "']"`:n?(0,Ge._)`"/" + ${e}`:(0,Ge._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ge.getProperty)(e).toString():"/"+bh(e)}ae.getErrorPath=uN;function Q0(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}ae.checkStrictMode=Q0});var Ro=T(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:true});var tr=se();var lN={data:new tr.Name("data"),valCxt:new tr.Name("valCxt"),instancePath:new tr.Name("instancePath"),parentData:new tr.Name("parentData"),parentDataProperty:new tr.Name("parentDataProperty"),rootData:new tr.Name("rootData"),dynamicAnchors:new tr.Name("dynamicAnchors"),vErrors:new tr.Name("vErrors"),errors:new tr.Name("errors"),this:new tr.Name("this"),self:new tr.Name("self"),scope:new tr.Name("scope"),json:new tr.Name("json"),jsonPos:new tr.Name("jsonPos"),jsonLen:new tr.Name("jsonLen"),jsonPart:new tr.Name("jsonPart")};vh.default=lN});var yu=T(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:true});rr.extendErrors=rr.resetErrorsCount=rr.reportExtraError=rr.reportError=rr.keyword$DataError=rr.keywordError=void 0;var ke=se();var kd=Te();var hr=Ro();rr.keywordError={message:({keyword:e})=>(0,ke.str)`must pass "${e}" keyword validation`};rr.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ke.str)`"${e}" keyword must be ${t} ($data)`:(0,ke.str)`"${e}" keyword is invalid ($data)`};function dN(e,t=rr.keywordError,r,n){const{it:o}=e;const{gen:i,compositeRule:s,allErrors:a}=o;const c=t$(e,t,r);if(n!==null&&n!==void 0?n:s||a){Y0(i,c)}else{e$(o,(0,ke._)`[${c}]`)}}rr.reportError=dN;function fN(e,t=rr.keywordError,r){const{it:n}=e;const{gen:o,compositeRule:i,allErrors:s}=n;const a=t$(e,t,r);Y0(o,a);if(!(i||s)){e$(n,hr.default.vErrors)}}rr.reportExtraError=fN;function pN(e,t){e.assign(hr.default.errors,t);e.if((0,ke._)`${hr.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ke._)`${hr.default.vErrors}.length`,t),()=>e.assign(hr.default.vErrors,null)))}rr.resetErrorsCount=pN;function mN({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");const s=e.name("err");e.forRange("i",o,hr.default.errors,a=>{e.const(s,(0,ke._)`${hr.default.vErrors}[${a}]`);e.if((0,ke._)`${s}.instancePath === undefined`,()=>e.assign((0,ke._)`${s}.instancePath`,(0,ke.strConcat)(hr.default.instancePath,i.errorPath)));e.assign((0,ke._)`${s}.schemaPath`,(0,ke.str)`${i.errSchemaPath}/${t}`);if(i.opts.verbose){e.assign((0,ke._)`${s}.schema`,r);e.assign((0,ke._)`${s}.data`,n)}})}rr.extendErrors=mN;function Y0(e,t){const r=e.const("err",t);e.if((0,ke._)`${hr.default.vErrors} === null`,()=>e.assign(hr.default.vErrors,(0,ke._)`[${r}]`),(0,ke._)`${hr.default.vErrors}.push(${r})`);e.code((0,ke._)`${hr.default.errors}++`)}function e$(e,t){const{gen:r,validateName:n,schemaEnv:o}=e;if(o.$async){r.throw((0,ke._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,ke._)`${n}.errors`,t);r.return(false)}}var cs={keyword:new ke.Name("keyword"),schemaPath:new ke.Name("schemaPath"),params:new ke.Name("params"),propertyName:new ke.Name("propertyName"),message:new ke.Name("message"),schema:new ke.Name("schema"),parentSchema:new ke.Name("parentSchema")};function t$(e,t,r){const{createErrors:n}=e.it;if(n===false)return(0,ke._)`{}`;return hN(e,t,r)}function hN(e,t,r={}){const{gen:n,it:o}=e;const i=[gN(o,r),yN(e,r)];_N(e,t,i);return n.object(...i)}function gN({errorPath:e},{instancePath:t}){const r=t?(0,ke.str)`${e}${(0,kd.getErrorPath)(t,kd.Type.Str)}`:e;return[hr.default.instancePath,(0,ke.strConcat)(hr.default.instancePath,r)]}function yN({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ke.str)`${t}/${e}`;if(r){o=(0,ke.str)`${o}${(0,kd.getErrorPath)(r,kd.Type.Str)}`}return[cs.schemaPath,o]}function _N(e,{params:t,message:r},n){const{keyword:o,data:i,schemaValue:s,it:a}=e;const{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([cs.keyword,o],[cs.params,typeof t=="function"?t(e):t||(0,ke._)`{}`]);if(c.messages){n.push([cs.message,typeof r=="function"?r(e):r])}if(c.verbose){n.push([cs.schema,s],[cs.parentSchema,(0,ke._)`${l}${d}`],[hr.default.data,i])}if(u)n.push([cs.propertyName,u])}});var n$=T(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:true});Ta.boolOrEmptySchema=Ta.topBoolOrEmptySchema=void 0;var xN=yu();var bN=se();var wN=Ro();var vN={message:"boolean schema is false"};function $N(e){const{gen:t,schema:r,validateName:n}=e;if(r===false){r$(e,false)}else if(typeof r=="object"&&r.$async===true){t.return(wN.default.data)}else{t.assign((0,bN._)`${n}.errors`,null);t.return(true)}}Ta.topBoolOrEmptySchema=$N;function IN(e,t){const{gen:r,schema:n}=e;if(n===false){r.var(t,false);r$(e)}else{r.var(t,true)}}Ta.boolOrEmptySchema=IN;function r$(e,t){const{gen:r,data:n}=e;const o={gen:r,keyword:"false schema",data:n,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,xN.reportError)(o,vN,void 0,t)}});var $h=T(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:true});ka.getRules=ka.isJSONType=void 0;var SN=["string","number","integer","boolean","null","object","array"];var TN=new Set(SN);function kN(e){return typeof e=="string"&&TN.has(e)}ka.isJSONType=kN;function PN(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}ka.getRules=PN});var Ih=T(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:true});ri.shouldUseRule=ri.shouldUseGroup=ri.schemaHasRulesForType=void 0;function ON({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==true&&o$(e,n)}ri.schemaHasRulesForType=ON;function o$(e,t){return t.rules.some(r=>i$(e,r))}ri.shouldUseGroup=o$;function i$(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))}ri.shouldUseRule=i$});var _u=T(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:true});nr.reportTypeError=nr.checkDataTypes=nr.checkDataType=nr.coerceAndCheckDataType=nr.getJSONTypes=nr.getSchemaTypes=nr.DataType=void 0;var RN=$h();var MN=Ih();var EN=yu();var Q=se();var s$=Te();var Pa;(function(e){e[e["Correct"]=0]="Correct";e[e["Wrong"]=1]="Wrong"})(Pa||(nr.DataType=Pa={}));function AN(e){const t=a$(e.type);const r=t.includes("null");if(r){if(e.nullable===false)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"')}if(e.nullable===true)t.push("null")}return t}nr.getSchemaTypes=AN;function a$(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(RN.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}nr.getJSONTypes=a$;function zN(e,t){const{gen:r,data:n,opts:o}=e;const i=CN(t,o.coerceTypes);const s=t.length>0&&!(i.length===0&&t.length===1&&(0,MN.schemaHasRulesForType)(e,t[0]));if(s){const a=Th(t,n,o.strictNumbers,Pa.Wrong);r.if(a,()=>{if(i.length)NN(e,t,i);else kh(e)})}return s}nr.coerceAndCheckDataType=zN;var c$=new Set(["string","number","integer","boolean","null"]);function CN(e,t){return t?e.filter(r=>c$.has(r)||t==="array"&&r==="array"):[]}function NN(e,t,r){const{gen:n,data:o,opts:i}=e;const s=n.let("dataType",(0,Q._)`typeof ${o}`);const a=n.let("coerced",(0,Q._)`undefined`);if(i.coerceTypes==="array"){n.if((0,Q._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,Q._)`${o}[0]`).assign(s,(0,Q._)`typeof ${o}`).if(Th(t,o,i.strictNumbers),()=>n.assign(a,o)))}n.if((0,Q._)`${a} !== undefined`);for(const u of r){if(c$.has(u)||u==="array"&&i.coerceTypes==="array"){c(u)}}n.else();kh(e);n.endIf();n.if((0,Q._)`${a} !== undefined`,()=>{n.assign(o,a);jN(e,a)});function c(u){switch(u){case"string":n.elseIf((0,Q._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Q._)`"" + ${o}`).elseIf((0,Q._)`${o} === null`).assign(a,(0,Q._)`""`);return;case"number":n.elseIf((0,Q._)`${s} == "boolean" || ${o} === null
|
|
2
|
+
import{a as iE}from"./chunk-DSIZQTS3.js";import{a as fb}from"./chunk-7F3QKGB7.js";import{s as pb}from"./chunk-YNDFGYGN.js";import{c as T,d as wo,e as qp,f as me,g as he,h as ge}from"./chunk-FK3SSGJE.js";var du=T(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae.regexpCode=Ae.getEsmExportName=Ae.getProperty=Ae.safeStringify=Ae.stringify=Ae.strConcat=Ae.addCodeArg=Ae.str=Ae._=Ae.nil=Ae._Code=Ae.Name=Ae.IDENTIFIER=Ae._CodeOrName=void 0;var uu=class{};Ae._CodeOrName=uu;Ae.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var os=class extends uu{constructor(t){super();if(!Ae.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}};Ae.Name=os;var sn=class extends uu{constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const 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)=>{if(n instanceof os)r[n.str]=(r[n.str]||0)+1;return r},{})}};Ae._Code=sn;Ae.nil=new sn("");function L0(e,...t){const r=[e[0]];let n=0;while(n<t.length){nh(r,t[n]);r.push(e[++n])}return new sn(r)}Ae._=L0;var rh=new sn("+");function Z0(e,...t){const r=[lu(e[0])];let n=0;while(n<t.length){r.push(rh);nh(r,t[n]);r.push(rh,lu(e[++n]))}qC(r);return new sn(r)}Ae.str=Z0;function nh(e,t){if(t instanceof sn)e.push(...t._items);else if(t instanceof os)e.push(t);else e.push(ZC(t))}Ae.addCodeArg=nh;function qC(e){let t=1;while(t<e.length-1){if(e[t]===rh){const r=UC(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function UC(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof os||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof os))return`"${e}${t.slice(1)}`;return}function LC(e,t){return t.emptyStr()?e:e.emptyStr()?t:Z0`${e}${t}`}Ae.strConcat=LC;function ZC(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:lu(Array.isArray(e)?e.join(","):e)}function VC(e){return new sn(lu(e))}Ae.stringify=VC;function lu(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ae.safeStringify=lu;function KC(e){return typeof e=="string"&&Ae.IDENTIFIER.test(e)?new sn(`.${e}`):L0`[${e}]`}Ae.getProperty=KC;function BC(e){if(typeof e=="string"&&Ae.IDENTIFIER.test(e)){return new sn(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Ae.getEsmExportName=BC;function GC(e){return new sn(e.toString())}Ae.regexpCode=GC});var sh=T(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:true});Sr.ValueScope=Sr.ValueScopeName=Sr.Scope=Sr.varKinds=Sr.UsedValueState=void 0;var Ir=du();var oh=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}};var bd;(function(e){e[e["Started"]=0]="Started";e[e["Completed"]=1]="Completed"})(bd||(Sr.UsedValueState=bd={}));Sr.varKinds={const:new Ir.Name("const"),let:new Ir.Name("let"),var:new Ir.Name("var")};var wd=class{constructor({prefixes:t,parent:r}={}){this._names={};this._prefixes=t;this._parent=r}toName(t){return t instanceof Ir.Name?t:this.name(t)}name(t){return new Ir.Name(this._newName(t))}_newName(t){const 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?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}}};Sr.Scope=wd;var vd=class extends Ir.Name{constructor(t,r){super(r);this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t;this.scopePath=(0,Ir._)`.${new Ir.Name(r)}[${n}]`}};Sr.ValueScopeName=vd;var HC=(0,Ir._)`\n`;var ih=class extends wd{constructor(t){super(t);this._values={};this._scope=t.scope;this.opts={...t,_n:t.lines?HC:Ir.nil}}get(){return this._scope}name(t){return new vd(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const o=this.toName(t);const{prefix:i}=o;const s=(n=r.key)!==null&&n!==void 0?n:r.ref;let a=this._values[i];if(a){const l=a.get(s);if(l)return l}else{a=this._values[i]=new Map}a.set(s,o);const c=this._scope[i]||(this._scope[i]=[]);const u=c.length;c[u]=r.ref;o.setValue(r,{property:i,itemIndex:u});return o}getValue(t,r){const n=this._values[t];if(!n)return;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,Ir._)`${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=Ir.nil;for(const s in t){const a=t[s];if(!a)continue;const c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,bd.Started);let l=r(u);if(l){const d=this.opts.es5?Sr.varKinds.var:Sr.varKinds.const;i=(0,Ir._)`${i}${d} ${u} = ${l};${this.opts._n}`}else if(l=o===null||o===void 0?void 0:o(u)){i=(0,Ir._)`${i}${l}${this.opts._n}`}else{throw new oh(u)}c.set(u,bd.Completed)})}return i}};Sr.ValueScope=ih});var se=T(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:true});ne.or=ne.and=ne.not=ne.CodeGen=ne.operators=ne.varKinds=ne.ValueScopeName=ne.ValueScope=ne.Scope=ne.Name=ne.regexpCode=ne.stringify=ne.getProperty=ne.nil=ne.strConcat=ne.str=ne._=void 0;var $e=du();var Tn=sh();var ti=du();Object.defineProperty(ne,"_",{enumerable:true,get:function(){return ti._}});Object.defineProperty(ne,"str",{enumerable:true,get:function(){return ti.str}});Object.defineProperty(ne,"strConcat",{enumerable:true,get:function(){return ti.strConcat}});Object.defineProperty(ne,"nil",{enumerable:true,get:function(){return ti.nil}});Object.defineProperty(ne,"getProperty",{enumerable:true,get:function(){return ti.getProperty}});Object.defineProperty(ne,"stringify",{enumerable:true,get:function(){return ti.stringify}});Object.defineProperty(ne,"regexpCode",{enumerable:true,get:function(){return ti.regexpCode}});Object.defineProperty(ne,"Name",{enumerable:true,get:function(){return ti.Name}});var Td=sh();Object.defineProperty(ne,"Scope",{enumerable:true,get:function(){return Td.Scope}});Object.defineProperty(ne,"ValueScope",{enumerable:true,get:function(){return Td.ValueScope}});Object.defineProperty(ne,"ValueScopeName",{enumerable:true,get:function(){return Td.ValueScopeName}});Object.defineProperty(ne,"varKinds",{enumerable:true,get:function(){return Td.varKinds}});ne.operators={GT:new $e._Code(">"),GTE:new $e._Code(">="),LT:new $e._Code("<"),LTE:new $e._Code("<="),EQ:new $e._Code("==="),NEQ:new $e._Code("!=="),NOT:new $e._Code("!"),OR:new $e._Code("||"),AND:new $e._Code("&&"),ADD:new $e._Code("+")};var Po=class{optimizeNodes(){return this}optimizeNames(t,r){return this}};var ah=class extends Po{constructor(t,r,n){super();this.varKind=t;this.name=r;this.rhs=n}render({es5:t,_n:r}){const n=t?Tn.varKinds.var:this.varKind;const o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(!t[this.name.str])return;if(this.rhs)this.rhs=Sa(this.rhs,t,r);return this}get names(){return this.rhs instanceof $e._CodeOrName?this.rhs.names:{}}};var $d=class extends Po{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 $e.Name&&!t[this.lhs.str]&&!this.sideEffects)return;this.rhs=Sa(this.rhs,t,r);return this}get names(){const t=this.lhs instanceof $e.Name?{}:{...this.lhs.names};return Sd(t,this.rhs)}};var ch=class extends $d{constructor(t,r,n,o){super(t,n,o);this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}};var uh=class extends Po{constructor(t){super();this.label=t;this.names={}}render({_n:t}){return`${this.label}:`+t}};var lh=class extends Po{constructor(t){super();this.label=t;this.names={}}render({_n:t}){const r=this.label?` ${this.label}`:"";return`break${r};`+t}};var dh=class extends Po{constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}};var fh=class extends Po{constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){this.code=Sa(this.code,t,r);return this}get names(){return this.code instanceof $e._CodeOrName?this.code.names:{}}};var fu=class extends Po{constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){const{nodes:t}=this;let r=t.length;while(r--){const n=t[r].optimizeNodes();if(Array.isArray(n))t.splice(r,1,...n);else if(n)t[r]=n;else t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){const{nodes:n}=this;let o=n.length;while(o--){const i=n[o];if(i.optimizeNames(t,r))continue;WC(t,i.names);n.splice(o,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>as(t,r.names),{})}};var Oo=class extends fu{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};var ph=class extends fu{};var Ia=class extends Oo{};Ia.kind="else";var is=class e extends Oo{constructor(t,r){super(r);this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);if(this.else)r+="else "+this.else.render(t);return r}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(t===true)return this.nodes;let r=this.else;if(r){const n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ia(n):n}if(r){if(t===false)return r instanceof e?r:r.nodes;if(this.nodes.length)return this;return new e(V0(t),r instanceof e?[r]:r.nodes)}if(t===false||!this.nodes.length)return void 0;return this}optimizeNames(t,r){var n;this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r);if(!(super.optimizeNames(t,r)||this.else))return;this.condition=Sa(this.condition,t,r);return this}get names(){const t=super.names;Sd(t,this.condition);if(this.else)as(t,this.else.names);return t}};is.kind="if";var ss=class extends Oo{};ss.kind="for";var mh=class extends ss{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=Sa(this.iteration,t,r);return this}get names(){return as(super.names,this.iteration.names)}};var hh=class extends ss{constructor(t,r,n,o){super();this.varKind=t;this.name=r;this.from=n;this.to=o}render(t){const r=t.es5?Tn.varKinds.var:this.varKind;const{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){const t=Sd(super.names,this.from);return Sd(t,this.to)}};var Id=class extends ss{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=Sa(this.iterable,t,r);return this}get names(){return as(super.names,this.iterable.names)}};var pu=class extends Oo{constructor(t,r,n){super();this.name=t;this.args=r;this.async=n}render(t){const r=this.async?"async ":"";return`${r}function ${this.name}(${this.args})`+super.render(t)}};pu.kind="func";var mu=class extends fu{render(t){return"return "+super.render(t)}};mu.kind="return";var gh=class extends Oo{render(t){let r="try"+super.render(t);if(this.catch)r+=this.catch.render(t);if(this.finally)r+=this.finally.render(t);return r}optimizeNodes(){var t,r;super.optimizeNodes();(t=this.catch)===null||t===void 0?void 0:t.optimizeNodes();(r=this.finally)===null||r===void 0?void 0:r.optimizeNodes();return this}optimizeNames(t,r){var n,o;super.optimizeNames(t,r);(n=this.catch)===null||n===void 0?void 0:n.optimizeNames(t,r);(o=this.finally)===null||o===void 0?void 0:o.optimizeNames(t,r);return this}get names(){const t=super.names;if(this.catch)as(t,this.catch.names);if(this.finally)as(t,this.finally.names);return t}};var hu=class extends Oo{constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};hu.kind="catch";var gu=class extends Oo{render(t){return"finally"+super.render(t)}};gu.kind="finally";var yh=class{constructor(t,r={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...r,_n:r.lines?"\n":""};this._extScope=t;this._scope=new Tn.Scope({parent:t});this._nodes=[new ph]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){const n=this._extScope.value(t,r);const o=this._values[n.prefix]||(this._values[n.prefix]=new Set);o.add(n);return 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){const i=this._scope.toName(r);if(n!==void 0&&o)this._constants[i.str]=n;this._leafNode(new ah(t,i,n));return i}const(t,r,n){return this._def(Tn.varKinds.const,t,r,n)}let(t,r,n){return this._def(Tn.varKinds.let,t,r,n)}var(t,r,n){return this._def(Tn.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new $d(t,r,n))}add(t,r){return this._leafNode(new ch(t,ne.operators.ADD,r))}code(t){if(typeof t=="function")t();else if(t!==$e.nil)this._leafNode(new fh(t));return this}object(...t){const r=["{"];for(const[n,o]of t){if(r.length>1)r.push(",");r.push(n);if(n!==o||this.opts.es5){r.push(":");(0,$e.addCodeArg)(r,o)}}r.push("}");return new $e._Code(r)}if(t,r,n){this._blockNode(new is(t));if(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 is(t))}else(){return this._elseNode(new Ia)}endIf(){return this._endBlockNode(is,Ia)}_for(t,r){this._blockNode(t);if(r)this.code(r).endFor();return this}for(t,r){return this._for(new mh(t),r)}forRange(t,r,n,o,i=this.opts.es5?Tn.varKinds.var:Tn.varKinds.let){const s=this._scope.toName(t);return this._for(new hh(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Tn.varKinds.const){const i=this._scope.toName(t);if(this.opts.es5){const s=r instanceof $e.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,$e._)`${s}.length`,a=>{this.var(i,(0,$e._)`${s}[${a}]`);n(i)})}return this._for(new Id("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Tn.varKinds.var:Tn.varKinds.const){if(this.opts.ownProperties){return this.forOf(t,(0,$e._)`Object.keys(${r})`,n)}const i=this._scope.toName(t);return this._for(new Id("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(ss)}label(t){return this._leafNode(new uh(t))}break(t){return this._leafNode(new lh(t))}return(t){const r=new mu;this._blockNode(r);this.code(t);if(r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(mu)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const o=new gh;this._blockNode(o);this.code(t);if(r){const i=this.name("e");this._currNode=o.catch=new hu(i);r(i)}if(n){this._currNode=o.finally=new gu;this.code(n)}return this._endBlockNode(hu,gu)}throw(t){return this._leafNode(new dh(t))}block(t,r){this._blockStarts.push(this._nodes.length);if(t)this.code(t).endBlock(r);return this}endBlock(t){const r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");const 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`)}this._nodes.length=r;return this}func(t,r=$e.nil,n,o){this._blockNode(new pu(t,r,n));if(o)this.code(o).endFunc();return this}endFunc(){return this._endBlockNode(pu)}optimize(t=1){while(t-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(t){this._currNode.nodes.push(t);return this}_blockNode(t){this._currNode.nodes.push(t);this._nodes.push(t)}_endBlockNode(t,r){const n=this._currNode;if(n instanceof t||r&&n instanceof r){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){const r=this._currNode;if(!(r instanceof is)){throw new Error('CodeGen: "else" without "if"')}this._currNode=r.else=t;return this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const r=this._nodes;r[r.length-1]=t}};ne.CodeGen=yh;function as(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Sd(e,t){return t instanceof $e._CodeOrName?as(e,t.names):e}function Sa(e,t,r){if(e instanceof $e.Name)return n(e);if(!o(e))return e;return new $e._Code(e._items.reduce((i,s)=>{if(s instanceof $e.Name)s=n(s);if(s instanceof $e._Code)i.push(...s._items);else i.push(s);return i},[]));function n(i){const s=r[i.str];if(s===void 0||t[i.str]!==1)return i;delete t[i.str];return s}function o(i){return i instanceof $e._Code&&i._items.some(s=>s instanceof $e.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function WC(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function V0(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,$e._)`!${_h(e)}`}ne.not=V0;var JC=K0(ne.operators.AND);function XC(...e){return e.reduce(JC)}ne.and=XC;var QC=K0(ne.operators.OR);function YC(...e){return e.reduce(QC)}ne.or=YC;function K0(e){return(t,r)=>t===$e.nil?r:r===$e.nil?t:(0,$e._)`${_h(t)} ${e} ${_h(r)}`}function _h(e){return e instanceof $e.Name?e:(0,$e._)`(${e})`}});var Te=T(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:true});ae.checkStrictMode=ae.getErrorPath=ae.Type=ae.useFunc=ae.setEvaluated=ae.evaluatedPropsToName=ae.mergeEvaluated=ae.eachItem=ae.unescapeJsonPointer=ae.escapeJsonPointer=ae.escapeFragment=ae.unescapeFragment=ae.schemaRefOrVal=ae.schemaHasRulesButRef=ae.schemaHasRules=ae.checkUnknownRules=ae.alwaysValidSchema=ae.toHash=void 0;var Ge=se();var eN=du();function tN(e){const t={};for(const r of e)t[r]=true;return t}ae.toHash=tN;function rN(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return true;H0(e,t);return!W0(t,e.self.RULES.all)}ae.alwaysValidSchema=rN;function H0(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;const o=n.RULES.keywords;for(const i in t){if(!o[i])Q0(e,`unknown keyword: "${i}"`)}}ae.checkUnknownRules=H0;function W0(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return true;return false}ae.schemaHasRules=W0;function nN(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return true;return false}ae.schemaHasRulesButRef=nN;function oN({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ge._)`${r}`}return(0,Ge._)`${e}${t}${(0,Ge.getProperty)(n)}`}ae.schemaRefOrVal=oN;function iN(e){return J0(decodeURIComponent(e))}ae.unescapeFragment=iN;function sN(e){return encodeURIComponent(bh(e))}ae.escapeFragment=sN;function bh(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}ae.escapeJsonPointer=bh;function J0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ae.unescapeJsonPointer=J0;function aN(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}ae.eachItem=aN;function B0({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{const c=s===void 0?i:s instanceof Ge.Name?(i instanceof Ge.Name?e(o,i,s):t(o,i,s),s):i instanceof Ge.Name?(t(o,s,i),i):r(i,s);return a===Ge.Name&&!(c instanceof Ge.Name)?n(o,c):c}}ae.mergeEvaluated={props:B0({mergeNames:(e,t,r)=>e.if((0,Ge._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Ge._)`${t} === true`,()=>e.assign(r,true),()=>e.assign(r,(0,Ge._)`${r} || {}`).code((0,Ge._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Ge._)`${r} !== true`,()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,Ge._)`${r} || {}`);wh(e,r,t)}}),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:X0}),items:B0({mergeNames:(e,t,r)=>e.if((0,Ge._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Ge._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Ge._)`${r} !== true`,()=>e.assign(r,t===true?true:(0,Ge._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function X0(e,t){if(t===true)return e.var("props",true);const r=e.var("props",(0,Ge._)`{}`);if(t!==void 0)wh(e,r,t);return r}ae.evaluatedPropsToName=X0;function wh(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Ge._)`${t}${(0,Ge.getProperty)(n)}`,true))}ae.setEvaluated=wh;var G0={};function cN(e,t){return e.scopeValue("func",{ref:t,code:G0[t.code]||(G0[t.code]=new eN._Code(t.code))})}ae.useFunc=cN;var xh;(function(e){e[e["Num"]=0]="Num";e[e["Str"]=1]="Str"})(xh||(ae.Type=xh={}));function uN(e,t,r){if(e instanceof Ge.Name){const n=t===xh.Num;return r?n?(0,Ge._)`"[" + ${e} + "]"`:(0,Ge._)`"['" + ${e} + "']"`:n?(0,Ge._)`"/" + ${e}`:(0,Ge._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ge.getProperty)(e).toString():"/"+bh(e)}ae.getErrorPath=uN;function Q0(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}ae.checkStrictMode=Q0});var Ro=T(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:true});var tr=se();var lN={data:new tr.Name("data"),valCxt:new tr.Name("valCxt"),instancePath:new tr.Name("instancePath"),parentData:new tr.Name("parentData"),parentDataProperty:new tr.Name("parentDataProperty"),rootData:new tr.Name("rootData"),dynamicAnchors:new tr.Name("dynamicAnchors"),vErrors:new tr.Name("vErrors"),errors:new tr.Name("errors"),this:new tr.Name("this"),self:new tr.Name("self"),scope:new tr.Name("scope"),json:new tr.Name("json"),jsonPos:new tr.Name("jsonPos"),jsonLen:new tr.Name("jsonLen"),jsonPart:new tr.Name("jsonPart")};vh.default=lN});var yu=T(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:true});rr.extendErrors=rr.resetErrorsCount=rr.reportExtraError=rr.reportError=rr.keyword$DataError=rr.keywordError=void 0;var ke=se();var kd=Te();var hr=Ro();rr.keywordError={message:({keyword:e})=>(0,ke.str)`must pass "${e}" keyword validation`};rr.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ke.str)`"${e}" keyword must be ${t} ($data)`:(0,ke.str)`"${e}" keyword is invalid ($data)`};function dN(e,t=rr.keywordError,r,n){const{it:o}=e;const{gen:i,compositeRule:s,allErrors:a}=o;const c=t$(e,t,r);if(n!==null&&n!==void 0?n:s||a){Y0(i,c)}else{e$(o,(0,ke._)`[${c}]`)}}rr.reportError=dN;function fN(e,t=rr.keywordError,r){const{it:n}=e;const{gen:o,compositeRule:i,allErrors:s}=n;const a=t$(e,t,r);Y0(o,a);if(!(i||s)){e$(n,hr.default.vErrors)}}rr.reportExtraError=fN;function pN(e,t){e.assign(hr.default.errors,t);e.if((0,ke._)`${hr.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ke._)`${hr.default.vErrors}.length`,t),()=>e.assign(hr.default.vErrors,null)))}rr.resetErrorsCount=pN;function mN({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");const s=e.name("err");e.forRange("i",o,hr.default.errors,a=>{e.const(s,(0,ke._)`${hr.default.vErrors}[${a}]`);e.if((0,ke._)`${s}.instancePath === undefined`,()=>e.assign((0,ke._)`${s}.instancePath`,(0,ke.strConcat)(hr.default.instancePath,i.errorPath)));e.assign((0,ke._)`${s}.schemaPath`,(0,ke.str)`${i.errSchemaPath}/${t}`);if(i.opts.verbose){e.assign((0,ke._)`${s}.schema`,r);e.assign((0,ke._)`${s}.data`,n)}})}rr.extendErrors=mN;function Y0(e,t){const r=e.const("err",t);e.if((0,ke._)`${hr.default.vErrors} === null`,()=>e.assign(hr.default.vErrors,(0,ke._)`[${r}]`),(0,ke._)`${hr.default.vErrors}.push(${r})`);e.code((0,ke._)`${hr.default.errors}++`)}function e$(e,t){const{gen:r,validateName:n,schemaEnv:o}=e;if(o.$async){r.throw((0,ke._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,ke._)`${n}.errors`,t);r.return(false)}}var cs={keyword:new ke.Name("keyword"),schemaPath:new ke.Name("schemaPath"),params:new ke.Name("params"),propertyName:new ke.Name("propertyName"),message:new ke.Name("message"),schema:new ke.Name("schema"),parentSchema:new ke.Name("parentSchema")};function t$(e,t,r){const{createErrors:n}=e.it;if(n===false)return(0,ke._)`{}`;return hN(e,t,r)}function hN(e,t,r={}){const{gen:n,it:o}=e;const i=[gN(o,r),yN(e,r)];_N(e,t,i);return n.object(...i)}function gN({errorPath:e},{instancePath:t}){const r=t?(0,ke.str)`${e}${(0,kd.getErrorPath)(t,kd.Type.Str)}`:e;return[hr.default.instancePath,(0,ke.strConcat)(hr.default.instancePath,r)]}function yN({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ke.str)`${t}/${e}`;if(r){o=(0,ke.str)`${o}${(0,kd.getErrorPath)(r,kd.Type.Str)}`}return[cs.schemaPath,o]}function _N(e,{params:t,message:r},n){const{keyword:o,data:i,schemaValue:s,it:a}=e;const{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([cs.keyword,o],[cs.params,typeof t=="function"?t(e):t||(0,ke._)`{}`]);if(c.messages){n.push([cs.message,typeof r=="function"?r(e):r])}if(c.verbose){n.push([cs.schema,s],[cs.parentSchema,(0,ke._)`${l}${d}`],[hr.default.data,i])}if(u)n.push([cs.propertyName,u])}});var n$=T(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:true});Ta.boolOrEmptySchema=Ta.topBoolOrEmptySchema=void 0;var xN=yu();var bN=se();var wN=Ro();var vN={message:"boolean schema is false"};function $N(e){const{gen:t,schema:r,validateName:n}=e;if(r===false){r$(e,false)}else if(typeof r=="object"&&r.$async===true){t.return(wN.default.data)}else{t.assign((0,bN._)`${n}.errors`,null);t.return(true)}}Ta.topBoolOrEmptySchema=$N;function IN(e,t){const{gen:r,schema:n}=e;if(n===false){r.var(t,false);r$(e)}else{r.var(t,true)}}Ta.boolOrEmptySchema=IN;function r$(e,t){const{gen:r,data:n}=e;const o={gen:r,keyword:"false schema",data:n,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,xN.reportError)(o,vN,void 0,t)}});var $h=T(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:true});ka.getRules=ka.isJSONType=void 0;var SN=["string","number","integer","boolean","null","object","array"];var TN=new Set(SN);function kN(e){return typeof e=="string"&&TN.has(e)}ka.isJSONType=kN;function PN(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}ka.getRules=PN});var Ih=T(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:true});ri.shouldUseRule=ri.shouldUseGroup=ri.schemaHasRulesForType=void 0;function ON({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==true&&o$(e,n)}ri.schemaHasRulesForType=ON;function o$(e,t){return t.rules.some(r=>i$(e,r))}ri.shouldUseGroup=o$;function i$(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))}ri.shouldUseRule=i$});var _u=T(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:true});nr.reportTypeError=nr.checkDataTypes=nr.checkDataType=nr.coerceAndCheckDataType=nr.getJSONTypes=nr.getSchemaTypes=nr.DataType=void 0;var RN=$h();var MN=Ih();var EN=yu();var Q=se();var s$=Te();var Pa;(function(e){e[e["Correct"]=0]="Correct";e[e["Wrong"]=1]="Wrong"})(Pa||(nr.DataType=Pa={}));function AN(e){const t=a$(e.type);const r=t.includes("null");if(r){if(e.nullable===false)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"')}if(e.nullable===true)t.push("null")}return t}nr.getSchemaTypes=AN;function a$(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(RN.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}nr.getJSONTypes=a$;function zN(e,t){const{gen:r,data:n,opts:o}=e;const i=CN(t,o.coerceTypes);const s=t.length>0&&!(i.length===0&&t.length===1&&(0,MN.schemaHasRulesForType)(e,t[0]));if(s){const a=Th(t,n,o.strictNumbers,Pa.Wrong);r.if(a,()=>{if(i.length)NN(e,t,i);else kh(e)})}return s}nr.coerceAndCheckDataType=zN;var c$=new Set(["string","number","integer","boolean","null"]);function CN(e,t){return t?e.filter(r=>c$.has(r)||t==="array"&&r==="array"):[]}function NN(e,t,r){const{gen:n,data:o,opts:i}=e;const s=n.let("dataType",(0,Q._)`typeof ${o}`);const a=n.let("coerced",(0,Q._)`undefined`);if(i.coerceTypes==="array"){n.if((0,Q._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,Q._)`${o}[0]`).assign(s,(0,Q._)`typeof ${o}`).if(Th(t,o,i.strictNumbers),()=>n.assign(a,o)))}n.if((0,Q._)`${a} !== undefined`);for(const u of r){if(c$.has(u)||u==="array"&&i.coerceTypes==="array"){c(u)}}n.else();kh(e);n.endIf();n.if((0,Q._)`${a} !== undefined`,()=>{n.assign(o,a);jN(e,a)});function c(u){switch(u){case"string":n.elseIf((0,Q._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Q._)`"" + ${o}`).elseIf((0,Q._)`${o} === null`).assign(a,(0,Q._)`""`);return;case"number":n.elseIf((0,Q._)`${s} == "boolean" || ${o} === null
|
|
3
3
|
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,Q._)`+${o}`);return;case"integer":n.elseIf((0,Q._)`${s} === "boolean" || ${o} === null
|
|
4
4
|
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,Q._)`+${o}`);return;case"boolean":n.elseIf((0,Q._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,false).elseIf((0,Q._)`${o} === "true" || ${o} === 1`).assign(a,true);return;case"null":n.elseIf((0,Q._)`${o} === "" || ${o} === 0 || ${o} === false`);n.assign(a,null);return;case"array":n.elseIf((0,Q._)`${s} === "string" || ${s} === "number"
|
|
5
5
|
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,Q._)`[${o}]`)}}}function jN({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Q._)`${t} !== undefined`,()=>e.assign((0,Q._)`${t}[${r}]`,n))}function Sh(e,t,r,n=Pa.Correct){const o=n===Pa.Correct?Q.operators.EQ:Q.operators.NEQ;let i;switch(e){case"null":return(0,Q._)`${t} ${o} null`;case"array":i=(0,Q._)`Array.isArray(${t})`;break;case"object":i=(0,Q._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,Q._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,Q._)`typeof ${t} ${o} ${e}`}return n===Pa.Correct?i:(0,Q.not)(i);function s(a=Q.nil){return(0,Q.and)((0,Q._)`typeof ${t} == "number"`,a,r?(0,Q._)`isFinite(${t})`:Q.nil)}}nr.checkDataType=Sh;function Th(e,t,r,n){if(e.length===1){return Sh(e[0],t,r,n)}let o;const i=(0,s$.toHash)(e);if(i.array&&i.object){const s=(0,Q._)`typeof ${t} != "object"`;o=i.null?s:(0,Q._)`!${t} || ${s}`;delete i.null;delete i.array;delete i.object}else{o=Q.nil}if(i.number)delete i.integer;for(const s in i)o=(0,Q.and)(o,Sh(s,t,r,n));return o}nr.checkDataTypes=Th;var FN={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Q._)`{type: ${e}}`:(0,Q._)`{type: ${t}}`};function kh(e){const t=DN(e);(0,EN.reportError)(t,FN)}nr.reportTypeError=kh;function DN(e){const{gen:t,data:r,schema:n}=e;const o=(0,s$.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var l$=T(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:true});Pd.assignDefaults=void 0;var Oa=se();var qN=Te();function UN(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r){for(const o in r){u$(e,o,r[o].default)}}else if(t==="array"&&Array.isArray(n)){n.forEach((o,i)=>u$(e,i,o.default))}}Pd.assignDefaults=UN;function u$(e,t,r){const{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;const a=(0,Oa._)`${i}${(0,Oa.getProperty)(t)}`;if(o){(0,qN.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Oa._)`${a} === undefined`;if(s.useDefaults==="empty"){c=(0,Oa._)`${c} || ${a} === null || ${a} === ""`}n.if(c,(0,Oa._)`${a} = ${(0,Oa.stringify)(r)}`)}});var an=T(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:true});Ke.validateUnion=Ke.validateArray=Ke.usePattern=Ke.callValidateCode=Ke.schemaProperties=Ke.allSchemaProperties=Ke.noPropertyInData=Ke.propertyInData=Ke.isOwnProperty=Ke.hasPropFunc=Ke.reportMissingProp=Ke.checkMissingProp=Ke.checkReportMissingProp=void 0;var ot=se();var Ph=Te();var ni=Ro();var LN=Te();function ZN(e,t){const{gen:r,data:n,it:o}=e;r.if(Rh(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ot._)`${t}`},true);e.error()})}Ke.checkReportMissingProp=ZN;function VN({gen:e,data:t,it:{opts:r}},n,o){return(0,ot.or)(...n.map(i=>(0,ot.and)(Rh(e,t,i,r.ownProperties),(0,ot._)`${o} = ${i}`)))}Ke.checkMissingProp=VN;function KN(e,t){e.setParams({missingProperty:t},true);e.error()}Ke.reportMissingProp=KN;function d$(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ot._)`Object.prototype.hasOwnProperty`})}Ke.hasPropFunc=d$;function Oh(e,t,r){return(0,ot._)`${d$(e)}.call(${t}, ${r})`}Ke.isOwnProperty=Oh;function BN(e,t,r,n){const o=(0,ot._)`${t}${(0,ot.getProperty)(r)} !== undefined`;return n?(0,ot._)`${o} && ${Oh(e,t,r)}`:o}Ke.propertyInData=BN;function Rh(e,t,r,n){const o=(0,ot._)`${t}${(0,ot.getProperty)(r)} === undefined`;return n?(0,ot.or)(o,(0,ot.not)(Oh(e,t,r))):o}Ke.noPropertyInData=Rh;function f$(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}Ke.allSchemaProperties=f$;function GN(e,t){return f$(t).filter(r=>!(0,Ph.alwaysValidSchema)(e,t[r]))}Ke.schemaProperties=GN;function HN({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){const l=u?(0,ot._)`${e}, ${t}, ${n}${o}`:t;const d=[[ni.default.instancePath,(0,ot.strConcat)(ni.default.instancePath,i)],[ni.default.parentData,s.parentData],[ni.default.parentDataProperty,s.parentDataProperty],[ni.default.rootData,ni.default.rootData]];if(s.opts.dynamicRef)d.push([ni.default.dynamicAnchors,ni.default.dynamicAnchors]);const g=(0,ot._)`${l}, ${r.object(...d)}`;return c!==ot.nil?(0,ot._)`${a}.call(${c}, ${g})`:(0,ot._)`${a}(${g})`}Ke.callValidateCode=HN;var WN=(0,ot._)`new RegExp`;function JN({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"";const{regExp:o}=t.code;const i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ot._)`${o.code==="new RegExp"?WN:(0,LN.useFunc)(e,o)}(${r}, ${n})`})}Ke.usePattern=JN;function XN(e){const{gen:t,data:r,keyword:n,it:o}=e;const i=t.name("valid");if(o.allErrors){const a=t.let("valid",true);s(()=>t.assign(a,false));return a}t.var(i,true);s(()=>t.break());return i;function s(a){const c=t.const("len",(0,ot._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Ph.Type.Num},i);t.if((0,ot.not)(i),a)})}}Ke.validateArray=XN;function QN(e){const{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=r.some(c=>(0,Ph.alwaysValidSchema)(o,c));if(i&&!o.opts.unevaluated)return;const s=t.let("valid",false);const a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{const l=e.subschema({keyword:n,schemaProp:u,compositeRule:true},a);t.assign(s,(0,ot._)`${s} || ${a}`);const d=e.mergeValidEvaluated(l,a);if(!d)t.if((0,ot.not)(s))}));e.result(s,()=>e.reset(),()=>e.error(true))}Ke.validateUnion=QN});var h$=T(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:true});so.validateKeywordUsage=so.validSchemaType=so.funcKeywordCode=so.macroKeywordCode=void 0;var gr=se();var us=Ro();var YN=an();var ej=yu();function tj(e,t){const{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e;const a=t.macro.call(s.self,o,i,s);const c=m$(r,n,a);if(s.opts.validateSchema!==false)s.self.validateSchema(a,true);const u=r.name("valid");e.subschema({schema:a,schemaPath:gr.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:true},u);e.pass(u,()=>e.error(true))}so.macroKeywordCode=tj;function rj(e,t){var r;const{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;oj(c,t);const u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate;const l=m$(n,o,u);const d=n.let("valid");e.block$data(d,g);e.ok((r=t.valid)!==null&&r!==void 0?r:d);function g(){if(t.errors===false){f();if(t.modifying)p$(e);m(()=>e.error())}else{const y=t.async?h():p();if(t.modifying)p$(e);m(()=>nj(e,y))}}function h(){const y=n.let("ruleErrs",null);n.try(()=>f((0,gr._)`await `),x=>n.assign(d,false).if((0,gr._)`${x} instanceof ${c.ValidationError}`,()=>n.assign(y,(0,gr._)`${x}.errors`),()=>n.throw(x)));return y}function p(){const y=(0,gr._)`${l}.errors`;n.assign(y,null);f(gr.nil);return y}function f(y=t.async?(0,gr._)`await `:gr.nil){const x=c.opts.passContext?us.default.this:us.default.self;const w=!("compile"in t&&!a||t.schema===false);n.assign(d,(0,gr._)`${y}${(0,YN.callValidateCode)(e,l,x,w)}`,t.modifying)}function m(y){var x;n.if((0,gr.not)((x=t.valid)!==null&&x!==void 0?x:d),y)}}so.funcKeywordCode=rj;function p$(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,gr._)`${n.parentData}[${n.parentDataProperty}]`))}function nj(e,t){const{gen:r}=e;r.if((0,gr._)`Array.isArray(${t})`,()=>{r.assign(us.default.vErrors,(0,gr._)`${us.default.vErrors} === null ? ${t} : ${us.default.vErrors}.concat(${t})`).assign(us.default.errors,(0,gr._)`${us.default.vErrors}.length`);(0,ej.extendErrors)(e)},()=>e.error())}function oj({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function m$(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,gr.stringify)(r)})}function ij(e,t,r=false){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=="undefined")}so.validSchemaType=ij;function sj({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")}const s=o.dependencies;if(s===null||s===void 0?void 0:s.some(a=>!Object.prototype.hasOwnProperty.call(e,a))){throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`)}if(o.validateSchema){const a=o.validateSchema(e[i]);if(!a){const 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)}}}so.validateKeywordUsage=sj});var y$=T(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:true});oi.extendSubschemaMode=oi.extendSubschemaData=oi.getSubschema=void 0;var ao=se();var g$=Te();function aj(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0){throw new Error('both "keyword" and "schema" passed, only one allowed')}if(t!==void 0){const a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,ao._)`${e.schemaPath}${(0,ao.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,ao._)`${e.schemaPath}${(0,ao.getProperty)(t)}${(0,ao.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,g$.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0){throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"')}return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}oi.getSubschema=aj;function cj(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0){throw new Error('both "data" and "dataProp" passed, only one allowed')}const{gen:a}=t;if(r!==void 0){const{errorPath:u,dataPathArr:l,opts:d}=t;const g=a.let("data",(0,ao._)`${t.data}${(0,ao.getProperty)(r)}`,true);c(g);e.errorPath=(0,ao.str)`${u}${(0,g$.getErrorPath)(r,n,d.jsPropertySyntax)}`;e.parentDataProperty=(0,ao._)`${r}`;e.dataPathArr=[...l,e.parentDataProperty]}if(o!==void 0){const u=o instanceof ao.Name?o:a.let("data",o,true);c(u);if(s!==void 0)e.propertyName=s}if(i)e.dataTypes=i;function c(u){e.data=u;e.dataLevel=t.dataLevel+1;e.dataTypes=[];t.definedProperties=new Set;e.parentData=t.data;e.dataNames=[...t.dataNames,u]}}oi.extendSubschemaData=cj;function uj(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){if(n!==void 0)e.compositeRule=n;if(o!==void 0)e.createErrors=o;if(i!==void 0)e.allErrors=i;e.jtdDiscriminator=t;e.jtdMetadata=r}oi.extendSubschemaMode=uj});var xu=T((vre,_$)=>{"use strict";_$.exports=function e(t,r){if(t===r)return true;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return false;var n,o,i;if(Array.isArray(t)){n=t.length;if(n!=r.length)return false;for(o=n;o--!==0;)if(!e(t[o],r[o]))return false;return true}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();i=Object.keys(t);n=i.length;if(n!==Object.keys(r).length)return false;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return false;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return false}return true}return t!==t&&r!==r}});var Mh=T(($re,x$)=>{"use strict";var ii=x$.exports=function(e,t,r){if(typeof t=="function"){r=t;t={}}r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){};var o=r.post||function(){};Od(t,n,o,e,"",e)};ii.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true,if:true,then:true,else:true};ii.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};ii.propsKeywords={$defs:true,definitions:true,properties:true,patternProperties:true,dependencies:true};ii.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function Od(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in ii.arrayKeywords){for(var g=0;g<d.length;g++)Od(e,t,r,d[g],o+"/"+l+"/"+g,i,o,l,n,g)}}else if(l in ii.propsKeywords){if(d&&typeof d=="object"){for(var h in d)Od(e,t,r,d[h],o+"/"+l+"/"+lj(h),i,o,l,n,h)}}else if(l in ii.keywords||e.allKeys&&!(l in ii.skipKeywords)){Od(e,t,r,d,o+"/"+l,i,o,l,n)}}r(n,o,i,s,a,c,u)}}function lj(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var bu=T(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:true});Tr.getSchemaRefs=Tr.resolveUrl=Tr.normalizeId=Tr._getFullPath=Tr.getFullPath=Tr.inlineRef=void 0;var dj=Te();var fj=xu();var pj=Mh();var mj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function hj(e,t=true){if(typeof e=="boolean")return true;if(t===true)return!Eh(e);if(!t)return false;return b$(e)<=t}Tr.inlineRef=hj;var gj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Eh(e){for(const t in e){if(gj.has(t))return true;const r=e[t];if(Array.isArray(r)&&r.some(Eh))return true;if(typeof r=="object"&&Eh(r))return true}return false}function b$(e){let t=0;for(const r in e){if(r==="$ref")return Infinity;t++;if(mj.has(r))continue;if(typeof e[r]=="object"){(0,dj.eachItem)(e[r],n=>t+=b$(n))}if(t===Infinity)return Infinity}return t}function w$(e,t="",r){if(r!==false)t=Ra(t);const n=e.parse(t);return v$(e,n)}Tr.getFullPath=w$;function v$(e,t){const r=e.serialize(t);return r.split("#")[0]+"#"}Tr._getFullPath=v$;var yj=/#\/?$/;function Ra(e){return e?e.replace(yj,""):""}Tr.normalizeId=Ra;function _j(e,t,r){r=Ra(r);return e.resolve(t,r)}Tr.resolveUrl=_j;var xj=/^[a-z_][-a-z0-9._]*$/i;function bj(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts;const o=Ra(e[r]||t);const i={"":o};const s=w$(n,o,false);const a={};const c=new Set;pj(e,{allKeys:true},(d,g,h,p)=>{if(p===void 0)return;const f=s+g;let m=i[p];if(typeof d[r]=="string")m=y.call(this,d[r]);x.call(this,d.$anchor);x.call(this,d.$dynamicAnchor);i[g]=m;function y(w){const R=this.opts.uriResolver.resolve;w=Ra(m?R(m,w):w);if(c.has(w))throw l(w);c.add(w);let O=this.refs[w];if(typeof O=="string")O=this.refs[O];if(typeof O=="object"){u(d,O.schema,w)}else if(w!==Ra(f)){if(w[0]==="#"){u(d,a[w],w);a[w]=d}else{this.refs[w]=f}}return w}function x(w){if(typeof w=="string"){if(!xj.test(w))throw new Error(`invalid anchor "${w}"`);y.call(this,`#${w}`)}}});return a;function u(d,g,h){if(g!==void 0&&!fj(d,g))throw l(h)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Tr.getSchemaRefs=bj});var $u=T(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:true});si.getData=si.KeywordCxt=si.validateFunctionCode=void 0;var k$=n$();var $$=_u();var zh=Ih();var Rd=_u();var wj=l$();var vu=h$();var Ah=y$();var D=se();var G=Ro();var vj=bu();var Mo=Te();var wu=yu();function $j(e){if(R$(e)){M$(e);if(O$(e)){Tj(e);return}}P$(e,()=>(0,k$.topBoolOrEmptySchema)(e))}si.validateFunctionCode=$j;function P$({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){if(o.code.es5){e.func(t,(0,D._)`${G.default.data}, ${G.default.valCxt}`,n.$async,()=>{e.code((0,D._)`"use strict"; ${I$(r,o)}`);Sj(e,o);e.code(i)})}else{e.func(t,(0,D._)`${G.default.data}, ${Ij(o)}`,n.$async,()=>e.code(I$(r,o)).code(i))}}function Ij(e){return(0,D._)`{${G.default.instancePath}="", ${G.default.parentData}, ${G.default.parentDataProperty}, ${G.default.rootData}=${G.default.data}${e.dynamicRef?(0,D._)`, ${G.default.dynamicAnchors}={}`:D.nil}}={}`}function Sj(e,t){e.if(G.default.valCxt,()=>{e.var(G.default.instancePath,(0,D._)`${G.default.valCxt}.${G.default.instancePath}`);e.var(G.default.parentData,(0,D._)`${G.default.valCxt}.${G.default.parentData}`);e.var(G.default.parentDataProperty,(0,D._)`${G.default.valCxt}.${G.default.parentDataProperty}`);e.var(G.default.rootData,(0,D._)`${G.default.valCxt}.${G.default.rootData}`);if(t.dynamicRef)e.var(G.default.dynamicAnchors,(0,D._)`${G.default.valCxt}.${G.default.dynamicAnchors}`)},()=>{e.var(G.default.instancePath,(0,D._)`""`);e.var(G.default.parentData,(0,D._)`undefined`);e.var(G.default.parentDataProperty,(0,D._)`undefined`);e.var(G.default.rootData,G.default.data);if(t.dynamicRef)e.var(G.default.dynamicAnchors,(0,D._)`{}`)})}function Tj(e){const{schema:t,opts:r,gen:n}=e;P$(e,()=>{if(r.$comment&&t.$comment)A$(e);Mj(e);n.let(G.default.vErrors,null);n.let(G.default.errors,0);if(r.unevaluated)kj(e);E$(e);zj(e)});return}function kj(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,D._)`${r}.evaluated`);t.if((0,D._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,D._)`${e.evaluated}.props`,(0,D._)`undefined`));t.if((0,D._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,D._)`${e.evaluated}.items`,(0,D._)`undefined`))}function I$(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,D._)`/*# sourceURL=${r} */`:D.nil}function Pj(e,t){if(R$(e)){M$(e);if(O$(e)){Oj(e,t);return}}(0,k$.boolOrEmptySchema)(e,t)}function O$({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return true;return false}function R$(e){return typeof e.schema!="boolean"}function Oj(e,t){const{schema:r,gen:n,opts:o}=e;if(o.$comment&&r.$comment)A$(e);Ej(e);Aj(e);const i=n.const("_errs",G.default.errors);E$(e,i);n.var(t,(0,D._)`${i} === ${G.default.errors}`)}function M$(e){(0,Mo.checkUnknownRules)(e);Rj(e)}function E$(e,t){if(e.opts.jtd)return S$(e,[],false,t);const r=(0,$$.getSchemaTypes)(e.schema);const n=(0,$$.coerceAndCheckDataType)(e,r);S$(e,r,!n,t)}function Rj(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&(0,Mo.schemaHasRulesButRef)(t,o.RULES)){o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}}function Mj(e){const{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema){(0,Mo.checkStrictMode)(e,"default is ignored in the schema root")}}function Ej(e){const t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,vj.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function Aj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function A$({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const i=r.$comment;if(o.$comment===true){e.code((0,D._)`${G.default.self}.logger.log(${i})`)}else if(typeof o.$comment=="function"){const s=(0,D.str)`${n}/$comment`;const a=e.scopeValue("root",{ref:t.root});e.code((0,D._)`${G.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function zj(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;if(r.$async){t.if((0,D._)`${G.default.errors} === 0`,()=>t.return(G.default.data),()=>t.throw((0,D._)`new ${o}(${G.default.vErrors})`))}else{t.assign((0,D._)`${n}.errors`,G.default.vErrors);if(i.unevaluated)Cj(e);t.return((0,D._)`${G.default.errors} === 0`)}}function Cj({gen:e,evaluated:t,props:r,items:n}){if(r instanceof D.Name)e.assign((0,D._)`${t}.props`,r);if(n instanceof D.Name)e.assign((0,D._)`${t}.items`,n)}function S$(e,t,r,n){const{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e;const{RULES:l}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Mo.schemaHasRulesButRef)(i,l))){o.block(()=>C$(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)Nj(e,t);o.block(()=>{for(const g of l.rules)d(g);d(l.post)});function d(g){if(!(0,zh.shouldUseGroup)(i,g))return;if(g.type){o.if((0,Rd.checkDataType)(g.type,s,c.strictNumbers));T$(e,g);if(t.length===1&&t[0]===g.type&&r){o.else();(0,Rd.reportTypeError)(e)}o.endIf()}else{T$(e,g)}if(!a)o.if((0,D._)`${G.default.errors} === ${n||0}`)}}function T$(e,t){const{gen:r,schema:n,opts:{useDefaults:o}}=e;if(o)(0,wj.assignDefaults)(e,t.type);r.block(()=>{for(const i of t.rules){if((0,zh.shouldUseRule)(n,i)){C$(e,i.keyword,i.definition,t.type)}}})}function Nj(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;jj(e,t);if(!e.opts.allowUnionTypes)Fj(e,t);Dj(e,e.dataTypes)}function jj(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{if(!z$(e.dataTypes,r)){Ch(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}});Uj(e,t)}function Fj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null"))){Ch(e,"use allowUnionTypes to allow union type keyword")}}function Dj(e,t){const r=e.self.RULES.all;for(const n in r){const o=r[n];if(typeof o=="object"&&(0,zh.shouldUseRule)(e.schema,o)){const{type:i}=o.definition;if(i.length&&!i.some(s=>qj(t,s))){Ch(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}}function qj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function z$(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Uj(e,t){const r=[];for(const n of e.dataTypes){if(z$(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer")}e.dataTypes=r}function Ch(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`;(0,Mo.checkStrictMode)(e,t,e.opts.strictTypes)}var Md=class{constructor(t,r,n){(0,vu.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,Mo.schemaRefOrVal)(t,this.schema,n,this.$data);this.schemaType=r.schemaType;this.parentSchema=t.schema;this.params={};this.it=t;this.def=r;if(this.$data){this.schemaCode=t.gen.const("vSchema",N$(this.$data,t))}else{this.schemaCode=this.schemaValue;if(!(0,vu.validSchemaType)(this.schema,r.schemaType,r.allowUndefined)){throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`)}}if("code"in r?r.trackErrors:r.errors!==false){this.errsCount=t.gen.const("_errs",G.default.errors)}}result(t,r,n){this.failResult((0,D.not)(t),r,n)}failResult(t,r,n){this.gen.if(t);if(n)n();else this.error();if(r){this.gen.else();r();if(this.allErrors)this.gen.endIf()}else{if(this.allErrors)this.gen.endIf();else this.gen.else()}}pass(t,r){this.failResult((0,D.not)(t),void 0,r)}fail(t){if(t===void 0){this.error();if(!this.allErrors)this.gen.if(false);return}this.gen.if(t);this.error();if(this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,D._)`${r} !== undefined && (${(0,D.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?wu.reportExtraError:wu.reportError)(this,this.def.error,r)}$dataError(){(0,wu.reportError)(this,this.def.$dataError||wu.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,wu.resetErrorsCount)(this.gen,this.errsCount)}ok(t){if(!this.allErrors)this.gen.if(t)}setParams(t,r){if(r)Object.assign(this.params,t);else this.params=t}block$data(t,r,n=D.nil){this.gen.block(()=>{this.check$data(t,n);r()})}check$data(t=D.nil,r=D.nil){if(!this.$data)return;const{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,D.or)((0,D._)`${o} === undefined`,r));if(t!==D.nil)n.assign(t,true);if(i.length||s.validateSchema){n.elseIf(this.invalid$data());this.$dataError();if(t!==D.nil)n.assign(t,false)}n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,D.or)(s(),a());function s(){if(n.length){if(!(r instanceof D.Name))throw new Error("ajv implementation error");const c=Array.isArray(n)?n:[n];return(0,D._)`${(0,Rd.checkDataTypes)(c,r,i.opts.strictNumbers,Rd.DataType.Wrong)}`}return D.nil}function a(){if(o.validateSchema){const c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,D._)`!${c}(${r})`}return D.nil}}subschema(t,r){const n=(0,Ah.getSubschema)(this.it,t);(0,Ah.extendSubschemaData)(n,this.it,t);(0,Ah.extendSubschemaMode)(n,t);const o={...this.it,...n,items:void 0,props:void 0};Pj(o,r);return o}mergeEvaluated(t,r){const{it:n,gen:o}=this;if(!n.opts.unevaluated)return;if(n.props!==true&&t.props!==void 0){n.props=Mo.mergeEvaluated.props(o,t.props,n.props,r)}if(n.items!==true&&t.items!==void 0){n.items=Mo.mergeEvaluated.items(o,t.items,n.items,r)}}mergeValidEvaluated(t,r){const{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==true||n.items!==true)){o.if(r,()=>this.mergeEvaluated(t,D.Name));return true}}};si.KeywordCxt=Md;function C$(e,t,r,n){const o=new Md(e,r,t);if("code"in r){r.code(o,n)}else if(o.$data&&r.validate){(0,vu.funcKeywordCode)(o,r)}else if("macro"in r){(0,vu.macroKeywordCode)(o,r)}else if(r.compile||r.validate){(0,vu.funcKeywordCode)(o,r)}}var Lj=/^\/(?:[^~]|~0|~1)*$/;var Zj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N$(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o;let i;if(e==="")return G.default.rootData;if(e[0]==="/"){if(!Lj.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e;i=G.default.rootData}else{const u=Zj.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);const l=+u[1];o=u[2];if(o==="#"){if(l>=t)throw new Error(c("property/index",l));return n[t-l]}if(l>t)throw new Error(c("data",l));i=r[t-l];if(!o)return i}let s=i;const a=o.split("/");for(const u of a){if(u){i=(0,D._)`${i}${(0,D.getProperty)((0,Mo.unescapeJsonPointer)(u))}`;s=(0,D._)`${s} && ${i}`}}return s;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}si.getData=N$});var Ed=T(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:true});var Nh=class extends Error{constructor(t){super("validation failed");this.errors=t;this.ajv=this.validation=true}};jh.default=Nh});var Iu=T(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:true});var Fh=bu();var Dh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`);this.missingRef=(0,Fh.resolveUrl)(t,r,n);this.missingSchema=(0,Fh.normalizeId)((0,Fh.getFullPath)(t,this.missingRef))}};qh.default=Dh});var zd=T(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:true});cn.resolveSchema=cn.getCompilingSchema=cn.resolveRef=cn.compileSchema=cn.SchemaEnv=void 0;var kn=se();var Vj=Ed();var ls=Ro();var Pn=bu();var j$=Te();var Kj=$u();var Ma=class{constructor(t){var r;this.refs={};this.dynamicAnchors={};let n;if(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,Pn.normalizeId)(n===null||n===void 0?void 0:n[t.schemaId||"$id"]);this.schemaPath=t.schemaPath;this.localRefs=t.localRefs;this.meta=t.meta;this.$async=n===null||n===void 0?void 0:n.$async;this.refs={}}};cn.SchemaEnv=Ma;function Lh(e){const t=F$.call(this,e);if(t)return t;const r=(0,Pn.getFullPath)(this.opts.uriResolver,e.root.baseId);const{es5:n,lines:o}=this.opts.code;const{ownProperties:i}=this.opts;const s=new kn.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i});let a;if(e.$async){a=s.scopeValue("Error",{ref:Vj.default,code:(0,kn._)`require("ajv/dist/runtime/validation_error").default`})}const c=s.scopeName("validate");e.validateName=c;const u={gen:s,allErrors:this.opts.allErrors,data:ls.default.data,parentData:ls.default.parentData,parentDataProperty:ls.default.parentDataProperty,dataNames:[ls.default.data],dataPathArr:[kn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===true?{ref:e.schema,code:(0,kn.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:kn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,kn._)`""`,opts:this.opts,self:this};let l;try{this._compilations.add(e);(0,Kj.validateFunctionCode)(u);s.optimize(this.opts.code.optimize);const d=s.toString();l=`${s.scopeRefs(ls.default.scope)}return ${d}`;if(this.opts.code.process)l=this.opts.code.process(l,e);const g=new Function(`${ls.default.self}`,`${ls.default.scope}`,l);const h=g(this,this.scope.get());this.scope.value(c,{ref:h});h.errors=null;h.schema=e.schema;h.schemaEnv=e;if(e.$async)h.$async=true;if(this.opts.code.source===true){h.source={validateName:c,validateCode:d,scopeValues:s._values}}if(this.opts.unevaluated){const{props:p,items:f}=u;h.evaluated={props:p instanceof kn.Name?void 0:p,items:f instanceof kn.Name?void 0:f,dynamicProps:p instanceof kn.Name,dynamicItems:f instanceof kn.Name};if(h.source)h.source.evaluated=(0,kn.stringify)(h.evaluated)}e.validate=h;return e}catch(d){delete e.validate;delete e.validateName;if(l)this.logger.error("Error compiling schema, function code:",l);throw d}finally{this._compilations.delete(e)}}cn.compileSchema=Lh;function Bj(e,t,r){var n;r=(0,Pn.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let i=Wj.call(this,e,r);if(i===void 0){const s=(n=e.localRefs)===null||n===void 0?void 0:n[r];const{schemaId:a}=this.opts;if(s)i=new Ma({schema:s,schemaId:a,root:e,baseId:t})}if(i===void 0)return;return e.refs[r]=Gj.call(this,i)}cn.resolveRef=Bj;function Gj(e){if((0,Pn.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Lh.call(this,e)}function F$(e){for(const t of this._compilations){if(Hj(t,e))return t}}cn.getCompilingSchema=F$;function Hj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Wj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||Ad.call(this,e,t)}function Ad(e,t){const r=this.opts.uriResolver.parse(t);const n=(0,Pn._getFullPath)(this.opts.uriResolver,r);let o=(0,Pn.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o){return Uh.call(this,r,e)}const i=(0,Pn.normalizeId)(n);const s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const a=Ad.call(this,e,s);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return Uh.call(this,r,a)}if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;if(!s.validate)Lh.call(this,s);if(i===(0,Pn.normalizeId)(t)){const{schema:a}=s;const{schemaId:c}=this.opts;const u=a[c];if(u)o=(0,Pn.resolveUrl)(this.opts.uriResolver,o,u);return new Ma({schema:a,schemaId:c,root:e,baseId:o})}return Uh.call(this,r,s)}cn.resolveSchema=Ad;var Jj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Uh(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;const c=r[(0,j$.unescapeFragment)(a)];if(c===void 0)return;r=c;const u=typeof r==="object"&&r[this.opts.schemaId];if(!Jj.has(a)&&u){t=(0,Pn.resolveUrl)(this.opts.uriResolver,t,u)}}let i;if(typeof r!="boolean"&&r.$ref&&!(0,j$.schemaHasRulesButRef)(r,this.RULES)){const a=(0,Pn.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Ad.call(this,n,a)}const{schemaId:s}=this.opts;i=i||new Ma({schema:r,schemaId:s,root:n,baseId:t});if(i.schema!==i.root.schema)return i;return void 0}});var D$=T((Ore,Xj)=>{Xj.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:false}});var Hh=T((Rre,B$)=>{"use strict";var Qj=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);var Vh=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);var ds=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);var Kh=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);var U$=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);var Bh=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);var Yj=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);var kr=new Array(256);{const e="0123456789ABCDEF";for(let t=0;t<256;t++){kr[t]="%"+e[t>>4]+e[t&15]}}function or(e){if(e<2048){return kr[192|e>>6]+kr[128|e&63]}if(e<65536){return kr[224|e>>12]+kr[128|e>>6&63]+kr[128|e&63]}return kr[240|e>>18]+kr[128|e>>12&63]+kr[128|e>>6&63]+kr[128|e&63]}function e1(e){let t="";let r=0;let n=0;for(n=0;n<e.length;n++){r=e[n].charCodeAt(0);if(r===48){continue}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++){r=e[n].charCodeAt(0);if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102)){return""}t+=e[n]}return t}var t1=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);var r1=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);var n1=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);var o1=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i1(e){if(e.length===0)return false;for(let t=0;t<e.length;t++){if(n1(e[t]))continue;if(e[t]==="%"&&t+2<e.length&&ds(e.slice(t+1,t+3))){t+=2;continue}return false}return true}function q$(e){let t=-1;let r=0;let n=-1;let o=0;for(let a=0;a<e.length;a++){if(e[a]==="0"){if(n===-1)n=a;o++;if(o>r){r=o;t=n}}else{n=-1;o=0}}if(r<2)return e.join(":");const i=e.slice(0,t).join(":");const s=e.slice(t+r).join(":");return i+"::"+s}function s1(e){const t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return void 0;const r=t===-1?e.split(":"):e.slice(0,t).split(":");const n=t===-1?[]:e.slice(t+2).split(":");if(t!==-1){if(r.length===1&&r[0]==="")r.length=0;if(n.length===1&&n[0]==="")n.length=0}const o=r.concat(n);let i=0;for(let a=0;a<o.length;a++){const c=o[a];if(c==="")return void 0;if(c.indexOf(".")!==-1){if(a!==o.length-1||t!==-1&&n.length===0||!Vh(c))return void 0;i+=2;continue}if(!t1(c))return void 0;o[a]=parseInt(c,16).toString(16);i++}if(t===-1){if(i!==8)return void 0;return q$(o)}if(i>=8)return void 0;const s=o.slice(0,r.length);for(let a=i;a<8;a++)s.push("0");for(let a=r.length;a<o.length;a++)s.push(o[a]);return q$(s)}function Zh(e){const t=e[0]==="["&&e[e.length-1]==="]";const r=e[0]==="["||e[e.length-1]==="]";if(r&&!t)return{host:e,isIPV6:false,error:true};let n=t?e.slice(1,-1):e;if(t&&r1(n)){n=n.toLowerCase();return{host:`[${n}]`,escapedHost:n,isIPV6:false,isIPVFuture:true}}if(a1(n,":")<2){return{host:e,isIPV6:false,error:t}}let o="";const i=n.indexOf("%");if(i!==-1){const a=n.slice(i,i+3).toLowerCase()==="%25"?3:1;o=n.slice(i+a);if(!i1(o))return{host:e,isIPV6:false,error:true};n=n.slice(0,i)}const s=s1(n);if(s===void 0)return{host:e,isIPV6:false,error:true};return{host:s+(o?"%"+o:""),escapedHost:s+(o?"%25"+o:""),isIPV6:true}}function a1(e,t){let r=0;for(let n=0;n<e.length;n++){if(e[n]===t)r++}return r}function c1(e){let t=e;const r=[];let n=-1;let o=0;while(o=t.length){if(o===1){if(t==="."){break}else if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]==="."){break}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(o===3){if(t==="/.."){if(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]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){t=t.slice(3);if(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 u1={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"};var l1=/[@/?#:]/g;var d1=/[@/?#]/g;function L$(e,t){const r=t?d1:l1;r.lastIndex=0;return e.replace(r,n=>u1[n])}function Z$(e,t=false){if(e.indexOf("%")===-1){return e}let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const o=e.slice(n+1,n+3);if(ds(o)){const i=o.toUpperCase();const s=String.fromCharCode(parseInt(i,16));if(t&&Kh(s)){r+=s}else{r+="%"+i}n+=2;continue}}r+=e[n]}return r}function f1(e){let t="";for(let r=0;r<e.length;r++){const n=e[r];if(n==="%"&&r+2<e.length){const o=e.slice(r+1,r+3);if(ds(o)){const i=o.toUpperCase();const s=String.fromCharCode(parseInt(i,16));if(s!=="."&&Kh(s)){t+=s}else{t+="%"+i}r+=2;continue}}if(U$(n)){t+=n}else{const o=e.charCodeAt(r);if(o<128){t+=K$(o)?n:kr[o]}else if(o<55296||o>57343){t+=or(o)}else if(o<=56319&&r+1<e.length){const i=e.charCodeAt(r+1);if(i>=56320&&i<=57343){t+=or(65536+(o-55296<<10)+(i-56320));r++}else{t+=or(65533)}}else{t+=or(65533)}}}return t}function p1(e,t=false){let r="";let n=t&&e[0]!=="/";for(let o=0;o<e.length;o++){const i=e[o];if(i==="%"&&o+2<e.length){const s=e.slice(o+1,o+3);if(ds(s)){r+="%"+s.toUpperCase();o+=2;continue}}if(i==="/"){n=false}if(U$(i)&&(i!==":"||!n)){r+=i}else{const s=e.charCodeAt(o);if(s<128){r+=kr[s]}else if(s<55296||s>57343){r+=or(s)}else if(s<=56319&&o+1<e.length){const a=e.charCodeAt(o+1);if(a>=56320&&a<=57343){r+=or(65536+(s-55296<<10)+(a-56320));o++}else{r+=or(65533)}}else{r+=or(65533)}}}return r}function Gh(e,t){let r="";for(let n=0;n<e.length;n++){const o=e[n];if(o==="%"&&n+2<e.length){const i=e.slice(n+1,n+3);if(ds(i)){r+="%"+i.toUpperCase();n+=2;continue}}if(t(o)){r+=o}else{const i=e.charCodeAt(n);if(i<128){r+=kr[i]}else if(i<55296||i>57343){r+=or(i)}else if(i<=56319&&n+1<e.length){const s=e.charCodeAt(n+1);if(s>=56320&&s<=57343){r+=or(65536+(i-55296<<10)+(s-56320));n++}else{r+=or(65533)}}else{r+=or(65533)}}}return r}function V$(e){return Gh(e,Yj)}function m1(e){return Gh(e,Bh)}function h1(e){return Gh(e,Bh)}function K$(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function g1(e){let t="";for(let r=0;r<e.length;r++){const n=e[r];if(n==="%"&&r+2<e.length){const o=e.slice(r+1,r+3);if(ds(o)){const i=o.toUpperCase();const s=String.fromCharCode(parseInt(i,16));if(Kh(s)){t+=s}else{t+="%"+i}r+=2;continue}}if(Bh(n)){t+=n}else{const o=e.charCodeAt(r);if(o<128){t+=K$(o)?n:kr[o]}else if(o<55296||o>57343){t+=or(o)}else if(o<=56319&&r+1<e.length){const i=e.charCodeAt(r+1);if(i>=56320&&i<=57343){t+=or(65536+(o-55296<<10)+(i-56320));r++}else{t+=or(65533)}}else{t+=or(65533)}}}return t}function y1(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){const n=e.slice(r+1,r+3);if(ds(n)){t+="%"+n.toUpperCase();r+=2;continue}}t+=escape(e[r])}return t}function _1(e){const t=[];if(e.userinfo!==void 0){t.push(V$(e.userinfo));t.push("@")}if(e.host!==void 0){let r=e.host;if(!Vh(r)){let n=Zh(r);if(n.isIPV6!==true&&n.isIPVFuture!==true){r=Z$(r,true);n=Zh(r)}if(n.isIPV6===true||n.isIPVFuture===true){r=`[${n.escapedHost}]`}else{r=L$(r,false)}}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string"){t.push(":");t.push(String(e.port))}return t.length?t.join(""):void 0}B$.exports={nonSimpleDomain:o1,recomposeAuthority:_1,reescapeHostDelimiters:L$,normalizePercentEncoding:Z$,normalizePathEncoding:f1,serializePathEncoding:p1,normalizeQueryFragmentEncoding:g1,encodeUserinfo:V$,encodeQuery:m1,encodeFragment:h1,escapePreservingEscapes:y1,removeDotSegments:c1,isIPv4:Vh,isUUID:Qj,normalizeIPv6:Zh,stringArrayToHexStripped:e1}});var X$=T((Mre,J$)=>{"use strict";var{isUUID:x1}=Hh();var b1=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;var w1=["http","https","ws","wss","urn","urn:uuid"];function v1(e){return w1.indexOf(e)!==-1}function Wh(e){if(e.secure===true){return true}else if(e.secure===false){return false}else if(e.scheme){return 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")}else{return false}}function G$(e){if(!e.host){e.error=e.error||"HTTP URIs must have a host."}return e}function H$(e){const t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port===""){e.port=void 0}if(!e.path){e.path="/"}return e}function $1(e){e.secure=Wh(e);e.resourceName=(e.path||"/")+(e.query?"?"+e.query:"");e.path=void 0;e.query=void 0;return e}function I1(e){if(e.port===(Wh(e)?443:80)||e.port===""){e.port=void 0}if(typeof e.secure==="boolean"){e.scheme=e.secure?"wss":"ws";e.secure=void 0}if(e.resourceName){const t=e.resourceName.indexOf("?");const r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0;e.query=t===-1?void 0:e.resourceName.slice(t+1);e.resourceName=void 0}e.fragment=void 0;return e}function S1(e,t){if(!e.path){e.error="URN can not be parsed";return e}const r=e.path.match(b1);if(r&&r[0]===e.path){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase();e.nss=r[2];const o=`${n}:${t.nid||e.nid}`;const i=Jh(o);e.path=void 0;if(i){e=i.parse(e,t)}}else{e.error=e.error||"URN can not be parsed."}return e}function T1(e,t){if(e.nid===void 0){throw new Error("URN without nid cannot be serialized")}const r=t.scheme||e.scheme||"urn";const n=e.nid.toLowerCase();const o=`${r}:${t.nid||n}`;const i=Jh(o);if(i){e=i.serialize(e,t)}const s=e;const a=e.nss;s.path=`${n||t.nid}:${a}`;t.skipEscape=true;return s}function k1(e,t){const r=e;r.uuid=r.nss;r.nss=void 0;if(!t.tolerant&&(!r.uuid||!x1(r.uuid))){r.error=r.error||"UUID is not valid."}return r}function P1(e){const t=e;t.nss=(e.uuid||"").toLowerCase();return t}var W$={scheme:"http",domainHost:true,parse:G$,serialize:H$};var O1={scheme:"https",domainHost:W$.domainHost,parse:G$,serialize:H$};var Cd={scheme:"ws",domainHost:true,parse:$1,serialize:I1};var R1={scheme:"wss",domainHost:Cd.domainHost,parse:Cd.parse,serialize:Cd.serialize};var M1={scheme:"urn",parse:S1,serialize:T1,skipNormalize:true};var E1={scheme:"urn:uuid",parse:k1,serialize:P1,skipNormalize:true};var Nd={http:W$,https:O1,ws:Cd,wss:R1,urn:M1,"urn:uuid":E1};Object.setPrototypeOf(Nd,null);function Jh(e){return e&&(Nd[e]||Nd[e.toLowerCase()])||void 0}J$.exports={wsIsSecure:Wh,SCHEMES:Nd,isValidSchemeName:v1,getSchemeHandler:Jh}});var Yh=T((Ere,Dd)=>{"use strict";var{normalizeIPv6:rI,removeDotSegments:Tu,recomposeAuthority:A1,normalizePercentEncoding:nI,normalizePathEncoding:z1,serializePathEncoding:Q$,normalizeQueryFragmentEncoding:Y$,encodeQuery:C1,encodeFragment:N1,reescapeHostDelimiters:j1,isIPv4:oI,nonSimpleDomain:F1}=Hh();var{SCHEMES:iI,getSchemeHandler:Xh}=X$();var sI=/^[A-Za-z][A-Za-z0-9+.-]*$/u;var aI="URI scheme is malformed.";function eI(e){const t=unescape(String(e));if(!sI.test(t)){throw new TypeError(aI)}return t}function D1(e,t){if(typeof e==="string"){e=G1(e,t)}else if(typeof e==="object"){e=Fd(fs(e,t),t)}return e}function q1(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"};const{parsed:o,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:u}=jd(e,n);const{parsed:l,malformedAuthorityOrPort:d,malformedPercentEncoding:g,malformedSchemeSpecific:h,malformedHost:p,malformedScheme:f}=jd(t,n);if(i||d||s||g||a||h||c||p||u||f){throw new Error(o.error||l.error||"URI is malformed.")}const m=cI(o,l,n,true);const y=Xh(r&&r.scheme||m.scheme);const x=m.host;const w=x!==void 0&&x!==""&&(oI(x)||rI(x).isIPV6);uI(m,r||{},y,w);const R=x&&x.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(x);if(m.error&&!R){throw new Error(m.error)}n.skipEscape=true;return fs(m,n)}function cI(e,t,r,n){const o={};if(!n){e=Fd(fs(e,r),r);t=Fd(fs(t,r),r)}r=r||{};if(!r.tolerant&&t.scheme){o.scheme=t.scheme;o.userinfo=t.userinfo;o.host=t.host;o.port=t.port;o.path=Tu(t.path||"");o.query=t.query}else{if(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=Tu(t.path||"");o.query=t.query}else{if(!t.path){o.path=e.path;if(t.query!==void 0){o.query=t.query}else{o.query=e.query}}else{if(t.path[0]==="/"){o.path=Tu(t.path)}else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path){o.path="/"+t.path}else if(!e.path){o.path=t.path}else{o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path}o.path=Tu(o.path)}o.query=t.query}o.userinfo=e.userinfo;o.host=e.host;o.port=e.port}o.scheme=e.scheme}o.fragment=t.fragment;return o}function U1(e,t,r){const n=tI(e,r);const o=tI(t,r);return n!==void 0&&o!==void 0&&n===o}function fs(e,t){const 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:""};const n=Object.assign({},t);const o=[];if(r.scheme){r.scheme=eI(r.scheme)}const i=Xh(n.scheme||r.scheme);if(i&&i.serialize)i.serialize(r,n);const s=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0;const a=!n.skipEscape&&r.scheme===void 0&&!s;if(r.path!==void 0){if(!n.skipEscape){r.path=Q$(r.path,a)}else{r.path=nI(r.path)}}if(n.reference!=="suffix"&&r.scheme){r.scheme=eI(r.scheme);o.push(r.scheme,":")}const c=A1(r);if(c!==void 0){if(n.reference!=="suffix"){o.push("//")}o.push(c);if(r.path&&r.path[0]!=="/"){o.push("/")}}if(r.path!==void 0){let u=r.path;if(!n.absolutePath&&(!i||!i.absolutePath)){u=Tu(u)}if(a){u=Q$(u,true)}if(c===void 0&&u[0]==="/"&&u[1]==="/"){u="/%2F"+u.slice(2)}o.push(u)}if(r.query!==void 0){o.push("?",C1(r.query))}if(r.fragment!==void 0){o.push("#",N1(r.fragment))}return o.join("")}var L1=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;var Z1=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/;var V1=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function K1(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."}return void 0}function Su(e){if(e===void 0)return false;let t=e.indexOf("%");while(t!==-1){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3))){return true}t=e.indexOf("%",t+3)}return false}function B1(e){const t=e[4];return Su(e[3])||t!==void 0&&!(t[0]==="["&&t[t.length-1]==="]")&&Su(t)||Su(e[6])||Su(e[7])||Su(e[8])}function uI(e,t,r,n){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&e.host[0]!=="["&&(t.domainHost||r&&r.domainHost)&&n===false&&F1(e.host)){try{e.host=new URL("http://"+e.host).hostname}catch(o){e.error=e.error||"Host's domain name can not be converted to ASCII: "+o;return true}}return false}function jd(e,t){const r=Object.assign({},t);const n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let o=false;let i=false;let s=false;let a=false;let c=false;let u=false;let l=false;if(r.reference==="suffix"){if(r.scheme){e=r.scheme+":"+e}else{e="//"+e}}const d=e.match(Z1);if(d!==null&&d[1].indexOf("\\")!==-1){n.error="URI authority must not contain a literal backslash.";o=true}const g=e.match(V1);if(g!==null){const p=g[1];const f=p.replace(/[\t\n\r]/g,"");if(f.length>=2){if(f.slice(0,2)!=="//"){n.error=n.error||"URI authority must not contain a literal backslash.";o=true}else if(p.length!==f.length){n.error=n.error||"URI authority introducer must not contain whitespace.";o=true}}}const h=e.match(L1);if(h){n.scheme=h[1];n.userinfo=h[3];n.host=h[4];n.port=parseInt(h[5],10);n.path=h[6]||"";n.query=h[7];n.fragment=h[8];if(n.scheme!==void 0){const m=unescape(n.scheme);if(sI.test(m)){n.scheme=m.toLowerCase()}else{n.error=n.error||aI;u=true}}i=B1(h);if(i){n.error=n.error||"URI contains malformed percent-encoding."}if(isNaN(n.port)){n.port=h[5]}const p=K1(n,h);if(p!==void 0){n.error=n.error||p;o=true}if(n.host){const m=oI(n.host);if(m===false){const y=n.host[0]==="["&&n.host[n.host.length-1]==="]";const x=rI(n.host);l=x.isIPV6||x.isIPVFuture===true;c=y&&x.error===true;n.host=l?x.host:x.host.toLowerCase();if(c){n.error=n.error||"URI host is malformed.";o=true}}else{l=true}}if(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"}else if(n.scheme===void 0){n.reference="relative"}else if(n.fragment===void 0){n.reference="absolute"}else{n.reference="uri"}if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference){n.error=n.error||"URI is not a "+r.reference+" reference."}const f=Xh(r.scheme||n.scheme);a=uI(n,r,f,l);if(!f||f&&!f.skipNormalize){if(e.indexOf("%")!==-1){if(n.host!==void 0&&!c){const m=l?n.host:nI(n.host,true);n.host=j1(m,l)}}if(n.path){n.path=z1(n.path)}if(n.query){n.query=Y$(n.query)}if(n.fragment){n.fragment=Y$(n.fragment)}}if(f&&f.parse){f.parse(n,r);if(f===iI.urn&&n.nid===void 0){s=true}}}else{n.error=n.error||"URI can not be parsed."}return{parsed:n,malformedAuthorityOrPort:o,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:a,malformedScheme:u}}function Fd(e,t){return jd(e,t).parsed}function G1(e,t){return lI(e,t).normalized}function lI(e,t){const{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:s,malformedScheme:a}=jd(e,t);return{normalized:n||o||i||s||a?e:fs(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:s,malformedScheme:a}}function tI(e,t){if(typeof e!=="string"&&typeof e!=="object"){return void 0}let r;try{r=typeof e==="string"?e:fs(e,t)}catch{return void 0}const{normalized:n,malformedAuthorityOrPort:o,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:a,malformedScheme:c}=lI(r,t);return o||i||s||a||c?void 0:n}var Qh={SCHEMES:iI,normalize:D1,resolve:q1,resolveComponent:cI,equal:U1,serialize:fs,parse:Fd};Dd.exports=Qh;Dd.exports.default=Qh;Dd.exports.fastUri=Qh});var fI=T(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:true});var dI=Yh();dI.code='require("ajv/dist/runtime/uri").default';eg.default=dI});var bI=T(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:true});Kt.CodeGen=Kt.Name=Kt.nil=Kt.stringify=Kt.str=Kt._=Kt.KeywordCxt=void 0;var H1=$u();Object.defineProperty(Kt,"KeywordCxt",{enumerable:true,get:function(){return H1.KeywordCxt}});var Ea=se();Object.defineProperty(Kt,"_",{enumerable:true,get:function(){return Ea._}});Object.defineProperty(Kt,"str",{enumerable:true,get:function(){return Ea.str}});Object.defineProperty(Kt,"stringify",{enumerable:true,get:function(){return Ea.stringify}});Object.defineProperty(Kt,"nil",{enumerable:true,get:function(){return Ea.nil}});Object.defineProperty(Kt,"Name",{enumerable:true,get:function(){return Ea.Name}});Object.defineProperty(Kt,"CodeGen",{enumerable:true,get:function(){return Ea.CodeGen}});var W1=Ed();var yI=Iu();var J1=$h();var ku=zd();var X1=se();var Pu=bu();var qd=_u();var rg=Te();var pI=D$();var Q1=fI();var _I=(e,t)=>new RegExp(e,t);_I.code="new RegExp";var Y1=["removeAdditional","useDefaults","coerceTypes"];var eF=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]);var tF={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."};var rF={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var mI=200;function nF(e){var t,r,n,o,i,s,a,c,u,l,d,g,h,p,f,m,y,x,w,R,O,Xe,vt,ro,Wi;const vn=e.strict;const Ji=(t=e.code)===null||t===void 0?void 0:t.optimize;const Oc=Ji===true||Ji===void 0?1:Ji||0;const Rc=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:_I;const Dp=(o=e.uriResolver)!==null&&o!==void 0?o:Q1.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:vn)!==null&&s!==void 0?s:true,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:vn)!==null&&c!==void 0?c:true,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:vn)!==null&&l!==void 0?l:"log",strictTuples:(g=(d=e.strictTuples)!==null&&d!==void 0?d:vn)!==null&&g!==void 0?g:"log",strictRequired:(p=(h=e.strictRequired)!==null&&h!==void 0?h:vn)!==null&&p!==void 0?p:false,code:e.code?{...e.code,optimize:Oc,regExp:Rc}:{optimize:Oc,regExp:Rc},loopRequired:(f=e.loopRequired)!==null&&f!==void 0?f:mI,loopEnum:(m=e.loopEnum)!==null&&m!==void 0?m:mI,meta:(y=e.meta)!==null&&y!==void 0?y:true,messages:(x=e.messages)!==null&&x!==void 0?x:true,inlineRefs:(w=e.inlineRefs)!==null&&w!==void 0?w:true,schemaId:(R=e.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(O=e.addUsedSchema)!==null&&O!==void 0?O:true,validateSchema:(Xe=e.validateSchema)!==null&&Xe!==void 0?Xe:true,validateFormats:(vt=e.validateFormats)!==null&&vt!==void 0?vt:true,unicodeRegExp:(ro=e.unicodeRegExp)!==null&&ro!==void 0?ro:true,int32range:(Wi=e.int32range)!==null&&Wi!==void 0?Wi:true,uriResolver:Dp}}var Ou=class{constructor(t={}){this.schemas={};this.refs={};this.formats={};this._compilations=new Set;this._loading={};this._cache=new Map;t=this.opts={...t,...nF(t)};const{es5:r,lines:n}=this.opts.code;this.scope=new X1.ValueScope({scope:{},prefixes:eF,es5:r,lines:n});this.logger=uF(t.logger);const o=t.validateFormats;t.validateFormats=false;this.RULES=(0,J1.getRules)();hI.call(this,tF,t,"NOT SUPPORTED");hI.call(this,rF,t,"DEPRECATED","warn");this._metaOpts=aF.call(this);if(t.formats)iF.call(this);this._addVocabularies();this._addDefaultMetaSchema();if(t.keywords)sF.call(this,t.keywords);if(typeof t.meta=="object")this.addMetaSchema(t.meta);oF.call(this);t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:r,schemaId:n}=this.opts;let o=pI;if(n==="id"){o={...pI};o.id=o.$id;delete o.$id}if(r&&t)this.addMetaSchema(o,o[n],false)}defaultMeta(){const{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"){n=this.getSchema(t);if(!n)throw new Error(`no schema with key or ref "${t}"`)}else{n=this.compile(t)}const o=n(r);if(!("$async"in n))this.errors=n.errors;return o}compile(t,r){const 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")}const{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(l,d){await i.call(this,l.$schema);const g=this._addSchema(l,d);return g.validate||s.call(this,g)}async function i(l){if(l&&!this.getSchema(l)){await o.call(this,{$ref:l},true)}}async function s(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof yI.default))throw d;a.call(this,d);await c.call(this,d.missingSchema);return s.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l]){throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}}async function c(l){const d=await u.call(this,l);if(!this.refs[l])await i.call(this,d.$schema);if(!this.refs[l])this.addSchema(d,l,r)}async function u(l){const d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(const s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t==="object"){const{schemaId:s}=this.opts;i=t[s];if(i!==void 0&&typeof i!="string"){throw new Error(`schema ${s} must be string`)}}r=(0,Pu.normalizeId)(r||i);this._checkUnique(r);this.schemas[r]=this._addSchema(t,n,r,o,true);return this}addMetaSchema(t,r,n=this.opts.validateSchema){this.addSchema(t,r,true,n);return this}validateSchema(t,r){if(typeof t=="boolean")return true;let n;n=t.$schema;if(n!==void 0&&typeof n!="string"){throw new Error("$schema must be a string")}n=n||this.opts.defaultMeta||this.defaultMeta();if(!n){this.logger.warn("meta-schema not available");this.errors=null;return true}const o=this.validate(n,t);if(!o&&r){const 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;while(typeof(r=gI.call(this,t))=="string")t=r;if(r===void 0){const{schemaId:n}=this.opts;const o=new ku.SchemaEnv({schema:{},schemaId:n});r=ku.resolveSchema.call(this,o,t);if(!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp){this._removeAllSchemas(this.schemas,t);this._removeAllSchemas(this.refs,t);return this}switch(typeof t){case"undefined":this._removeAllSchemas(this.schemas);this._removeAllSchemas(this.refs);this._cache.clear();return this;case"string":{const r=gI.call(this,t);if(typeof r=="object")this._cache.delete(r.schema);delete this.schemas[t];delete this.refs[t];return this}case"object":{const r=t;this._cache.delete(r);let n=t[this.opts.schemaId];if(n){n=(0,Pu.normalizeId)(n);delete this.schemas[n];delete this.refs[n]}return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string"){n=t;if(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){r=t;n=r.keyword;if(Array.isArray(n)&&!n.length){throw new Error("addKeywords: keyword must be string or non-empty array")}}else{throw new Error("invalid addKeywords parameters")}dF.call(this,n,r);if(!r){(0,rg.eachItem)(n,i=>tg.call(this,i));return this}pF.call(this,r);const o={...r,type:(0,qd.getJSONTypes)(r.type),schemaType:(0,qd.getJSONTypes)(r.schemaType)};(0,rg.eachItem)(n,o.type.length===0?i=>tg.call(this,i,o):i=>o.type.forEach(s=>tg.call(this,i,o,s)));return this}getKeyword(t){const r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){const{RULES:r}=this;delete r.keywords[t];delete r.all[t];for(const n of r.rules){const o=n.rules.findIndex(i=>i.keyword===t);if(o>=0)n.rules.splice(o,1)}return this}addFormat(t,r){if(typeof r=="string")r=new RegExp(r);this.formats[t]=r;return this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){if(!t||t.length===0)return"No errors";return t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){const n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const o of r){const i=o.split("/").slice(1);let s=t;for(const a of i)s=s[a];for(const a in n){const c=n[a];if(typeof c!="object")continue;const{$data:u}=c.definition;const l=s[a];if(u&&l)s[a]=xI(l)}}return t}_removeAllSchemas(t,r){for(const n in t){const o=t[n];if(!r||r.test(n)){if(typeof o=="string"){delete t[n]}else if(o&&!o.meta){this._cache.delete(o.schema);delete t[n]}}}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s;const{schemaId:a}=this.opts;if(typeof t=="object"){s=t[a]}else{if(this.opts.jtd)throw new Error("schema must be object");else 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,Pu.normalizeId)(s||n);const u=Pu.getSchemaRefs.call(this,t,n);c=new ku.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u});this._cache.set(c.schema,c);if(i&&!n.startsWith("#")){if(n)this._checkUnique(n);this.refs[n]=c}if(o)this.validateSchema(t,true);return 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);else ku.compileSchema.call(this,t);if(!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const r=this.opts;this.opts=this._metaOpts;try{ku.compileSchema.call(this,t)}finally{this.opts=r}}};Ou.ValidationError=W1.default;Ou.MissingRefError=yI.default;Kt.default=Ou;function hI(e,t,r,n="error"){for(const o in e){const i=o;if(i in t)this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function gI(e){e=(0,Pu.normalizeId)(e);return this.schemas[e]||this.refs[e]}function oF(){const e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function iF(){for(const e in this.opts.formats){const t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function sF(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function aF(){const e={...this.opts};for(const t of Y1)delete e[t];return e}var cF={log(){},warn(){},error(){}};function uF(e){if(e===false)return cF;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 lF=/^[a-z_$][a-z0-9_$:-]*$/i;function dF(e,t){const{RULES:r}=this;(0,rg.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lF.test(n))throw new Error(`Keyword ${n} has invalid name`)});if(!t)return;if(t.$data&&!("code"in t||"validate"in t)){throw new Error('$data keyword must have "code" or "validate" function')}}function tg(e,t,r){var n;const o=t===null||t===void 0?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find(({type:c})=>c===r);if(!s){s={type:r,rules:[]};i.rules.push(s)}i.keywords[e]=true;if(!t)return;const a={keyword:e,definition:{...t,type:(0,qd.getJSONTypes)(t.type),schemaType:(0,qd.getJSONTypes)(t.schemaType)}};if(t.before)fF.call(this,s,a,t.before);else s.rules.push(a);i.all[e]=a;(n=t.implements)===null||n===void 0?void 0:n.forEach(c=>this.addKeyword(c))}function fF(e,t,r){const n=e.rules.findIndex(o=>o.keyword===r);if(n>=0){e.rules.splice(n,0,t)}else{e.rules.push(t);this.logger.warn(`rule ${r} is not defined`)}}function pF(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=xI(t);e.validateSchema=this.compile(t,true)}var mF={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function xI(e){return{anyOf:[e,mF]}}});var wI=T(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:true});var hF={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ng.default=hF});var SI=T(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:true});ps.callRef=ps.getValidate=void 0;var gF=Iu();var vI=an();var Pr=se();var Aa=Ro();var $I=zd();var Ud=Te();var yF={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e;const{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n;const{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return d();const l=$I.resolveRef.call(c,u,o,r);if(l===void 0)throw new gF.default(n.opts.uriResolver,o,r);if(l instanceof $I.SchemaEnv)return g(l);return h(l);function d(){if(i===u)return Ld(e,s,i,i.$async);const p=t.scopeValue("root",{ref:u});return Ld(e,(0,Pr._)`${p}.validate`,u,u.$async)}function g(p){const f=II(e,p);Ld(e,f,p,p.$async)}function h(p){const f=t.scopeValue("schema",a.code.source===true?{ref:p,code:(0,Pr.stringify)(p)}:{ref:p});const m=t.name("valid");const y=e.subschema({schema:p,dataTypes:[],schemaPath:Pr.nil,topSchemaRef:f,errSchemaPath:r},m);e.mergeEvaluated(y);e.ok(m)}}};function II(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Pr._)`${r.scopeValue("wrapper",{ref:t})}.validate`}ps.getValidate=II;function Ld(e,t,r,n){const{gen:o,it:i}=e;const{allErrors:s,schemaEnv:a,opts:c}=i;const u=c.passContext?Aa.default.this:Pr.nil;if(n)l();else d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");const p=o.let("valid");o.try(()=>{o.code((0,Pr._)`await ${(0,vI.callValidateCode)(e,t,u)}`);h(t);if(!s)o.assign(p,true)},f=>{o.if((0,Pr._)`!(${f} instanceof ${i.ValidationError})`,()=>o.throw(f));g(f);if(!s)o.assign(p,false)});e.ok(p)}function d(){e.result((0,vI.callValidateCode)(e,t,u),()=>h(t),()=>g(t))}function g(p){const f=(0,Pr._)`${p}.errors`;o.assign(Aa.default.vErrors,(0,Pr._)`${Aa.default.vErrors} === null ? ${f} : ${Aa.default.vErrors}.concat(${f})`);o.assign(Aa.default.errors,(0,Pr._)`${Aa.default.vErrors}.length`)}function h(p){var f;if(!i.opts.unevaluated)return;const m=(f=r===null||r===void 0?void 0:r.validate)===null||f===void 0?void 0:f.evaluated;if(i.props!==true){if(m&&!m.dynamicProps){if(m.props!==void 0){i.props=Ud.mergeEvaluated.props(o,m.props,i.props)}}else{const y=o.var("props",(0,Pr._)`${p}.evaluated.props`);i.props=Ud.mergeEvaluated.props(o,y,i.props,Pr.Name)}}if(i.items!==true){if(m&&!m.dynamicItems){if(m.items!==void 0){i.items=Ud.mergeEvaluated.items(o,m.items,i.items)}}else{const y=o.var("items",(0,Pr._)`${p}.evaluated.items`);i.items=Ud.mergeEvaluated.items(o,y,i.items,Pr.Name)}}}}ps.callRef=Ld;ps.default=yF});var TI=T(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:true});var _F=wI();var xF=SI();var bF=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_F.default,xF.default];og.default=bF});var kI=T(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:true});var Zd=se();var ai=Zd.operators;var Vd={maximum:{okStr:"<=",ok:ai.LTE,fail:ai.GT},minimum:{okStr:">=",ok:ai.GTE,fail:ai.LT},exclusiveMaximum:{okStr:"<",ok:ai.LT,fail:ai.GTE},exclusiveMinimum:{okStr:">",ok:ai.GT,fail:ai.LTE}};var wF={message:({keyword:e,schemaCode:t})=>(0,Zd.str)`must be ${Vd[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Zd._)`{comparison: ${Vd[e].okStr}, limit: ${t}}`};var vF={keyword:Object.keys(Vd),type:"number",schemaType:"number",$data:true,error:wF,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Zd._)`${r} ${Vd[t].fail} ${n} || isNaN(${r})`)}};ig.default=vF});var PI=T(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:true});var Ru=se();var $F={message:({schemaCode:e})=>(0,Ru.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Ru._)`{multipleOf: ${e}}`};var IF={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:$F,code(e){const{gen:t,data:r,schemaCode:n,it:o}=e;const i=o.opts.multipleOfPrecision;const s=t.let("res");const a=i?(0,Ru._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,Ru._)`${s} !== parseInt(${s})`;e.fail$data((0,Ru._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};sg.default=IF});var RI=T(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:true});function OI(e){const t=e.length;let r=0;let n=0;let o;while(n<t){r++;o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<t){o=e.charCodeAt(n);if((o&64512)===56320)n++}}return r}ag.default=OI;OI.code='require("ajv/dist/runtime/ucs2length").default'});var MI=T(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:true});var ms=se();var SF=Te();var TF=RI();var kF={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,ms.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,ms._)`{limit: ${e}}`};var PF={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:kF,code(e){const{keyword:t,data:r,schemaCode:n,it:o}=e;const i=t==="maxLength"?ms.operators.GT:ms.operators.LT;const s=o.opts.unicode===false?(0,ms._)`${r}.length`:(0,ms._)`${(0,SF.useFunc)(e.gen,TF.default)}(${r})`;e.fail$data((0,ms._)`${s} ${i} ${n}`)}};cg.default=PF});var EI=T(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:true});var OF=an();var RF=Te();var za=se();var MF={message:({schemaCode:e})=>(0,za.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,za._)`{pattern: ${e}}`};var EF={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:MF,code(e){const{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;const a=s.opts.unicodeRegExp?"u":"";if(n){const{regExp:c}=s.opts.code;const u=c.code==="new RegExp"?(0,za._)`new RegExp`:(0,RF.useFunc)(t,c);const l=t.let("valid");t.try(()=>t.assign(l,(0,za._)`${u}(${i}, ${a}).test(${r})`),()=>t.assign(l,false));e.fail$data((0,za._)`!${l}`)}else{const c=(0,OF.usePattern)(e,o);e.fail$data((0,za._)`!${c}.test(${r})`)}}};ug.default=EF});var AI=T(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:true});var Mu=se();var AF={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Mu.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Mu._)`{limit: ${e}}`};var zF={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:AF,code(e){const{keyword:t,data:r,schemaCode:n}=e;const o=t==="maxProperties"?Mu.operators.GT:Mu.operators.LT;e.fail$data((0,Mu._)`Object.keys(${r}).length ${o} ${n}`)}};lg.default=zF});var zI=T(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:true});var Eu=an();var Au=se();var CF=Te();var NF={message:({params:{missingProperty:e}})=>(0,Au.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Au._)`{missingProperty: ${e}}`};var jF={keyword:"required",type:"object",schemaType:"array",$data:true,error:NF,code(e){const{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e;const{opts:a}=s;if(!i&&r.length===0)return;const c=r.length>=a.loopRequired;if(s.allErrors)u();else l();if(a.strictRequired){const h=e.parentSchema.properties;const{definedProperties:p}=e.it;for(const f of r){if((h===null||h===void 0?void 0:h[f])===void 0&&!p.has(f)){const m=s.schemaEnv.baseId+s.errSchemaPath;const y=`required property "${f}" is not defined at "${m}" (strictRequired)`;(0,CF.checkStrictMode)(s,y,s.opts.strictRequired)}}}function u(){if(c||i){e.block$data(Au.nil,d)}else{for(const h of r){(0,Eu.checkReportMissingProp)(e,h)}}}function l(){const h=t.let("missing");if(c||i){const p=t.let("valid",true);e.block$data(p,()=>g(h,p));e.ok(p)}else{t.if((0,Eu.checkMissingProp)(e,r,h));(0,Eu.reportMissingProp)(e,h);t.else()}}function d(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h});t.if((0,Eu.noPropertyInData)(t,o,h,a.ownProperties),()=>e.error())})}function g(h,p){e.setParams({missingProperty:h});t.forOf(h,n,()=>{t.assign(p,(0,Eu.propertyInData)(t,o,h,a.ownProperties));t.if((0,Au.not)(p),()=>{e.error();t.break()})},Au.nil)}}};dg.default=jF});var CI=T(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:true});var zu=se();var FF={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,zu.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,zu._)`{limit: ${e}}`};var DF={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:FF,code(e){const{keyword:t,data:r,schemaCode:n}=e;const o=t==="maxItems"?zu.operators.GT:zu.operators.LT;e.fail$data((0,zu._)`${r}.length ${o} ${n}`)}};fg.default=DF});var Kd=T(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:true});var NI=xu();NI.code='require("ajv/dist/runtime/equal").default';pg.default=NI});var jI=T(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:true});var mg=_u();var Bt=se();var qF=Te();var UF=Kd();var LF={message:({params:{i:e,j:t}})=>(0,Bt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Bt._)`{i: ${e}, j: ${t}}`};var ZF={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:LF,code(e){const{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;const c=t.let("valid");const u=i.items?(0,mg.getSchemaTypes)(i.items):[];e.block$data(c,l,(0,Bt._)`${s} === false`);e.ok(c);function l(){const p=t.let("i",(0,Bt._)`${r}.length`);const f=t.let("j");e.setParams({i:p,j:f});t.assign(c,true);t.if((0,Bt._)`${p} > 1`,()=>(d()?g:h)(p,f))}function d(){return u.length>0&&!u.some(p=>p==="object"||p==="array")}function g(p,f){const m=t.name("item");const y=(0,mg.checkDataTypes)(u,m,a.opts.strictNumbers,mg.DataType.Wrong);const x=t.const("indices",(0,Bt._)`{}`);t.for((0,Bt._)`;${p}--;`,()=>{t.let(m,(0,Bt._)`${r}[${p}]`);t.if(y,(0,Bt._)`continue`);if(u.length>1)t.if((0,Bt._)`typeof ${m} == "string"`,(0,Bt._)`${m} += "_"`);t.if((0,Bt._)`typeof ${x}[${m}] == "number"`,()=>{t.assign(f,(0,Bt._)`${x}[${m}]`);e.error();t.assign(c,false).break()}).code((0,Bt._)`${x}[${m}] = ${p}`)})}function h(p,f){const m=(0,qF.useFunc)(t,UF.default);const y=t.name("outer");t.label(y).for((0,Bt._)`;${p}--;`,()=>t.for((0,Bt._)`${f} = ${p}; ${f}--;`,()=>t.if((0,Bt._)`${m}(${r}[${p}], ${r}[${f}])`,()=>{e.error();t.assign(c,false).break(y)})))}}};hg.default=ZF});var FI=T(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:true});var gg=se();var VF=Te();var KF=Kd();var BF={message:"must be equal to constant",params:({schemaCode:e})=>(0,gg._)`{allowedValue: ${e}}`};var GF={keyword:"const",$data:true,error:BF,code(e){const{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;if(n||i&&typeof i=="object"){e.fail$data((0,gg._)`!${(0,VF.useFunc)(t,KF.default)}(${r}, ${o})`)}else{e.fail((0,gg._)`${i} !== ${r}`)}}};yg.default=GF});var DI=T(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:true});var Cu=se();var HF=Te();var WF=Kd();var JF={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Cu._)`{allowedValues: ${e}}`};var XF={keyword:"enum",schemaType:"array",$data:true,error:JF,code(e){const{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");const a=o.length>=s.opts.loopEnum;let c;const u=()=>c!==null&&c!==void 0?c:c=(0,HF.useFunc)(t,WF.default);let l;if(a||n){l=t.let("valid");e.block$data(l,d)}else{if(!Array.isArray(o))throw new Error("ajv implementation error");const h=t.const("vSchema",i);l=(0,Cu.or)(...o.map((p,f)=>g(h,f)))}e.pass(l);function d(){t.assign(l,false);t.forOf("v",i,h=>t.if((0,Cu._)`${u()}(${r}, ${h})`,()=>t.assign(l,true).break()))}function g(h,p){const f=o[p];return typeof f==="object"&&f!==null?(0,Cu._)`${u()}(${r}, ${h}[${p}])`:(0,Cu._)`${r} === ${f}`}}};_g.default=XF});var qI=T(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:true});var QF=kI();var YF=PI();var eD=MI();var tD=EI();var rD=AI();var nD=zI();var oD=CI();var iD=jI();var sD=FI();var aD=DI();var cD=[QF.default,YF.default,eD.default,tD.default,rD.default,nD.default,oD.default,iD.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},sD.default,aD.default];xg.default=cD});var wg=T(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:true});Nu.validateAdditionalItems=void 0;var hs=se();var bg=Te();var uD={message:({params:{len:e}})=>(0,hs.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,hs._)`{limit: ${e}}`};var lD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:uD,code(e){const{parentSchema:t,it:r}=e;const{items:n}=t;if(!Array.isArray(n)){(0,bg.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}UI(e,n)}};function UI(e,t){const{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=true;const a=r.const("len",(0,hs._)`${o}.length`);if(n===false){e.setParams({len:t.length});e.pass((0,hs._)`${a} <= ${t.length}`)}else if(typeof n=="object"&&!(0,bg.alwaysValidSchema)(s,n)){const u=r.var("valid",(0,hs._)`${a} <= ${t.length}`);r.if((0,hs.not)(u),()=>c(u));e.ok(u)}function c(u){r.forRange("i",t.length,a,l=>{e.subschema({keyword:i,dataProp:l,dataPropType:bg.Type.Num},u);if(!s.allErrors)r.if((0,hs.not)(u),()=>r.break())})}}Nu.validateAdditionalItems=UI;Nu.default=lD});var vg=T(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:true});ju.validateTuple=void 0;var LI=se();var Bd=Te();var dD=an();var fD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return ZI(e,"additionalItems",t);r.items=true;if((0,Bd.alwaysValidSchema)(r,t))return;e.ok((0,dD.validateArray)(e))}};function ZI(e,t,r=e.schema){const{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;l(o);if(a.opts.unevaluated&&r.length&&a.items!==true){a.items=Bd.mergeEvaluated.items(n,r.length,a.items)}const c=n.name("valid");const u=n.const("len",(0,LI._)`${i}.length`);r.forEach((d,g)=>{if((0,Bd.alwaysValidSchema)(a,d))return;n.if((0,LI._)`${u} > ${g}`,()=>e.subschema({keyword:s,schemaProp:g,dataProp:g},c));e.ok(c)});function l(d){const{opts:g,errSchemaPath:h}=a;const p=r.length;const f=p===d.minItems&&(p===d.maxItems||d[t]===false);if(g.strictTuples&&!f){const m=`"${s}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,Bd.checkStrictMode)(a,m,g.strictTuples)}}}ju.validateTuple=ZI;ju.default=fD});var VI=T($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:true});var pD=vg();var mD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,pD.validateTuple)(e,"items")};$g.default=mD});var BI=T(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:true});var KI=se();var hD=Te();var gD=an();var yD=wg();var _D={message:({params:{len:e}})=>(0,KI.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,KI._)`{limit: ${e}}`};var xD={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_D,code(e){const{schema:t,parentSchema:r,it:n}=e;const{prefixItems:o}=r;n.items=true;if((0,hD.alwaysValidSchema)(n,t))return;if(o)(0,yD.validateAdditionalItems)(e,o);else e.ok((0,gD.validateArray)(e))}};Ig.default=xD});var GI=T(Sg=>{"use strict";Object.defineProperty(Sg,"__esModule",{value:true});var un=se();var Gd=Te();var bD={message:({params:{min:e,max:t}})=>t===void 0?(0,un.str)`must contain at least ${e} valid item(s)`:(0,un.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,un._)`{minContains: ${e}}`:(0,un._)`{minContains: ${e}, maxContains: ${t}}`};var wD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:bD,code(e){const{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;let s;let a;const{minContains:c,maxContains:u}=n;if(i.opts.next){s=c===void 0?1:c;a=u}else{s=1}const l=t.const("len",(0,un._)`${o}.length`);e.setParams({min:s,max:a});if(a===void 0&&s===0){(0,Gd.checkStrictMode)(i,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(a!==void 0&&s>a){(0,Gd.checkStrictMode)(i,`"minContains" > "maxContains" is always invalid`);e.fail();return}if((0,Gd.alwaysValidSchema)(i,r)){let f=(0,un._)`${l} >= ${s}`;if(a!==void 0)f=(0,un._)`${f} && ${l} <= ${a}`;e.pass(f);return}i.items=true;const d=t.name("valid");if(a===void 0&&s===1){h(d,()=>t.if(d,()=>t.break()))}else if(s===0){t.let(d,true);if(a!==void 0)t.if((0,un._)`${o}.length > 0`,g)}else{t.let(d,false);g()}e.result(d,()=>e.reset());function g(){const f=t.name("_valid");const m=t.let("count",0);h(f,()=>t.if(f,()=>p(m)))}function h(f,m){t.forRange("i",0,l,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:Gd.Type.Num,compositeRule:true},f);m()})}function p(f){t.code((0,un._)`${f}++`);if(a===void 0){t.if((0,un._)`${f} >= ${s}`,()=>t.assign(d,true).break())}else{t.if((0,un._)`${f} > ${a}`,()=>t.assign(d,false).break());if(s===1)t.assign(d,true);else t.if((0,un._)`${f} >= ${s}`,()=>t.assign(d,true))}}}};Sg.default=wD});var JI=T(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:true});co.validateSchemaDeps=co.validatePropertyDeps=co.error=void 0;var Tg=se();var vD=Te();var Fu=an();co.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const n=t===1?"property":"properties";return(0,Tg.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Tg._)`{property: ${e},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{b as u}from"./chunk-
|
|
2
|
+
import{b as u}from"./chunk-WUORF7YS.js";import{e as n}from"./chunk-WHBWI5OQ.js";import{ga as D}from"./chunk-XWNCITOR.js";import{c as i,n as o}from"./chunk-ISBSRM3S.js";function f(e,r=i,t=D){return r(void 0,t())}function m(){return f(n())}function s(e){const r=e.MINIMAX_DATA_DIR?.trim();if(r)return r;const t=e.MAVIS_DATA_DIR?.trim();return t||void 0}function v(e=process.env,r=m){return s(e)??r()}function l(e=m,r=process.env){return v(r,e)}function d(e={}){const r=(e.getBuildEnv??n)();const t=e.profile;const a=l(e.getDefaultDataDir??(t!==void 0?()=>i(void 0,o(t)):()=>f(r)),e.environment??process.env);(e.configureRuntimeEnvironment??u)({dataDir:a});return Promise.resolve(a)}export{f as a,v as b,l as c,d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
|
|
2
|
-
import{b as m}from"./chunk-XSWWOH4F.js";import{x as X}from"./chunk-MVI24MQ2.js";import{L as $,U as A}from"./chunk-5R2PGOIA.js";import{e as I}from"./chunk-FK3SSGJE.js";import{execFile as F}from"node:child_process";import{platform as O,release as W}from"node:os";import{posix as M}from"node:path";import{promisify as V}from"node:util";var j=V(F);async function he(e,n){if(!/^(?:[a-z]:[\\/]|\\\\)/iu.test(e)||O()!=="linux"||!(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP||process.env.WSLENV||/microsoft/iu.test(W()))){return e}try{const{stdout:t}=await j("wslpath",["-a","-u",e],{encoding:"utf8",timeout:1e3,maxBuffer:64*1024,...n?{signal:n}:{}});const r=t.replace(/\r?\n$/u,"");if(!M.isAbsolute(r)||/[\r\n\0]/u.test(r)){throw new Error("wslpath did not return an absolute Linux path.")}return r}catch(t){throw new Error("Could not convert the Windows path with wslpath. Use an accessible Linux path instead.",{cause:t})}}var _=I(X(),1);var q=1e6;var z=1e3;var B=32;var x=/^(?![A-Za-z]:[\\/])(?![\\/])(?!.*(?:^|[\\/])\.\.(?:[\\/]|$))[^\0]+$/u;var L=/^sha256:[a-f0-9]{64}$/u;var G=/^git-blob:[a-f0-9]{40,64}$/u;function ve(e){if(!E(e))return void 0;const n=e.reviewOutcome;return n==="pass"||n==="needs_changes"||n==="failed"?n:void 0}function be(e){const n=e.trim();if(!n.startsWith("<annotation-result")||!n.endsWith("</annotation-result>")){return void 0}try{const t=K(n);R(t,"annotation-result");g(t,["version","source","review-run-id","trigger","mode","verdict"]);if(c(t,"version")!=="2"||c(t,"source")!=="code-review"||c(t,"verdict")!=="needs-changes"||!c(t,"review-run-id")){return void 0}const r=c(t,"trigger");const i=c(t,"mode");if(r!=="slash"&&r!=="natural_language"||i!=="inline"&&i!=="subagent"){return void 0}h(t);T(t,["summary","annotations"]);const s=b(f(t,"summary"));const o=f(t,"annotations");g(o,[]);h(o);if(o.children.some(l=>l.name!=="annotation"))return void 0;const u=o.children.map(U);if(!s||u.length===0)return void 0;return{schemaVersion:1,type:"review.result",scope:"local_changes",verdict:"needs_changes",summary:s,findings:u,mode:i}}catch{return void 0}}function xe(e){const n=e.trim();if(!n)return void 0;return{schemaVersion:1,type:"review.result",scope:"local_changes",verdict:"pass",summary:n,findings:[]}}function Re(e){if(!E(e)||e.schemaVersion!==1||e.type!=="review.result"){return false}if(e.scope!=="local_changes"||e.verdict!=="pass"&&e.verdict!=="needs_changes"||typeof e.summary!=="string"||!e.summary.trim()||!Array.isArray(e.findings)||!e.findings.every(Y)||e.mode!==void 0&&e.mode!=="inline"&&e.mode!=="subagent"){return false}return e.verdict==="pass"?e.findings.length===0:e.findings.length>0}function Te(e){if(e.verdict==="pass")return m(e.summary);return[m(e.summary),...e.findings.flatMap(n=>["",`[${n.priority}] ${m(n.title)}`,m(H(n)),m(n.content)])].join("\n")}function H(e){if(e.targetType==="file")return e.path;const n=e.startLine===e.endLine?String(e.startLine):`${String(e.startLine)}-${String(e.endLine)}`;return`${e.path}:${n}${e.side?` (${e.side})`:""}`}function U(e){R(e,"annotation");g(e,["id","kind","priority"]);if(c(e,"kind")!=="code-review"){throw new Error("annotation kind must be code-review")}const n=c(e,"id");const t=c(e,"priority");if(!n||!S(t))throw new Error("annotation identity is invalid");h(e);T(e,["target","title","content"]);const r=Z(f(e,"target"));const i=b(f(e,"title"));const s=b(f(e,"content"));if(!i||!s)throw new Error("annotation text is empty");return{id:n,priority:t,...r,title:i,content:s}}function Z(e){R(e,"target");const n=c(e,"uri");if(!x.test(n)||c(e,"type")!=="file"){throw new Error("annotation target is invalid")}h(e);if(e.attributes.state==="deleted"){g(e,["type","uri","state","blob-revision"]);if(e.children.length>0||!G.test(c(e,"blob-revision"))){throw new Error("deleted annotation target is invalid")}return{targetType:"file",path:n}}g(e,["type","uri"]);T(e,["selector","related-change"]);const t=f(e,"selector");g(t,["type","side","start-line","end-line","anchor-revision","context-before","context-after"]);h(t);if(t.children.length>0||c(t,"type")!=="line-range"){throw new Error("annotation selector is invalid")}const r=c(t,"side");const i=y(c(t,"start-line"));const s=y(c(t,"end-line"));const o=t.attributes["anchor-revision"];if(r!=="old"&&r!=="new"||s<i||o!==void 0&&!L.test(o)||!k(t.attributes["context-before"])||!k(t.attributes["context-after"])){throw new Error("annotation selector is invalid")}const u=Q(e,"related-change");if(u)J(u);return{targetType:"line-range",path:n,side:r,startLine:i,endLine:s}}function J(e){g(e,["path","side","start-line","end-line","revision"]);h(e);const n=c(e,"path");const t=c(e,"side");const r=y(c(e,"start-line"));const i=y(c(e,"end-line"));if(e.children.length>0||!x.test(n)||t!=="old"&&t!=="new"||i<r||!L.test(c(e,"revision"))){throw new Error("related change is invalid")}}function K(e){if(e.length>q)throw new Error("Review result is too large");let n;let t=false;let r=0;let i="";const s=[];const o=new _.SaxesParser({xmlns:false});o.on("opentag",u=>{r+=1;if(r>z||s.length>=B)t=true;const l={name:u.name,attributes:Object.fromEntries(Object.entries(u.attributes).map(([a,p])=>[a,String(p)])),children:[],text:""};const d=s.at(-1);if(d)d.children.push(l);else if(n)t=true;else n=l;s.push(l)});o.on("text",u=>{const l=s.at(-1);if(l)l.text+=u;else i+=u});o.on("closetag",()=>{s.pop()});o.on("cdata",()=>{t=true});o.on("comment",()=>{t=true});o.on("doctype",()=>{t=true});o.on("processinginstruction",()=>{t=true});o.on("error",()=>{t=true});o.write(e).close();if(t||!n||s.length>0||i.trim()){throw new Error("Review result XML is invalid")}return n}function b(e){g(e,[]);if(e.children.length>0)throw new Error(`${e.name} must contain text only`);return e.text.trim()}function R(e,n){if(e.name!==n)throw new Error(`Expected ${n}`)}function g(e,n){const t=[...n].sort().join("\0");const r=Object.keys(e.attributes).sort().join("\0");if(r!==t)throw new Error(`${e.name} attributes are invalid`)}function h(e){if(e.text.trim())throw new Error(`${e.name} contains unexpected text`)}function T(e,n){const t=new Set(n);if(e.children.some(r=>!t.has(r.name))){throw new Error(`${e.name} contains an unexpected element`)}}function f(e,n){const t=e.children.filter(i=>i.name===n);const r=t[0];if(t.length!==1||!r){throw new Error(`${e.name} must contain one ${n}`)}return r}function Q(e,n){const t=e.children.filter(r=>r.name===n);if(t.length>1)throw new Error(`${e.name} contains duplicate ${n}`);return t[0]}function c(e,n){const t=e.attributes[n];if(t===void 0)throw new Error(`${e.name}.${n} is required`);return t}function y(e){if(!/^[1-9]\d*$/u.test(e))throw new Error("Expected a positive integer");const n=Number(e);if(!Number.isSafeInteger(n))throw new Error("Integer is out of range");return n}function k(e){return e===void 0||/^[0-3]$/u.test(e)}function S(e){return e==="P0"||e==="P1"||e==="P2"||e==="P3"}function Y(e){if(!E(e))return false;if(typeof e.id!=="string"||!e.id||typeof e.priority!=="string"||!S(e.priority)||typeof e.path!=="string"||!x.test(e.path)||typeof e.title!=="string"||!e.title.trim()||typeof e.content!=="string"||!e.content.trim()){return false}if(e.targetType==="file"){return e.side===void 0&&e.startLine===void 0&&e.endLine===void 0}return e.targetType==="line-range"&&(e.side==="old"||e.side==="new")&&typeof e.startLine==="number"&&Number.isSafeInteger(e.startLine)&&e.startLine>0&&typeof e.endLine==="number"&&Number.isSafeInteger(e.endLine)&&e.endLine>=e.startLine}function E(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var N=/<(?:deliver[-_]assets|media|publish[_-]artifact|preview_card|genui-|mavis-widget|mavis-thinking|mavis-progress|think|final|permission-(?:ask|response)|questionnaire-(?:ask|response))\b|^\s*preview_cards?:\s*$/imu;function ke(e){const n=ee(e);if(n.assets.length===0)return n.text;return[n.text,ue(n.assets)].filter(Boolean).join("\n\n")}function ee(e){const n=m(e);if(!n||!N.test(n))return{text:n,assets:[]};const t=$(n);const r=[];const i=[];let s="\uE000mcode-protected";while(n.includes(s))s+="-";let o=false;const u=t.map(a=>{if(a.type==="protected"){const p=r.push(a.content)-1;return`${s}-${p}\uE001`}if(!N.test(a.content)){return a.content}o=true;return te(a.content,i)}).join("");if(!o)return{text:n,assets:[]};let l=de(u);r.forEach((a,p)=>{l=l.replace(`${s}-${p}\uE001`,a)});const d=[...new Map(i.map(a=>[a.path.trim(),a])).values()];return{text:l,assets:d.map(a=>({path:a.path.trim(),...a.name?.trim()?{name:a.name.trim()}:{}}))}}function te(e,n){let t=e;t=w(t,"mavis-thinking");t=w(t,"think");t=ne(t,"mavis-progress");t=w(t,"permission-ask");t=w(t,"permission-response");t=w(t,"questionnaire-ask");t=w(t,"questionnaire-response");t=t.replace(/<\/?final\b[^>]*>/giu,"");t=re(t);t=ie(t);t=se(t);t=ae(t);t=ce(t,n);t=t.replace(/<\/?(?:deliver-assets|deliver_assets)\b[^>]*>/giu,"file attachment").replace(/<media\b[^>]*\/?>/giu,"file attachment").replace(/<media\b[^>]*$/iu,"");return t}function w(e,n){const t=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu");let r=e;let i=e.replace(t,"");while(i!==r){r=i;i=i.replace(t,"")}return i}function ne(e,n){const t=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu");let r=e;let i=e.replace(t,(s,o)=>o.trim());while(i!==r){r=i;i=i.replace(t,(s,o)=>o.trim())}return i}function re(e){const n=/<mavis-widget\b([^>]*)>([\s\S]*?)<\/mavis-widget\s*>/giu;let t=e.replace(n,(r,i,s)=>{const o=/<mavis-fallback\b[^>]*>([\s\S]*?)<\/mavis-fallback\s*>/iu.exec(s)?.[1];if(o?.trim())return o.trim();return P(v(i))});t=t.replace(/<mavis-widget\b([^>]*)>[\s\S]*$/iu,(r,i)=>P(v(i)));return t.replace(/<mavis-widget\b[^>]*$/iu,"Interactive content is loading\u2026")}function P(e){const n=e["kind"]?.trim();const t=e["title"]?.trim();if(n&&t)return`Interactive ${n}: ${t} (open in Desktop).`;if(t)return`Interactive content: ${t} (open in Desktop).`;return"Interactive content available in Desktop."}function ie(e){const n=/<genui-([\w-]+)\b([^>]*)>[\s\S]*?<\/genui-\1\s*>/giu;const t=/<genui-([\w-]+)\b([^>]*?)\/\s*>/giu;let r=e.replace(n,(i,s,o)=>C(s,v(o)));r=r.replace(t,(i,s,o)=>C(s,v(o)));return r.replace(/<genui-[\w-]*\b[^>]*$/iu,"Interactive content is loading\u2026")}function C(e,n){if(e.toLocaleLowerCase()==="mcp-auth"){const t=n["label"]?.trim()||n["server-id"]?.trim();return t?`MCP authorization required: ${t} (open in Desktop).`:"MCP authorization required (open in Desktop)."}if(e.toLocaleLowerCase()==="agent-team-recommendation"){const t=n["status"]?.trim().toLocaleLowerCase();if(t==="accepted")return"Team recommendation accepted.";if(t==="skipped")return"Team recommendation skipped.";return"Team recommendation available in Desktop."}return"Interactive content available in Desktop."}function v(e){const n={};const t=/([\w-]+)\s*=\s*(["'])(.*?)\2/gu;let r;while((r=t.exec(e))!==null){const i=r[1];const s=r[3];if(i&&s!==void 0)n[i]=oe(s)}return n}function se(e){const n=/<(deliver-assets|deliver_assets)\b[^>]*>\s*<\/\1\s*>/giu;let t=e;let r=e.replace(n,"");while(r!==t){t=r;r=r.replace(n,"")}return r}function oe(e){return e.replace(/"/gu,'"').replace(/'|'/gu,"'").replace(/</gu,"<").replace(/>/gu,">").replace(/&/gu,"&")}function ae(e){const n=/<\/?(deliver-assets|deliver_assets)\b[^>]*>/giu;const t=[];let r;while((r=n.exec(e))!==null){t.push({start:r.index,end:n.lastIndex,name:r[1]?.toLocaleLowerCase()??"",closing:r[0].startsWith("</")})}if(t.length===0)return e;const i=[];const s=new Set;t.forEach((l,d)=>{if(!l.closing){i.push(d);return}for(let a=i.length-1;a>=0;a-=1){const p=i[a];if(p===void 0||t[p]?.name!==l.name)continue;i.splice(a,1);s.add(p);s.add(d);return}});if(s.size===t.length)return e;let o=0;let u="";t.forEach((l,d)=>{u+=e.slice(o,l.start);u+=s.has(d)?e.slice(l.start,l.end):"file attachment";o=l.end});return u+e.slice(o)}function ce(e,n){let t=e;for(let r=0;r<3;r+=1){const i=A(t);const s=le(i);t=s.text;if(s.assets.length===0)break;n.push(...s.assets)}return t}function le(e){const n=[];const t=[];for(const r of e){if(r.type==="deliver-assets"||r.type==="image-gallery"){t.push(...r.items)}else if(r.content.trim()){n.push(r.content.trim())}}return{text:n.join("\n\n"),assets:t}}function ue(e){const n=e[0];if(!n)return"";if(e.length===1)return`File: ${D(n)}`;return["Files:",...e.map(t=>`- ${D(t)}`)].join("\n")}function D(e){const n=e.path.trim();const t=e.name?.trim();const r=n.split(/[\\/]/u).filter(Boolean).at(-1);if(!t||t===n||t===r)return n;const i=n?t.indexOf(n):-1;if(i>=0){return t.slice(0,i+n.length).trimEnd()}return`${t} \xB7 ${n}`}function de(e){return e.replace(/[^\S\r\n]+$/gmu,"").replace(/(?:\r?\n[\t ]*){3,}/gu,"\n\n").trim()}export{he as a,ke as b,ee as c,ve as d,be as e,xe as f,Re as g,Te as h};
|
|
2
|
+
import{b as m}from"./chunk-GS7TCNDK.js";import{x as X}from"./chunk-O5EROATK.js";import{L as $,U as A}from"./chunk-3MLT4F77.js";import{e as I}from"./chunk-FK3SSGJE.js";import{execFile as F}from"node:child_process";import{platform as O,release as W}from"node:os";import{posix as M}from"node:path";import{promisify as V}from"node:util";var j=V(F);async function he(e,n){if(!/^(?:[a-z]:[\\/]|\\\\)/iu.test(e)||O()!=="linux"||!(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP||process.env.WSLENV||/microsoft/iu.test(W()))){return e}try{const{stdout:t}=await j("wslpath",["-a","-u",e],{encoding:"utf8",timeout:1e3,maxBuffer:64*1024,...n?{signal:n}:{}});const r=t.replace(/\r?\n$/u,"");if(!M.isAbsolute(r)||/[\r\n\0]/u.test(r)){throw new Error("wslpath did not return an absolute Linux path.")}return r}catch(t){throw new Error("Could not convert the Windows path with wslpath. Use an accessible Linux path instead.",{cause:t})}}var _=I(X(),1);var q=1e6;var z=1e3;var B=32;var x=/^(?![A-Za-z]:[\\/])(?![\\/])(?!.*(?:^|[\\/])\.\.(?:[\\/]|$))[^\0]+$/u;var L=/^sha256:[a-f0-9]{64}$/u;var G=/^git-blob:[a-f0-9]{40,64}$/u;function ve(e){if(!E(e))return void 0;const n=e.reviewOutcome;return n==="pass"||n==="needs_changes"||n==="failed"?n:void 0}function be(e){const n=e.trim();if(!n.startsWith("<annotation-result")||!n.endsWith("</annotation-result>")){return void 0}try{const t=K(n);R(t,"annotation-result");g(t,["version","source","review-run-id","trigger","mode","verdict"]);if(c(t,"version")!=="2"||c(t,"source")!=="code-review"||c(t,"verdict")!=="needs-changes"||!c(t,"review-run-id")){return void 0}const r=c(t,"trigger");const i=c(t,"mode");if(r!=="slash"&&r!=="natural_language"||i!=="inline"&&i!=="subagent"){return void 0}h(t);T(t,["summary","annotations"]);const s=b(f(t,"summary"));const o=f(t,"annotations");g(o,[]);h(o);if(o.children.some(l=>l.name!=="annotation"))return void 0;const u=o.children.map(U);if(!s||u.length===0)return void 0;return{schemaVersion:1,type:"review.result",scope:"local_changes",verdict:"needs_changes",summary:s,findings:u,mode:i}}catch{return void 0}}function xe(e){const n=e.trim();if(!n)return void 0;return{schemaVersion:1,type:"review.result",scope:"local_changes",verdict:"pass",summary:n,findings:[]}}function Re(e){if(!E(e)||e.schemaVersion!==1||e.type!=="review.result"){return false}if(e.scope!=="local_changes"||e.verdict!=="pass"&&e.verdict!=="needs_changes"||typeof e.summary!=="string"||!e.summary.trim()||!Array.isArray(e.findings)||!e.findings.every(Y)||e.mode!==void 0&&e.mode!=="inline"&&e.mode!=="subagent"){return false}return e.verdict==="pass"?e.findings.length===0:e.findings.length>0}function Te(e){if(e.verdict==="pass")return m(e.summary);return[m(e.summary),...e.findings.flatMap(n=>["",`[${n.priority}] ${m(n.title)}`,m(H(n)),m(n.content)])].join("\n")}function H(e){if(e.targetType==="file")return e.path;const n=e.startLine===e.endLine?String(e.startLine):`${String(e.startLine)}-${String(e.endLine)}`;return`${e.path}:${n}${e.side?` (${e.side})`:""}`}function U(e){R(e,"annotation");g(e,["id","kind","priority"]);if(c(e,"kind")!=="code-review"){throw new Error("annotation kind must be code-review")}const n=c(e,"id");const t=c(e,"priority");if(!n||!S(t))throw new Error("annotation identity is invalid");h(e);T(e,["target","title","content"]);const r=Z(f(e,"target"));const i=b(f(e,"title"));const s=b(f(e,"content"));if(!i||!s)throw new Error("annotation text is empty");return{id:n,priority:t,...r,title:i,content:s}}function Z(e){R(e,"target");const n=c(e,"uri");if(!x.test(n)||c(e,"type")!=="file"){throw new Error("annotation target is invalid")}h(e);if(e.attributes.state==="deleted"){g(e,["type","uri","state","blob-revision"]);if(e.children.length>0||!G.test(c(e,"blob-revision"))){throw new Error("deleted annotation target is invalid")}return{targetType:"file",path:n}}g(e,["type","uri"]);T(e,["selector","related-change"]);const t=f(e,"selector");g(t,["type","side","start-line","end-line","anchor-revision","context-before","context-after"]);h(t);if(t.children.length>0||c(t,"type")!=="line-range"){throw new Error("annotation selector is invalid")}const r=c(t,"side");const i=y(c(t,"start-line"));const s=y(c(t,"end-line"));const o=t.attributes["anchor-revision"];if(r!=="old"&&r!=="new"||s<i||o!==void 0&&!L.test(o)||!k(t.attributes["context-before"])||!k(t.attributes["context-after"])){throw new Error("annotation selector is invalid")}const u=Q(e,"related-change");if(u)J(u);return{targetType:"line-range",path:n,side:r,startLine:i,endLine:s}}function J(e){g(e,["path","side","start-line","end-line","revision"]);h(e);const n=c(e,"path");const t=c(e,"side");const r=y(c(e,"start-line"));const i=y(c(e,"end-line"));if(e.children.length>0||!x.test(n)||t!=="old"&&t!=="new"||i<r||!L.test(c(e,"revision"))){throw new Error("related change is invalid")}}function K(e){if(e.length>q)throw new Error("Review result is too large");let n;let t=false;let r=0;let i="";const s=[];const o=new _.SaxesParser({xmlns:false});o.on("opentag",u=>{r+=1;if(r>z||s.length>=B)t=true;const l={name:u.name,attributes:Object.fromEntries(Object.entries(u.attributes).map(([a,p])=>[a,String(p)])),children:[],text:""};const d=s.at(-1);if(d)d.children.push(l);else if(n)t=true;else n=l;s.push(l)});o.on("text",u=>{const l=s.at(-1);if(l)l.text+=u;else i+=u});o.on("closetag",()=>{s.pop()});o.on("cdata",()=>{t=true});o.on("comment",()=>{t=true});o.on("doctype",()=>{t=true});o.on("processinginstruction",()=>{t=true});o.on("error",()=>{t=true});o.write(e).close();if(t||!n||s.length>0||i.trim()){throw new Error("Review result XML is invalid")}return n}function b(e){g(e,[]);if(e.children.length>0)throw new Error(`${e.name} must contain text only`);return e.text.trim()}function R(e,n){if(e.name!==n)throw new Error(`Expected ${n}`)}function g(e,n){const t=[...n].sort().join("\0");const r=Object.keys(e.attributes).sort().join("\0");if(r!==t)throw new Error(`${e.name} attributes are invalid`)}function h(e){if(e.text.trim())throw new Error(`${e.name} contains unexpected text`)}function T(e,n){const t=new Set(n);if(e.children.some(r=>!t.has(r.name))){throw new Error(`${e.name} contains an unexpected element`)}}function f(e,n){const t=e.children.filter(i=>i.name===n);const r=t[0];if(t.length!==1||!r){throw new Error(`${e.name} must contain one ${n}`)}return r}function Q(e,n){const t=e.children.filter(r=>r.name===n);if(t.length>1)throw new Error(`${e.name} contains duplicate ${n}`);return t[0]}function c(e,n){const t=e.attributes[n];if(t===void 0)throw new Error(`${e.name}.${n} is required`);return t}function y(e){if(!/^[1-9]\d*$/u.test(e))throw new Error("Expected a positive integer");const n=Number(e);if(!Number.isSafeInteger(n))throw new Error("Integer is out of range");return n}function k(e){return e===void 0||/^[0-3]$/u.test(e)}function S(e){return e==="P0"||e==="P1"||e==="P2"||e==="P3"}function Y(e){if(!E(e))return false;if(typeof e.id!=="string"||!e.id||typeof e.priority!=="string"||!S(e.priority)||typeof e.path!=="string"||!x.test(e.path)||typeof e.title!=="string"||!e.title.trim()||typeof e.content!=="string"||!e.content.trim()){return false}if(e.targetType==="file"){return e.side===void 0&&e.startLine===void 0&&e.endLine===void 0}return e.targetType==="line-range"&&(e.side==="old"||e.side==="new")&&typeof e.startLine==="number"&&Number.isSafeInteger(e.startLine)&&e.startLine>0&&typeof e.endLine==="number"&&Number.isSafeInteger(e.endLine)&&e.endLine>=e.startLine}function E(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var N=/<(?:deliver[-_]assets|media|publish[_-]artifact|preview_card|genui-|mavis-widget|mavis-thinking|mavis-progress|think|final|permission-(?:ask|response)|questionnaire-(?:ask|response))\b|^\s*preview_cards?:\s*$/imu;function ke(e){const n=ee(e);if(n.assets.length===0)return n.text;return[n.text,ue(n.assets)].filter(Boolean).join("\n\n")}function ee(e){const n=m(e);if(!n||!N.test(n))return{text:n,assets:[]};const t=$(n);const r=[];const i=[];let s="\uE000mcode-protected";while(n.includes(s))s+="-";let o=false;const u=t.map(a=>{if(a.type==="protected"){const p=r.push(a.content)-1;return`${s}-${p}\uE001`}if(!N.test(a.content)){return a.content}o=true;return te(a.content,i)}).join("");if(!o)return{text:n,assets:[]};let l=de(u);r.forEach((a,p)=>{l=l.replace(`${s}-${p}\uE001`,a)});const d=[...new Map(i.map(a=>[a.path.trim(),a])).values()];return{text:l,assets:d.map(a=>({path:a.path.trim(),...a.name?.trim()?{name:a.name.trim()}:{}}))}}function te(e,n){let t=e;t=w(t,"mavis-thinking");t=w(t,"think");t=ne(t,"mavis-progress");t=w(t,"permission-ask");t=w(t,"permission-response");t=w(t,"questionnaire-ask");t=w(t,"questionnaire-response");t=t.replace(/<\/?final\b[^>]*>/giu,"");t=re(t);t=ie(t);t=se(t);t=ae(t);t=ce(t,n);t=t.replace(/<\/?(?:deliver-assets|deliver_assets)\b[^>]*>/giu,"file attachment").replace(/<media\b[^>]*\/?>/giu,"file attachment").replace(/<media\b[^>]*$/iu,"");return t}function w(e,n){const t=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu");let r=e;let i=e.replace(t,"");while(i!==r){r=i;i=i.replace(t,"")}return i}function ne(e,n){const t=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu");let r=e;let i=e.replace(t,(s,o)=>o.trim());while(i!==r){r=i;i=i.replace(t,(s,o)=>o.trim())}return i}function re(e){const n=/<mavis-widget\b([^>]*)>([\s\S]*?)<\/mavis-widget\s*>/giu;let t=e.replace(n,(r,i,s)=>{const o=/<mavis-fallback\b[^>]*>([\s\S]*?)<\/mavis-fallback\s*>/iu.exec(s)?.[1];if(o?.trim())return o.trim();return P(v(i))});t=t.replace(/<mavis-widget\b([^>]*)>[\s\S]*$/iu,(r,i)=>P(v(i)));return t.replace(/<mavis-widget\b[^>]*$/iu,"Interactive content is loading\u2026")}function P(e){const n=e["kind"]?.trim();const t=e["title"]?.trim();if(n&&t)return`Interactive ${n}: ${t} (open in Desktop).`;if(t)return`Interactive content: ${t} (open in Desktop).`;return"Interactive content available in Desktop."}function ie(e){const n=/<genui-([\w-]+)\b([^>]*)>[\s\S]*?<\/genui-\1\s*>/giu;const t=/<genui-([\w-]+)\b([^>]*?)\/\s*>/giu;let r=e.replace(n,(i,s,o)=>C(s,v(o)));r=r.replace(t,(i,s,o)=>C(s,v(o)));return r.replace(/<genui-[\w-]*\b[^>]*$/iu,"Interactive content is loading\u2026")}function C(e,n){if(e.toLocaleLowerCase()==="mcp-auth"){const t=n["label"]?.trim()||n["server-id"]?.trim();return t?`MCP authorization required: ${t} (open in Desktop).`:"MCP authorization required (open in Desktop)."}if(e.toLocaleLowerCase()==="agent-team-recommendation"){const t=n["status"]?.trim().toLocaleLowerCase();if(t==="accepted")return"Team recommendation accepted.";if(t==="skipped")return"Team recommendation skipped.";return"Team recommendation available in Desktop."}return"Interactive content available in Desktop."}function v(e){const n={};const t=/([\w-]+)\s*=\s*(["'])(.*?)\2/gu;let r;while((r=t.exec(e))!==null){const i=r[1];const s=r[3];if(i&&s!==void 0)n[i]=oe(s)}return n}function se(e){const n=/<(deliver-assets|deliver_assets)\b[^>]*>\s*<\/\1\s*>/giu;let t=e;let r=e.replace(n,"");while(r!==t){t=r;r=r.replace(n,"")}return r}function oe(e){return e.replace(/"/gu,'"').replace(/'|'/gu,"'").replace(/</gu,"<").replace(/>/gu,">").replace(/&/gu,"&")}function ae(e){const n=/<\/?(deliver-assets|deliver_assets)\b[^>]*>/giu;const t=[];let r;while((r=n.exec(e))!==null){t.push({start:r.index,end:n.lastIndex,name:r[1]?.toLocaleLowerCase()??"",closing:r[0].startsWith("</")})}if(t.length===0)return e;const i=[];const s=new Set;t.forEach((l,d)=>{if(!l.closing){i.push(d);return}for(let a=i.length-1;a>=0;a-=1){const p=i[a];if(p===void 0||t[p]?.name!==l.name)continue;i.splice(a,1);s.add(p);s.add(d);return}});if(s.size===t.length)return e;let o=0;let u="";t.forEach((l,d)=>{u+=e.slice(o,l.start);u+=s.has(d)?e.slice(l.start,l.end):"file attachment";o=l.end});return u+e.slice(o)}function ce(e,n){let t=e;for(let r=0;r<3;r+=1){const i=A(t);const s=le(i);t=s.text;if(s.assets.length===0)break;n.push(...s.assets)}return t}function le(e){const n=[];const t=[];for(const r of e){if(r.type==="deliver-assets"||r.type==="image-gallery"){t.push(...r.items)}else if(r.content.trim()){n.push(r.content.trim())}}return{text:n.join("\n\n"),assets:t}}function ue(e){const n=e[0];if(!n)return"";if(e.length===1)return`File: ${D(n)}`;return["Files:",...e.map(t=>`- ${D(t)}`)].join("\n")}function D(e){const n=e.path.trim();const t=e.name?.trim();const r=n.split(/[\\/]/u).filter(Boolean).at(-1);if(!t||t===n||t===r)return n;const i=n?t.indexOf(n):-1;if(i>=0){return t.slice(0,i+n.length).trimEnd()}return`${t} \xB7 ${n}`}function de(e){return e.replace(/[^\S\r\n]+$/gmu,"").replace(/(?:\r?\n[\t ]*){3,}/gu,"\n\n").trim()}export{he as a,ke as b,ee as c,ve as d,be as e,xe as f,Re as g,Te as h};
|