likec4 1.25.1 → 1.26.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/__app__/react/likec4.tsx +15 -64
- package/__app__/src/index-iX7kahqQ.js +495 -0
- package/__app__/src/main.js +48934 -3
- package/__app__/src/style.css +1 -1
- package/__app__/webcomponent/webcomponent.js +2 -16
- package/dist/cli/index.mjs +727 -1112
- package/dist/index.d.mts +11 -16022
- package/dist/index.d.ts +11 -16022
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +2 -2
- package/dist/model/index.d.ts +2 -2
- package/dist/shared/likec4.BCmwBuM_.mjs +3682 -0
- package/dist/shared/likec4.D3T36QRo.mjs +354 -0
- package/dist/shared/likec4.Y_4a6gTW.d.mts +2063 -0
- package/dist/shared/likec4.Y_4a6gTW.d.ts +2063 -0
- package/dist/vite-plugin/index.d.mts +48 -0
- package/dist/vite-plugin/index.d.ts +48 -0
- package/dist/vite-plugin/index.mjs +2 -0
- package/package.json +27 -14
- package/react/index.d.ts +10 -1
- package/react/index.js +6489 -5513
- package/vite-plugin-modules.d.ts +88 -0
- package/__app__/src/chunks/-index-overview-CKkCSnRi.js +0 -310
- package/__app__/src/chunks/-view-lazy-data-CI4xD57c.js +0 -9
- package/__app__/src/chunks/index-C6pszJh8.js +0 -495
- package/__app__/src/chunks/likec4-CyM7Z_P_.js +0 -6139
- package/__app__/src/chunks/main-BWk4fT0y.js +0 -25442
- package/__app__/src/chunks/mantine-BYP9_27v.js +0 -13364
- package/__app__/src/chunks/tanstack-router-x-0typxf.js +0 -2925
- package/__app__/src/icons.js +0 -9
- package/dist/shared/likec4.8R_NjvKs.mjs +0 -3608
- /package/react/{style.css → likec4.css} +0 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`).map(
|
|
2
|
+
import{h as tt,k as uh,o as at,q as _s,u as ee,w as lh,r as fh,s as dh,v as St,t as hh,e as Yo,x as Xo,d as ph,L as rt,y as mh,z as nt,l as Jo,A as gh,B as yh,n as _h,D as $h,E as Vt,F as Qo,G as vh,H as sr,I as $s,J as Zo,K as bh,Q as wh}from"../shared/likec4.BCmwBuM_.mjs";import Re,{hrtime as Eh,cwd as vs,exit as ea,stdout as Sh,argv as Rh}from"node:process";import{strictEqual as Ah,notStrictEqual as Oh}from"assert";import bs,{resolve as Ue,dirname as ws,normalize as Ch,relative as Ph,extname as Ih,
|
|
3
|
+
basename as Nh}from"path";import{statSync as ta,readdirSync as Th,readFileSync as Es,writeFile as jh}from"fs";import ra,{format as na,inspect as Lh}from"util";import{fileURLToPath as Dh}from"url";import $e,{resolve as ge,dirname as Rt,join as ir,relative as At,extname as or,isAbsolute as Ss,basename as Nr}from"node:path";import pe,{existsSync as Ot,copyFileSync as sa,readdirSync as xh,rmSync as Rs}from"node:fs";import{mkdtemp as Tr,writeFile as Ct,mkdir as ct,stat as As,copyFile as Mh,rm as kh}from"node:fs/promises";
|
|
4
|
+
import ar,{tmpdir as jr}from"node:os";import{fileURLToPath as ia}from"node:url";import oa from"@vitejs/plugin-react";import{L as Os,J as qh,S as Hh,P as Uh,q as Fh,Y as zh}from"../shared/likec4.D3T36QRo.mjs";import{build as cr,createServer as Vh,preview as Gh}from"vite";import{hasAtLeast as Bh,invariant as Cs,nonexhaustive as aa,delay as ca}from"@likec4/core";import{chromium as ua}from"playwright";import Wh from"node:net";import{setTimeout as Kh}from"node:timers/promises";import{promisify as Ie,
|
|
5
|
+
isDeepStrictEqual as Yh}from"node:util";import ur from"node:crypto";import Xh from"node:assert";import"tty";import"os";import"crypto";import"net";import"child_process";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"@likec4/core/utils";import"boxen";import"node:child_process";import"node:events";import"node:stream/promises";import"fs/promises";import"@likec4/core/model";const Jh={right:np,center:sp},Qh=0,Lr=1,Zh=2,Dr=3;
|
|
6
|
+
class ep{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){const r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);const r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){
|
|
7
|
+
const r=e.split(`
|
|
8
|
+
`).map(s=>s.split(" "));let n=0;return r.forEach(s=>{s.length>1&&De.stringWidth(s[0])>n&&(n=Math.min(Math.floor(this.width*.5),De.stringWidth(s[0])))}),r.forEach(s=>{this.div(...s.map((i,o)=>({text:i.trim(),padding:this.measurePadding(i),width:o===0&&s.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const r=De.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){const e=[];return this.
|
|
9
9
|
rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
|
|
10
|
-
`)}rowToString(e,r){return this.rasterize(e).forEach((n,
|
|
11
|
-
this.renderInline(
|
|
12
|
-
`):i
|
|
13
|
-
`),
|
|
14
|
-
o=>o.width||
|
|
15
|
-
t=t.trim();const r=
|
|
10
|
+
`)}rowToString(e,r){return this.rasterize(e).forEach((n,s)=>{let i="";n.forEach((o,a)=>{const{width:u}=e[a],l=this.negatePadding(e[a]);let c=o;if(l>De.stringWidth(o)&&(c+=" ".repeat(l-De.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){const h=Jh[e[a].align];c=h(c,l),De.stringWidth(c)<l&&(c+=" ".repeat((u||0)-De.stringWidth(c)-1))}const d=e[a].padding||[0,0,0,0];d[Dr]&&(i+=" ".repeat(d[Dr])),i+=la(e[a],c,"| "),i+=c,i+=la(e[a],c," |"),d[Lr]&&(i+=" ".repeat(d[Lr])),s===0&&r.length>0&&(i=
|
|
11
|
+
this.renderInline(i,r[r.length-1]))}),r.push({text:i.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){const n=e.match(/^ */),s=n?n[0].length:0,i=r.text,o=De.stringWidth(i.trimRight());return r.span?this.wrap?s<o?e:(r.hidden=!0,i.trimRight()+" ".repeat(s-o)+e.trimLeft()):(r.hidden=!0,i+e):e}rasterize(e){const r=[],n=this.columnWidths(e);let s;return e.forEach((i,o)=>{i.width=n[o],this.wrap?s=De.wrap(i.text,this.negatePadding(i),{hard:!0}).split(`
|
|
12
|
+
`):s=i.text.split(`
|
|
13
|
+
`),i.border&&(s.unshift("."+"-".repeat(this.negatePadding(i)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(i)+2)+"'")),i.padding&&(s.unshift(...new Array(i.padding[Qh]||0).fill("")),s.push(...new Array(i.padding[Zh]||0).fill(""))),s.forEach((a,u)=>{r[u]||r.push([]);const l=r[u];for(let c=0;c<o;c++)l[c]===void 0&&l.push("");l.push(a)})}),r}negatePadding(e){let r=e.width||0;return e.padding&&(r-=(e.padding[Dr]||0)+(e.padding[Lr]||0)),e.border&&(r-=4),r}columnWidths(e){if(!this.wrap)return e.map(
|
|
14
|
+
o=>o.width||De.stringWidth(o.text));let r=e.length,n=this.width;const s=e.map(o=>{if(o.width)return r--,n-=o.width,o.width}),i=r?Math.floor(n/r):0;return s.map((o,a)=>o===void 0?Math.max(i,tp(e[a])):o)}}function la(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}function tp(t){const e=t.padding||[],r=1+(e[Dr]||0)+(e[Lr]||0);return t.border?r+4:r}function rp(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function np(t,e){
|
|
15
|
+
t=t.trim();const r=De.stringWidth(t);return r<e?" ".repeat(e-r)+t:t}function sp(t,e){t=t.trim();const r=De.stringWidth(t);return r>=e?t:" ".repeat(e-r>>1)+t}let De;function ip(t,e){return De=e,new ep({width:t?.width||rp(),wrap:t?.wrap})}const fa=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function da(t){return t.replace(fa,"")}function op(t,e){const[r,n]=t.match(fa)||["",""];t=da(t);let s="";for(let i=0;i<t.length;i++)i!==0&&i%e===0&&(s+=
|
|
16
16
|
`
|
|
17
|
-
`),
|
|
18
|
-
o=o.toUpperCase()),
|
|
19
|
-
r=null,n=null,
|
|
20
|
-
envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),
|
|
21
|
-
t-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],c=n.envPrefix,d=a["populate--"],h=d?"--":"_",
|
|
22
|
-
configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,p=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[]).forEach(function(
|
|
26
|
-
|
|
27
|
-
match(/^-.\..+=/))V=
|
|
28
|
-
|
|
29
|
-
(
|
|
30
|
-
"--"&&
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return!a["parse-positional-numbers"]&&
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return}
|
|
66
|
-
|
|
67
|
-
c,a,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
keys(
|
|
84
|
-
`:
|
|
85
|
-
`,
|
|
86
|
-
|
|
87
|
-
w=Object.keys(
|
|
88
|
-
(
|
|
89
|
-
(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
`);
|
|
93
|
-
`)}return
|
|
94
|
-
count(
|
|
95
|
-
hiddenOptions.indexOf(
|
|
96
|
-
void 0&&!
|
|
97
|
-
|
|
98
|
-
{text:t,indentation:e}}function
|
|
17
|
+
`),s+=t.charAt(i);return r&&n&&(s=`${r}${s}${n}`),s}function ap(t){return ip(t,{stringWidth:e=>[...e].length,stripAnsi:da,wrap:op})}function cp(t,e){let r=Ue(".",t),n;for(ta(r).isDirectory()||(r=ws(r));;){if(n=e(r,Th(r)),n)return Ue(r,n);if(r=ws(n=r),n===r)break}}function lr(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1;const s=t.match(/^-+/);for(let i=s?s[0].length:0;i<t.length;i++){let o=t.charAt(i);n&&(n=!1,
|
|
18
|
+
o=o.toUpperCase()),i!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(r+=o)}return r}}function ha(t,e){const r=t.toLowerCase();e=e||"-";let n="";for(let s=0;s<t.length;s++){const i=r.charAt(s),o=t.charAt(s);i!==o&&s>0?n+=`${e}${r.charAt(s)}`:n+=o}return n}function pa(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function up(t){if(Array.isArray(t))return t.map(o=>typeof o!="string"?o+"":o);t=t.trim();let e=0,
|
|
19
|
+
r=null,n=null,s=null;const i=[];for(let o=0;o<t.length;o++){if(r=n,n=t.charAt(o),n===" "&&!s){r!==" "&&e++;continue}n===s?s=null:(n==="'"||n==='"')&&!s&&(s=n),i[e]||(i[e]=""),i[e]+=n}return i}var Be;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(Be||(Be={}));let ut;class lp{constructor(e){ut=e}parse(e,r){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,
|
|
20
|
+
envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),s=up(e),i=typeof e=="string",o=fp(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"se\
|
|
21
|
+
t-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],c=n.envPrefix,d=a["populate--"],h=d?"--":"_",y=Object.create(null),b=Object.create(null),_=n.__||ut.format,f={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),
|
|
22
|
+
configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,p=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(P){const T=typeof P=="object"?P.key:P,Z=Object.keys(P).map(function(W){return{boolean:"bools",string:"strings",number:"numbers"}[W]}).filter(Boolean).pop();Z&&(f[Z][T]=!0),f.arrays[T]=!0,f.keys.push(T)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(P){f.
|
|
23
|
+
bools[P]=!0,f.keys.push(P)}),[].concat(n.string||[]).filter(Boolean).forEach(function(P){f.strings[P]=!0,f.keys.push(P)}),[].concat(n.number||[]).filter(Boolean).forEach(function(P){f.numbers[P]=!0,f.keys.push(P)}),[].concat(n.count||[]).filter(Boolean).forEach(function(P){f.counts[P]=!0,f.keys.push(P)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(P){f.normalize[P]=!0,f.keys.push(P)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([P,T])=>{typeof T=="number"&&(f.nargs[P]=
|
|
24
|
+
T,f.keys.push(P))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([P,T])=>{typeof T=="function"&&(f.coercions[P]=T,f.keys.push(P))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(P){f.configs[P]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([P,T])=>{(typeof T=="boolean"||typeof T=="function")&&(f.configs[P]=T)})),M(n.key,o,n.default,f.arrays),Object.keys(u).forEach(function(P){(f.aliases[P]||
|
|
25
|
+
[]).forEach(function(T){u[T]=u[P]})});let m=null;ne();let $=[];const v=Object.assign(Object.create(null),{_:[]}),E={};for(let P=0;P<s.length;P++){const T=s[P],Z=T.replace(/^-{3,}/,"---");let W,N,te,V,re,le;if(T!=="--"&&/^-/.test(T)&&Q(T))S(T);else if(Z.match(/^---+(=|$)/)){S(T);continue}else if(T.match(/^--.+=/)||!a["short-option-groups"]&&T.match(/^-.+=/))V=T.match(/^--?([^=]+)=([\s\S]*)$/),V!==null&&Array.isArray(V)&&V.length>=3&&(w(V[1],f.arrays)?P=F(P,V[1],s,V[2]):w(V[1],f.nargs)!==!1?P=I(P,
|
|
26
|
+
V[1],s,V[2]):B(V[1],V[2],!0));else if(T.match(p)&&a["boolean-negation"])V=T.match(p),V!==null&&Array.isArray(V)&&V.length>=2&&(N=V[1],B(N,w(N,f.arrays)?[!1]:!1));else if(T.match(/^--.+/)||!a["short-option-groups"]&&T.match(/^-[^-]+/))V=T.match(/^--?(.+)/),V!==null&&Array.isArray(V)&&V.length>=2&&(N=V[1],w(N,f.arrays)?P=F(P,N,s):w(N,f.nargs)!==!1?P=I(P,N,s):(re=s[P+1],re!==void 0&&(!re.match(/^-/)||re.match(g))&&!w(N,f.bools)&&!w(N,f.counts)||/^(true|false)$/.test(re)?(B(N,re),P++):B(N,oe(N))));else if(T.
|
|
27
|
+
match(/^-.\..+=/))V=T.match(/^-([^=]+)=([\s\S]*)$/),V!==null&&Array.isArray(V)&&V.length>=3&&B(V[1],V[2]);else if(T.match(/^-.\..+/)&&!T.match(g))re=s[P+1],V=T.match(/^-(.\..+)/),V!==null&&Array.isArray(V)&&V.length>=2&&(N=V[1],re!==void 0&&!re.match(/^-/)&&!w(N,f.bools)&&!w(N,f.counts)?(B(N,re),P++):B(N,oe(N)));else if(T.match(/^-[^-]+/)&&!T.match(g)){te=T.slice(1,-1).split(""),W=!1;for(let _e=0;_e<te.length;_e++){if(re=T.slice(_e+2),te[_e+1]&&te[_e+1]==="="){le=T.slice(_e+3),N=te[_e],w(N,f.arrays)?
|
|
28
|
+
P=F(P,N,s,le):w(N,f.nargs)!==!1?P=I(P,N,s,le):B(N,le),W=!0;break}if(re==="-"){B(te[_e],re);continue}if(/[A-Za-z]/.test(te[_e])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(re)&&w(re,f.bools)===!1){B(te[_e],re),W=!0;break}if(te[_e+1]&&te[_e+1].match(/\W/)){B(te[_e],re),W=!0;break}else B(te[_e],oe(te[_e]))}N=T.slice(-1)[0],!W&&N!=="-"&&(w(N,f.arrays)?P=F(P,N,s):w(N,f.nargs)!==!1?P=I(P,N,s):(re=s[P+1],re!==void 0&&(!/^(-|--)[^-]/.test(re)||re.match(g))&&!w(N,f.bools)&&!w(N,f.counts)||/^(true|false)$/.test(re)?
|
|
29
|
+
(B(N,re),P++):B(N,oe(N))))}else if(T.match(/^-[0-9]$/)&&T.match(g)&&w(T.slice(1),f.bools))N=T.slice(1),B(N,oe(N));else if(T==="--"){$=s.slice(P+1);break}else if(a["halt-at-non-option"]){$=s.slice(P);break}else S(T)}G(v,!0),G(v,!1),x(v),K(),U(v,f.aliases,u,!0),X(v),a["set-placeholder-key"]&&se(v),Object.keys(f.counts).forEach(function(P){A(v,P.split("."))||B(P,0)}),d&&$.length&&(v[h]=[]),$.forEach(function(P){v[h].push(P)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(v).filter(P=>P!==
|
|
30
|
+
"--"&&P.includes("-")).forEach(P=>{delete v[P]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(P=>o[P])).forEach(P=>{a["camel-case-expansion"]&&P.includes("-")&&delete v[P.split(".").map(T=>lr(T)).join(".")],delete v[P]});function S(P){const T=j("_",P);(typeof T=="string"||typeof T=="number")&&v._.push(T)}function I(P,T,Z,W){let N,te=w(T,f.nargs);if(te=typeof te!="number"||isNaN(te)?1:te,te===0)return J(W)||(m=Error(_("Argument unexpected for: %s",T))),B(T,oe(T)),P;let V=J(W)?0:1;if(a["nar\
|
|
31
|
+
gs-eats-options"])Z.length-(P+1)+V<te&&(m=Error(_("Not enough arguments following: %s",T))),V=te;else{for(N=P+1;N<Z.length&&(!Z[N].match(/^-[^0-9]/)||Z[N].match(g)||Q(Z[N]));N++)V++;V<te&&(m=Error(_("Not enough arguments following: %s",T)))}let re=Math.min(V,te);for(!J(W)&&re>0&&(B(T,W),re--),N=P+1;N<re+P+1;N++)B(T,Z[N]);return P+re}function F(P,T,Z,W){let N=[],te=W||Z[P+1];const V=w(T,f.nargs);if(w(T,f.bools)&&!/^(true|false)$/.test(te))N.push(!0);else if(J(te)||J(W)&&/^-/.test(te)&&!g.test(te)&&
|
|
32
|
+
!Q(te)){if(u[T]!==void 0){const re=u[T];N=Array.isArray(re)?re:[re]}}else{J(W)||N.push(k(T,W,!0));for(let re=P+1;re<Z.length&&!(!a["greedy-arrays"]&&N.length>0||V&&typeof V=="number"&&N.length>=V||(te=Z[re],/^-/.test(te)&&!g.test(te)&&!Q(te)));re++)P=re,N.push(k(T,te,i))}return typeof V=="number"&&(V&&N.length<V||isNaN(V)&&N.length===0)&&(m=Error(_("Not enough arguments following: %s",T))),B(T,N),P}function B(P,T,Z=i){if(/-/.test(P)&&a["camel-case-expansion"]){const te=P.split(".").map(function(V){
|
|
33
|
+
return lr(V)}).join(".");D(P,te)}const W=k(P,T,Z),N=P.split(".");z(v,N,W),f.aliases[P]&&f.aliases[P].forEach(function(te){const V=te.split(".");z(v,V,W)}),N.length>1&&a["dot-notation"]&&(f.aliases[N[0]]||[]).forEach(function(te){let V=te.split(".");const re=[].concat(N);re.shift(),V=V.concat(re),(f.aliases[P]||[]).includes(V.join("."))||z(v,V,W)}),w(P,f.normalize)&&!w(P,f.arrays)&&[P].concat(f.aliases[P]||[]).forEach(function(V){Object.defineProperty(E,V,{enumerable:!0,get(){return T},set(re){T=
|
|
34
|
+
typeof re=="string"?ut.normalize(re):re}})})}function D(P,T){f.aliases[P]&&f.aliases[P].length||(f.aliases[P]=[T],y[T]=!0),f.aliases[T]&&f.aliases[T].length||D(T,P)}function k(P,T,Z){Z&&(T=dp(T)),(w(P,f.bools)||w(P,f.counts))&&typeof T=="string"&&(T=T==="true");let W=Array.isArray(T)?T.map(function(N){return j(P,N)}):j(P,T);return w(P,f.counts)&&(J(W)||typeof W=="boolean")&&(W=Ps()),w(P,f.normalize)&&w(P,f.arrays)&&(Array.isArray(T)?W=T.map(N=>ut.normalize(N)):W=ut.normalize(T)),W}function j(P,T){
|
|
35
|
+
return!a["parse-positional-numbers"]&&P==="_"||!w(P,f.strings)&&!w(P,f.bools)&&!Array.isArray(T)&&(pa(T)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${T}`)))||!J(T)&&w(P,f.numbers))&&(T=Number(T)),T}function x(P){const T=Object.create(null);U(T,f.aliases,u),Object.keys(f.configs).forEach(function(Z){const W=P[Z]||T[Z];if(W)try{let N=null;const te=ut.resolve(ut.cwd(),W),V=f.configs[Z];if(typeof V=="function"){try{N=V(te)}catch(re){N=re}if(N instanceof Error){m=N;return}}else N=
|
|
36
|
+
ut.require(te);H(N)}catch(N){N.name==="PermissionDenied"?m=N:P[Z]&&(m=Error(_("Invalid JSON config file: %s",W)))}})}function H(P,T){Object.keys(P).forEach(function(Z){const W=P[Z],N=T?T+"."+Z:Z;typeof W=="object"&&W!==null&&!Array.isArray(W)&&a["dot-notation"]?H(W,N):(!A(v,N.split("."))||w(N,f.arrays)&&a["combine-arrays"])&&B(N,W)})}function K(){typeof l<"u"&&l.forEach(function(P){H(P)})}function G(P,T){if(typeof c>"u")return;const Z=typeof c=="string"?c:"",W=ut.env();Object.keys(W).forEach(function(N){
|
|
37
|
+
if(Z===""||N.lastIndexOf(Z,0)===0){const te=N.split("__").map(function(V,re){return re===0&&(V=V.substring(Z.length)),lr(V)});(T&&f.configs[te.join(".")]||!T)&&!A(P,te)&&B(te.join("."),W[N])}})}function X(P){let T;const Z=new Set;Object.keys(P).forEach(function(W){if(!Z.has(W)&&(T=w(W,f.coercions),typeof T=="function"))try{const N=j(W,T(P[W]));[].concat(f.aliases[W]||[],W).forEach(te=>{Z.add(te),P[te]=N})}catch(N){m=N}})}function se(P){return f.keys.forEach(T=>{~T.indexOf(".")||typeof P[T]>"u"&&
|
|
38
|
+
(P[T]=void 0)}),P}function U(P,T,Z,W=!1){Object.keys(Z).forEach(function(N){A(P,N.split("."))||(z(P,N.split("."),Z[N]),W&&(b[N]=!0),(T[N]||[]).forEach(function(te){A(P,te.split("."))||z(P,te.split("."),Z[N])}))})}function A(P,T){let Z=P;a["dot-notation"]||(T=[T.join(".")]),T.slice(0,-1).forEach(function(N){Z=Z[N]||{}});const W=T[T.length-1];return typeof Z!="object"?!1:W in Z}function z(P,T,Z){let W=P;a["dot-notation"]||(T=[T.join(".")]),T.slice(0,-1).forEach(function(le){le=ma(le),typeof W=="ob\
|
|
39
|
+
ject"&&W[le]===void 0&&(W[le]={}),typeof W[le]!="object"||Array.isArray(W[le])?(Array.isArray(W[le])?W[le].push({}):W[le]=[W[le],{}],W=W[le][W[le].length-1]):W=W[le]});const N=ma(T[T.length-1]),te=w(T.join("."),f.arrays),V=Array.isArray(Z);let re=a["duplicate-arguments-array"];!re&&w(N,f.nargs)&&(re=!0,(!J(W[N])&&f.nargs[N]===1||Array.isArray(W[N])&&W[N].length===f.nargs[N])&&(W[N]=void 0)),Z===Ps()?W[N]=Ps(W[N]):Array.isArray(W[N])?re&&te&&V?W[N]=a["flatten-duplicate-arrays"]?W[N].concat(Z):(Array.
|
|
40
|
+
isArray(W[N][0])?W[N]:[W[N]]).concat([Z]):!re&&!!te==!!V?W[N]=Z:W[N]=W[N].concat([Z]):W[N]===void 0&&te?W[N]=V?Z:[Z]:re&&!(W[N]===void 0||w(N,f.counts)||w(N,f.bools))?W[N]=[W[N],Z]:W[N]=Z}function M(...P){P.forEach(function(T){Object.keys(T||{}).forEach(function(Z){f.aliases[Z]||(f.aliases[Z]=[].concat(o[Z]||[]),f.aliases[Z].concat(Z).forEach(function(W){if(/-/.test(W)&&a["camel-case-expansion"]){const N=lr(W);N!==Z&&f.aliases[Z].indexOf(N)===-1&&(f.aliases[Z].push(N),y[N]=!0)}}),f.aliases[Z].concat(
|
|
41
|
+
Z).forEach(function(W){if(W.length>1&&/[A-Z]/.test(W)&&a["camel-case-expansion"]){const N=ha(W,"-");N!==Z&&f.aliases[Z].indexOf(N)===-1&&(f.aliases[Z].push(N),y[N]=!0)}}),f.aliases[Z].forEach(function(W){f.aliases[W]=[Z].concat(f.aliases[Z].filter(function(N){return W!==N}))}))})})}function w(P,T){const Z=[].concat(f.aliases[P]||[],P),W=Object.keys(T),N=Z.find(te=>W.includes(te));return N?T[N]:!1}function R(P){const T=Object.keys(f);return[].concat(T.map(W=>f[W])).some(function(W){return Array.isArray(
|
|
42
|
+
W)?W.includes(P):W[P]})}function C(P,...T){return[].concat(...T).some(function(W){const N=P.match(W);return N&&R(N[1])})}function Y(P){if(P.match(g)||!P.match(/^-[^-]+/))return!1;let T=!0,Z;const W=P.slice(1).split("");for(let N=0;N<W.length;N++){if(Z=P.slice(N+2),!R(W[N])){T=!1;break}if(W[N+1]&&W[N+1]==="="||Z==="-"||/[A-Za-z]/.test(W[N])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(Z)||W[N+1]&&W[N+1].match(/\W/))break}return T}function Q(P){return a["unknown-options-as-args"]&&ie(P)}function ie(P){return P=
|
|
43
|
+
P.replace(/^-{3,}/,"--"),P.match(g)||Y(P)?!1:!C(P,/^-+([^=]+?)=[\s\S]*$/,p,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function oe(P){return!w(P,f.bools)&&!w(P,f.counts)&&`${P}`in u?u[P]:L(q(P))}function L(P){return{[Be.BOOLEAN]:!0,[Be.STRING]:"",[Be.NUMBER]:void 0,[Be.ARRAY]:[]}[P]}function q(P){let T=Be.BOOLEAN;return w(P,f.strings)?T=Be.STRING:w(P,f.numbers)?T=Be.NUMBER:w(P,f.bools)?T=Be.BOOLEAN:w(P,f.arrays)&&(T=Be.ARRAY),T}function J(P){return P===void 0}function ne(){
|
|
44
|
+
Object.keys(f.counts).find(P=>w(P,f.arrays)?(m=Error(_("Invalid configuration: %s, opts.count excludes opts.array.",P)),!0):w(P,f.nargs)?(m=Error(_("Invalid configuration: %s, opts.count excludes opts.narg.",P)),!0):!1)}return{aliases:Object.assign({},f.aliases),argv:Object.assign(E,v),configuration:a,defaulted:Object.assign({},b),error:m,newAliases:Object.assign({},y)}}}function fp(t){const e=[],r=Object.create(null);let n=!0;for(Object.keys(t).forEach(function(s){e.push([].concat(t[s],s))});n;){
|
|
45
|
+
n=!1;for(let s=0;s<e.length;s++)for(let i=s+1;i<e.length;i++)if(e[s].filter(function(a){return e[i].indexOf(a)!==-1}).length){e[s]=e[s].concat(e[i]),e.splice(i,1),n=!0;break}}return e.forEach(function(s){s=s.filter(function(o,a,u){return u.indexOf(o)===a});const i=s.pop();i!==void 0&&typeof i=="string"&&(r[i]=s)}),r}function Ps(t){return t!==void 0?t+1:1}function ma(t){return t==="__proto__"?"___proto___":t}function dp(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?
|
|
46
|
+
t.substring(1,t.length-1):t}var Is,Ns,Ts;const ga=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,ya=(Ns=(Is=process==null?void 0:process.versions)===null||Is===void 0?void 0:Is.node)!==null&&Ns!==void 0?Ns:(Ts=process==null?void 0:process.version)===null||Ts===void 0?void 0:Ts.slice(1);if(ya&&Number(ya.match(/^([^.]+)/)[1])<ga)throw Error(`yargs parser supports a minimum Node.js version of ${ga}. Read our version support policy: https://git\
|
|
47
|
+
hub.com/yargs/yargs-parser#supported-nodejs-versions`);const hp=process?process.env:{},_a=new lp({cwd:process.cwd,env:()=>hp,format:na,normalize:Ch,resolve:Ue,require:t=>{if(typeof require<"u")return require(t);if(t.match(/\.json$/))return JSON.parse(Es(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),fr=function(e,r){return _a.parse(e.slice(),r).argv};fr.detailed=function(t,e){return _a.parse(t.slice(),e)},fr.camelCase=lr,fr.decamelize=ha,fr.looksLikeNumber=pa;function $a(){
|
|
48
|
+
return pp()?0:1}function pp(){return mp()&&!process.defaultApp}function mp(){return!!process.versions.electron}function gp(t){return t.slice($a()+1)}function yp(){return process.argv[$a()]}class Oe extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}}const _p={fs:{readFileSync:Es,writeFile:jh},format:na,resolve:Ue,exists:t=>{try{return ta(t).isFile()}catch{return!1}}};let We;class $p{constructor(e){e=e||{},this.directory=
|
|
49
|
+
e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const r=e.shift();let n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),
|
|
50
|
+
!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),We.format.apply(We.format,[this.cache[this.locale][r]||r].concat(e))}__n(){const e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),s=e.shift();let i=function(){};typeof e[e.length-1]=="function"&&(i=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=s===1?r:n;this.cache[this.locale][r]&&(o=this.cache[this.locale][r][s===
|
|
51
|
+
1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const a=[o];return~o.indexOf("%d")&&a.push(s),We.format.apply(We.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){
|
|
52
|
+
let n="";return e.forEach(function(s,i){const o=r[i+1];n+=s,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const e=this,r=this.writeQueue[0],n=r.directory,s=r.locale,i=r.cb,o=this._resolveLocaleFile(n,s),a=JSON.stringify(this.cache[s],null,2);We.fs.writeFile(o,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(u)})}_readLocaleFile(){
|
|
53
|
+
let e={};const r=this._resolveLocaleFile(this.directory,this.locale);try{We.fs.readFileSync&&(e=JSON.parse(We.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=We.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){const s=We.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(e){
|
|
54
|
+
return We.exists(e)}}function vp(t,e){We=e;const r=new $p(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}const bp=t=>vp(t,_p),wp="require is not supported by ESM",va="loading a directory of commands is not supported yet for ESM";let dr;try{dr=Dh(import.meta.url)}catch{dr=process.cwd()}const Ep=dr.substring(0,dr.lastIndexOf("node_modules")),Sp={assert:{notStrictEqual:Oh,strictEqual:Ah},cliui:ap,
|
|
55
|
+
findUp:cp,getEnv:t=>process.env[t],inspect:Lh,getCallerFile:()=>{throw new Oe(va)},getProcessArgvBin:yp,mainFilename:Ep||process.cwd(),Parser:fr,path:{basename:Nh,dirname:ws,extname:Ih,relative:Ph,resolve:Ue},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Es,require:()=>{throw new Oe(wp)},requireDirectory:()=>{
|
|
56
|
+
throw new Oe(va)},stringWidth:t=>[...t].length,y18n:bp({directory:Ue(dr,"../../../locales"),updateFiles:!1})};function Ke(t,e,r,n){r.assert.notStrictEqual(t,e,n)}function ba(t,e){e.assert.strictEqual(typeof t,"string")}function xr(t){return Object.keys(t)}function Ae(t){return!!t&&!!t.then&&typeof t.then=="function"}function hr(t){const r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=r.shift();if(!s)throw new Error(`No command found in: ${t}`);const i={cmd:s.replace(n,
|
|
57
|
+
""),demanded:[],optional:[]};return r.forEach((o,a)=>{let u=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===r.length-1&&(u=!0),/^\[/.test(o)?i.optional.push({cmd:o.replace(n,"").split("|"),variadic:u}):i.demanded.push({cmd:o.replace(n,"").split("|"),variadic:u})}),i}const Rp=["first","second","third","fourth","fifth","sixth"];function ce(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[hr(`cmd ${t}`),e,r]}try{let s=0;const[i,o,a]=n(),u=[].slice.call(o);for(;u.length&&
|
|
58
|
+
u[u.length-1]===void 0;)u.pop();const l=a||u.length;if(l<i.demanded.length)throw new Oe(`Not enough arguments provided. Expected ${i.demanded.length} but received ${u.length}.`);const c=i.demanded.length+i.optional.length;if(l>c)throw new Oe(`Too many arguments provided. Expected max ${c} but received ${l}.`);i.demanded.forEach(d=>{const h=u.shift(),y=wa(h);d.cmd.filter(_=>_===y||_==="*").length===0&&Ea(y,d.cmd,s),s+=1}),i.optional.forEach(d=>{if(u.length===0)return;const h=u.shift(),y=wa(h);d.cmd.
|
|
59
|
+
filter(_=>_===y||_==="*").length===0&&Ea(y,d.cmd,s),s+=1})}catch(s){console.warn(s.stack)}}function wa(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function Ea(t,e,r){throw new Oe(`Invalid ${Rp[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}class Ap{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,s=!1){if(ce("<array|function> [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let i=0;i<
|
|
60
|
+
e.length;i++){if(typeof e[i]!="function")throw Error("middleware must be a function");const o=e[i];o.applyBeforeValidation=r,o.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){const i=e;i.applyBeforeValidation=r,i.global=n,i.mutates=s,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,r){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(s=>{const i=[...n[r]||[],r];return s.option?!i.includes(s.option):
|
|
61
|
+
!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}}function Op(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}function pr(t,e,r,n){return r.reduce((s,i)=>{if(i.applyBeforeValidation!==n)return s;if(i.mutates){if(i.applied)return s;i.applied=!0}if(Ae(
|
|
62
|
+
s))return s.then(o=>Promise.all([o,i(o,e)])).then(([o,a])=>Object.assign(o,a));{const o=i(s,e);return Ae(o)?o.then(a=>Object.assign(s,a)):Object.assign(s,o)}},t)}function mr(t,e,r=n=>{throw n}){try{const n=Cp(t)?t():t;return Ae(n)?n.then(s=>e(s)):e(n)}catch(n){return r(n)}}function Cp(t){return typeof t=="function"}function Pp(t){if(typeof require>"u")return null;for(let e=0,r=Object.keys(require.cache),n;e<r.length;e++)if(n=require.cache[r[e]],n.exports===t)return n;return null}const Gt=/(^\*)|(^\$0)/;
|
|
63
|
+
class Ip{constructor(e,r,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,s){s=s||{},typeof s.recurse!="boolean"&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i=typeof s.visit=="function"?s.visit:o=>o;s.visit=(o,a,u)=>{const l=i(o,a,u);if(l){if(this.requireCache.has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory(
|
|
64
|
+
{require:r,filename:n},e,s)}addHandler(e,r,n,s,i,o){let a=[];const u=Op(i);if(s=s||(()=>{}),Array.isArray(e))if(Tp(e))[e,...a]=e;else for(const l of e)this.addHandler(l);else if(Lp(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Sa(n)){this.addHandler([e].concat(a),r,n.builder,n.handler,n.middlewares,n.deprecated);
|
|
65
|
+
return}if(typeof e=="string"){const l=hr(e);a=a.map(h=>hr(h).cmd);let c=!1;const d=[l.cmd].concat(a).filter(h=>Gt.test(h)?(c=!0,!1):!0);d.length===0&&c&&d.push("$0"),c&&(l.cmd=d[0],a=d.slice(1),e=e.replace(Gt,l.cmd)),a.forEach(h=>{this.aliasMap[h]=l.cmd}),r!==!1&&this.usage.command(e,r,c,a,o),this.handlers[l.cmd]={original:e,description:r,handler:s,builder:n||{},middlewares:u,deprecated:o,demanded:l.demanded,optional:l.optional},c&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){
|
|
66
|
+
return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,s,i,o){const a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),c=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));const d=this.applyBuilderUpdateUsageAndParse(c,a,r,n.aliases,l,s,i,o);return Ae(d)?d.then(h=>this.applyMiddlewareAndGetResult(
|
|
67
|
+
c,a,h.innerArgv,u,i,h.aliases,r)):this.applyMiddlewareAndGetResult(c,a,d.innerArgv,u,i,d.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,s,i,o,a,u){const l=r.builder;let c=n;if(js(l)){n.getInternalMethods().getUsageInstance().freeze();const d=l(n.getInternalMethods().reset(s),u);if(Ae(d))return d.then(h=>(c=Xp(h)?h:n,this.parseAndUpdateUsage(e,r,c,i,o,a)))}else jp(l)&&(n.getInternalMethods().getUsageInstance().freeze(),c=n.getInternalMethods().reset(s),Object.keys(r.builder).forEach(d=>{c.option(
|
|
68
|
+
d,l[d])}));return this.parseAndUpdateUsage(e,r,c,i,o,a)}parseAndUpdateUsage(e,r,n,s,i,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,r),r.description);const a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,o);return Ae(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.
|
|
69
|
+
getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){const n=Gt.test(r.original)?r.original.replace(Gt,"").trim():r.original,s=e.filter(i=>!Gt.test(i));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(e,r,n,s,i,o,a,u){if(!o.getInternalMethods().getHasOutput()){const l=o.getInternalMethods().runValidation(i,u,o.parsed.error,e);n=mr(n,c=>(l(c),c))}if(r.handler&&!o.getInternalMethods().
|
|
70
|
+
getHasOutput()){o.getInternalMethods().setHasOutput();const l=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(n,l,!1,!1),n=pr(n,o,a,!1),n=mr(n,c=>{const d=r.handler(c);return Ae(d)?d.then(()=>c):c}),e||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Ae(n)&&!o.getInternalMethods().hasParseCallback()&&n.catch(c=>{try{o.getInternalMethods().getUsageInstance().fail(null,c)}catch{}})}return e||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,s,i,o,a){
|
|
71
|
+
let u={};if(i)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,s,a));const l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),c=pr(n,a,l,!0);return Ae(c)?c.then(d=>this.handleValidationAndGetResult(e,r,d,s,o,a,l,u)):this.handleValidationAndGetResult(e,r,c,s,o,a,l,u)}populatePositionals(e,r,n,s){r._=r._.slice(n.commands.length);const i=e.demanded.slice(0),o=e.optional.slice(0),a={};for(this.validation.positionalCount(i.length,r._.length);i.length;){
|
|
72
|
+
const u=i.shift();this.populatePositional(u,r,a)}for(;o.length;){const u=o.shift();this.populatePositional(u,r,a)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,a,this.cmdToParseOptions(e.original),s),a}populatePositional(e,r,n){const s=e.cmd[0];e.variadic?n[s]=r._.splice(0).map(String):r._.length&&(n[s]=[String(r._.shift())])}cmdToParseOptions(e){const r={array:[],default:{},alias:{},demand:{}},n=hr(e);return n.demanded.forEach(s=>{const[i,...o]=s.cmd;s.variadic&&(r.
|
|
73
|
+
array.push(i),r.default[i]=[]),r.alias[i]=o,r.demand[i]=!0}),n.optional.forEach(s=>{const[i,...o]=s.cmd;s.variadic&&(r.array.push(i),r.default[i]=[]),r.alias[i]=o}),r}postProcessPositionals(e,r,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const l of Object.keys(n.alias))i.alias[l]=(i.alias[l]||[]).concat(n.alias[l]);i.array=i.array.concat(n.array),i.config={};const o=[];if(Object.keys(r).forEach(l=>{r[l].map(c=>{i.configuration["unknown-options-a\
|
|
74
|
+
s-args"]&&(i.key[l]=!0),o.push(`--${l}`),o.push(c)})}),!o.length)return;const a=Object.assign({},i.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(o,Object.assign({},i,{configuration:a}));if(u.error)s.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{const l=Object.keys(r);Object.keys(r).forEach(c=>{l.push(...u.aliases[c])}),Object.keys(u.argv).forEach(c=>{l.includes(c)&&(r[c]||(r[c]=u.argv[c]),!this.isInConfigs(s,c)&&!this.isDefaulted(s,c)&&Object.prototype.
|
|
75
|
+
hasOwnProperty.call(e,c)&&Object.prototype.hasOwnProperty.call(u.argv,c)&&(Array.isArray(e[c])||Array.isArray(u.argv[c]))?e[c]=[].concat(e[c],u.argv[c]):e[c]=u.argv[c])})}}isDefaulted(e,r){const{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){const{configObjects:n}=e.getOptions();return n.some(s=>Object.prototype.hasOwnProperty.call(s,r))||n.some(s=>Object.prototype.hasOwnProperty.call(
|
|
76
|
+
s,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const n=Gt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const r=this.defaultCommand.builder;if(js(r))return r(e,!0);Sa(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}moduleName(e){const r=Pp(e);if(!r)throw new Error(`No \
|
|
77
|
+
command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(r.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:r,desc:n}){for(const s of[e,r,n]){if(typeof s=="string"||s===!1)return s;Ke(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const e=this.frozens.pop();Ke(e,void 0,this.shim),{handlers:this.
|
|
78
|
+
handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function Np(t,e,r,n){return new Ip(t,e,r,n)}function Sa(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}function Tp(t){return t.every(e=>typeof e=="string")}function js(t){return typeof t=="function"}function jp(t){return typeof t=="object"}function Lp(t){return typeof t=="object"&&!Array.isArray(
|
|
79
|
+
t)}function gr(t={},e=()=>!0){const r={};return xr(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function yr(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{const r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function Dp(t){return typeof t=="boolean"}function xp(t,e){const r=e.y18n.__,n={},s=[];n.failFn=function(k){s.push(k)};let i=null,o=null,a=!0;n.showHelpOnFail=function(k=!0,j){const[x,H]=typeof k=="string"?[!0,k]:[k,j];return t.getInternalMethods().
|
|
80
|
+
isGlobalContext()&&(o=H),i=H,a=x,n};let u=!1;n.fail=function(k,j){const x=t.getInternalMethods().getLoggerInstance();if(s.length)for(let H=s.length-1;H>=0;--H){const K=s[H];if(Dp(K)){if(j)throw j;if(k)throw Error(k)}else K(k,j,n)}else{if(t.getExitProcess()&&yr(!0),!u){u=!0,a&&(t.showHelp("error"),x.error()),(k||j)&&x.error(k||j);const H=i||o;H&&((k||j)&&x.error(""),x.error(H))}if(j=j||new Oe(k),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,j);throw j}};
|
|
81
|
+
let l=[],c=!1;n.usage=(D,k)=>D===null?(c=!0,l=[],n):(c=!1,l.push([D,k||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>r("Positionals:");let d=[];n.example=(D,k)=>{d.push([D,k||""])};let h=[];n.command=function(k,j,x,H,K=!1){x&&(h=h.map(G=>(G[2]=!1,G))),h.push([k,j||"",x,H,K])},n.getCommands=()=>h;let y={};n.describe=function(k,j){Array.isArray(k)?k.forEach(x=>{n.describe(x,j)}):typeof k=="object"?Object.keys(k).forEach(x=>{n.describe(x,k[x])}):y[k]=j},n.getDescriptions=
|
|
82
|
+
()=>y;let b=[];n.epilog=D=>{b.push(D)};let _=!1,f;n.wrap=D=>{_=!0,f=D},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(_||(f=I(),_=!0),f);const g="__yargsString__:";n.deferY18nLookup=D=>g+D,n.help=function(){if($)return $;m();const k=t.customScriptName?t.$0:e.path.basename(t.$0),j=t.getDemandedOptions(),x=t.getDemandedCommands(),H=t.getDeprecatedOptions(),K=t.getGroups(),G=t.getOptions();let X=[];X=X.concat(Object.keys(y)),X=X.concat(Object.keys(j)),X=X.concat(Object.keys(x)),X=X.concat(Object.
|
|
83
|
+
keys(G.default)),X=X.filter(E),X=Object.keys(X.reduce((C,Y)=>(Y!=="_"&&(C[Y]=!0),C),{}));const se=n.getWrap(),U=e.cliui({width:se,wrap:!!se});if(!c){if(l.length)l.forEach(C=>{U.div({text:`${C[0].replace(/\$0/g,k)}`}),C[1]&&U.div({text:`${C[1]}`,padding:[1,0,0,0]})}),U.div();else if(h.length){let C=null;x._?C=`${k} <${r("command")}>
|
|
84
|
+
`:C=`${k} [${r("command")}]
|
|
85
|
+
`,U.div(`${C}`)}}if(h.length>1||h.length===1&&!h[0][2]){U.div(r("Commands:"));const C=t.getInternalMethods().getContext(),Y=C.commands.length?`${C.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(h=h.sort((ie,oe)=>ie[0].localeCompare(oe[0])));const Q=k?`${k} `:"";h.forEach(ie=>{const oe=`${Q}${Y}${ie[0].replace(/^\$0 ?/,"")}`;U.span({text:oe,padding:[0,2,0,2],width:p(h,se,`${k}${Y}`)+4},{text:ie[1]});const L=[];ie[2]&&L.push(`[${r("default")}]`),ie[3]&&
|
|
86
|
+
ie[3].length&&L.push(`[${r("aliases:")} ${ie[3].join(", ")}]`),ie[4]&&(typeof ie[4]=="string"?L.push(`[${r("deprecated: %s",ie[4])}]`):L.push(`[${r("deprecated")}]`)),L.length?U.div({text:L.join(" "),padding:[0,0,0,2],align:"right"}):U.div()}),U.div()}const A=(Object.keys(G.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);X=X.filter(C=>!t.parsed.newAliases[C]&&A.every(Y=>(G.alias[Y]||[]).indexOf(C)===-1));const z=r("Options:");K[z]||(K[z]=[]),v(X,G.alias,K,z);const M=C=>/^--/.test(Mr(C)),
|
|
87
|
+
w=Object.keys(K).filter(C=>K[C].length>0).map(C=>{const Y=K[C].filter(E).map(Q=>{if(A.includes(Q))return Q;for(let ie=0,oe;(oe=A[ie])!==void 0;ie++)if((G.alias[oe]||[]).includes(Q))return oe;return Q});return{groupName:C,normalizedKeys:Y}}).filter(({normalizedKeys:C})=>C.length>0).map(({groupName:C,normalizedKeys:Y})=>{const Q=Y.reduce((ie,oe)=>(ie[oe]=[oe].concat(G.alias[oe]||[]).map(L=>C===n.getPositionalGroupName()?L:(/^[0-9]$/.test(L)?G.boolean.includes(oe)?"-":"--":L.length>1?"--":"-")+L).sort(
|
|
88
|
+
(L,q)=>M(L)===M(q)?0:M(L)?1:-1).join(", "),ie),{});return{groupName:C,normalizedKeys:Y,switches:Q}});if(w.filter(({groupName:C})=>C!==n.getPositionalGroupName()).some(({normalizedKeys:C,switches:Y})=>!C.every(Q=>M(Y[Q])))&&w.filter(({groupName:C})=>C!==n.getPositionalGroupName()).forEach(({normalizedKeys:C,switches:Y})=>{C.forEach(Q=>{M(Y[Q])&&(Y[Q]=Mp(Y[Q],4))})}),w.forEach(({groupName:C,normalizedKeys:Y,switches:Q})=>{U.div(C),Y.forEach(ie=>{const oe=Q[ie];let L=y[ie]||"",q=null;L.includes(g)&&
|
|
89
|
+
(L=r(L.substring(g.length))),G.boolean.includes(ie)&&(q=`[${r("boolean")}]`),G.count.includes(ie)&&(q=`[${r("count")}]`),G.string.includes(ie)&&(q=`[${r("string")}]`),G.normalize.includes(ie)&&(q=`[${r("string")}]`),G.array.includes(ie)&&(q=`[${r("array")}]`),G.number.includes(ie)&&(q=`[${r("number")}]`);const J=T=>typeof T=="string"?`[${r("deprecated: %s",T)}]`:`[${r("deprecated")}]`,ne=[ie in H?J(H[ie]):null,q,ie in j?`[${r("required")}]`:null,G.choices&&G.choices[ie]?`[${r("choices:")} ${n.stringifiedValues(
|
|
90
|
+
G.choices[ie])}]`:null,S(G.default[ie],G.defaultDescription[ie])].filter(Boolean).join(" ");U.span({text:Mr(oe),padding:[0,2,0,2+Ra(oe)],width:p(Q,se)+4},L);const P=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;ne&&!P?U.div({text:ne,padding:[0,0,0,2],align:"right"}):U.div()}),U.div()}),d.length&&(U.div(r("Examples:")),d.forEach(C=>{C[0]=C[0].replace(/\$0/g,k)}),d.forEach(C=>{C[1]===""?U.div({text:C[0],padding:[0,2,0,2]}):U.div({text:C[0],padding:[0,2,0,2],width:p(d,se)+4},{text:C[1]})}),
|
|
91
|
+
U.div()),b.length>0){const C=b.map(Y=>Y.replace(/\$0/g,k)).join(`
|
|
92
|
+
`);U.div(`${C}
|
|
93
|
+
`)}return U.toString().replace(/\s*$/,"")};function p(D,k,j){let x=0;return Array.isArray(D)||(D=Object.values(D).map(H=>[H])),D.forEach(H=>{x=Math.max(e.stringWidth(j?`${j} ${Mr(H[0])}`:Mr(H[0]))+Ra(H[0]),x)}),k&&(x=Math.min(x,parseInt((k*.5).toString(),10))),x}function m(){const D=t.getDemandedOptions(),k=t.getOptions();(Object.keys(k.alias)||[]).forEach(j=>{k.alias[j].forEach(x=>{y[x]&&n.describe(j,y[x]),x in D&&t.demandOption(j,D[x]),k.boolean.includes(x)&&t.boolean(j),k.count.includes(x)&&t.
|
|
94
|
+
count(j),k.string.includes(x)&&t.string(j),k.normalize.includes(x)&&t.normalize(j),k.array.includes(x)&&t.array(j),k.number.includes(x)&&t.number(j)})})}let $;n.cacheHelpMessage=function(){$=this.help()},n.clearCachedHelpMessage=function(){$=void 0},n.hasCachedHelpMessage=function(){return!!$};function v(D,k,j,x){let H=[],K=null;return Object.keys(j).forEach(G=>{H=H.concat(j[G])}),D.forEach(G=>{K=[G].concat(k[G]),K.some(X=>H.indexOf(X)!==-1)||j[x].push(G)}),H}function E(D){return t.getOptions().
|
|
95
|
+
hiddenOptions.indexOf(D)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=D=>{const k=t.getInternalMethods().getLoggerInstance();D||(D="error"),(typeof D=="function"?D:k[D])(n.help())},n.functionDescription=D=>["(",D.name?e.Parser.decamelize(D.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(k,j){let x="";const H=j||", ",K=[].concat(k);return!k||!K.length||K.forEach(G=>{x.length&&(x+=H),x+=JSON.stringify(G)}),x};function S(D,k){let j=`[${r("default:")} `;if(D===
|
|
96
|
+
void 0&&!k)return null;if(k)j+=k;else switch(typeof D){case"string":j+=`"${D}"`;break;case"object":j+=JSON.stringify(D);break;default:j+=D}return`${j}]`}function I(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let F=null;n.version=D=>{F=D},n.showVersion=D=>{const k=t.getInternalMethods().getLoggerInstance();D||(D="error"),(typeof D=="function"?D:k[D])(F)},n.reset=function(k){return i=null,u=!1,l=[],c=!1,b=[],d=[],h=[],y=gr(y,j=>!k[j]),n};const B=[];return n.freeze=function(){
|
|
97
|
+
B.push({failMessage:i,failureOutput:u,usages:l,usageDisabled:c,epilogs:b,examples:d,commands:h,descriptions:y})},n.unfreeze=function(k=!1){const j=B.pop();j&&(k?(y={...j.descriptions,...y},h=[...j.commands,...h],l=[...j.usages,...l],d=[...j.examples,...d],b=[...j.epilogs,...b]):{failMessage:i,failureOutput:u,usages:l,usageDisabled:c,epilogs:b,examples:d,commands:h,descriptions:y}=j)},n}function Ls(t){return typeof t=="object"}function Mp(t,e){return Ls(t)?{text:t.text,indentation:t.indentation+e}:
|
|
98
|
+
{text:t,indentation:e}}function Ra(t){return Ls(t)?t.indentation:0}function Mr(t){return Ls(t)?t.text:t}const kp=`###-begin-{{app_name}}-completions-###
|
|
99
99
|
#
|
|
100
100
|
# yargs command completion script
|
|
101
101
|
#
|
|
@@ -123,7 +123,7 @@ _{{app_name}}_yargs_completions()
|
|
|
123
123
|
}
|
|
124
124
|
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
|
125
125
|
###-end-{{app_name}}-completions-###
|
|
126
|
-
`,
|
|
126
|
+
`,qp=`#compdef {{app_name}}
|
|
127
127
|
###-begin-{{app_name}}-completions-###
|
|
128
128
|
#
|
|
129
129
|
# yargs command completion script
|
|
@@ -142,92 +142,92 @@ _{{app_name}}_yargs_completions()
|
|
|
142
142
|
}
|
|
143
143
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
144
144
|
###-end-{{app_name}}-completions-###
|
|
145
|
-
`;class
|
|
146
|
-
length;a<u;++a)if(
|
|
147
|
-
r)&&this.usage.getCommands().forEach(
|
|
148
|
-
includes(a)&&!this.argsContainKey(r,a,u)&&this.completeOptionKey(a,e,
|
|
149
|
-
getContext().commands.length+1),a=
|
|
150
|
-
isArray(
|
|
151
|
-
void 0?void 0:this.aliases)===null||
|
|
152
|
-
shim),
|
|
153
|
-
o=>this.customCompletion(e,o,n,r):o=>this.defaultCompletion(e,o,n,r);return
|
|
154
|
-
return t.length>3}function
|
|
155
|
-
function
|
|
156
|
-
h._.min.toString()))
|
|
157
|
-
function(d,h){let
|
|
158
|
-
${
|
|
159
|
-
`)}`:"";e.fail(
|
|
160
|
-
h)&&p.push(
|
|
161
|
-
getCommandInstance().getCommands(),
|
|
162
|
-
function(d){const h=t.getOptions(),
|
|
163
|
-
${n("Argument: %s, Given: %s, Choices: %s",f,e.stringifiedValues(
|
|
164
|
-
ber"?d=c._.length>=d:d.match(/^--no-.+/)?(d=d.match(/^--no-(.+)/)[1],d=!Object.prototype.hasOwnProperty.call(c,d)):d=Object.prototype.hasOwnProperty.call(c,d),d}
|
|
165
|
-
`;h.forEach(
|
|
166
|
-
getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(h=>{u[h].forEach(
|
|
167
|
-
freeze=function(){l.push({implied:o,conflicting:u})},
|
|
168
|
-
|
|
169
|
-
if(n==="a"&&!
|
|
170
|
-
id not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fe,
|
|
171
|
-
"getDollarZero"),
|
|
172
|
-
"getContext"),
|
|
173
|
-
this,void 0),
|
|
174
|
-
|
|
175
|
-
"[string|boolean] [string]",[e,r],arguments.length),
|
|
176
|
-
n),this.describe(n,r||
|
|
177
|
-
return ce("<function> [boolean]",[e,r],arguments.length),this.middleware((n,
|
|
178
|
-
if(ce("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new
|
|
179
|
-
a;const u=
|
|
180
|
-
f")),
|
|
181
|
-
script"),this.command(
|
|
182
|
-
"f").getCallerFile(),r),this}count(e){return ce("<array|string>",[e],arguments.length),this[
|
|
183
|
-
return this.default(e,r,n)}demandCommand(e=1,r,n,
|
|
184
|
-
Array.isArray(e)?e.forEach(
|
|
185
|
-
ing]",[e,r],arguments.length),this[
|
|
186
|
-
e)?e.forEach(n=>this.example(...n)):
|
|
187
|
-
return ce("<array> [function]",[e,r],arguments.length),r?
|
|
188
|
-
"f"),
|
|
189
|
-
|
|
190
|
-
return ce("<string>",[e],arguments.length),
|
|
191
|
-
length),this[
|
|
145
|
+
`;class Hp{constructor(e,r,n,s){var i,o,a;this.yargs=e,this.usage=r,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((i=this.shim.getEnv("SHELL"))===null||i===void 0?void 0:i.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,r,n,s){const i=this.command.getCommandHandlers();for(let a=0,u=e.
|
|
146
|
+
length;a<u;++a)if(i[e[a]]&&i[e[a]].builder){const l=i[e[a]].builder;if(js(l)){this.indexAfterLastReset=a+1;const c=this.yargs.getInternalMethods().reset();return l(c,!0),c.argv}}const o=[];this.commandCompletions(o,e,n),this.optionCompletions(o,e,r,n),this.choicesFromOptionsCompletions(o,e,r,n),this.choicesFromPositionalsCompletions(o,e,r,n),s(null,o)}commandCompletions(e,r,n){const s=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&s[s.length-1]!==n&&!this.previousArgHasChoices(
|
|
147
|
+
r)&&this.usage.getCommands().forEach(i=>{const o=hr(i[0]).cmd;if(r.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{const a=i[1]||"";e.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,r,n,s){if((s.match(/^-/)||s===""&&e.length===0)&&!this.previousArgHasChoices(r)){const i=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(i.key).forEach(a=>{const u=!!i.configuration["boolean-negation"]&&i.boolean.includes(a);!o.includes(a)&&!i.hiddenOptions.
|
|
148
|
+
includes(a)&&!this.argsContainKey(r,a,u)&&this.completeOptionKey(a,e,s,u&&!!i.default[a])})}}choicesFromOptionsCompletions(e,r,n,s){if(this.previousArgHasChoices(r)){const i=this.getPreviousArgChoices(r);i&&i.length>0&&e.push(...i.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,s){if(s===""&&e.length>0&&this.previousArgHasChoices(r))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().
|
|
149
|
+
getContext().commands.length+1),a=i[n._.length-o-1];if(!a)return;const u=this.yargs.getOptions().choices[a]||[];for(const l of u)l.startsWith(s)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;const s=r.replace(/^-+/,""),i=this.yargs.getOptions(),o=[s,...this.yargs.getAliases()[s]||[]];let a;for(const u of o)if(Object.prototype.hasOwnProperty.call(i.key,u)&&Array.
|
|
150
|
+
isArray(i.choices[u])){a=i.choices[u];break}if(a)return a.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){const r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){const s=i=>e.indexOf((/^[^0-9]$/.test(i)?"-":"--")+i)!==-1;if(s(r)||n&&s(`no-${r}`))return!0;if(this.aliases){for(const i of this.aliases[r])if(s(i))return!0}return!1}completeOptionKey(e,r,n,s){var i,o,a,u;let l=e;if(this.zshShell){const y=this.usage.getDescriptions(),b=(o=(i=this===null||this===
|
|
151
|
+
void 0?void 0:this.aliases)===null||i===void 0?void 0:i[e])===null||o===void 0?void 0:o.find(g=>{const p=y[g];return typeof p=="string"&&p.length>0}),_=b?y[b]:void 0,f=(u=(a=y[e])!==null&&a!==void 0?a:_)!==null&&u!==void 0?u:"";l=`${e.replace(/:/g,"\\:")}:${f.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const c=y=>/^--/.test(y),d=y=>/^[^0-9]$/.test(y),h=!c(n)&&d(e)?"-":"--";r.push(h+l),s&&r.push(h+"no-"+l)}customCompletion(e,r,n,s){if(Ke(this.customCompletionFunction,null,this.
|
|
152
|
+
shim),Fp(this.customCompletionFunction)){const i=this.customCompletionFunction(n,r);return Ae(i)?i.then(o=>{this.shim.process.nextTick(()=>{s(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{s(o,void 0)})}):s(null,i)}else return zp(this.customCompletionFunction)?this.customCompletionFunction(n,r,(i=s)=>this.defaultCompletion(e,r,n,i),i=>{s(null,i)}):this.customCompletionFunction(n,r,i=>{s(null,i)})}getCompletion(e,r){const n=e.length?e[e.length-1]:"",s=this.yargs.parse(e,!0),i=this.customCompletionFunction?
|
|
153
|
+
o=>this.customCompletion(e,o,n,r):o=>this.defaultCompletion(e,o,n,r);return Ae(s)?s.then(i):i(s)}generateCompletionScript(e,r){let n=this.zshShell?qp:kp;const s=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function Up(t,e,r,n){return new Hp(t,e,r,n)}function Fp(t){return t.length<3}function zp(t){
|
|
154
|
+
return t.length>3}function Vp(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;const r=[];let n;for(n=0;n<=e.length;n++)r[n]=[n];let s;for(s=0;s<=t.length;s++)r[0][s]=s;for(n=1;n<=e.length;n++)for(s=1;s<=t.length;s++)e.charAt(n-1)===t.charAt(s-1)?r[n][s]=r[n-1][s-1]:n>1&&s>1&&e.charAt(n-2)===t.charAt(s-1)&&e.charAt(n-1)===t.charAt(s-2)?r[n][s]=r[n-2][s-2]+1:r[n][s]=Math.min(r[n-1][s-1]+1,Math.min(r[n][s-1]+1,r[n-1][s]+1));return r[e.length][t.length]}const Aa=["$0","--","_"];
|
|
155
|
+
function Gp(t,e,r){const n=r.y18n.__,s=r.y18n.__n,i={};i.nonOptionCount=function(d){const h=t.getDemandedCommands(),b=d._.length+(d["--"]?d["--"].length:0)-t.getInternalMethods().getContext().commands.length;h._&&(b<h._.min||b>h._.max)&&(b<h._.min?h._.minMsg!==void 0?e.fail(h._.minMsg?h._.minMsg.replace(/\$0/g,b.toString()).replace(/\$1/,h._.min.toString()):null):e.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b.toString(),
|
|
156
|
+
h._.min.toString())):b>h._.max&&(h._.maxMsg!==void 0?e.fail(h._.maxMsg?h._.maxMsg.replace(/\$0/g,b.toString()).replace(/\$1/,h._.max.toString()):null):e.fail(s("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",b,b.toString(),h._.max.toString()))))},i.positionalCount=function(d,h){h<d&&e.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",h,h+"",d+""))},i.requiredArguments=
|
|
157
|
+
function(d,h){let y=null;for(const b of Object.keys(h))(!Object.prototype.hasOwnProperty.call(d,b)||typeof d[b]>"u")&&(y=y||{},y[b]=h[b]);if(y){const b=[];for(const f of Object.keys(y)){const g=y[f];g&&b.indexOf(g)<0&&b.push(g)}const _=b.length?`
|
|
158
|
+
${b.join(`
|
|
159
|
+
`)}`:"";e.fail(s("Missing required argument: %s","Missing required arguments: %s",Object.keys(y).length,Object.keys(y).join(", ")+_))}},i.unknownArguments=function(d,h,y,b,_=!0){var f;const g=t.getInternalMethods().getCommandInstance().getCommands(),p=[],m=t.getInternalMethods().getContext();if(Object.keys(d).forEach($=>{!Aa.includes($)&&!Object.prototype.hasOwnProperty.call(y,$)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),$)&&!i.isValidAndSomeAliasIsNotNew($,
|
|
160
|
+
h)&&p.push($)}),_&&(m.commands.length>0||g.length>0||b)&&d._.slice(m.commands.length).forEach($=>{g.includes(""+$)||p.push(""+$)}),_){const v=((f=t.getDemandedCommands()._)===null||f===void 0?void 0:f.max)||0,E=m.commands.length+v;E<d._.length&&d._.slice(E).forEach(S=>{S=String(S),!m.commands.includes(S)&&!p.includes(S)&&p.push(S)})}p.length&&e.fail(s("Unknown argument: %s","Unknown arguments: %s",p.length,p.map($=>$.trim()?$:`"${$}"`).join(", ")))},i.unknownCommands=function(d){const h=t.getInternalMethods().
|
|
161
|
+
getCommandInstance().getCommands(),y=[],b=t.getInternalMethods().getContext();return(b.commands.length>0||h.length>0)&&d._.slice(b.commands.length).forEach(_=>{h.includes(""+_)||y.push(""+_)}),y.length>0?(e.fail(s("Unknown command: %s","Unknown commands: %s",y.length,y.join(", "))),!0):!1},i.isValidAndSomeAliasIsNotNew=function(d,h){if(!Object.prototype.hasOwnProperty.call(h,d))return!1;const y=t.parsed.newAliases;return[d,...h[d]].some(b=>!Object.prototype.hasOwnProperty.call(y,b)||!y[d])},i.limitedChoices=
|
|
162
|
+
function(d){const h=t.getOptions(),y={};if(!Object.keys(h.choices).length)return;Object.keys(d).forEach(f=>{Aa.indexOf(f)===-1&&Object.prototype.hasOwnProperty.call(h.choices,f)&&[].concat(d[f]).forEach(g=>{h.choices[f].indexOf(g)===-1&&g!==void 0&&(y[f]=(y[f]||[]).concat(g))})});const b=Object.keys(y);if(!b.length)return;let _=n("Invalid values:");b.forEach(f=>{_+=`
|
|
163
|
+
${n("Argument: %s, Given: %s, Choices: %s",f,e.stringifiedValues(y[f]),e.stringifiedValues(h.choices[f]))}`}),e.fail(_)};let o={};i.implies=function(d,h){ce("<string|object> [array|number|string]",[d,h],arguments.length),typeof d=="object"?Object.keys(d).forEach(y=>{i.implies(y,d[y])}):(t.global(d),o[d]||(o[d]=[]),Array.isArray(h)?h.forEach(y=>i.implies(d,y)):(Ke(h,void 0,r),o[d].push(h)))},i.getImplied=function(){return o};function a(c,d){const h=Number(d);return d=isNaN(h)?d:h,typeof d=="num\
|
|
164
|
+
ber"?d=c._.length>=d:d.match(/^--no-.+/)?(d=d.match(/^--no-(.+)/)[1],d=!Object.prototype.hasOwnProperty.call(c,d)):d=Object.prototype.hasOwnProperty.call(c,d),d}i.implications=function(d){const h=[];if(Object.keys(o).forEach(y=>{const b=y;(o[y]||[]).forEach(_=>{let f=b;const g=_;f=a(d,f),_=a(d,_),f&&!_&&h.push(` ${b} -> ${g}`)})}),h.length){let y=`${n("Implications failed:")}
|
|
165
|
+
`;h.forEach(b=>{y+=b}),e.fail(y)}};let u={};i.conflicts=function(d,h){ce("<string|object> [array|string]",[d,h],arguments.length),typeof d=="object"?Object.keys(d).forEach(y=>{i.conflicts(y,d[y])}):(t.global(d),u[d]||(u[d]=[]),Array.isArray(h)?h.forEach(y=>i.conflicts(d,y)):u[d].push(h))},i.getConflicting=()=>u,i.conflicting=function(d){Object.keys(d).forEach(h=>{u[h]&&u[h].forEach(y=>{y&&d[h]!==void 0&&d[y]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",h,y))})}),t.getInternalMethods().
|
|
166
|
+
getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(h=>{u[h].forEach(y=>{y&&d[r.Parser.camelCase(h)]!==void 0&&d[r.Parser.camelCase(y)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",h,y))})})},i.recommendCommands=function(d,h){h=h.sort((f,g)=>g.length-f.length);let b=null,_=1/0;for(let f=0,g;(g=h[f])!==void 0;f++){const p=Vp(d,g);p<=3&&p<_&&(_=p,b=g)}b&&e.fail(n("Did you mean %s?",b))},i.reset=function(d){return o=gr(o,h=>!d[h]),u=gr(u,h=>!d[h]),i};const l=[];return i.
|
|
167
|
+
freeze=function(){l.push({implied:o,conflicting:u})},i.unfreeze=function(){const d=l.pop();Ke(d,void 0,r),{implied:o,conflicting:u}=d},i}let Ds=[],_r;function xs(t,e,r,n){_r=n;let s={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return s;const i=/\.json|\..*rc$/.test(t.extends);let o=null;if(i)o=Wp(e,t.extends);else try{o=require.resolve(t.extends)}catch{return t}Bp(o),Ds.push(o),s=i?JSON.parse(_r.readFileSync(o,"utf8")):require(t.extends),delete t.extends,
|
|
168
|
+
s=xs(s,_r.path.dirname(o),r,_r)}return Ds=[],r?Oa(s,t):Object.assign({},s,t)}function Bp(t){if(Ds.indexOf(t)>-1)throw new Oe(`Circular extended configurations: '${t}'.`)}function Wp(t,e){return _r.path.resolve(t,e)}function Oa(t,e){const r={};function n(s){return s&&typeof s=="object"&&!Array.isArray(s)}Object.assign(r,t);for(const s of Object.keys(e))n(e[s])&&n(r[s])?r[s]=Oa(t[s],e[s]):r[s]=e[s];return r}var ae=function(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");
|
|
169
|
+
if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r},O=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class d\
|
|
170
|
+
id not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Se,Pt,$r,Fe,xe,kr,mt,It,qr,ze,Hr,Ve,st,Me,Ge,Ur,Bt,Ce,ue,Fr,zr,ke,Nt,Wt,Tt,gt,Vr,fe,jt,Lt,Dt,de,Gr,it,Ee;function Kp(t){return(e=[],r=t.process.cwd(),n)=>{const s=new Yp(e,r,n,t);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s}}const Ca=Symbol("copyDoubleDash"),Pa=Symbol("copyDoubleDash"),Ms=Symbol("deleteFromParserHintObject"),Ia=Symbol("emitWarning"),Na=Symbol("freeze"),Ta=Symbol(
|
|
171
|
+
"getDollarZero"),xt=Symbol("getParserConfiguration"),ja=Symbol("getUsageConfiguration"),ks=Symbol("guessLocale"),La=Symbol("guessVersion"),Da=Symbol("parsePositionalNumbers"),qs=Symbol("pkgUp"),yt=Symbol("populateParserHintArray"),Kt=Symbol("populateParserHintSingleValueDictionary"),Hs=Symbol("populateParserHintArrayDictionary"),Us=Symbol("populateParserHintDictionary"),Fs=Symbol("sanitizeKey"),zs=Symbol("setKey"),Vs=Symbol("unfreeze"),xa=Symbol("validateAsync"),Ma=Symbol("getCommandInstance"),ka=Symbol(
|
|
172
|
+
"getContext"),qa=Symbol("getHasOutput"),Ha=Symbol("getLoggerInstance"),Ua=Symbol("getParseContext"),Fa=Symbol("getUsageInstance"),za=Symbol("getValidationInstance"),Br=Symbol("hasParseCallback"),Va=Symbol("isGlobalContext"),Mt=Symbol("postProcess"),Ga=Symbol("rebase"),Gs=Symbol("reset"),vr=Symbol("runYargsParserAndExecuteCommands"),Bs=Symbol("runValidation"),Ba=Symbol("setHasOutput"),kt=Symbol("kTrackManuallySetKeys");class Yp{constructor(e=[],r,n,s){this.customScriptName=!1,this.parsed=!1,Se.set(
|
|
173
|
+
this,void 0),Pt.set(this,void 0),$r.set(this,{commands:[],fullCommands:[]}),Fe.set(this,null),xe.set(this,null),kr.set(this,"show-hidden"),mt.set(this,null),It.set(this,!0),qr.set(this,{}),ze.set(this,!0),Hr.set(this,[]),Ve.set(this,void 0),st.set(this,{}),Me.set(this,!1),Ge.set(this,null),Ur.set(this,!0),Bt.set(this,void 0),Ce.set(this,""),ue.set(this,void 0),Fr.set(this,void 0),zr.set(this,{}),ke.set(this,null),Nt.set(this,null),Wt.set(this,{}),Tt.set(this,{}),gt.set(this,void 0),Vr.set(this,!1),
|
|
174
|
+
fe.set(this,void 0),jt.set(this,!1),Lt.set(this,!1),Dt.set(this,!1),de.set(this,void 0),Gr.set(this,{}),it.set(this,null),Ee.set(this,void 0),ae(this,fe,s,"f"),ae(this,gt,e,"f"),ae(this,Pt,r,"f"),ae(this,Fr,n,"f"),ae(this,Ve,new Ap(this),"f"),this.$0=this[Ta](),this[Gs](),ae(this,Se,O(this,Se,"f"),"f"),ae(this,de,O(this,de,"f"),"f"),ae(this,Ee,O(this,Ee,"f"),"f"),ae(this,ue,O(this,ue,"f"),"f"),O(this,ue,"f").showHiddenOpt=O(this,kr,"f"),ae(this,Bt,this[Pa](),"f")}addHelpOpt(e,r){const n="help";return ce(
|
|
175
|
+
"[string|boolean] [string]",[e,r],arguments.length),O(this,Ge,"f")&&(this[Ms](O(this,Ge,"f")),ae(this,Ge,null,"f")),e===!1&&r===void 0?this:(ae(this,Ge,typeof e=="string"?e:n,"f"),this.boolean(O(this,Ge,"f")),this.describe(O(this,Ge,"f"),r||O(this,de,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(ce("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;const n=typeof e=="string"?e:O(this,kr,"f");return this.boolean(
|
|
176
|
+
n),this.describe(n,r||O(this,de,"f").deferY18nLookup("Show hidden options")),O(this,ue,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return ce("<object|string|array> [string|array]",[e,r],arguments.length),this[Hs](this.alias.bind(this),"alias",e,r),this}array(e){return ce("<array|string>",[e],arguments.length),this[yt]("array",e),this[kt](e),this}boolean(e){return ce("<array|string>",[e],arguments.length),this[yt]("boolean",e),this[kt](e),this}check(e,r){
|
|
177
|
+
return ce("<function> [boolean]",[e,r],arguments.length),this.middleware((n,s)=>mr(()=>e(n,s.getOptions()),i=>(i?(typeof i=="string"||i instanceof Error)&&O(this,de,"f").fail(i.toString(),i):O(this,de,"f").fail(O(this,fe,"f").y18n.__("Argument check failed: %s",e.toString())),n),i=>(O(this,de,"f").fail(i.message?i.message:i.toString(),i),n)),!1,r),this}choices(e,r){return ce("<object|string|array> [string|array]",[e,r],arguments.length),this[Hs](this.choices.bind(this),"choices",e,r),this}coerce(e,r){
|
|
178
|
+
if(ce("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Oe("coerce callback must be provided");for(const n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(const n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new Oe("coerce callback must be provided");return O(this,ue,"f").key[e]=!0,O(this,Ve,"f").addCoerceMiddleware((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,e)?mr(()=>(i=s.getAliases(),r(n[e])),a=>{n[e]=
|
|
179
|
+
a;const u=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[e]&&u!==!0)for(const l of i[e])n[l]=a;return n},a=>{throw new Oe(a.message)}):n},e),this}conflicts(e,r){return ce("<string|object> [string|array]",[e,r],arguments.length),O(this,Ee,"f").conflicts(e,r),this}config(e="config",r,n){return ce("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=xs(e,O(this,Pt,"f"),this[xt]()["deep-merge-config"]||!1,O(this,fe,"\
|
|
180
|
+
f")),O(this,ue,"f").configObjects=(O(this,ue,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||O(this,de,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(s=>{O(this,ue,"f").config[s]=n||!0}),this)}completion(e,r,n){return ce("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),ae(this,xe,e||O(this,xe,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion\
|
|
181
|
+
script"),this.command(O(this,xe,"f"),r),n&&O(this,Fe,"f").registerFunction(n),this}command(e,r,n,s,i,o){return ce("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,s,i,o],arguments.length),O(this,Se,"f").addHandler(e,r,n,s,i,o),this}commands(e,r,n,s,i,o){return this.command(e,r,n,s,i,o)}commandDir(e,r){ce("<string> [object]",[e,r],arguments.length);const n=O(this,Fr,"f")||O(this,fe,"f").require;return O(this,Se,"f").addDirectory(e,n,O(this,fe,
|
|
182
|
+
"f").getCallerFile(),r),this}count(e){return ce("<array|string>",[e],arguments.length),this[yt]("count",e),this[kt](e),this}default(e,r,n){return ce("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(ba(e,O(this,fe,"f")),O(this,ue,"f").defaultDescription[e]=n),typeof r=="function"&&(ba(e,O(this,fe,"f")),O(this,ue,"f").defaultDescription[e]||(O(this,ue,"f").defaultDescription[e]=O(this,de,"f").functionDescription(r)),r=r.call()),this[Kt](this.default.bind(this),"default",e,r),this}defaults(e,r,n){
|
|
183
|
+
return this.default(e,r,n)}demandCommand(e=1,r,n,s){return ce("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,s],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),O(this,ue,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:s},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(s=>{Ke(n,!0,O(this,fe,"f")),this.demandOption(s,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(Ke(n,!0,O(this,fe,"f")),this.demandCommand(e,r,n,n)):
|
|
184
|
+
Array.isArray(e)?e.forEach(s=>{Ke(n,!0,O(this,fe,"f")),this.demandOption(s,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return ce("<object|string|array> [string]",[e,r],arguments.length),this[Kt](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return ce("<string> [string|boolean]",[e,r],arguments.length),O(this,ue,"f").deprecatedOptions[e]=r,this}describe(e,r){return ce("<object|string|array> [str\
|
|
185
|
+
ing]",[e,r],arguments.length),this[zs](e,!0),O(this,de,"f").describe(e,r),this}detectLocale(e){return ce("<boolean>",[e],arguments.length),ae(this,It,e,"f"),this}env(e){return ce("[string|boolean]",[e],arguments.length),e===!1?delete O(this,ue,"f").envPrefix:O(this,ue,"f").envPrefix=e||"",this}epilogue(e){return ce("<string>",[e],arguments.length),O(this,de,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return ce("<string|array> [string]",[e,r],arguments.length),Array.isArray(
|
|
186
|
+
e)?e.forEach(n=>this.example(...n)):O(this,de,"f").example(e,r),this}exit(e,r){ae(this,Me,!0,"f"),ae(this,mt,r,"f"),O(this,ze,"f")&&O(this,fe,"f").process.exit(e)}exitProcess(e=!0){return ce("[boolean]",[e],arguments.length),ae(this,ze,e,"f"),this}fail(e){if(ce("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Oe("Invalid first argument. Expected function or boolean 'false'");return O(this,de,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){
|
|
187
|
+
return ce("<array> [function]",[e,r],arguments.length),r?O(this,Fe,"f").getCompletion(e,r):new Promise((n,s)=>{O(this,Fe,"f").getCompletion(e,(i,o)=>{i?s(i):n(o)})})}getDemandedOptions(){return ce([],0),O(this,ue,"f").demandedOptions}getDemandedCommands(){return ce([],0),O(this,ue,"f").demandedCommands}getDeprecatedOptions(){return ce([],0),O(this,ue,"f").deprecatedOptions}getDetectLocale(){return O(this,It,"f")}getExitProcess(){return O(this,ze,"f")}getGroups(){return Object.assign({},O(this,st,
|
|
188
|
+
"f"),O(this,Tt,"f"))}getHelp(){if(ae(this,Me,!0,"f"),!O(this,de,"f").hasCachedHelpMessage()){if(!this.parsed){const r=this[vr](O(this,gt,"f"),void 0,void 0,0,!0);if(Ae(r))return r.then(()=>O(this,de,"f").help())}const e=O(this,Se,"f").runDefaultBuilderOn(this);if(Ae(e))return e.then(()=>O(this,de,"f").help())}return Promise.resolve(O(this,de,"f").help())}getOptions(){return O(this,ue,"f")}getStrict(){return O(this,jt,"f")}getStrictCommands(){return O(this,Lt,"f")}getStrictOptions(){return O(this,
|
|
189
|
+
Dt,"f")}global(e,r){return ce("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?O(this,ue,"f").local=O(this,ue,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{O(this,ue,"f").local.includes(n)||O(this,ue,"f").local.push(n)}),this}group(e,r){ce("<string|array> <string>",[e,r],arguments.length);const n=O(this,Tt,"f")[r]||O(this,st,"f")[r];O(this,Tt,"f")[r]&&delete O(this,Tt,"f")[r];const s={};return O(this,st,"f")[r]=(n||[]).concat(e).filter(i=>s[i]?!1:s[i]=!0),this}hide(e){
|
|
190
|
+
return ce("<string>",[e],arguments.length),O(this,ue,"f").hiddenOptions.push(e),this}implies(e,r){return ce("<string|object> [number|string|array]",[e,r],arguments.length),O(this,Ee,"f").implies(e,r),this}locale(e){return ce("[string]",[e],arguments.length),e===void 0?(this[ks](),O(this,fe,"f").y18n.getLocale()):(ae(this,It,!1,"f"),O(this,fe,"f").y18n.setLocale(e),this)}middleware(e,r,n){return O(this,Ve,"f").addMiddleware(e,!!r,n)}nargs(e,r){return ce("<string|object|array> [number]",[e,r],arguments.
|
|
191
|
+
length),this[Kt](this.nargs.bind(this),"narg",e,r),this}normalize(e){return ce("<array|string>",[e],arguments.length),this[yt]("normalize",e),this}number(e){return ce("<array|string>",[e],arguments.length),this[yt]("number",e),this[kt](e),this}option(e,r){if(ce("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[kt](e),O(this,it,"f")&&(e==="version"||r?.alias==="version")&&this[Ia](['"version\
|
|
192
192
|
" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
193
|
-
`),void 0,"versionWarning"),
|
|
193
|
+
`),void 0,"versionWarning"),O(this,ue,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);const n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);const s=r.demand||r.required||r.require;s&&this.demand(e,s),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),
|
|
194
194
|
r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global==
|
|
195
|
-
"boolean"&&this.global(e,r.global),r.defaultDescription&&(
|
|
196
|
-
r,n],arguments.length),this[
|
|
197
|
-
this.parsed=
|
|
198
|
-
let n=null;const
|
|
199
|
-
an"].includes(a)?!1:n.includes(o));const
|
|
200
|
-
e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return ce("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&
|
|
201
|
-
"f"),!
|
|
202
|
-
r),this}showVersion(e){return ce("[string|function]",[e],arguments.length),
|
|
203
|
-
string>",[e],arguments.length),this[
|
|
204
|
-
command(e,r,n,
|
|
205
|
-
1){if(e===!1)return this;n=e,e=
|
|
206
|
-
|
|
207
|
-
log:(...e)=>{this[
|
|
208
|
-
`,"f"),
|
|
209
|
-
`,"f"),
|
|
210
|
-
this,
|
|
211
|
-
process.argv().slice(1,2):r=
|
|
212
|
-
this,
|
|
213
|
-
|
|
214
|
-
r,n,
|
|
215
|
-
d=this,h=this,{options:{set value(
|
|
216
|
-
|
|
217
|
-
bind(this),getUsageConfiguration:this[
|
|
218
|
-
return
|
|
219
|
-
r.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(a=>{n[a]=!0})}),Object.assign(
|
|
220
|
-
|
|
221
|
-
this,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
o=!0,this.showHelp("log"),this.exit(0))
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
lean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},
|
|
229
|
-
boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},
|
|
230
|
-
r==="directory"&&a?.isDirectory())return o}catch{}
|
|
195
|
+
"boolean"&&this.global(e,r.global),r.defaultDescription&&(O(this,ue,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);const i=r.describe||r.description||r.desc,o=O(this,de,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,e)||typeof i=="string")&&this.describe(e,i),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){ce("[string|array] [function|boolean|object] [function]",[e,
|
|
196
|
+
r,n],arguments.length),this[Na](),typeof e>"u"&&(e=O(this,gt,"f")),typeof r=="object"&&(ae(this,Nt,r,"f"),r=n),typeof r=="function"&&(ae(this,ke,r,"f"),r=!1),r||ae(this,gt,e,"f"),O(this,ke,"f")&&ae(this,ze,!1,"f");const s=this[vr](e,!!r),i=this.parsed;return O(this,Fe,"f").setParsed(this.parsed),Ae(s)?s.then(o=>(O(this,ke,"f")&&O(this,ke,"f").call(this,O(this,mt,"f"),o,O(this,Ce,"f")),o)).catch(o=>{throw O(this,ke,"f")&&O(this,ke,"f")(o,this.parsed.argv,O(this,Ce,"f")),o}).finally(()=>{this[Vs](),
|
|
197
|
+
this.parsed=i}):(O(this,ke,"f")&&O(this,ke,"f").call(this,O(this,mt,"f"),s,O(this,Ce,"f")),this[Vs](),this.parsed=i,s)}parseAsync(e,r,n){const s=this.parse(e,r,n);return Ae(s)?s:Promise.resolve(s)}parseSync(e,r,n){const s=this.parse(e,r,n);if(Ae(s))throw new Oe(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(e){return ce("<object>",[e],arguments.length),ae(this,zr,e,"f"),this}pkgConf(e,r){ce("<string> [string]",[e,r],arguments.length);
|
|
198
|
+
let n=null;const s=this[qs](r||O(this,Pt,"f"));return s[e]&&typeof s[e]=="object"&&(n=xs(s[e],r||O(this,Pt,"f"),this[xt]()["deep-merge-config"]||!1,O(this,fe,"f")),O(this,ue,"f").configObjects=(O(this,ue,"f").configObjects||[]).concat(n)),this}positional(e,r){ce("<string> <object>",[e,r],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=gr(r,(o,a)=>o==="type"&&!["string","number","boole\
|
|
199
|
+
an"].includes(a)?!1:n.includes(o));const s=O(this,$r,"f").fullCommands[O(this,$r,"f").fullCommands.length-1],i=s?O(this,Se,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return xr(i).forEach(o=>{const a=i[o];Array.isArray(a)?a.indexOf(e)!==-1&&(r[o]=!0):a[e]&&!(o in r)&&(r[o]=a[e])}),this.group(e,O(this,de,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return ce("[boolean]",[e],arguments.length),ae(this,Vr,e,"f"),this}required(e,r,n){return this.demand(
|
|
200
|
+
e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return ce("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&O(this,ue,"f").narg[e]?this:(this[Kt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return ce("[string] [string]",[e,r],arguments.length),e=e||this.$0,O(this,Bt,"f").log(O(this,Fe,"f").generateCompletionScript(e,r||O(this,xe,"f")||"completion")),this}showHelp(e){if(ce("[string|function]",[e],arguments.length),ae(this,Me,!0,
|
|
201
|
+
"f"),!O(this,de,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[vr](O(this,gt,"f"),void 0,void 0,0,!0);if(Ae(n))return n.then(()=>{O(this,de,"f").showHelp(e)}),this}const r=O(this,Se,"f").runDefaultBuilderOn(this);if(Ae(r))return r.then(()=>{O(this,de,"f").showHelp(e)}),this}return O(this,de,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return ce("[boolean|string] [string]",[e,r],arguments.length),O(this,de,"f").showHelpOnFail(e,
|
|
202
|
+
r),this}showVersion(e){return ce("[string|function]",[e],arguments.length),O(this,de,"f").showVersion(e),this}skipValidation(e){return ce("<array|string>",[e],arguments.length),this[yt]("skipValidation",e),this}strict(e){return ce("[boolean]",[e],arguments.length),ae(this,jt,e!==!1,"f"),this}strictCommands(e){return ce("[boolean]",[e],arguments.length),ae(this,Lt,e!==!1,"f"),this}strictOptions(e){return ce("[boolean]",[e],arguments.length),ae(this,Dt,e!==!1,"f"),this}string(e){return ce("<array|\
|
|
203
|
+
string>",[e],arguments.length),this[yt]("string",e),this[kt](e),this}terminalWidth(){return ce([],0),O(this,fe,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return ce("<object>",[e],arguments.length),ae(this,It,!1,"f"),O(this,fe,"f").y18n.updateLocale(e),this}usage(e,r,n,s){if(ce("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,s],arguments.length),r!==void 0){if(Ke(e,null,O(this,fe,"f")),(e||"").match(/^\$0( |$)/))return this.
|
|
204
|
+
command(e,r,n,s);throw new Oe(".usage() description must start with $0 if being used as alias for .command()")}else return O(this,de,"f").usage(e),this}usageConfiguration(e){return ce("<object>",[e],arguments.length),ae(this,Gr,e,"f"),this}version(e,r,n){const s="version";if(ce("[boolean|string] [string] [string]",[e,r,n],arguments.length),O(this,it,"f")&&(this[Ms](O(this,it,"f")),O(this,de,"f").version(void 0),ae(this,it,null,"f")),arguments.length===0)n=this[La](),e=s;else if(arguments.length===
|
|
205
|
+
1){if(e===!1)return this;n=e,e=s}else arguments.length===2&&(n=r,r=void 0);return ae(this,it,typeof e=="string"?e:s,"f"),r=r||O(this,de,"f").deferY18nLookup("Show version number"),O(this,de,"f").version(n||void 0),this.boolean(O(this,it,"f")),this.describe(O(this,it,"f"),r),this}wrap(e){return ce("<number|null|undefined>",[e],arguments.length),O(this,de,"f").wrap(e),this}[(Se=new WeakMap,Pt=new WeakMap,$r=new WeakMap,Fe=new WeakMap,xe=new WeakMap,kr=new WeakMap,mt=new WeakMap,It=new WeakMap,qr=new WeakMap,
|
|
206
|
+
ze=new WeakMap,Hr=new WeakMap,Ve=new WeakMap,st=new WeakMap,Me=new WeakMap,Ge=new WeakMap,Ur=new WeakMap,Bt=new WeakMap,Ce=new WeakMap,ue=new WeakMap,Fr=new WeakMap,zr=new WeakMap,ke=new WeakMap,Nt=new WeakMap,Wt=new WeakMap,Tt=new WeakMap,gt=new WeakMap,Vr=new WeakMap,fe=new WeakMap,jt=new WeakMap,Lt=new WeakMap,Dt=new WeakMap,de=new WeakMap,Gr=new WeakMap,it=new WeakMap,Ee=new WeakMap,Ca)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Pa](){return{
|
|
207
|
+
log:(...e)=>{this[Br]()||console.log(...e),ae(this,Me,!0,"f"),O(this,Ce,"f").length&&ae(this,Ce,O(this,Ce,"f")+`
|
|
208
|
+
`,"f"),ae(this,Ce,O(this,Ce,"f")+e.join(" "),"f")},error:(...e)=>{this[Br]()||console.error(...e),ae(this,Me,!0,"f"),O(this,Ce,"f").length&&ae(this,Ce,O(this,Ce,"f")+`
|
|
209
|
+
`,"f"),ae(this,Ce,O(this,Ce,"f")+e.join(" "),"f")}}}[Ms](e){xr(O(this,ue,"f")).forEach(r=>{if((s=>s==="configObjects")(r))return;const n=O(this,ue,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete O(this,de,"f").getDescriptions()[e]}[Ia](e,r,n){O(this,qr,"f")[n]||(O(this,fe,"f").process.emitWarning(e,r),O(this,qr,"f")[n]=!0)}[Na](){O(this,Hr,"f").push({options:O(this,ue,"f"),configObjects:O(this,ue,"f").configObjects.slice(0),exitProcess:O(
|
|
210
|
+
this,ze,"f"),groups:O(this,st,"f"),strict:O(this,jt,"f"),strictCommands:O(this,Lt,"f"),strictOptions:O(this,Dt,"f"),completionCommand:O(this,xe,"f"),output:O(this,Ce,"f"),exitError:O(this,mt,"f"),hasOutput:O(this,Me,"f"),parsed:this.parsed,parseFn:O(this,ke,"f"),parseContext:O(this,Nt,"f")}),O(this,de,"f").freeze(),O(this,Ee,"f").freeze(),O(this,Se,"f").freeze(),O(this,Ve,"f").freeze()}[Ta](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(O(this,fe,"f").process.argv()[0])?r=O(this,fe,"f").
|
|
211
|
+
process.argv().slice(1,2):r=O(this,fe,"f").process.argv().slice(0,1),e=r.map(n=>{const s=this[Ga](O(this,Pt,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&s.length<n.length?s:n}).join(" ").trim(),O(this,fe,"f").getEnv("_")&&O(this,fe,"f").getProcessArgvBin()===O(this,fe,"f").getEnv("_")&&(e=O(this,fe,"f").getEnv("_").replace(`${O(this,fe,"f").path.dirname(O(this,fe,"f").process.execPath())}/`,"")),e}[xt](){return O(this,zr,"f")}[ja](){return O(this,Gr,"f")}[ks](){if(!O(this,It,"f"))return;const e=O(
|
|
212
|
+
this,fe,"f").getEnv("LC_ALL")||O(this,fe,"f").getEnv("LC_MESSAGES")||O(this,fe,"f").getEnv("LANG")||O(this,fe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[La](){return this[qs]().version||"unknown"}[Da](e){const r=e["--"]?e["--"]:e._;for(let n=0,s;(s=r[n])!==void 0;n++)O(this,fe,"f").Parser.looksLikeNumber(s)&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)))&&(r[n]=Number(s));return e}[qs](e){const r=e||"*";if(O(this,Wt,"f")[r])return O(this,Wt,"f")[r];let n={};try{let s=e||
|
|
213
|
+
O(this,fe,"f").mainFilename;!e&&O(this,fe,"f").path.extname(s)&&(s=O(this,fe,"f").path.dirname(s));const i=O(this,fe,"f").findUp(s,(o,a)=>{if(a.includes("package.json"))return"package.json"});Ke(i,void 0,O(this,fe,"f")),n=JSON.parse(O(this,fe,"f").readFileSync(i,"utf8"))}catch{}return O(this,Wt,"f")[r]=n||{},O(this,Wt,"f")[r]}[yt](e,r){r=[].concat(r),r.forEach(n=>{n=this[Fs](n),O(this,ue,"f")[e].push(n)})}[Kt](e,r,n,s){this[Us](e,r,n,s,(i,o,a)=>{O(this,ue,"f")[i][o]=a})}[Hs](e,r,n,s){this[Us](e,
|
|
214
|
+
r,n,s,(i,o,a)=>{O(this,ue,"f")[i][o]=(O(this,ue,"f")[i][o]||[]).concat(a)})}[Us](e,r,n,s,i){if(Array.isArray(n))n.forEach(o=>{e(o,s)});else if((o=>typeof o=="object")(n))for(const o of xr(n))e(o,n[o]);else i(r,this[Fs](n),s)}[Fs](e){return e==="__proto__"?"___proto___":e}[zs](e,r){return this[Kt](this[zs].bind(this),"key",e,r),this}[Vs](){var e,r,n,s,i,o,a,u,l,c,d,h;const y=O(this,Hr,"f").pop();Ke(y,void 0,O(this,fe,"f"));let b;e=this,r=this,n=this,s=this,i=this,o=this,a=this,u=this,l=this,c=this,
|
|
215
|
+
d=this,h=this,{options:{set value(_){ae(e,ue,_,"f")}}.value,configObjects:b,exitProcess:{set value(_){ae(r,ze,_,"f")}}.value,groups:{set value(_){ae(n,st,_,"f")}}.value,output:{set value(_){ae(s,Ce,_,"f")}}.value,exitError:{set value(_){ae(i,mt,_,"f")}}.value,hasOutput:{set value(_){ae(o,Me,_,"f")}}.value,parsed:this.parsed,strict:{set value(_){ae(a,jt,_,"f")}}.value,strictCommands:{set value(_){ae(u,Lt,_,"f")}}.value,strictOptions:{set value(_){ae(l,Dt,_,"f")}}.value,completionCommand:{set value(_){
|
|
216
|
+
ae(c,xe,_,"f")}}.value,parseFn:{set value(_){ae(d,ke,_,"f")}}.value,parseContext:{set value(_){ae(h,Nt,_,"f")}}.value}=y,O(this,ue,"f").configObjects=b,O(this,de,"f").unfreeze(),O(this,Ee,"f").unfreeze(),O(this,Se,"f").unfreeze(),O(this,Ve,"f").unfreeze()}[xa](e,r){return mr(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Ma].bind(this),getContext:this[ka].bind(this),getHasOutput:this[qa].bind(this),getLoggerInstance:this[Ha].bind(this),getParseContext:this[Ua].bind(this),getParserConfiguration:this[xt].
|
|
217
|
+
bind(this),getUsageConfiguration:this[ja].bind(this),getUsageInstance:this[Fa].bind(this),getValidationInstance:this[za].bind(this),hasParseCallback:this[Br].bind(this),isGlobalContext:this[Va].bind(this),postProcess:this[Mt].bind(this),reset:this[Gs].bind(this),runValidation:this[Bs].bind(this),runYargsParserAndExecuteCommands:this[vr].bind(this),setHasOutput:this[Ba].bind(this)}}[Ma](){return O(this,Se,"f")}[ka](){return O(this,$r,"f")}[qa](){return O(this,Me,"f")}[Ha](){return O(this,Bt,"f")}[Ua](){
|
|
218
|
+
return O(this,Nt,"f")||{}}[Fa](){return O(this,de,"f")}[za](){return O(this,Ee,"f")}[Br](){return!!O(this,ke,"f")}[Va](){return O(this,Ur,"f")}[Mt](e,r,n,s){return n||Ae(e)||(r||(e=this[Ca](e)),(this[xt]()["parse-positional-numbers"]||this[xt]()["parse-positional-numbers"]===void 0)&&(e=this[Da](e)),s&&(e=pr(e,this,O(this,Ve,"f").getMiddleware(),!1))),e}[Gs](e={}){ae(this,ue,O(this,ue,"f")||{},"f");const r={};r.local=O(this,ue,"f").local||[],r.configObjects=O(this,ue,"f").configObjects||[];const n={};
|
|
219
|
+
r.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(a=>{n[a]=!0})}),Object.assign(O(this,Tt,"f"),Object.keys(O(this,st,"f")).reduce((o,a)=>{const u=O(this,st,"f")[a].filter(l=>!(l in n));return u.length>0&&(o[a]=u),o},{})),ae(this,st,{},"f");const s=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],i=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return s.forEach(o=>{r[o]=(O(this,
|
|
220
|
+
ue,"f")[o]||[]).filter(a=>!n[a])}),i.forEach(o=>{r[o]=gr(O(this,ue,"f")[o],a=>!n[a])}),r.envPrefix=O(this,ue,"f").envPrefix,ae(this,ue,r,"f"),ae(this,de,O(this,de,"f")?O(this,de,"f").reset(n):xp(this,O(this,fe,"f")),"f"),ae(this,Ee,O(this,Ee,"f")?O(this,Ee,"f").reset(n):Gp(this,O(this,de,"f"),O(this,fe,"f")),"f"),ae(this,Se,O(this,Se,"f")?O(this,Se,"f").reset():Np(O(this,de,"f"),O(this,Ee,"f"),O(this,Ve,"f"),O(this,fe,"f")),"f"),O(this,Fe,"f")||ae(this,Fe,Up(this,O(this,de,"f"),O(this,Se,"f"),O(
|
|
221
|
+
this,fe,"f")),"f"),O(this,Ve,"f").reset(),ae(this,xe,null,"f"),ae(this,Ce,"","f"),ae(this,mt,null,"f"),ae(this,Me,!1,"f"),this.parsed=!1,this}[Ga](e,r){return O(this,fe,"f").path.relative(e,r)}[vr](e,r,n,s=0,i=!1){let o=!!n||i;e=e||O(this,gt,"f"),O(this,ue,"f").__=O(this,fe,"f").y18n.__,O(this,ue,"f").configuration=this[xt]();const a=!!O(this,ue,"f").configuration["populate--"],u=Object.assign({},O(this,ue,"f").configuration,{"populate--":!0}),l=O(this,fe,"f").Parser.detailed(e,Object.assign({},
|
|
222
|
+
O(this,ue,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,O(this,Nt,"f"));let d;const h=l.aliases;let y=!1,b=!1;Object.keys(c).forEach(_=>{_===O(this,Ge,"f")&&c[_]?y=!0:_===O(this,it,"f")&&c[_]&&(b=!0)}),c.$0=this.$0,this.parsed=l,s===0&&O(this,de,"f").clearCachedHelpMessage();try{if(this[ks](),r)return this[Mt](c,a,!!n,!1);O(this,Ge,"f")&&[O(this,Ge,"f")].concat(h[O(this,Ge,"f")]||[]).filter(m=>m.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),y=!0),ae(this,
|
|
223
|
+
Ur,!1,"f");const _=O(this,Se,"f").getCommands(),f=O(this,Fe,"f").completionKey in c,g=y||f||i;if(c._.length){if(_.length){let p;for(let m=s||0,$;c._[m]!==void 0;m++)if($=String(c._[m]),_.includes($)&&$!==O(this,xe,"f")){const v=O(this,Se,"f").runCommand($,this,l,m+1,i,y||b||i);return this[Mt](v,a,!!n,!1)}else if(!p&&$!==O(this,xe,"f")){p=$;break}!O(this,Se,"f").hasDefaultCommand()&&O(this,Vr,"f")&&p&&!g&&O(this,Ee,"f").recommendCommands(p,_)}O(this,xe,"f")&&c._.includes(O(this,xe,"f"))&&!f&&(O(this,
|
|
224
|
+
ze,"f")&&yr(!0),this.showCompletionScript(),this.exit(0))}if(O(this,Se,"f").hasDefaultCommand()&&!g){const p=O(this,Se,"f").runCommand(null,this,l,0,i,y||b||i);return this[Mt](p,a,!!n,!1)}if(f){O(this,ze,"f")&&yr(!0),e=[].concat(e);const p=e.slice(e.indexOf(`--${O(this,Fe,"f").completionKey}`)+1);return O(this,Fe,"f").getCompletion(p,(m,$)=>{if(m)throw new Oe(m.message);($||[]).forEach(v=>{O(this,Bt,"f").log(v)}),this.exit(0)}),this[Mt](c,!a,!!n,!1)}if(O(this,Me,"f")||(y?(O(this,ze,"f")&&yr(!0),
|
|
225
|
+
o=!0,this.showHelp("log"),this.exit(0)):b&&(O(this,ze,"f")&&yr(!0),o=!0,O(this,de,"f").showVersion("log"),this.exit(0))),!o&&O(this,ue,"f").skipValidation.length>0&&(o=Object.keys(c).some(p=>O(this,ue,"f").skipValidation.indexOf(p)>=0&&c[p]===!0)),!o){if(l.error)throw new Oe(l.error.message);if(!f){const p=this[Bs](h,{},l.error);n||(d=pr(c,this,O(this,Ve,"f").getMiddleware(),!0)),d=this[xa](p,d??c),Ae(d)&&!n&&(d=d.then(()=>pr(c,this,O(this,Ve,"f").getMiddleware(),!1)))}}}catch(_){if(_ instanceof
|
|
226
|
+
Oe)O(this,de,"f").fail(_.message,_);else throw _}return this[Mt](d??c,a,!!n,!0)}[Bs](e,r,n,s){const i={...this.getDemandedOptions()};return o=>{if(n)throw new Oe(n.message);O(this,Ee,"f").nonOptionCount(o),O(this,Ee,"f").requiredArguments(o,i);let a=!1;O(this,Lt,"f")&&(a=O(this,Ee,"f").unknownCommands(o)),O(this,jt,"f")&&!a?O(this,Ee,"f").unknownArguments(o,e,r,!!s):O(this,Dt,"f")&&O(this,Ee,"f").unknownArguments(o,e,{},!1,!1),O(this,Ee,"f").limitedChoices(o),O(this,Ee,"f").implications(o),O(this,
|
|
227
|
+
Ee,"f").conflicting(o)}}[Ba](){ae(this,Me,!0,"f")}[kt](e){if(typeof e=="string")O(this,ue,"f").key[e]=!0;else for(const r of e)O(this,ue,"f").key[r]=!0}}function Xp(t){return!!t&&typeof t.getInternalMethods=="function"}const Jp=Kp(Sp),br={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:ge},Ye={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:'use graphviz binaries ("dot" should be on PATH)',default:!1},Wa={boolean:!0,type:"boo\
|
|
228
|
+
lean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},Wr={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:ge},Ws={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},Ka={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"'},Ya={boolean:!0,type:"boolean",desc:"overview all diagrams as graph [experimental]",default:!1},Qp={boolean:!0,type:"\
|
|
229
|
+
boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},Zp={alias:"l",type:"string",desc:"ip address of the network interface to listen on",default:"127.0.0.1"},Xa=t=>t instanceof URL?ia(t):t;function em(t,{cwd:e=Re.cwd(),type:r="file",stopAt:n}={}){let s=$e.resolve(Xa(e)??"");const{root:i}=$e.parse(s);for(n=$e.resolve(s,Xa(n)??i);s&&s!==n&&s!==i;){const o=$e.isAbsolute(t)?t:$e.join(s,t);try{const a=pe.statSync(o,{throwIfNoEntry:!1});if(r==="file"&&a?.isFile()||
|
|
230
|
+
r==="directory"&&a?.isDirectory())return o}catch{}s=$e.dirname(s)}}function tm({cwd:t=Re.cwd()}={}){return em("package.json",{cwd:t})}const Ks=tt("vite"),Kr=Rt(ia(import.meta.url)),rm=`
|
|
231
231
|
/* prettier-ignore-start */
|
|
232
232
|
/* eslint-disable */
|
|
233
233
|
|
|
@@ -236,937 +236,552 @@ r==="directory"&&a?.isDirectory())return o}catch{}i=be.dirname(i)}}function l0({
|
|
|
236
236
|
* DO NOT EDIT MANUALLY!
|
|
237
237
|
******************************************************************************/
|
|
238
238
|
|
|
239
|
-
`.trimStart(),
|
|
239
|
+
`.trimStart(),nm=`
|
|
240
240
|
|
|
241
241
|
/* prettier-ignore-end */
|
|
242
|
-
`,
|
|
242
|
+
`,Ys={banner:rm,footer:nm};function Ja(){const t=tm({cwd:Kr});if(!t)throw new Error("likec4 package folder not found");return Rt(t)}function Xs(){const t=Ja(),e=[ge(t,"__app__"),ge(Kr,"../__app__"),ge(Kr,"../../__app__"),ge(Kr,"../../dist/__app__")],r=uh(e,Ot);if(!r)throw at.error(`likec4 app root does not exist, tried:
|
|
243
243
|
${e.join(`
|
|
244
|
-
`)}`),new Error("likec4 app root does not exist");return r}async function
|
|
245
|
-
`),t}const
|
|
246
|
-
nodes[r];
|
|
247
|
-
"range"&&(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=
|
|
248
|
-
nodes)u+=n(l);return u};return n(e)},
|
|
249
|
-
o be a number.");let m={relaxZeros:!0,...p};typeof m.strictZeros=="boolean"&&(m.relaxZeros=m.strictZeros===!1);let
|
|
250
|
-
0){let
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
repeat(g))}function d(f,g){return f-f%Math.pow(10,g)}function h(f){let[g=0,p=""]=f;return p||g>1?`{${g+(p?","+p:"")}}`:""}function
|
|
254
|
-
|
|
255
|
-
m):m},l=(m
|
|
256
|
-
m);if(m
|
|
257
|
-
|
|
258
|
-
v:
|
|
259
|
-
m
|
|
260
|
-
!0)return d+o.value;if(o.isClose===!0)return console.log("node.isClose",d,o.value),d+o.value;if(o.type==="open")return c?d+o.value:"(";if(o.type==="close")return c?d+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":c?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const
|
|
261
|
-
|
|
244
|
+
`)}`),new Error("likec4 app root does not exist");return r}async function Js(){const t=await Tr(ir(jr(),".likec4-public-"));return await Ct(ir(t,"likec4-views.js"),`// generated by likec4
|
|
245
|
+
`),t}const Qs=1e4;function Zs(){const t=Ja();return{"likec4/icons":ge(t,"icons"),"likec4/react":ge(t,"react"),"likec4/model":ge(t,"dist/model")}}var ei={},Qa;function ti(){return Qa||(Qa=1,function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,r)=>e.nodes.find(n=>n.type===r),t.exceedsLimit=(e,r,n=1,s)=>s===!1||!t.isInteger(e)||!t.isInteger(r)?!1:(Number(r)-Number(e))/Number(n)>=s,t.escapeNode=(e,r=0,n)=>{const s=e.
|
|
246
|
+
nodes[r];s&&(n&&s.type===n||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1,t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type===
|
|
247
|
+
"range"&&(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=s=>{for(let i=0;i<s.length;i++){const o=s[i];if(Array.isArray(o)){n(o);continue}o!==void 0&&r.push(o)}return r};return n(e),r}}(ei)),ei}var ri,Za;function ni(){if(Za)return ri;Za=1;const t=ti();return ri=(e,r={})=>{const n=(s,i={})=>{const o=r.escapeInvalid&&t.isInvalidBrace(i),a=s.invalid===!0&&r.escapeInvalid===!0;let u="";if(s.value)return(o||a)&&t.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(const l of s.
|
|
248
|
+
nodes)u+=n(l);return u};return n(e)},ri}var si,ec;function sm(){return ec||(ec=1,si=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}),si}var ii,tc;function im(){if(tc)return ii;tc=1;const t=sm(),e=(f,g,p)=>{if(t(f)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(g===void 0||f===g)return String(f);if(t(g)===!1)throw new TypeError("toRegexRange: expected the second argument t\
|
|
249
|
+
o be a number.");let m={relaxZeros:!0,...p};typeof m.strictZeros=="boolean"&&(m.relaxZeros=m.strictZeros===!1);let $=String(m.relaxZeros),v=String(m.shorthand),E=String(m.capture),S=String(m.wrap),I=f+":"+g+"="+$+v+E+S;if(e.cache.hasOwnProperty(I))return e.cache[I].result;let F=Math.min(f,g),B=Math.max(f,g);if(Math.abs(F-B)===1){let H=f+"|"+g;return m.capture?`(${H})`:m.wrap===!1?H:`(?:${H})`}let D=b(f)||b(g),k={min:f,max:g,a:F,b:B},j=[],x=[];if(D&&(k.isPadded=D,k.maxLen=String(k.max).length),F<
|
|
250
|
+
0){let H=B<0?Math.abs(B):1;x=i(H,Math.abs(F),k,m),F=k.a=0}return B>=0&&(j=i(F,B,k,m)),k.negatives=x,k.positives=j,k.result=r(x,j),m.capture===!0?k.result=`(${k.result})`:m.wrap!==!1&&j.length+x.length>1&&(k.result=`(?:${k.result})`),e.cache[I]=k,k.result};function r(f,g,p){let m=o(f,g,"-",!1)||[],$=o(g,f,"",!1)||[],v=o(f,g,"-?",!0)||[];return m.concat(v).concat($).join("|")}function n(f,g){let p=1,m=1,$=c(f,p),v=new Set([g]);for(;f<=$&&$<=g;)v.add($),p+=1,$=c(f,p);for($=d(g+1,m)-1;f<$&&$<=g;)v.add(
|
|
251
|
+
$),m+=1,$=d(g+1,m)-1;return v=[...v],v.sort(u),v}function s(f,g,p){if(f===g)return{pattern:f,count:[],digits:0};let m=a(f,g),$=m.length,v="",E=0;for(let S=0;S<$;S++){let[I,F]=m[S];I===F?v+=I:I!=="0"||F!=="9"?v+=y(I,F):E++}return E&&(v+=p.shorthand===!0?"\\d":"[0-9]"),{pattern:v,count:[E],digits:$}}function i(f,g,p,m){let $=n(f,g),v=[],E=f,S;for(let I=0;I<$.length;I++){let F=$[I],B=s(String(E),String(F),m),D="";if(!p.isPadded&&S&&S.pattern===B.pattern){S.count.length>1&&S.count.pop(),S.count.push(
|
|
252
|
+
B.count[0]),S.string=S.pattern+h(S.count),E=F+1;continue}p.isPadded&&(D=_(F,p,m)),B.string=D+B.pattern+h(B.count),v.push(B),E=F+1,S=B}return v}function o(f,g,p,m,$){let v=[];for(let E of f){let{string:S}=E;!m&&!l(g,"string",S)&&v.push(p+S),m&&l(g,"string",S)&&v.push(p+S)}return v}function a(f,g){let p=[];for(let m=0;m<f.length;m++)p.push([f[m],g[m]]);return p}function u(f,g){return f>g?1:g>f?-1:0}function l(f,g,p){return f.some(m=>m[g]===p)}function c(f,g){return Number(String(f).slice(0,-g)+"9".
|
|
253
|
+
repeat(g))}function d(f,g){return f-f%Math.pow(10,g)}function h(f){let[g=0,p=""]=f;return p||g>1?`{${g+(p?","+p:"")}}`:""}function y(f,g,p){return`[${f}${g-f===1?"":"-"}${g}]`}function b(f){return/^-?(0+)\d/.test(f)}function _(f,g,p){if(!g.isPadded)return f;let m=Math.abs(g.maxLen-String(f).length),$=p.relaxZeros!==!1;switch(m){case 0:return"";case 1:return $?"0?":"0";case 2:return $?"0{0,2}":"00";default:return $?`0{0,${m}}`:`0{${m}}`}}return e.cache={},e.clearCache=()=>e.cache={},ii=e,ii}var oi,
|
|
254
|
+
rc;function nc(){if(rc)return oi;rc=1;const t=ra,e=im(),r=m=>m!==null&&typeof m=="object"&&!Array.isArray(m),n=m=>$=>m===!0?Number($):String($),s=m=>typeof m=="number"||typeof m=="string"&&m!=="",i=m=>Number.isInteger(+m),o=m=>{let $=`${m}`,v=-1;if($[0]==="-"&&($=$.slice(1)),$==="0")return!1;for(;$[++v]==="0";);return v>0},a=(m,$,v)=>typeof m=="string"||typeof $=="string"?!0:v.stringify===!0,u=(m,$,v)=>{if($>0){let E=m[0]==="-"?"-":"";E&&(m=m.slice(1)),m=E+m.padStart(E?$-1:$,"0")}return v===!1?String(
|
|
255
|
+
m):m},l=(m,$)=>{let v=m[0]==="-"?"-":"";for(v&&(m=m.slice(1),$--);m.length<$;)m="0"+m;return v?"-"+m:m},c=(m,$,v)=>{m.negatives.sort((B,D)=>B<D?-1:B>D?1:0),m.positives.sort((B,D)=>B<D?-1:B>D?1:0);let E=$.capture?"":"?:",S="",I="",F;return m.positives.length&&(S=m.positives.map(B=>l(String(B),v)).join("|")),m.negatives.length&&(I=`-(${E}${m.negatives.map(B=>l(String(B),v)).join("|")})`),S&&I?F=`${S}|${I}`:F=S||I,$.wrap?`(${E}${F})`:F},d=(m,$,v,E)=>{if(v)return e(m,$,{wrap:!1,...E});let S=String.fromCharCode(
|
|
256
|
+
m);if(m===$)return S;let I=String.fromCharCode($);return`[${S}-${I}]`},h=(m,$,v)=>{if(Array.isArray(m)){let E=v.wrap===!0,S=v.capture?"":"?:";return E?`(${S}${m.join("|")})`:m.join("|")}return e(m,$,v)},y=(...m)=>new RangeError("Invalid range arguments: "+t.inspect(...m)),b=(m,$,v)=>{if(v.strictRanges===!0)throw y([m,$]);return[]},_=(m,$)=>{if($.strictRanges===!0)throw new TypeError(`Expected step "${m}" to be a number`);return[]},f=(m,$,v=1,E={})=>{let S=Number(m),I=Number($);if(!Number.isInteger(
|
|
257
|
+
S)||!Number.isInteger(I)){if(E.strictRanges===!0)throw y([m,$]);return[]}S===0&&(S=0),I===0&&(I=0);let F=S>I,B=String(m),D=String($),k=String(v);v=Math.max(Math.abs(v),1);let j=o(B)||o(D)||o(k),x=j?Math.max(B.length,D.length,k.length):0,H=j===!1&&a(m,$,E)===!1,K=E.transform||n(H);if(E.toRegex&&v===1)return d(l(m,x),l($,x),!0,E);let G={negatives:[],positives:[]},X=A=>G[A<0?"negatives":"positives"].push(Math.abs(A)),se=[],U=0;for(;F?S>=I:S<=I;)E.toRegex===!0&&v>1?X(S):se.push(u(K(S,U),x,H)),S=F?S-
|
|
258
|
+
v:S+v,U++;return E.toRegex===!0?v>1?c(G,E,x):h(se,null,{wrap:!1,...E}):se},g=(m,$,v=1,E={})=>{if(!i(m)&&m.length>1||!i($)&&$.length>1)return b(m,$,E);let S=E.transform||(H=>String.fromCharCode(H)),I=`${m}`.charCodeAt(0),F=`${$}`.charCodeAt(0),B=I>F,D=Math.min(I,F),k=Math.max(I,F);if(E.toRegex&&v===1)return d(D,k,!1,E);let j=[],x=0;for(;B?I>=F:I<=F;)j.push(S(I,x)),I=B?I-v:I+v,x++;return E.toRegex===!0?h(j,null,{wrap:!1,options:E}):j},p=(m,$,v,E={})=>{if($==null&&s(m))return[m];if(!s(m)||!s($))return b(
|
|
259
|
+
m,$,E);if(typeof v=="function")return p(m,$,1,{transform:v});if(r(v))return p(m,$,0,v);let S={...E};return S.capture===!0&&(S.wrap=!0),v=v||S.step||1,i(v)?i(m)&&i($)?f(m,$,v,S):g(m,$,Math.max(Math.abs(v),1),S):v!=null&&!r(v)?_(v,S):p(m,$,1,v)};return oi=p,oi}var ai,sc;function om(){if(sc)return ai;sc=1;const t=nc(),e=ti();return ai=(n,s={})=>{const i=(o,a={})=>{const u=e.isInvalidBrace(a),l=o.invalid===!0&&s.escapeInvalid===!0,c=u===!0||l===!0,d=s.escapeInvalid===!0?"\\":"";let h="";if(o.isOpen===
|
|
260
|
+
!0)return d+o.value;if(o.isClose===!0)return console.log("node.isClose",d,o.value),d+o.value;if(o.type==="open")return c?d+o.value:"(";if(o.type==="close")return c?d+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":c?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const y=e.reduce(o.nodes),b=t(...y,{...s,wrap:!1,toRegex:!0,strictZeros:!0});if(b.length!==0)return y.length>1&&b.length>1?`(${b})`:b}if(o.nodes)for(const y of o.nodes)h+=i(y,o);return h};return i(n)},ai}var ci,
|
|
261
|
+
ic;function am(){if(ic)return ci;ic=1;const t=nc(),e=ni(),r=ti(),n=(i="",o="",a=!1)=>{const u=[];if(i=[].concat(i),o=[].concat(o),!o.length)return i;if(!i.length)return a?r.flatten(o).map(l=>`{${l}}`):o;for(const l of i)if(Array.isArray(l))for(const c of l)u.push(n(c,o,a));else for(let c of o)a===!0&&typeof c=="string"&&(c=`{${c}}`),u.push(Array.isArray(c)?n(l,c,a):l+c);return r.flatten(u)};return ci=(i,o={})=>{const a=o.rangeLimit===void 0?1e3:o.rangeLimit,u=(l,c={})=>{l.queue=[];let d=c,h=c.queue;
|
|
262
262
|
for(;d.type!=="brace"&&d.type!=="root"&&d.parent;)d=d.parent,h=d.queue;if(l.invalid||l.dollar){h.push(n(h.pop(),e(l,o)));return}if(l.type==="brace"&&l.invalid!==!0&&l.nodes.length===2){h.push(n(h.pop(),["{}"]));return}if(l.nodes&&l.ranges>0){const f=r.reduce(l.nodes);if(r.exceedsLimit(...f,o.step,a))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let g=t(...f,o);g.length===0&&(g=e(l,o)),h.push(n(h.pop(),g)),l.nodes=[];return}
|
|
263
|
-
const
|
|
263
|
+
const y=r.encloseBrace(l);let b=l.queue,_=l;for(;_.type!=="brace"&&_.type!=="root"&&_.parent;)_=_.parent,b=_.queue;for(let f=0;f<l.nodes.length;f++){const g=l.nodes[f];if(g.type==="comma"&&l.type==="brace"){f===1&&b.push(""),b.push("");continue}if(g.type==="close"){h.push(n(h.pop(),b,y));continue}if(g.value&&g.type!=="open"){b.push(n(b.pop(),g.value));continue}g.nodes&&u(g,l)}return b};return r.flatten(u(i))},ci}var ui,oc;function cm(){return oc||(oc=1,ui={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"\
|
|
264
264
|
A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"\
|
|
265
265
|
{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
266
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),
|
|
267
|
-
CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:l,CHAR_LEFT_SQUARE_BRACKET:c,CHAR_RIGHT_SQUARE_BRACKET:d,CHAR_DOUBLE_QUOTE:h,CHAR_SINGLE_QUOTE:
|
|
268
|
-
let
|
|
269
|
-
|
|
270
|
-
type:"brace",open:!0,close:!1,dollar:I.value&&I.value.slice(-1)==="$"||
|
|
271
|
-
const
|
|
272
|
-
"close"&&(
|
|
273
|
-
|
|
274
|
-
=.)",u="[^/]",l=`(?:${o}|$)`,c=`(?:^|${o})`,d=`${n}{1,2}${l}`,h=`(?!${n})`,
|
|
275
|
-
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`}
|
|
266
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),ui}var li,ac;function um(){if(ac)return li;ac=1;const t=ni(),{MAX_LENGTH:e,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:s,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,
|
|
267
|
+
CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:l,CHAR_LEFT_SQUARE_BRACKET:c,CHAR_RIGHT_SQUARE_BRACKET:d,CHAR_DOUBLE_QUOTE:h,CHAR_SINGLE_QUOTE:y,CHAR_NO_BREAK_SPACE:b,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_}=cm();return li=(g,p={})=>{if(typeof g!="string")throw new TypeError("Expected a string");const m=p||{},$=typeof m.maxLength=="number"?Math.min(e,m.maxLength):e;if(g.length>$)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${$})`);const v={type:"root",input:g,nodes:[]},E=[v];
|
|
268
|
+
let S=v,I=v,F=0;const B=g.length;let D=0,k=0,j;const x=()=>g[D++],H=K=>{if(K.type==="text"&&I.type==="dot"&&(I.type="text"),I&&I.type==="text"&&K.type==="text"){I.value+=K.value;return}return S.nodes.push(K),K.parent=S,K.prev=I,I=K,K};for(H({type:"bos"});D<B;)if(S=E[E.length-1],j=x(),!(j===_||j===b)){if(j===r){H({type:"text",value:(p.keepEscaping?j:"")+x()});continue}if(j===d){H({type:"text",value:"\\"+j});continue}if(j===c){F++;let K;for(;D<B&&(K=x());){if(j+=K,K===c){F++;continue}if(K===r){j+=
|
|
269
|
+
x();continue}if(K===d&&(F--,F===0))break}H({type:"text",value:j});continue}if(j===o){S=H({type:"paren",nodes:[]}),E.push(S),H({type:"text",value:j});continue}if(j===a){if(S.type!=="paren"){H({type:"text",value:j});continue}S=E.pop(),H({type:"text",value:j}),S=E[E.length-1];continue}if(j===h||j===y||j===n){const K=j;let G;for(p.keepQuotes!==!0&&(j="");D<B&&(G=x());){if(G===r){j+=G+x();continue}if(G===K){p.keepQuotes===!0&&(j+=G);break}j+=G}H({type:"text",value:j});continue}if(j===u){k++;const G={
|
|
270
|
+
type:"brace",open:!0,close:!1,dollar:I.value&&I.value.slice(-1)==="$"||S.dollar===!0,depth:k,commas:0,ranges:0,nodes:[]};S=H(G),E.push(S),H({type:"open",value:j});continue}if(j===l){if(S.type!=="brace"){H({type:"text",value:j});continue}const K="close";S=E.pop(),S.close=!0,H({type:K,value:j}),k--,S=E[E.length-1];continue}if(j===s&&k>0){if(S.ranges>0){S.ranges=0;const K=S.nodes.shift();S.nodes=[K,{type:"text",value:t(S)}]}H({type:"comma",value:j}),S.commas++;continue}if(j===i&&k>0&&S.commas===0){
|
|
271
|
+
const K=S.nodes;if(k===0||K.length===0){H({type:"text",value:j});continue}if(I.type==="dot"){if(S.range=[],I.value+=j,I.type="range",S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,I.type="text";continue}S.ranges++,S.args=[];continue}if(I.type==="range"){K.pop();const G=K[K.length-1];G.value+=I.value+j,I=G,S.ranges--;continue}H({type:"dot",value:j});continue}H({type:"text",value:j})}do if(S=E.pop(),S.type!=="root"){S.nodes.forEach(X=>{X.nodes||(X.type==="open"&&(X.isOpen=!0),X.type===
|
|
272
|
+
"close"&&(X.isClose=!0),X.nodes||(X.type="text"),X.invalid=!0)});const K=E[E.length-1],G=K.nodes.indexOf(S);K.nodes.splice(G,1,...S.nodes)}while(E.length>0);return H({type:"eos"}),v},li}var fi,cc;function lm(){if(cc)return fi;cc=1;const t=ni(),e=om(),r=am(),n=um(),s=(i,o={})=>{let a=[];if(Array.isArray(i))for(const u of i){const l=s.create(u,o);Array.isArray(l)?a.push(...l):a.push(l)}else a=[].concat(s.create(i,o));return o&&o.expand===!0&&o.nodupes===!0&&(a=[...new Set(a)]),a};return s.parse=(i,o={})=>n(
|
|
273
|
+
i,o),s.stringify=(i,o={})=>t(typeof i=="string"?s.parse(i,o):i,o),s.compile=(i,o={})=>(typeof i=="string"&&(i=s.parse(i,o)),e(i,o)),s.expand=(i,o={})=>{typeof i=="string"&&(i=s.parse(i,o));let a=r(i,o);return o.noempty===!0&&(a=a.filter(Boolean)),o.nodupes===!0&&(a=[...new Set(a)]),a},s.create=(i,o={})=>i===""||i.length<3?[i]:o.expand!==!0?s.compile(i,o):s.expand(i,o),fi=s,fi}var di={},hi,uc;function Yr(){if(uc)return hi;uc=1;const t=bs,e="\\\\/",r=`[^${e}]`,n="\\.",s="\\+",i="\\?",o="\\/",a="(?\
|
|
274
|
+
=.)",u="[^/]",l=`(?:${o}|$)`,c=`(?:^|${o})`,d=`${n}{1,2}${l}`,h=`(?!${n})`,y=`(?!${c}${d})`,b=`(?!${n}{0,1}${l})`,_=`(?!${d})`,f=`[^.${o}]`,g=`${u}*?`,p={DOT_LITERAL:n,PLUS_LITERAL:s,QMARK_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:a,QMARK:u,END_ANCHOR:l,DOTS_SLASH:d,NO_DOT:h,NO_DOTS:y,NO_DOT_SLASH:b,NO_DOTS_SLASH:_,QMARK_NO_DOT:f,STAR:g,START_ANCHOR:c},m={...p,SLASH_LITERAL:`[${e}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,
|
|
275
|
+
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},$={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return hi={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
|
|
276
276
|
REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,
|
|
277
277
|
CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,
|
|
278
|
-
CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars(v){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${v.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(v){return v===!0?m:p}},
|
|
279
|
-
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:
|
|
280
|
-
a[0]===8&&a[1]>=10},t.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:r===!0||e.sep==="\\",t.escapeLast=(a,u,l)=>{const c=a.lastIndexOf(u,l);return c===-1?a:a[c-1]==="\\"?t.escapeLast(a,u,c-1):`${a.slice(0,c)}\\${a.slice(c)}`},t.removePrefix=(a,u={})=>{let l=a;return l.startsWith("./")&&(l=l.slice(2),u.prefix="./"),l},t.wrapOutput=(a,u={},l={})=>{const c=l.contains?"":"^",d=l.contains?"":"$";let h=`${c}(?:${a})${d}`;return u.negated===!0&&(h=`(?:^(?!${h}).*$)`),h}}(
|
|
281
|
-
if(
|
|
282
|
-
|
|
283
|
-
!0,
|
|
284
|
-
break}if(
|
|
285
|
-
continue}break}if(
|
|
286
|
-
if(v.tokens===!0&&(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
"
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
`);const a={html:[],css:[],js:[],other:[]};for(const l of Object.keys(o))
|
|
324
|
-
u.push(h),d
|
|
325
|
-
output={});const e=r=>{r.inlineDynamicImports=!0};if(Array.isArray(t.build.rollupOptions.output))for(const r of t.build.rollupOptions.output)e(r);else e(t.build.rollupOptions.output)}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
"
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
`+s,D=g.join(m);p=`[
|
|
384
|
-
`+s+D+`,
|
|
385
|
-
`+f+"]"}return i.pop(),s=f,p}};const hg={parse:og,stringify:dg};var Ct=hg;const pg=t=>t.charAt(0).toLocaleUpperCase()+t.slice(1),mg=t=>t.split(".").map(pg).join(""),gg=t=>mg(t.parent?t.id.slice(t.parent.length+1):t.id),yg=({autoLayout:t})=>{switch(t.direction){case"TB":return"down";case"BT":return"up";case"LR":return"right";case"RL":return"left"}},Eg=({shape:t})=>{switch(t){case"queue":case"cylinder":case"rectangle":case"person":return t;case"storage":return"stored_data";case"mobile":case"browse\
|
|
386
|
-
r":return"rectangle"}};function _c(t){const{nodes:e,edges:r}=t,n=new Map,i=(o,a)=>{const u=gg(o),l=(a?a+".":"")+u;n.set(o.id,l);const c=JSON.stringify(o.title),d=Eg(o);return new Ne().append(u,": {",ve).indent({indentedChildren:h=>h.append("label: ",c,ve).appendIf(d!=="rectangle","shape: ",d,ve).appendIf(o.children.length>0,ve,nt(e.filter(E=>E.parent===o.id),E=>i(E,l))),indentation:2}).append("}",ve)},s=o=>new Ne().append(n.get(o.source)," -> ",n.get(o.target)).append(a=>o.label&&a.append(": ",JSON.
|
|
387
|
-
stringify(o.label)));return kt(new Ne().append("direction: ",yg(t),ve,ve).append(nt(e.filter(o=>Ji(o.parent)),o=>i(o),{appendNewLineIfNotEmpty:!0})).appendIf(r.length>0,ve,nt(r,o=>s(o),{appendNewLineIfNotEmpty:!0})))}const Dg=t=>t.charAt(0).toLocaleUpperCase()+t.slice(1),vg=t=>t.split(".").map(Dg).join(""),$g=t=>vg(t.parent?t.id.slice(t.parent.length+1):t.id),_g=({shape:t})=>{switch(t){case"queue":case"cylinder":return["[(",")]"];case"person":return["[fa:fa-user ","]"];case"storage":return["([",
|
|
388
|
-
"])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function wc(t){const{nodes:e,edges:r}=t,n=new Map,i=(o,a)=>{const u=$g(o),l=(a?a+".":"")+u;n.set(o.id,l);const c=o.title.replaceAll(`
|
|
389
|
-
`,"\\n"),d=_g(o),h=new Ne;return o.children.length>0?h.append("subgraph ",l,"[",JSON.stringify(o.title),"]",ve).indent({indentedChildren:[nt(e.filter(E=>E.parent===o.id),E=>i(E,l),{appendNewLineIfNotEmpty:!0})],indentation:2}).append("end",ve):h.append(l,d[0],c,d[1]),h},s=o=>new Ne().append(n.get(o.source)," -.",o.label?' "'+o.label.replaceAll(`
|
|
390
|
-
`,"\\n")+'" .-':"-","> ",n.get(o.target));return kt(new Ne().appendIf(t.title!==null&&t.title.length>0,"---",ve,`title: ${JSON.stringify(t.title)}`,ve,"---",ve).append("graph ",t.autoLayout.direction,ve).indent({indentedChildren:o=>{o.append(nt(e.filter(a=>Ji(a.parent)),a=>i(a),{appendNewLineIfNotEmpty:!0})).appendIf(r.length>0,nt(r,a=>s(a),{appendNewLineIfNotEmpty:!0}))},indentation:2}))}function wg(t){const e=new Ne;return e.appendTemplate`
|
|
391
|
-
/* prettier-ignore-start */
|
|
392
|
-
/* eslint-disable */
|
|
393
|
-
|
|
394
|
-
/******************************************************************************
|
|
395
|
-
* This file was generated
|
|
396
|
-
* DO NOT EDIT MANUALLY!
|
|
397
|
-
******************************************************************************/
|
|
398
|
-
|
|
399
|
-
import { LikeC4Model } from 'likec4/model'
|
|
400
|
-
|
|
401
|
-
export const likeC4Model = LikeC4Model.fromDump(${Ct.stringify(t.$model,{space:2,quote:"'"})})
|
|
402
|
-
|
|
403
|
-
export type LikeC4ModelTypes = typeof likeC4Model.Aux
|
|
404
|
-
export type LikeC4ElementId = LikeC4ModelTypes['Fqn']
|
|
405
|
-
export type LikeC4DeploymentId = LikeC4ModelTypes['Deployment']
|
|
406
|
-
export type LikeC4ViewId = LikeC4ModelTypes['ViewId']
|
|
407
|
-
|
|
408
|
-
/* prettier-ignore-end */
|
|
409
|
-
`,kt(e)}function bg(t){return nt(t,e=>jt`${Ct.stringify(e.id)}`,{separator:" | "})}function Ag(t){const e=Array.from(t),r=new Ne;return r.appendTemplate`
|
|
410
|
-
/******************************************************************************
|
|
411
|
-
* This file was generated
|
|
412
|
-
* DO NOT EDIT MANUALLY!
|
|
413
|
-
******************************************************************************/
|
|
414
|
-
/* prettier-ignore-start */
|
|
415
|
-
/* eslint-disable */
|
|
416
|
-
|
|
417
|
-
// @ts-nocheck
|
|
418
|
-
|
|
419
|
-
import type { DiagramView } from 'likec4'
|
|
420
|
-
`.append(ve,ve),e.length===0?(r.append("export {}",ve),kt(r)):(r.appendTemplate`
|
|
421
|
-
export type LikeC4ViewId = ${bg(e)};
|
|
422
|
-
export const LikeC4Views = {
|
|
423
|
-
`.indent({indentation:2,indentedChildren(n){n.appendNewLineIf(e.length>1).append(nt(e,i=>jt`${Ct.stringify(i.id)}: (${Ct.stringify(i)} as unknown) as DiagramView`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("} as const satisfies Record<LikeC4ViewId, DiagramView>",ve,ve).appendTemplate`
|
|
424
|
-
export type LikeC4Views = typeof LikeC4Views
|
|
425
|
-
|
|
426
|
-
export function isLikeC4ViewId(value: unknown): value is LikeC4ViewId {
|
|
427
|
-
return (
|
|
428
|
-
value != null &&
|
|
429
|
-
typeof value === 'string' &&
|
|
430
|
-
!!LikeC4Views[value]
|
|
431
|
-
)
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
/* prettier-ignore-end */
|
|
435
|
-
`.append(ve),kt(r))}function Yr(t){t instanceof Set&&(t=[...t].sort(Qp));const e=t.map(r=>` | ${JSON.stringify(r)}`);return e.length===0&&e.push(" never"),e.join(`
|
|
436
|
-
`)+";"}function Cg(t){const{fqns:e,tags:r,kinds:n}=eu([...t.elements()]).reduce((o,a)=>(o.fqns.push(a.id),o.kinds.add(a.kind),o.tags.push(...a.tags),o),{fqns:[],kinds:new Set,tags:[]}),i=eu([...t.deployment.elements()]).map(o=>o.id),{viewIds:s}=[...t.views()].reduce((o,a)=>(o.viewIds.add(a.id),o.tags.push(...a.tags),o.tags.push(...a.includedTags),o),{viewIds:new Set,tags:r});return`
|
|
437
|
-
/* prettier-ignore-start */
|
|
438
|
-
/* eslint-disable */
|
|
439
|
-
|
|
440
|
-
/******************************************************************************
|
|
441
|
-
* This file was generated
|
|
442
|
-
* DO NOT EDIT MANUALLY!
|
|
443
|
-
******************************************************************************/
|
|
444
|
-
|
|
445
|
-
import type { PropsWithChildren } from 'react'
|
|
446
|
-
import type { JSX } from 'react/jsx-runtime'
|
|
447
|
-
import type {
|
|
448
|
-
DiagramView,
|
|
449
|
-
LikeC4Model as GenericLikeC4Model,
|
|
450
|
-
} from 'likec4/model'
|
|
451
|
-
import type {
|
|
452
|
-
LikeC4ViewProps as GenericLikeC4ViewProps,
|
|
453
|
-
ReactLikeC4Props as GenericReactLikeC4Props
|
|
454
|
-
} from 'likec4/react'
|
|
455
|
-
|
|
456
|
-
type LikeC4ElementId =
|
|
457
|
-
${Yr(e)}
|
|
458
|
-
|
|
459
|
-
type LikeC4DeploymentId =
|
|
460
|
-
${Yr(i)}
|
|
461
|
-
|
|
462
|
-
type LikeC4ViewId =
|
|
463
|
-
${Yr(s)}
|
|
464
|
-
|
|
465
|
-
type LikeC4ElementKind =
|
|
466
|
-
${Yr(n)}
|
|
467
|
-
|
|
468
|
-
type LikeC4Tag =
|
|
469
|
-
${Yr(new Set(r))}
|
|
470
|
-
|
|
471
|
-
declare function isLikeC4ViewId(value: unknown): value is LikeC4ViewId;
|
|
472
|
-
|
|
473
|
-
type Aux = GenericLikeC4Model.Typed<LikeC4ElementId, LikeC4DeploymentId, LikeC4ViewId, DiagramView<LikeC4ViewId>>;
|
|
474
|
-
type LikeC4Model = GenericLikeC4Model<Aux>;
|
|
475
|
-
type LikeC4ViewModel = GenericLikeC4Model.View<Aux>;
|
|
476
|
-
|
|
477
|
-
declare const likeC4Model: LikeC4Model;
|
|
478
|
-
declare function useLikeC4Model(): LikeC4Model;
|
|
479
|
-
declare function useLikeC4View(viewId: LikeC4ViewId): DiagramView<LikeC4ViewId>;
|
|
480
|
-
declare function useLikeC4ViewModel(viewId: LikeC4ViewId): LikeC4ViewModel;
|
|
481
|
-
|
|
482
|
-
declare function LikeC4ModelProvider(props: PropsWithChildren): JSX.Element;
|
|
483
|
-
|
|
484
|
-
type IconRendererProps = {
|
|
485
|
-
node: {
|
|
486
|
-
id: string
|
|
487
|
-
title: string
|
|
488
|
-
icon?: string | undefined
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
declare function RenderIcon(props: IconRendererProps): JSX.Element;
|
|
492
|
-
|
|
493
|
-
type LikeC4ViewProps = GenericLikeC4ViewProps<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>;
|
|
494
|
-
declare function LikeC4View({viewId, ...props}: LikeC4ViewProps): JSX.Element;
|
|
495
|
-
|
|
496
|
-
type ReactLikeC4Props = GenericReactLikeC4Props<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>
|
|
497
|
-
declare function ReactLikeC4({viewId, ...props}: ReactLikeC4Props): JSX.Element;
|
|
498
|
-
|
|
499
|
-
export {
|
|
500
|
-
type LikeC4ElementId,
|
|
501
|
-
type LikeC4DeploymentId,
|
|
502
|
-
type LikeC4ViewId,
|
|
503
|
-
type LikeC4Tag,
|
|
504
|
-
type LikeC4ElementKind,
|
|
505
|
-
type LikeC4ViewProps,
|
|
506
|
-
type ReactLikeC4Props,
|
|
507
|
-
type LikeC4Model,
|
|
508
|
-
isLikeC4ViewId,
|
|
509
|
-
useLikeC4Model,
|
|
510
|
-
useLikeC4View,
|
|
511
|
-
useLikeC4ViewModel,
|
|
512
|
-
likeC4Model,
|
|
513
|
-
LikeC4ModelProvider,
|
|
514
|
-
LikeC4View,
|
|
515
|
-
RenderIcon,
|
|
516
|
-
ReactLikeC4
|
|
517
|
-
}
|
|
518
|
-
/* prettier-ignore-end */
|
|
519
|
-
`.trimStart()}function Sg(t){const e=new Ne;return e.appendTemplate`
|
|
520
|
-
/******************************************************************************
|
|
521
|
-
* This file was generated
|
|
522
|
-
* DO NOT EDIT MANUALLY!
|
|
523
|
-
******************************************************************************/
|
|
524
|
-
/* eslint-disable */
|
|
525
|
-
|
|
526
|
-
export function d2Source(viewId) {
|
|
527
|
-
switch (viewId) {
|
|
528
|
-
`.appendNewLine().indent({indentation:4,indentedChildren(r){r.append(nt(t,n=>jt`
|
|
529
|
-
case ${JSON.stringify(n.id)}: {
|
|
530
|
-
return ${JSON.stringify(_c(n))}
|
|
531
|
-
}
|
|
532
|
-
`,{appendNewLineIfNotEmpty:!0})).appendTemplate`
|
|
533
|
-
default: {
|
|
534
|
-
throw new Error('Unknown viewId: ' + viewId)
|
|
535
|
-
}
|
|
536
|
-
`}}).append(ve," }",ve).appendTemplate`
|
|
537
|
-
}
|
|
538
|
-
`.append(ve,ve),kt(e)}function Rg(t){const e=new Ne;return e.appendTemplate`
|
|
539
|
-
/******************************************************************************
|
|
540
|
-
* This file was generated
|
|
541
|
-
* DO NOT EDIT MANUALLY!
|
|
542
|
-
******************************************************************************/
|
|
543
|
-
/* eslint-disable */
|
|
544
|
-
|
|
545
|
-
export function dotSource(viewId) {
|
|
546
|
-
switch (viewId) {
|
|
547
|
-
`.appendNewLine().indent({indentation:4,indentedChildren(r){r.append(nt(Object.keys(t),n=>jt`
|
|
548
|
-
case ${JSON.stringify(n)}: {
|
|
549
|
-
return ${JSON.stringify(t[n].dot)}
|
|
550
|
-
}
|
|
551
|
-
`,{appendNewLineIfNotEmpty:!0})).appendTemplate`
|
|
552
|
-
default: {
|
|
553
|
-
throw new Error('Unknown viewId: ' + viewId)
|
|
554
|
-
}
|
|
555
|
-
`}}).append(ve," }",ve).appendTemplate`
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
export function svgSource(viewId) {
|
|
559
|
-
switch (viewId) {
|
|
560
|
-
`.appendNewLine().indent({indentation:4,indentedChildren(r){r.append(nt(Object.keys(t),n=>jt`
|
|
561
|
-
case ${JSON.stringify(n)}: {
|
|
562
|
-
return ${JSON.stringify(t[n].svg)}
|
|
563
|
-
}
|
|
564
|
-
`,{appendNewLineIfNotEmpty:!0})).appendTemplate`
|
|
565
|
-
default: {
|
|
566
|
-
throw new Error('Unknown viewId: ' + viewId)
|
|
567
|
-
}
|
|
568
|
-
`}}).append(ve," }",ve,"}",ve,ve),kt(e)}function Og(t){const e=_p(t.flatMap(i=>i.nodes.map(s=>s.icon)),Ma(Ua),Ma(i=>qa(i)&&!i.toLowerCase().startsWith("http")),wp()).sort(),{imports:r,cases:n}=e.reduce((i,s,o)=>{const[a,u]=s.split(":"),l="Icon"+o.toString().padStart(2,"0");return i.imports.push(`import ${l} from 'likec4/icons/${a}/${u}'`),i.cases.push(` '${a}:${u}': ${l}`),i},{imports:[],cases:[]});return`
|
|
569
|
-
${r.join(`
|
|
570
|
-
`)}
|
|
571
|
-
|
|
572
|
-
export const Icons = {
|
|
573
|
-
${n.join(`,
|
|
574
|
-
`)}
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
if (import.meta.hot) {
|
|
578
|
-
import.meta.hot.accept(md => {
|
|
579
|
-
const update = md.Icons
|
|
580
|
-
if (update) {
|
|
581
|
-
if (!import.meta.hot.data.icons) {
|
|
582
|
-
import.meta.hot.data.icons = Icons
|
|
583
|
-
}
|
|
584
|
-
Object.assign(import.meta.hot.data.icons, update)
|
|
585
|
-
} else {
|
|
586
|
-
import.meta.hot.invalidate()
|
|
587
|
-
}
|
|
588
|
-
})
|
|
589
|
-
}
|
|
590
|
-
`}function Ig(t){const{views:e,...r}=t.$model;return`
|
|
591
|
-
import { createLikeC4Model } from 'likec4/model'
|
|
592
|
-
import { nano } from 'likec4/react'
|
|
593
|
-
|
|
594
|
-
// This is needed for better tree shaking
|
|
595
|
-
export const LikeC4Views = ${Ct.stringify(e)}
|
|
596
|
-
|
|
597
|
-
export const likeC4Model = /* @__PURE__ */ createLikeC4Model(Object.assign(
|
|
598
|
-
${Ct.stringify(r)},
|
|
599
|
-
{views: LikeC4Views}
|
|
600
|
-
))
|
|
601
|
-
|
|
602
|
-
export const $likec4model = /* @__PURE__ */ nano.atom(likeC4Model)
|
|
603
|
-
|
|
604
|
-
export function useLikeC4Model() {
|
|
605
|
-
return /* @__PURE__ */ nano.useStore($likec4model)
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
if (import.meta.hot) {
|
|
609
|
-
import.meta.hot.accept(md => {
|
|
610
|
-
const update = md.$likec4model
|
|
611
|
-
if (update) {
|
|
612
|
-
if (!import.meta.hot.data.$current) {
|
|
613
|
-
import.meta.hot.data.$current = $likec4model
|
|
614
|
-
}
|
|
615
|
-
import.meta.hot.data.$current.set(update.get())
|
|
616
|
-
} else {
|
|
617
|
-
import.meta.hot.invalidate()
|
|
618
|
-
}
|
|
619
|
-
})
|
|
620
|
-
}
|
|
621
|
-
`}function Fg(t){const e=new Ne;return e.appendTemplate`
|
|
622
|
-
/******************************************************************************
|
|
623
|
-
* This file was generated
|
|
624
|
-
* DO NOT EDIT MANUALLY!
|
|
625
|
-
******************************************************************************/
|
|
626
|
-
/* eslint-disable */
|
|
627
|
-
|
|
628
|
-
export function mmdSource(viewId) {
|
|
629
|
-
switch (viewId) {
|
|
630
|
-
`.appendNewLine().indent({indentation:4,indentedChildren(r){r.append(nt(t,n=>jt`
|
|
631
|
-
case ${JSON.stringify(n.id)}: {
|
|
632
|
-
return ${JSON.stringify(wc(n))}
|
|
633
|
-
}
|
|
634
|
-
`,{appendNewLineIfNotEmpty:!0})).appendTemplate`
|
|
635
|
-
default: {
|
|
636
|
-
throw new Error('Unknown viewId: ' + viewId)
|
|
637
|
-
}
|
|
638
|
-
`}}).append(ve," }",ve).appendTemplate`
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
`.append(ve,ve),kt(e)}function bc(t){return`
|
|
642
|
-
import { nano } from 'likec4/react'
|
|
643
|
-
|
|
644
|
-
export const $graph = nano.atom(${Ct.stringify(t,null,2)})
|
|
645
|
-
|
|
646
|
-
export const useOverviewGraph = () => {
|
|
647
|
-
return nano.useStore($graph)
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
if (import.meta.hot) {
|
|
651
|
-
import.meta.hot.accept(md => {
|
|
652
|
-
const update = md.$graph
|
|
653
|
-
if (update) {
|
|
654
|
-
if (!import.meta.hot.data.graph) {
|
|
655
|
-
import.meta.hot.data.graph = $graph
|
|
656
|
-
}
|
|
657
|
-
import.meta.hot.data.graph.set(update.value)
|
|
658
|
-
} else {
|
|
659
|
-
import.meta.hot.invalidate()
|
|
660
|
-
}
|
|
661
|
-
})
|
|
662
|
-
}
|
|
663
|
-
`}function Pg(t,e){const{imports:r,cases:n}=t.reduce((i,{id:s},o)=>{const a=De(e,`${s}.png`);if(!Pt(a))return i;const u="Png"+o.toString().padStart(2,"0");return i.imports.push(`import ${u} from 'likec4/previews/${s}.png'`),i.cases.push(` ${JSON.stringify(s)}: ${u}`),i},{imports:[],cases:[]});return`
|
|
664
|
-
import { nano } from 'likec4/react'
|
|
665
|
-
// assets dir: ${e}
|
|
666
|
-
|
|
667
|
-
${r.join(`
|
|
668
|
-
`)}
|
|
669
|
-
|
|
670
|
-
const Previews = {
|
|
671
|
-
${n.join(`,
|
|
672
|
-
`)}
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
export let $previews = nano.map(Previews)
|
|
676
|
-
|
|
677
|
-
export let usePreviewUrl = (id) => {
|
|
678
|
-
const views = nano.useStore($previews, {
|
|
679
|
-
keys: [id]
|
|
680
|
-
})
|
|
681
|
-
return views[id] ?? null
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
if (import.meta.hot) {
|
|
685
|
-
import.meta.hot.accept(md => {
|
|
686
|
-
const update = md.$previews
|
|
687
|
-
if (update) {
|
|
688
|
-
if (!import.meta.hot.data.$current) {
|
|
689
|
-
import.meta.hot.data.$current = $previews
|
|
690
|
-
}
|
|
691
|
-
const oldKeys = new Set([...Object.keys(import.meta.hot.data.$current.get())])
|
|
692
|
-
for (const [id, view] of Object.entries(update.get())) {
|
|
693
|
-
oldKeys.delete(id)
|
|
694
|
-
import.meta.hot.data.$current.setKey(id, view)
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
for (const key of oldKeys.values()) {
|
|
698
|
-
import.meta.hot.data.$current.setKey(key, undefined)
|
|
699
|
-
}
|
|
700
|
-
} else {
|
|
701
|
-
import.meta.hot.invalidate()
|
|
702
|
-
}
|
|
703
|
-
})
|
|
704
|
-
}
|
|
705
|
-
`}const Ng={id:"virtual:likec4/dot-sources",virtualId:"\0likec4-plugin/dot-sources.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/dot-sources"));const r=await t.viewsService.viewsAsGraphvizOut(),n=Ap(r,({id:i,svg:s,dot:o})=>[i,{dot:o,svg:s}]);return Rg(n)}},Tg={id:"virtual:likec4/d2-sources",virtualId:"\0likec4-plugin/d2-sources.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/d2-sources"));const r=await t.viewsService.computedViews();return Sg(
|
|
706
|
-
r)}},Lg={id:"virtual:likec4/mmd-sources",virtualId:"\0likec4-plugin/mmd-sources.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/mmd-sources"));const r=await t.viewsService.computedViews();return Fg(r)}},jg={id:"virtual:likec4/icons",virtualId:"\0likec4-plugin/icons.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/icons"));const r=await t.viewsService.computedViews();return Og(r)}},kg={id:"virtual:likec4/overview-graph",virtualId:"\0likec4-plu\
|
|
707
|
-
gin/overview-graph.js",async load({likec4:t,logger:e,useOverviewGraph:r}){if(r===!0)try{e.info(K.dim("generating virtual:likec4/overview-graph"));const n=await t.viewsService.overviewGraph();return bc(n)}catch(n){e.error(n)}return e.info(K.dim("generating empty virtual:likec4/overview-graph")),bc({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}})}},Ac={id:"virtual:likec4/previews",virtualId:"\0likec4-plugin/previews.js",async load({likec4:t,logger:e,assetsDir:r}){e.info(K.dim("generating v\
|
|
708
|
-
irtual:likec4/previews"));const n=await t.viewsService.computedViews();return Pg(n,r)}},Bg={id:"virtual:likec4/model",virtualId:"\0likec4-plugin/model.js",async load({likec4:t,logger:e,assetsDir:r}){e.info(K.dim("generating virtual:likec4/model"));const n=await t.layoutedModel();return Ig(n)}},oo=[jg,Ng,Tg,Lg,kg,Ac,Bg],xg=t=>{const e=t.toLowerCase();return e.endsWith(".c4")||e.endsWith(".likec4")||e.endsWith(".like-c4")};function ao({useOverviewGraph:t=!1,languageServices:e}){let r,n=e.workspace;
|
|
709
|
-
return{name:"vite-plugin-likec4",configResolved(i){if(r=i.logger,t){const s=i.resolve.alias.find(o=>o.find==="likec4/previews")?.replacement;s?(n=s,r.info(K.dim("likec4/previews alias")+" "+K.dim(n))):r.warn("likec4/previews alias not found")}},resolveId(i){const s=oo.find(o=>o.id===i);return s?s.virtualId:null},async load(i){const s=oo.find(o=>o.virtualId===i);return s?await s.load({logger:r,likec4:e,assetsDir:n,useOverviewGraph:t}):null},configureServer(i){const s=bp(1),o=()=>{s.clearQueue(),s(
|
|
710
|
-
async()=>{const[l]=e.getErrors();if(l){i.ws.send({type:"error",err:{name:"LikeC4ValidationError",message:"Validation error: "+l.message.slice(0,500),stack:"",plugin:"vite-plugin-likec4",loc:{file:l.sourceFsPath,line:l.range.start.line+1,column:l.range.start.character+1}}});return}for(const c of oo){const d=i.moduleGraph.getModuleById(c.virtualId);if(d&&d.importers.size>0){r.info(`${K.green("trigger hmr")} ${K.dim(d.url)}`);try{await i.reloadModule(d)}catch(h){r.error(h)}}}})},a=e.workspace;r.info(
|
|
711
|
-
`${K.dim("watch")} ${a}`);const u=l=>c=>{xg(c)&&e.notifyUpdate({[l]:c})};if(i.watcher.add(a).on("add",u("changed")).on("change",u("changed")).on("unlink",u("removed")),t&&!n.startsWith(e.workspace)){r.info(`${K.dim("watch")} ${n}`);const l=()=>{const c=i.moduleGraph.getModuleById(Ac.virtualId);c&&c.importers.size>0&&i.reloadModule(c)};i.watcher.add(n).on("add",l).on("change",l).on("unlink",l)}e.onModelUpdate(()=>{mt.debug("likec4 model update triggered"),o()})}}}const uo=async({languageServices:t,
|
|
712
|
-
likec4AssetsDir:e,...r})=>{const n=r.customLogger??Cs,i=Rs(),s=r?.useOverviewGraph===!0;n.info(`${K.cyan("likec4 app root")} ${K.dim(i)}`);const o=r.outputDir??De(t.workspace,"dist");n.info(K.cyan("output")+" "+K.dim(o));let a="/";r.base&&(a=Cp(r.base),!Sp(a)&&a!=="./"&&(a=Rp(a))),a!=="/"&&n.info(`${K.green("app base url")} ${K.dim(a)}`);const u=r.webcomponentPrefix??"likec4";return{isDev:!1,likec4AssetsDir:e,webcomponentPrefix:u,root:i,languageServices:t,clearScreen:!1,base:a,resolve:{conditions:[
|
|
713
|
-
"production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...Fs(),"likec4/previews":e}},configFile:!1,mode:"production",optimizeDeps:{force:!0,include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react/jsx-dev-runtime","react-dom/client"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(u),__USE_STYLE_BUNDLE__:"false",__USE_OVERVIEW_GRAPH__:s?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.e\
|
|
714
|
-
nv.NODE_ENV":'"production"'},build:{outDir:o,modulePreload:!1,emptyOutDir:!1,cssCodeSplit:!1,sourcemap:!1,cssMinify:!0,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:Is,rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:n,plugins:[Za(),ao({languageServices:t,useOverviewGraph:s})].concat(r.outputSingleFile?[P0()]:[])}};async function co({languageServices:t,outDir:e,base:r,webcomponentPrefix:n="likec4",filename:i="likec4-views.js"}){const s=Cs,
|
|
715
|
-
o=Rs();return s.info(K.cyan("outDir")+" "+K.dim(e)),{root:o,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:Fs()},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Ss},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:Is,lib:{entry:"webcomponent/webcomponent.js",fileName(a,u){return i},formats:["iife"],name:"LikeC4Views"},commonjsOptions:{
|
|
716
|
-
defaultIsModuleExports:a=>a.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:s,plugins:[ao({languageServices:t,useOverviewGraph:!1})]}}const Mg=["favicon.ico","robots.txt"],qg=async({buildWebcomponent:t=!0,webcomponentPrefix:e="likec4",languageServices:r,likec4AssetsDir:n,outputSingleFile:i,...s})=>{n??=await an(Rr(un(),".likec4-assets-"));const{isDev:o,...a}=await uo(
|
|
717
|
-
{...s,languageServices:r,likec4AssetsDir:n,webcomponentPrefix:e,outputSingleFile:i}),u=await Os();for(const d of Mg){const h=De(a.root,d);Pt(h)&&Ja(h,De(u,d))}const l=await r.viewsService.computedViews(),c=await r.diagrams();if(c.length===0)throw process.exitCode=1,new Error("no views found");if(c.length===l.length?a.customLogger.info(`${K.dim("workspace:")} ${K.green("\u2713 all views layouted")}`):a.customLogger.warn(`${K.dim("workspace:")} ${K.yellow(`\u2717 layouted ${c.length} of ${l.length}\
|
|
718
|
-
views`)}`),c.forEach(d=>{d.hasLayoutDrift&&a.customLogger.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(d.id))}),t){const d=await co({webcomponentPrefix:e,languageServices:r,outDir:u,base:a.base});await Fr(d)}if(await Fr({...a,publicDir:u,mode:"production"}),i)for(let d of Yp(De(a.build.outDir)).filter(h=>h!=="index.html"))is(De(a.build.outDir,d),{recursive:!0});else{const d=De(a.build.outDir,"index.html");Pt(d)&&Ja(d,De(a.build.outDir,"404.html"))}};function Cc(t){
|
|
719
|
-
if(t.resolvedUrls)return Ha(t.resolvedUrls.network)??Ha(t.resolvedUrls.local)}function Sc(t){if(!t.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");zt([K.green("LikeC4 served at:"),"",K.dim("Local: ")+t.resolvedUrls.local.join(`
|
|
720
|
-
`+"".padEnd(9," ")),t.resolvedUrls.network.length?K.dim("Network: ")+t.resolvedUrls.network.join(`
|
|
721
|
-
`+"".padEnd(9," ")):void 0].filter(e=>Ua(e)).join(`
|
|
722
|
-
`))}class Rc extends Error{constructor(e){super(`${e} is locked`)}}const Er={old:new Set,young:new Set},Ug=1e3*15,In=1024,Fn=65535;let Xr;const Hg=()=>{const t=Ir.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(t))for(const n of r)e.add(n.address);return e},Oc=t=>new Promise((e,r)=>{const n=rm.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{const{port:i}=n.address();n.close(()=>{e(i)})})}),Ic=async(t,e)=>{if(t.host||t.port===0)return Oc(t);for(const r of e)
|
|
723
|
-
try{await Oc({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},Vg=function*(t){t&&(yield*t),yield 0};async function lo(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){const i=t.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const s of i){if(typeof s!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
|
|
724
|
-
responding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}Xr===void 0&&(Xr=setTimeout(()=>{Xr=void 0,Er.old=Er.young,Er.young=new Set},Ug),Xr.unref&&Xr.unref());const n=Hg();for(const i of Vg(e))try{if(r.has(i))continue;let s=await Ic({...t,port:i},n);for(;Er.old.has(s)||Er.young.has(s);){if(i!==0)throw new Rc(i);s=await Ic({...t,port:i},n)}return Er.young.add(s),s}catch(s){
|
|
725
|
-
if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof Rc))throw s}throw new Error("No available ports found")}function Pn(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<In||t>Fn)throw new RangeError(`'from' must be between ${In} and ${Fn}`);if(e<In||e>Fn)throw new RangeError(`'to' must be between ${In} and ${Fn}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,i){for(let s=n;s<=
|
|
726
|
-
i;s++)yield s}(t,e)}async function Fc({buildWebcomponent:t=!0,hmr:e=!0,webcomponentPrefix:r="likec4",languageServices:n,likec4AssetsDir:i,openBrowser:s,listen:o,...a}){i??=await an(Rr(un(),".likec4-assets-"));const{isDev:u,...l}=await uo({...a,languageServices:n,likec4AssetsDir:i,webcomponentPrefix:r}),c=await lo({port:[5173,...Pn(61e3,61010),...Pn(62002,62010)]}),d=await lo({port:Pn(24678,24690)}),h=await Os();let E;if(t){const y=await co({webcomponentPrefix:r,languageServices:n,outDir:h,base:l.
|
|
727
|
-
base});E=Fr({...y,logLevel:"warn"}).catch(f=>(mt.warn("webcomponent build failed",{err:f}),mt.warn("Ignoring error and continuing"),Promise.resolve()))}const $=await em({...l,define:Object.assign({},l.define,e&&{"process.env.NODE_ENV":'"development"'}),mode:e?"development":l.mode,publicDir:h,server:{host:o??"127.0.0.1",allowedHosts:!0,port:c,hmr:e&&{overlay:!0,port:d},fs:{strict:!1},open:s??!u}});return await $.listen(),E&&await E,$}async function zg({browserContext:t,views:e,output:r,logger:n,timeout:i,
|
|
728
|
-
maxAttempts:s,outputType:o,theme:a}){let u;const l=e.map(h=>({view:h,attempt:1})),c=[];let d;for(;d=l.shift();){const{view:h,attempt:E}=d,$=`/export/${encodeURIComponent(h.id)}`;try{if(E>1){u&&(u.close({runBeforeUnload:!0}).catch(m=>n.error(`failed to close page: ${m}`)),u=void 0);const p=Va(E*200,{min:200,max:1e3});n.info(K.cyan($)+K.dim(` attempt ${E} of ${s} after ${p}ms`)),await nm(p)}else h.hasLayoutDrift&&n.warn(K.yellow("Drift detected, manual layout can not be applied, view may be invali\
|
|
729
|
-
d: ")+K.red(h.id)),n.info(K.cyan($));u??=await t.newPage(),await u.setViewportSize({width:h.bounds.width+20*2,height:h.bounds.height+20*2}),await u.goto($+`?padding=20&theme=${a}`);const y=u.getByRole("presentation");await y.waitFor(),h.nodes.some(p=>qa(p.icon)&&p.icon.toLowerCase().startsWith("http"))&&await Gg(u,i);let f=".";o==="relative"&&(f=h.relativePath??".",f.includes("/")?f=f.slice(0,f.lastIndexOf("/")):f=".");const g=De(r,f,`${h.id}.png`);await y.screenshot({path:g,omitBackground:!0}),
|
|
730
|
-
c.push({view:h,path:g})}catch(y){u?.close({runBeforeUnload:!0}).catch(f=>n.error(`failed to close page: ${f}`)),n.error(K.red("failed "+$+`
|
|
731
|
-
`+y)),E<s&&(l.push({view:h,attempt:E+1}),n.info(K.dim(`retry ${$}`))),u=void 0}}return c}async function Gg(t,e){let r=await t.locator("//img").all();if(!r.length)return;const n=r.map(i=>i.evaluate(s=>s.complete||new Promise((o,a)=>{s.onload=o,s.onerror=a}),{timeout:Math.max(3e4,e)}));await Promise.allSettled(n)}async function Pc({logger:t,serverUrl:e,theme:r="light",timeoutMs:n=15e3,views:i,output:s,outputType:o="relative",maxAttempts:a=3}){t.info(`${K.cyan("export output")} ${K.dim(s)}`),t.info(
|
|
732
|
-
`${K.cyan("from server")} ${K.dim(e)}`);const u=nu.executablePath();t.info(K.cyan("Start chromium")),t.info(K.dim(u));const l=await nu.launch();t.info(K.cyan("Color scheme: ")+r);const c=await l.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:e,ignoreHTTPSErrors:!0,reducedMotion:"reduce",isMobile:!1});c.setDefaultNavigationTimeout(n),c.setDefaultTimeout(n);try{return await zg({browserContext:c,views:i,output:s,outputType:o,logger:t,maxAttempts:a,timeout:n,theme:r})}finally{t.info(K.cyan("c\
|
|
733
|
-
lose chromium")),await c.close(),await l.close()}}async function Nc({path:t,useDotBin:e,theme:r="light",output:n,outputType:i,serverUrl:s,ignore:o=!1,timeoutMs:a=1e4,maxAttempts:u=3}){const l=pt("c4:export"),c=jp(),d=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});n??=d.workspace;const h=await d.diagrams();if(!Zp(h,1))throw l.warn("no views found"),new Error("no views found");let E;if(!s&&(l.info(K.cyan("start preview server")),E=await Fc({languageServices:d,buildWebcomponent:!1,
|
|
734
|
-
openBrowser:!1,useOverviewGraph:!1,hmr:!1}),s=Cc(E),!s))throw l.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");try{const $=await Pc({logger:l,serverUrl:s,theme:r,timeoutMs:a,views:h,output:n,outputType:i,maxAttempts:u}),{pretty:y}=Op(c);if($.length>0&&l.info(K.green(`exported ${$.length} views in ${y}`)),$.length!==h.length&&(o&&$.length>0?l.info(K.dim("ignore")+" "+K.red(`failed ${h.length-$.length} out of ${h.length} views`)):l.error(K.
|
|
735
|
-
red(`failed ${h.length-$.length} out of ${h.length} views`))),$.length!==h.length&&($.length===0||!o))throw new Error(`Failed ${h.length-$.length} out of ${h.length} views`)}finally{E&&(l.info(K.cyan("stop server")),await E.close().catch($=>{l.error($)}))}}const{cyan:Tc,dim:Lc}=K;async function Wg({path:t,useDotBin:e,useHashHistory:r,webcomponentPrefix:n,useOverview:i=!1,output:s,outputSingleFile:o,base:a}){const u=pt("c4:build"),l=await gt.fromWorkspace(t,{graphviz:e?"binary":"wasm",logger:"vit\
|
|
736
|
-
e"}),c=s??De(l.workspace,"dist");let d=De(c,"assets");if(i)try{d=De(c,"assets","previews"),await $t(d,{recursive:!0}),u.info(`${Tc("Generate previews")} ${Lc(d)}
|
|
737
|
-
`),await Nc({path:t,useDotBin:e,output:d,outputType:"flat",ignore:!0})}catch(h){u.error(K.red("Failed to generate previews")),u.error(h),u.warn(K.yellow("Ignore previews and continue build")),is(d,{recursive:!0,force:!0}),i=!1}await qg({base:a,useHashHistory:o||r,customLogger:u,useOverviewGraph:i,webcomponentPrefix:n,languageServices:l,likec4AssetsDir:d,outputDir:s,outputSingleFile:o}),i&&(u.info(`${Tc("clean previews")} ${Lc(d)}`),is(d,{recursive:!0,force:!0}))}const Kg={command:"build [path]",
|
|
738
|
-
aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("path",Vr).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:De}).option("base",Uu).option("use-hash-history",qu).option("use-dot",at).option("webcomponent-prefix",As).option("use-overview",Hu).option("output-single-file",a0).example(`${K.green("$0 build -o ./build ./src")}`,K.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async t=>{
|
|
739
|
-
await Wg({path:t.path,output:t.output,base:t.base,useHashHistory:t["use-hash-history"],useDotBin:t["use-dot"],useOverview:t["use-overview"]??!1,webcomponentPrefix:t["webcomponent-prefix"],outputSingleFile:t["output-single-file"]??!1})}},ar=t=>{const e=typeof t;return t!==null&&(e==="object"||e==="function")},fo=new Set(["__proto__","prototype","constructor"]),Yg=new Set("0123456789");function Nn(t){const e=[];let r="",n="start",i=!1;for(const s of t)switch(s){case"\\":{if(n==="index")throw new Error(
|
|
740
|
-
"Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=s),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=s;break}if(fo.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=s;break}if(n==="property"){if(fo.has(r))return[];e.push(
|
|
741
|
-
r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Yg.has(s))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=s}}switch(i&&(r+="\\"),n){case"property":{if(fo.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not \
|
|
742
|
-
closed");case"start":{e.push("");break}}return e}function ho(t,e){if(typeof e!="number"&&Array.isArray(t)){const r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function jc(t,e){if(ho(t,e))throw new Error("Cannot use string index")}function Xg(t,e,r){if(!ar(t)||typeof e!="string")return r===void 0?t:r;const n=Nn(e);if(n.length===0)return r;for(let i=0;i<n.length;i++){const s=n[i];if(ho(t,s)?t=i===n.length-1?void 0:null:t=t[s],t==null){if(i!==n.length-1)return r;break}}return t===
|
|
743
|
-
void 0?r:t}function kc(t,e,r){if(!ar(t)||typeof e!="string")return t;const n=t,i=Nn(e);for(let s=0;s<i.length;s++){const o=i[s];jc(t,o),s===i.length-1?t[o]=r:ar(t[o])||(t[o]=typeof i[s+1]=="number"?[]:{}),t=t[o]}return n}function Jg(t,e){if(!ar(t)||typeof e!="string")return!1;const r=Nn(e);for(let n=0;n<r.length;n++){const i=r[n];if(jc(t,i),n===r.length-1)return delete t[i],!0;if(t=t[i],!ar(t))return!1}}function Qg(t,e){if(!ar(t)||typeof e!="string")return!1;const r=Nn(e);if(r.length===0)return!1;
|
|
744
|
-
for(const n of r){if(!ar(t)||!(n in t)||ho(t,n))return!1;t=t[n]}return!0}const xt=Ir.homedir(),po=Ir.tmpdir(),{env:Dr}=Te,Zg=t=>{const e=be.join(xt,"Library");return{data:be.join(e,"Application Support",t),config:be.join(e,"Preferences",t),cache:be.join(e,"Caches",t),log:be.join(e,"Logs",t),temp:be.join(po,t)}},ey=t=>{const e=Dr.APPDATA||be.join(xt,"AppData","Roaming"),r=Dr.LOCALAPPDATA||be.join(xt,"AppData","Local");return{data:be.join(r,t,"Data"),config:be.join(e,t,"Config"),cache:be.join(r,t,
|
|
745
|
-
"Cache"),log:be.join(r,t,"Log"),temp:be.join(po,t)}},ty=t=>{const e=be.basename(xt);return{data:be.join(Dr.XDG_DATA_HOME||be.join(xt,".local","share"),t),config:be.join(Dr.XDG_CONFIG_HOME||be.join(xt,".config"),t),cache:be.join(Dr.XDG_CACHE_HOME||be.join(xt,".cache"),t),log:be.join(Dr.XDG_STATE_HOME||be.join(xt,".local","state"),t),temp:be.join(po,e,t)}};function ry(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),Te.
|
|
746
|
-
platform==="darwin"?Zg(t):Te.platform==="win32"?ey(t):ty(t)}const Mt=(t,e)=>function(...n){return t.apply(void 0,n).catch(e)},St=(t,e)=>function(...n){try{return t.apply(void 0,n)}catch(i){return e(i)}},ny=Te.getuid?!Te.getuid():!1,iy=1e4,Xe=()=>{},Re={isChangeErrorOk:t=>{if(!Re.isNodeError(t))return!1;const{code:e}=t;return e==="ENOSYS"||!ny&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!Re.isNodeError(t))return!1;const{code:e}=t;return e==="EMFILE"||e===
|
|
747
|
-
"ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:t=>{if(!Re.isNodeError(t))throw t;if(!Re.isChangeErrorOk(t))throw t}};class sy{constructor(){this.interval=25,this.intervalId=void 0,this.limit=iy,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=e=>{this.
|
|
748
|
-
queueWaiting.add(e),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=e=>{this.queueWaiting.delete(e),this.queueActive.delete(e)},this.schedule=()=>new Promise(e=>{const r=()=>this.remove(n),n=()=>e(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const e of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(e),this.queueActive.add(e),e()}}}}}const oy=new sy,qt=(t,e)=>function(n){
|
|
749
|
-
return function i(...s){return oy.schedule().then(o=>{const a=l=>(o(),l),u=l=>{if(o(),Date.now()>=n)throw l;if(e(l)){const c=Math.round(100*Math.random());return new Promise(h=>setTimeout(h,c)).then(()=>i.apply(void 0,s))}throw l};return t.apply(void 0,s).then(a,u)})}},Ut=(t,e)=>function(n){return function i(...s){try{return t.apply(void 0,s)}catch(o){if(Date.now()>n)throw o;if(e(o))return i.apply(void 0,s);throw o}}},qe={attempt:{chmod:Mt(Me(ge.chmod),Re.onChangeError),chown:Mt(Me(ge.chown),Re.
|
|
750
|
-
onChangeError),close:Mt(Me(ge.close),Xe),fsync:Mt(Me(ge.fsync),Xe),mkdir:Mt(Me(ge.mkdir),Xe),realpath:Mt(Me(ge.realpath),Xe),stat:Mt(Me(ge.stat),Xe),unlink:Mt(Me(ge.unlink),Xe),chmodSync:St(ge.chmodSync,Re.onChangeError),chownSync:St(ge.chownSync,Re.onChangeError),closeSync:St(ge.closeSync,Xe),existsSync:St(ge.existsSync,Xe),fsyncSync:St(ge.fsync,Xe),mkdirSync:St(ge.mkdirSync,Xe),realpathSync:St(ge.realpathSync,Xe),statSync:St(ge.statSync,Xe),unlinkSync:St(ge.unlinkSync,Xe)},retry:{close:qt(Me(ge.
|
|
751
|
-
close),Re.isRetriableError),fsync:qt(Me(ge.fsync),Re.isRetriableError),open:qt(Me(ge.open),Re.isRetriableError),readFile:qt(Me(ge.readFile),Re.isRetriableError),rename:qt(Me(ge.rename),Re.isRetriableError),stat:qt(Me(ge.stat),Re.isRetriableError),write:qt(Me(ge.write),Re.isRetriableError),writeFile:qt(Me(ge.writeFile),Re.isRetriableError),closeSync:Ut(ge.closeSync,Re.isRetriableError),fsyncSync:Ut(ge.fsyncSync,Re.isRetriableError),openSync:Ut(ge.openSync,Re.isRetriableError),readFileSync:Ut(ge.readFileSync,
|
|
752
|
-
Re.isRetriableError),renameSync:Ut(ge.renameSync,Re.isRetriableError),statSync:Ut(ge.statSync,Re.isRetriableError),writeSync:Ut(ge.writeSync,Re.isRetriableError),writeFileSync:Ut(ge.writeFileSync,Re.isRetriableError)}},ay="utf8",Bc=438,uy=511,cy={},ly=Ir.userInfo().uid,fy=Ir.userInfo().gid,dy=1e3,hy=!!Te.getuid;Te.getuid&&Te.getuid();const xc=128,py=t=>t instanceof Error&&"code"in t,Mc=t=>typeof t=="string",mo=t=>t===void 0,my=Te.platform==="linux",qc=Te.platform==="win32",go=["SIGABRT","SIGALRM",
|
|
753
|
-
"SIGHUP","SIGINT","SIGTERM"];qc||go.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),my&&go.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class gy{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const r of this.callbacks)r();e&&(qc&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Te.kill(Te.pid,"SIGTERM"):Te.kill(Te.pid,e))}},this.hook=()=>{Te.once("exit",()=>this.exit());for(const e of go)try{Te.once(
|
|
754
|
-
e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}const yy=new gy,Ey=yy.register,Ue={store:{},create:t=>{const e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),i=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${t}${i}`},get:(t,e,r=!0)=>{const n=Ue.truncate(e(t));return n in Ue.store?Ue.get(t,e,r):(Ue.store[n]=r,[n,()=>delete Ue.store[n]])},purge:t=>{Ue.store[t]&&(delete Ue.store[t],qe.attempt.unlink(t))},
|
|
755
|
-
purgeSync:t=>{Ue.store[t]&&(delete Ue.store[t],qe.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(const t in Ue.store)Ue.purgeSync(t)},truncate:t=>{const e=be.basename(t);if(e.length<=xc)return t;const r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!r)return t;const n=e.length-xc;return`${t.slice(0,-e.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Ey(Ue.purgeSyncAll);function Uc(t,e,r=cy){if(Mc(r))return Uc(t,e,{encoding:r});const n=Date.now()+((r.timeout??dy)||-1);let i=null,
|
|
756
|
-
s=null,o=null;try{const a=qe.attempt.realpathSync(t),u=!!a;t=a||t,[s,i]=Ue.get(t,r.tmpCreate||Ue.create,r.tmpPurge!==!1);const l=hy&&mo(r.chown),c=mo(r.mode);if(u&&(l||c)){const d=qe.attempt.statSync(t);d&&(r={...r},l&&(r.chown={uid:d.uid,gid:d.gid}),c&&(r.mode=d.mode))}if(!u){const d=be.dirname(t);qe.attempt.mkdirSync(d,{mode:uy,recursive:!0})}o=qe.retry.openSync(n)(s,"w",r.mode||Bc),r.tmpCreated&&r.tmpCreated(s),Mc(e)?qe.retry.writeSync(n)(o,e,0,r.encoding||ay):mo(e)||qe.retry.writeSync(n)(o,e,
|
|
757
|
-
0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?qe.retry.fsyncSync(n)(o):qe.attempt.fsync(o)),qe.retry.closeSync(n)(o),o=null,r.chown&&(r.chown.uid!==ly||r.chown.gid!==fy)&&qe.attempt.chownSync(s,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Bc&&qe.attempt.chmodSync(s,r.mode);try{qe.retry.renameSync(n)(s,t)}catch(d){if(!py(d)||d.code!=="ENAMETOOLONG")throw d;qe.retry.renameSync(n)(s,Ue.truncate(t))}i(),s=null}finally{o&&qe.attempt.closeSync(o),s&&Ue.purge(s)}}var Tn={exports:{}},yo={},Rt={},ur={},Eo={},
|
|
758
|
-
Do={},vo={},Hc;function Ln(){return Hc||(Hc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(p){if(super(),!t.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){
|
|
759
|
-
return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((m,D)=>`${m}${D}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((m,D)=>(D instanceof r&&(m[D.str]=(m[D.str]||0)+1),m),
|
|
760
|
-
{})}}t._Code=n,t.nil=new n("");function i(g,...p){const m=[g[0]];let D=0;for(;D<p.length;)a(m,p[D]),m.push(g[++D]);return new n(m)}t._=i;const s=new n("+");function o(g,...p){const m=[E(g[0])];let D=0;for(;D<p.length;)m.push(s),a(m,p[D]),m.push(s,E(g[++D]));return u(m),new n(m)}t.str=o;function a(g,p){p instanceof n?g.push(...p._items):p instanceof r?g.push(p):g.push(d(p))}t.addCodeArg=a;function u(g){let p=1;for(;p<g.length-1;){if(g[p]===s){const m=l(g[p-1],g[p+1]);if(m!==void 0){g.splice(p-1,3,
|
|
761
|
-
m);continue}g[p++]="+"}p++}}function l(g,p){if(p==='""')return g;if(g==='""')return p;if(typeof g=="string")return p instanceof r||g[g.length-1]!=='"'?void 0:typeof p!="string"?`${g.slice(0,-1)}${p}"`:p[0]==='"'?g.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(g instanceof r))return`"${g}${p.slice(1)}`}function c(g,p){return p.emptyStr()?g:g.emptyStr()?p:o`${g}${p}`}t.strConcat=c;function d(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:E(Array.isArray(g)?g.join(
|
|
762
|
-
","):g)}function h(g){return new n(E(g))}t.stringify=h;function E(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=E;function $(g){return typeof g=="string"&&t.IDENTIFIER.test(g)?new n(`.${g}`):i`[${g}]`}t.getProperty=$;function y(g){if(typeof g=="string"&&t.IDENTIFIER.test(g))return new n(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}t.getEsmExportName=y;function f(g){return new n(g.toString())}t.
|
|
763
|
-
regexpCode=f}(vo)),vo}var $o={},Vc;function zc(){return Vc||(Vc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=Ln();class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};
|
|
764
|
-
class i{constructor({prefixes:l,parent:c}={}){this._names={},this._prefixes=l,this._parent=c}toName(l){return l instanceof e.Name?l:this.name(l)}name(l){return new e.Name(this._newName(l))}_newName(l){const c=this._names[l]||this._nameGroup(l);return`${l}${c.index++}`}_nameGroup(l){var c,d;if(!((d=(c=this._parent)===null||c===void 0?void 0:c._prefixes)===null||d===void 0)&&d.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this.
|
|
765
|
-
_names[l]={prefix:l,index:0}}}t.Scope=i;class s extends e.Name{constructor(l,c){super(c),this.prefix=l}setValue(l,{property:c,itemIndex:d}){this.value=l,this.scopePath=(0,e._)`.${new e.Name(c)}[${d}]`}}t.ValueScopeName=s;const o=(0,e._)`\n`;class a extends i{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:e.nil}}get(){return this._scope}name(l){return new s(l,this._newName(l))}value(l,c){var d;if(c.ref===void 0)throw new Error("CodeGen: ref must be passed\
|
|
766
|
-
in value");const h=this.toName(l),{prefix:E}=h,$=(d=c.key)!==null&&d!==void 0?d:c.ref;let y=this._values[E];if(y){const p=y.get($);if(p)return p}else y=this._values[E]=new Map;y.set($,h);const f=this._scope[E]||(this._scope[E]=[]),g=f.length;return f[g]=c.ref,h.setValue(c,{property:E,itemIndex:g}),h}getValue(l,c){const d=this._values[l];if(d)return d.get(c)}scopeRefs(l,c=this._values){return this._reduceValues(c,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,e.
|
|
767
|
-
_)`${l}${d.scopePath}`})}scopeCode(l=this._values,c,d){return this._reduceValues(l,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},c,d)}_reduceValues(l,c,d={},h){let E=e.nil;for(const $ in l){const y=l[$];if(!y)continue;const f=d[$]=d[$]||new Map;y.forEach(g=>{if(f.has(g))return;f.set(g,n.Started);let p=c(g);if(p){const m=this.opts.es5?t.varKinds.var:t.varKinds.const;E=(0,e._)`${E}${m} ${g} = ${p};${this.opts._n}`}else if(p=h?.(g))E=(0,e._)`${E}${p}${this.
|
|
768
|
-
opts._n}`;else throw new r(g);f.set(g,n.Completed)})}return E}}t.ValueScope=a}($o)),$o}var Gc;function pe(){return Gc||(Gc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=Ln(),r=zc();var n=Ln();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,
|
|
278
|
+
CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars(v){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${v.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(v){return v===!0?m:p}},hi}var lc;function Xr(){return lc||(lc=1,function(t){const e=bs,r=process.
|
|
279
|
+
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=Yr();t.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),t.hasRegexChars=a=>i.test(a),t.isRegexChar=a=>a.length===1&&t.hasRegexChars(a),t.escapeRegex=a=>a.replace(o,"\\$1"),t.toPosixSlashes=a=>a.replace(n,"/"),t.removeBackslashes=a=>a.replace(s,u=>u==="\\"?"":u),t.supportsLookbehinds=()=>{const a=process.version.slice(1).split(".").map(Number);return a.length===3&&a[0]>=9||
|
|
280
|
+
a[0]===8&&a[1]>=10},t.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:r===!0||e.sep==="\\",t.escapeLast=(a,u,l)=>{const c=a.lastIndexOf(u,l);return c===-1?a:a[c-1]==="\\"?t.escapeLast(a,u,c-1):`${a.slice(0,c)}\\${a.slice(c)}`},t.removePrefix=(a,u={})=>{let l=a;return l.startsWith("./")&&(l=l.slice(2),u.prefix="./"),l},t.wrapOutput=(a,u={},l={})=>{const c=l.contains?"":"^",d=l.contains?"":"$";let h=`${c}(?:${a})${d}`;return u.negated===!0&&(h=`(?:^(?!${h}).*$)`),h}}(di)),di}var pi,fc;function fm(){
|
|
281
|
+
if(fc)return pi;fc=1;const t=Xr(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:c,CHAR_PLUS:d,CHAR_QUESTION_MARK:h,CHAR_RIGHT_CURLY_BRACE:y,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:_}=Yr(),f=m=>m===a||m===n,g=m=>{m.isPrefix!==!0&&(m.depth=m.isGlobstar?1/0:1)};return pi=(m,$)=>{const v=$||{},E=m.length-1,S=v.parts===!0||v.scanToEnd===!0,I=[],F=[],
|
|
282
|
+
B=[];let D=m,k=-1,j=0,x=0,H=!1,K=!1,G=!1,X=!1,se=!1,U=!1,A=!1,z=!1,M=!1,w=!1,R=0,C,Y,Q={value:"",depth:0,isGlob:!1};const ie=()=>k>=E,oe=()=>D.charCodeAt(k+1),L=()=>(C=Y,D.charCodeAt(++k));for(;k<E;){Y=L();let T;if(Y===n){A=Q.backslashes=!0,Y=L(),Y===u&&(U=!0);continue}if(U===!0||Y===u){for(R++;ie()!==!0&&(Y=L());){if(Y===n){A=Q.backslashes=!0,L();continue}if(Y===u){R++;continue}if(U!==!0&&Y===i&&(Y=L())===i){if(H=Q.isBrace=!0,G=Q.isGlob=!0,w=!0,S===!0)continue;break}if(U!==!0&&Y===s){if(H=Q.isBrace=
|
|
283
|
+
!0,G=Q.isGlob=!0,w=!0,S===!0)continue;break}if(Y===y&&(R--,R===0)){U=!1,H=Q.isBrace=!0,w=!0;break}}if(S===!0)continue;break}if(Y===a){if(I.push(k),F.push(Q),Q={value:"",depth:0,isGlob:!1},w===!0)continue;if(C===i&&k===j+1){j+=2;continue}x=k+1;continue}if(v.noext!==!0&&(Y===d||Y===r||Y===e||Y===h||Y===o)===!0&&oe()===l){if(G=Q.isGlob=!0,X=Q.isExtglob=!0,w=!0,Y===o&&k===j&&(M=!0),S===!0){for(;ie()!==!0&&(Y=L());){if(Y===n){A=Q.backslashes=!0,Y=L();continue}if(Y===b){G=Q.isGlob=!0,w=!0;break}}continue}
|
|
284
|
+
break}if(Y===e){if(C===e&&(se=Q.isGlobstar=!0),G=Q.isGlob=!0,w=!0,S===!0)continue;break}if(Y===h){if(G=Q.isGlob=!0,w=!0,S===!0)continue;break}if(Y===c){for(;ie()!==!0&&(T=L());){if(T===n){A=Q.backslashes=!0,L();continue}if(T===_){K=Q.isBracket=!0,G=Q.isGlob=!0,w=!0;break}}if(S===!0)continue;break}if(v.nonegate!==!0&&Y===o&&k===j){z=Q.negated=!0,j++;continue}if(v.noparen!==!0&&Y===l){if(G=Q.isGlob=!0,S===!0){for(;ie()!==!0&&(Y=L());){if(Y===l){A=Q.backslashes=!0,Y=L();continue}if(Y===b){w=!0;break}}
|
|
285
|
+
continue}break}if(G===!0){if(w=!0,S===!0)continue;break}}v.noext===!0&&(X=!1,G=!1);let q=D,J="",ne="";j>0&&(J=D.slice(0,j),D=D.slice(j),x-=j),q&&G===!0&&x>0?(q=D.slice(0,x),ne=D.slice(x)):G===!0?(q="",ne=D):q=D,q&&q!==""&&q!=="/"&&q!==D&&f(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),v.unescape===!0&&(ne&&(ne=t.removeBackslashes(ne)),q&&A===!0&&(q=t.removeBackslashes(q)));const P={prefix:J,input:m,start:j,base:q,glob:ne,isBrace:H,isBracket:K,isGlob:G,isExtglob:X,isGlobstar:se,negated:z,negatedExtglob:M};
|
|
286
|
+
if(v.tokens===!0&&(P.maxDepth=0,f(Y)||F.push(Q),P.tokens=F),v.parts===!0||v.tokens===!0){let T;for(let Z=0;Z<I.length;Z++){const W=T?T+1:j,N=I[Z],te=m.slice(W,N);v.tokens&&(Z===0&&j!==0?(F[Z].isPrefix=!0,F[Z].value=J):F[Z].value=te,g(F[Z]),P.maxDepth+=F[Z].depth),(Z!==0||te!=="")&&B.push(te),T=N}if(T&&T+1<m.length){const Z=m.slice(T+1);B.push(Z),v.tokens&&(F[F.length-1].value=Z,g(F[F.length-1]),P.maxDepth+=F[F.length-1].depth)}P.slashes=I,P.parts=B}return P},pi}var mi,dc;function dm(){if(dc)return mi;
|
|
287
|
+
dc=1;const t=Yr(),e=Xr(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=t,a=(c,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...c,d);c.sort();const h=`[${c.join("-")}]`;try{new RegExp(h)}catch{return c.map(b=>e.escapeRegex(b)).join("..")}return h},u=(c,d)=>`Missing ${c}: "${d}" - use "\\\\${d}" to match literal characters`,l=(c,d)=>{if(typeof c!="string")throw new TypeError("Expected a string");c=o[c]||c;const h={...d},y=typeof h.
|
|
288
|
+
maxLength=="number"?Math.min(r,h.maxLength):r;let b=c.length;if(b>y)throw new SyntaxError(`Input length: ${b}, exceeds maximum allowed length: ${y}`);const _={type:"bos",value:"",output:h.prepend||""},f=[_],g=h.capture?"":"?:",p=e.isWindows(d),m=t.globChars(p),$=t.extglobChars(m),{DOT_LITERAL:v,PLUS_LITERAL:E,SLASH_LITERAL:S,ONE_CHAR:I,DOTS_SLASH:F,NO_DOT:B,NO_DOT_SLASH:D,NO_DOTS_SLASH:k,QMARK:j,QMARK_NO_DOT:x,STAR:H,START_ANCHOR:K}=m,G=N=>`(${g}(?:(?!${K}${N.dot?F:v}).)*?)`,X=h.dot?"":B,se=h.dot?
|
|
289
|
+
j:x;let U=h.bash===!0?G(h):H;h.capture&&(U=`(${U})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const A={input:c,index:-1,start:0,dot:h.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};c=e.removePrefix(c,A),b=c.length;const z=[],M=[],w=[];let R=_,C;const Y=()=>A.index===b-1,Q=A.peek=(N=1)=>c[A.index+N],ie=A.advance=()=>c[++A.index]||"",oe=()=>c.slice(A.index+1),L=(N="",te=0)=>{A.consumed+=N,A.index+=te},q=N=>{A.output+=
|
|
290
|
+
N.output!=null?N.output:N.value,L(N.value)},J=()=>{let N=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ie(),A.start++,N++;return N%2===0?!1:(A.negated=!0,A.start++,!0)},ne=N=>{A[N]++,w.push(N)},P=N=>{A[N]--,w.pop()},T=N=>{if(R.type==="globstar"){const te=A.braces>0&&(N.type==="comma"||N.type==="brace"),V=N.extglob===!0||z.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!te&&!V&&(A.output=A.output.slice(0,-R.output.length),R.type="star",R.value="*",R.output=U,A.output+=
|
|
291
|
+
R.output)}if(z.length&&N.type!=="paren"&&(z[z.length-1].inner+=N.value),(N.value||N.output)&&q(N),R&&R.type==="text"&&N.type==="text"){R.value+=N.value,R.output=(R.output||"")+N.value;return}N.prev=R,f.push(N),R=N},Z=(N,te)=>{const V={...$[te],conditions:1,inner:""};V.prev=R,V.parens=A.parens,V.output=A.output;const re=(h.capture?"(":"")+V.open;ne("parens"),T({type:N,value:te,output:A.output?"":I}),T({type:"paren",extglob:!0,value:ie(),output:re}),z.push(V)},W=N=>{let te=N.close+(h.capture?")":""),
|
|
292
|
+
V;if(N.type==="negate"){let re=U;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(re=G(h)),(re!==U||Y()||/^\)+$/.test(oe()))&&(te=N.close=`)$))${re}`),N.inner.includes("*")&&(V=oe())&&/^\.[^\\/.]+$/.test(V)){const le=l(V,{...d,fastpaths:!1}).output;te=N.close=`)${le})${re})`}N.prev.type==="bos"&&(A.negatedExtglob=!0)}T({type:"paren",extglob:!0,value:C,output:te}),P("parens")};if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(c)){let N=!1,te=c.replace(i,(V,re,le,_e,we,ot)=>_e==="\\"?(N=!0,V):
|
|
293
|
+
_e==="?"?re?re+_e+(we?j.repeat(we.length):""):ot===0?se+(we?j.repeat(we.length):""):j.repeat(le.length):_e==="."?v.repeat(le.length):_e==="*"?re?re+_e+(we?U:""):U:re?V:`\\${V}`);return N===!0&&(h.unescape===!0?te=te.replace(/\\/g,""):te=te.replace(/\\+/g,V=>V.length%2===0?"\\\\":V?"\\":"")),te===c&&h.contains===!0?(A.output=c,A):(A.output=e.wrapOutput(te,A,d),A)}for(;!Y();){if(C=ie(),C==="\0")continue;if(C==="\\"){const V=Q();if(V==="/"&&h.bash!==!0||V==="."||V===";")continue;if(!V){C+="\\",T({type:"\
|
|
294
|
+
text",value:C});continue}const re=/^\\+/.exec(oe());let le=0;if(re&&re[0].length>2&&(le=re[0].length,A.index+=le,le%2!==0&&(C+="\\")),h.unescape===!0?C=ie():C+=ie(),A.brackets===0){T({type:"text",value:C});continue}}if(A.brackets>0&&(C!=="]"||R.value==="["||R.value==="[^")){if(h.posix!==!1&&C===":"){const V=R.value.slice(1);if(V.includes("[")&&(R.posix=!0,V.includes(":"))){const re=R.value.lastIndexOf("["),le=R.value.slice(0,re),_e=R.value.slice(re+2),we=n[_e];if(we){R.value=le+we,A.backtrack=!0,
|
|
295
|
+
ie(),!_.output&&f.indexOf(R)===1&&(_.output=I);continue}}}(C==="["&&Q()!==":"||C==="-"&&Q()==="]")&&(C=`\\${C}`),C==="]"&&(R.value==="["||R.value==="[^")&&(C=`\\${C}`),h.posix===!0&&C==="!"&&R.value==="["&&(C="^"),R.value+=C,q({value:C});continue}if(A.quotes===1&&C!=='"'){C=e.escapeRegex(C),R.value+=C,q({value:C});continue}if(C==='"'){A.quotes=A.quotes===1?0:1,h.keepQuotes===!0&&T({type:"text",value:C});continue}if(C==="("){ne("parens"),T({type:"paren",value:C});continue}if(C===")"){if(A.parens===
|
|
296
|
+
0&&h.strictBrackets===!0)throw new SyntaxError(u("opening","("));const V=z[z.length-1];if(V&&A.parens===V.parens+1){W(z.pop());continue}T({type:"paren",value:C,output:A.parens?")":"\\)"}),P("parens");continue}if(C==="["){if(h.nobracket===!0||!oe().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));C=`\\${C}`}else ne("brackets");T({type:"bracket",value:C});continue}if(C==="]"){if(h.nobracket===!0||R&&R.type==="bracket"&&R.value.length===1){T({type:"t\
|
|
297
|
+
ext",value:C,output:`\\${C}`});continue}if(A.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(u("opening","["));T({type:"text",value:C,output:`\\${C}`});continue}P("brackets");const V=R.value.slice(1);if(R.posix!==!0&&V[0]==="^"&&!V.includes("/")&&(C=`/${C}`),R.value+=C,q({value:C}),h.literalBrackets===!1||e.hasRegexChars(V))continue;const re=e.escapeRegex(R.value);if(A.output=A.output.slice(0,-R.value.length),h.literalBrackets===!0){A.output+=re,R.value=re;continue}R.value=`(${g}${re}\
|
|
298
|
+
|${R.value})`,A.output+=R.value;continue}if(C==="{"&&h.nobrace!==!0){ne("braces");const V={type:"brace",value:C,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};M.push(V),T(V);continue}if(C==="}"){const V=M[M.length-1];if(h.nobrace===!0||!V){T({type:"text",value:C,output:C});continue}let re=")";if(V.dots===!0){const le=f.slice(),_e=[];for(let we=le.length-1;we>=0&&(f.pop(),le[we].type!=="brace");we--)le[we].type!=="dots"&&_e.unshift(le[we].value);re=a(_e,h),A.backtrack=!0}if(V.
|
|
299
|
+
comma!==!0&&V.dots!==!0){const le=A.output.slice(0,V.outputIndex),_e=A.tokens.slice(V.tokensIndex);V.value=V.output="\\{",C=re="\\}",A.output=le;for(const we of _e)A.output+=we.output||we.value}T({type:"brace",value:C,output:re}),P("braces"),M.pop();continue}if(C==="|"){z.length>0&&z[z.length-1].conditions++,T({type:"text",value:C});continue}if(C===","){let V=C;const re=M[M.length-1];re&&w[w.length-1]==="braces"&&(re.comma=!0,V="|"),T({type:"comma",value:C,output:V});continue}if(C==="/"){if(R.type===
|
|
300
|
+
"dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",f.pop(),R=_;continue}T({type:"slash",value:C,output:S});continue}if(C==="."){if(A.braces>0&&R.type==="dot"){R.value==="."&&(R.output=v);const V=M[M.length-1];R.type="dots",R.output+=C,R.value+=C,V.dots=!0;continue}if(A.braces+A.parens===0&&R.type!=="bos"&&R.type!=="slash"){T({type:"text",value:C,output:v});continue}T({type:"dot",value:C,output:v});continue}if(C==="?"){if(!(R&&R.value==="(")&&h.noextglob!==!0&&Q()==="("&&Q(2)!==
|
|
301
|
+
"?"){Z("qmark",C);continue}if(R&&R.type==="paren"){const re=Q();let le=C;if(re==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(R.value==="("&&!/[!=<:]/.test(re)||re==="<"&&!/<([!=]|\w+>)/.test(oe()))&&(le=`\\${C}`),T({type:"text",value:C,output:le});continue}if(h.dot!==!0&&(R.type==="slash"||R.type==="bos")){T({type:"qmark",value:C,output:x});continue}T({type:"qmark",value:C,output:j});continue}if(C==="!"){if(h.noextglob!==!0&&Q()==="("&&
|
|
302
|
+
(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){Z("negate",C);continue}if(h.nonegate!==!0&&A.index===0){J();continue}}if(C==="+"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){Z("plus",C);continue}if(R&&R.value==="("||h.regex===!1){T({type:"plus",value:C,output:E});continue}if(R&&(R.type==="bracket"||R.type==="paren"||R.type==="brace")||A.parens>0){T({type:"plus",value:C});continue}T({type:"plus",value:E});continue}if(C==="@"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){T({type:"at",extglob:!0,value:C,output:""});
|
|
303
|
+
continue}T({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);const V=s.exec(oe());V&&(C+=V[0],A.index+=V[0].length),T({type:"text",value:C});continue}if(R&&(R.type==="globstar"||R.star===!0)){R.type="star",R.star=!0,R.value+=C,R.output=U,A.backtrack=!0,A.globstar=!0,L(C);continue}let N=oe();if(h.noextglob!==!0&&/^\([^?]/.test(N)){Z("star",C);continue}if(R.type==="star"){if(h.noglobstar===!0){L(C);continue}const V=R.prev,re=V.prev,le=V.type==="slash"||V.type==="bos",_e=re&&
|
|
304
|
+
(re.type==="star"||re.type==="globstar");if(h.bash===!0&&(!le||N[0]&&N[0]!=="/")){T({type:"star",value:C,output:""});continue}const we=A.braces>0&&(V.type==="comma"||V.type==="brace"),ot=z.length&&(V.type==="pipe"||V.type==="paren");if(!le&&V.type!=="paren"&&!we&&!ot){T({type:"star",value:C,output:""});continue}for(;N.slice(0,3)==="/**";){const pt=c[A.index+4];if(pt&&pt!=="/")break;N=N.slice(3),L("/**",3)}if(V.type==="bos"&&Y()){R.type="globstar",R.value+=C,R.output=G(h),A.output=R.output,A.globstar=
|
|
305
|
+
!0,L(C);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&!_e&&Y()){A.output=A.output.slice(0,-(V.output+R.output).length),V.output=`(?:${V.output}`,R.type="globstar",R.output=G(h)+(h.strictSlashes?")":"|$)"),R.value+=C,A.globstar=!0,A.output+=V.output+R.output,L(C);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&N[0]==="/"){const pt=N[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(V.output+R.output).length),V.output=`(?:${V.output}`,R.type="globstar",R.output=`${G(h)}${S}|${S}${pt})`,R.value+=
|
|
306
|
+
C,A.output+=V.output+R.output,A.globstar=!0,L(C+ie()),T({type:"slash",value:"/",output:""});continue}if(V.type==="bos"&&N[0]==="/"){R.type="globstar",R.value+=C,R.output=`(?:^|${S}|${G(h)}${S})`,A.output=R.output,A.globstar=!0,L(C+ie()),T({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-R.output.length),R.type="globstar",R.output=G(h),R.value+=C,A.output+=R.output,A.globstar=!0,L(C);continue}const te={type:"star",value:C,output:U};if(h.bash===!0){te.output=".*?",(R.type===
|
|
307
|
+
"bos"||R.type==="slash")&&(te.output=X+te.output),T(te);continue}if(R&&(R.type==="bracket"||R.type==="paren")&&h.regex===!0){te.output=C,T(te);continue}(A.index===A.start||R.type==="slash"||R.type==="dot")&&(R.type==="dot"?(A.output+=D,R.output+=D):h.dot===!0?(A.output+=k,R.output+=k):(A.output+=X,R.output+=X),Q()!=="*"&&(A.output+=I,R.output+=I)),T(te)}for(;A.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));A.output=e.escapeLast(A.output,"["),P("brackets")}for(;A.parens>
|
|
308
|
+
0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));A.output=e.escapeLast(A.output,"("),P("parens")}for(;A.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));A.output=e.escapeLast(A.output,"{"),P("braces")}if(h.strictSlashes!==!0&&(R.type==="star"||R.type==="bracket")&&T({type:"maybe_slash",value:"",output:`${S}?`}),A.backtrack===!0){A.output="";for(const N of A.tokens)A.output+=N.output!=null?N.output:N.value,N.suffix&&(A.output+=N.suffix)}return A};return l.
|
|
309
|
+
fastpaths=(c,d)=>{const h={...d},y=typeof h.maxLength=="number"?Math.min(r,h.maxLength):r,b=c.length;if(b>y)throw new SyntaxError(`Input length: ${b}, exceeds maximum allowed length: ${y}`);c=o[c]||c;const _=e.isWindows(d),{DOT_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:$,NO_DOTS:v,NO_DOTS_SLASH:E,STAR:S,START_ANCHOR:I}=t.globChars(_),F=h.dot?v:$,B=h.dot?E:$,D=h.capture?"":"?:",k={negated:!1,prefix:""};let j=h.bash===!0?".*?":S;h.capture&&(j=`(${j})`);const x=X=>X.noglobstar===!0?j:
|
|
310
|
+
`(${D}(?:(?!${I}${X.dot?m:f}).)*?)`,H=X=>{switch(X){case"*":return`${F}${p}${j}`;case".*":return`${f}${p}${j}`;case"*.*":return`${F}${j}${f}${p}${j}`;case"*/*":return`${F}${j}${g}${p}${B}${j}`;case"**":return F+x(h);case"**/*":return`(?:${F}${x(h)}${g})?${B}${p}${j}`;case"**/*.*":return`(?:${F}${x(h)}${g})?${B}${j}${f}${p}${j}`;case"**/.*":return`(?:${F}${x(h)}${g})?${f}${p}${j}`;default:{const se=/^(.*?)\.(\w+)$/.exec(X);if(!se)return;const U=H(se[1]);return U?U+f+se[2]:void 0}}},K=e.removePrefix(
|
|
311
|
+
c,k);let G=H(K);return G&&h.strictSlashes!==!0&&(G+=`${g}?`),G},mi=l,mi}var gi,hc;function hm(){if(hc)return gi;hc=1;const t=bs,e=fm(),r=dm(),n=Xr(),s=Yr(),i=a=>a&&typeof a=="object"&&!Array.isArray(a),o=(a,u,l=!1)=>{if(Array.isArray(a)){const g=a.map(m=>o(m,u,l));return m=>{for(const $ of g){const v=$(m);if(v)return v}return!1}}const c=i(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");const d=u||{},h=n.isWindows(u),y=c?o.compileRe(
|
|
312
|
+
a,u):o.makeRe(a,u,!1,!0),b=y.state;delete y.state;let _=()=>!1;if(d.ignore){const g={...u,ignore:null,onMatch:null,onResult:null};_=o(d.ignore,g,l)}const f=(g,p=!1)=>{const{isMatch:m,match:$,output:v}=o.test(g,y,u,{glob:a,posix:h}),E={glob:a,state:b,regex:y,posix:h,input:g,output:v,match:$,isMatch:m};return typeof d.onResult=="function"&&d.onResult(E),m===!1?(E.isMatch=!1,p?E:!1):_(g)?(typeof d.onIgnore=="function"&&d.onIgnore(E),E.isMatch=!1,p?E:!1):(typeof d.onMatch=="function"&&d.onMatch(E),p?
|
|
313
|
+
E:!0)};return l&&(f.state=b),f};return o.test=(a,u,l,{glob:c,posix:d}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const h=l||{},y=h.format||(d?n.toPosixSlashes:null);let b=a===c,_=b&&y?y(a):a;return b===!1&&(_=y?y(a):a,b=_===c),(b===!1||h.capture===!0)&&(h.matchBase===!0||h.basename===!0?b=o.matchBase(a,u,l,d):b=u.exec(_)),{isMatch:!!b,match:b,output:_}},o.matchBase=(a,u,l,c=n.isWindows(l))=>(u instanceof RegExp?u:o.makeRe(
|
|
314
|
+
u,l)).test(t.basename(a)),o.isMatch=(a,u,l)=>o(u,l)(a),o.parse=(a,u)=>Array.isArray(a)?a.map(l=>o.parse(l,u)):r(a,{...u,fastpaths:!1}),o.scan=(a,u)=>e(a,u),o.compileRe=(a,u,l=!1,c=!1)=>{if(l===!0)return a.output;const d=u||{},h=d.contains?"":"^",y=d.contains?"":"$";let b=`${h}(?:${a.output})${y}`;a&&a.negated===!0&&(b=`^(?!${b}).*$`);const _=o.toRegex(b,u);return c===!0&&(_.state=a),_},o.makeRe=(a,u={},l=!1,c=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-empty string");let d={
|
|
315
|
+
negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(d.output=r.fastpaths(a,u)),d.output||(d=r(a,u)),o.compileRe(d,u,l,c)},o.toRegex=(a,u)=>{try{const l=u||{};return new RegExp(a,l.flags||(l.nocase?"i":""))}catch(l){if(u&&u.debug===!0)throw l;return/$^/}},o.constants=s,gi=o,gi}var yi,pc;function pm(){return pc||(pc=1,yi=hm()),yi}var _i,mc;function mm(){if(mc)return _i;mc=1;const t=ra,e=lm(),r=pm(),n=Xr(),s=a=>a===""||a==="./",i=a=>{const u=a.indexOf("{");return u>-1&&a.indexOf(
|
|
316
|
+
"}",u)>-1},o=(a,u,l)=>{u=[].concat(u),a=[].concat(a);let c=new Set,d=new Set,h=new Set,y=0,b=g=>{h.add(g.output),l&&l.onResult&&l.onResult(g)};for(let g=0;g<u.length;g++){let p=r(String(u[g]),{...l,onResult:b},!0),m=p.state.negated||p.state.negatedExtglob;m&&y++;for(let $ of a){let v=p($,!0);(m?!v.isMatch:v.isMatch)&&(m?c.add(v.output):(c.delete(v.output),d.add(v.output)))}}let f=(y===u.length?[...h]:[...d]).filter(g=>!c.has(g));if(l&&f.length===0){if(l.failglob===!0)throw new Error(`No matches \
|
|
317
|
+
found for "${u.join(", ")}"`);if(l.nonull===!0||l.nullglob===!0)return l.unescape?u.map(g=>g.replace(/\\/g,"")):u}return f};return o.match=o,o.matcher=(a,u)=>r(a,u),o.isMatch=(a,u,l)=>r(u,l)(a),o.any=o.isMatch,o.not=(a,u,l={})=>{u=[].concat(u).map(String);let c=new Set,d=[],h=b=>{l.onResult&&l.onResult(b),d.push(b.output)},y=new Set(o(a,u,{...l,onResult:h}));for(let b of d)y.has(b)||c.add(b);return[...c]},o.contains=(a,u,l)=>{if(typeof a!="string")throw new TypeError(`Expected a string: "${t.inspect(
|
|
318
|
+
a)}"`);if(Array.isArray(u))return u.some(c=>o.contains(a,c,l));if(typeof u=="string"){if(s(a)||s(u))return!1;if(a.includes(u)||a.startsWith("./")&&a.slice(2).includes(u))return!0}return o.isMatch(a,u,{...l,contains:!0})},o.matchKeys=(a,u,l)=>{if(!n.isObject(a))throw new TypeError("Expected the first argument to be an object");let c=o(Object.keys(a),u,l),d={};for(let h of c)d[h]=a[h];return d},o.some=(a,u,l)=>{let c=[].concat(a);for(let d of[].concat(u)){let h=r(String(d),l);if(c.some(y=>h(y)))return!0}
|
|
319
|
+
return!1},o.every=(a,u,l)=>{let c=[].concat(a);for(let d of[].concat(u)){let h=r(String(d),l);if(!c.every(y=>h(y)))return!1}return!0},o.all=(a,u,l)=>{if(typeof a!="string")throw new TypeError(`Expected a string: "${t.inspect(a)}"`);return[].concat(u).every(c=>r(c,l)(a))},o.capture=(a,u,l)=>{let c=n.isWindows(l),h=r.makeRe(String(a),{...l,capture:!0}).exec(c?n.toPosixSlashes(u):u);if(h)return h.slice(1).map(y=>y===void 0?"":y)},o.makeRe=(...a)=>r.makeRe(...a),o.scan=(...a)=>r.scan(...a),o.parse=(a,u)=>{
|
|
320
|
+
let l=[];for(let c of[].concat(a||[]))for(let d of e(String(c),u))l.push(r.parse(d,u));return l},o.braces=(a,u)=>{if(typeof a!="string")throw new TypeError("Expected a string");return u&&u.nobrace===!0||!i(a)?[a]:e(a,u)},o.braceExpand=(a,u)=>{if(typeof a!="string")throw new TypeError("Expected a string");return o.braces(a,{...u,expand:!0})},o.hasBraces=i,_i=o,_i}var gm=mm();const gc=_s(gm),ym={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};function _m(t,e,r,n=!1){const s=new RegExp(
|
|
321
|
+
`<script([^>]*?) src="[./]*${e}"([^>]*)></script>`),i=/"?__VITE_PRELOAD__"?/g,o=r.replace(i,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),a=t.replace(s,(u,l,c)=>`<script${l}${c}>${o.trim()}</script>`);return n?Sm(a):a}function $m(t,e,r){const n=new RegExp(`<link([^>]*?) href="[./]*${e}"([^>]*?)>`),s=r.replace('@charset "UTF-8";',"");return t.replace(n,(o,a,u)=>`<style${a}${u}>${s.trim()}</style>`)}const vm=/\.[mc]?js$/,bm=/\.css$/,wm=/\.html?$/;function Em({useRecommendedBuildConfig:t=!0,removeViteModuleLoader:e=!1,
|
|
322
|
+
inlinePattern:r=[],deleteInlinedFiles:n=!0}=ym){function s(i){console.debug(`NOTE: asset not inlined: ${i}`)}return{name:"vite:singlefile",config:t?Rm:void 0,enforce:"post",generateBundle:(i,o)=>{console.debug(`
|
|
323
|
+
`);const a={html:[],css:[],js:[],other:[]};for(const l of Object.keys(o))wm.test(l)?a.html.push(l):bm.test(l)?a.css.push(l):vm.test(l)?a.js.push(l):a.other.push(l);const u=[];for(const l of a.html){const c=o[l];let d=c.source;for(const h of a.js){if(r.length&&!gc.isMatch(h,r)){s(h);continue}const y=o[h];y.code!=null&&(console.debug(`Inlining: ${h}`),u.push(h),d=_m(d,y.fileName,y.code,e))}for(const h of a.css){if(r.length&&!gc.isMatch(h,r)){s(h);continue}const y=o[h];console.debug(`Inlining: ${h}`),
|
|
324
|
+
u.push(h),d=$m(d,y.fileName,y.source)}c.source=d}if(n)for(const l of u)delete o[l];for(const l of a.other)s(l)}}}const Sm=t=>t.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">'),Rm=t=>{t.build||(t.build={}),t.build.assetsInlineLimit=()=>!0,t.build.chunkSizeWarningLimit=1e8,t.build.cssCodeSplit=!1,t.base="./",t.build.assetsDir="",t.build.rollupOptions||(t.build.rollupOptions={}),t.build.rollupOptions.output||(t.build.rollupOptions.
|
|
325
|
+
output={});const e=r=>{r.inlineDynamicImports=!0};if(Array.isArray(t.build.rollupOptions.output))for(const r of t.build.rollupOptions.output)e(r);else e(t.build.rollupOptions.output)},$i=async({languageServices:t,likec4AssetsDir:e,...r})=>{const n=r.customLogger??Ks,s=Xs(),i=r?.useOverviewGraph===!0;n.info(`${ee.cyan("likec4 app root")} ${ee.dim(s)}`);const o=r.outputDir??ge(t.workspace,"dist");n.info(ee.cyan("output")+" "+ee.dim(o));let a="/";r.base&&(a=lh(r.base),!fh(a)&&a!=="./"&&(a=dh(a))),a!==
|
|
326
|
+
"/"&&n.info(`${ee.green("app base url")} ${ee.dim(a)}`);const u=r.webcomponentPrefix??"likec4";return{isDev:!1,likec4AssetsDir:e,webcomponentPrefix:u,root:s,languageServices:t,clearScreen:!1,base:a,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...Zs(),"likec4/previews":e}},configFile:!1,mode:"production",optimizeDeps:{force:!0,include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react/jsx\
|
|
327
|
+
-dev-runtime","react-dom/client"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(u),__USE_STYLE_BUNDLE__:"false",__USE_OVERVIEW_GRAPH__:i?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:o,modulePreload:!1,emptyOutDir:!1,cssCodeSplit:!1,sourcemap:!1,cssMinify:!0,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:Qs,rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:n,
|
|
328
|
+
plugins:[oa(),Os({languageServices:t.languageServices,useOverviewGraph:i})].concat(r.outputSingleFile?[Em()]:[])}};async function vi({languageServices:t,outDir:e,base:r,webcomponentPrefix:n="likec4",filename:s="likec4-views.js"}){const i=Ks,o=Xs();return i.info(ee.cyan("outDir")+" "+ee.dim(e)),{root:o,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:Zs()},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},
|
|
329
|
+
esbuild:{...Ys},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:Qs,lib:{entry:"webcomponent/webcomponent.js",fileName(a,u){return s},formats:["iife"],name:"LikeC4Views"},commonjsOptions:{defaultIsModuleExports:a=>a.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:i,plugins:[Os({languageServices:t.languageServices,
|
|
330
|
+
useOverviewGraph:!1})]}}const Am=["favicon.ico","robots.txt"],Om=async({buildWebcomponent:t=!0,webcomponentPrefix:e="likec4",languageServices:r,likec4AssetsDir:n,outputSingleFile:s,...i})=>{n??=await Tr(ir(jr(),".likec4-assets-"));const{isDev:o,...a}=await $i({...i,languageServices:r,likec4AssetsDir:n,webcomponentPrefix:e,outputSingleFile:s}),u=await Js();for(const d of Am){const h=ge(a.root,d);Ot(h)&&sa(h,ge(u,d))}const l=await r.viewsService.computedViews(),c=await r.diagrams();if(c.length===0)
|
|
331
|
+
throw process.exitCode=1,new Error("no views found");if(c.length===l.length?a.customLogger.info(`${ee.dim("workspace:")} ${ee.green("\u2713 all views layouted")}`):a.customLogger.warn(`${ee.dim("workspace:")} ${ee.yellow(`\u2717 layouted ${c.length} of ${l.length} views`)}`),c.forEach(d=>{d.hasLayoutDrift&&a.customLogger.warn(ee.yellow("drift detected, manual layout can not be applied, view:")+" "+ee.red(d.id))}),t){const d=await vi({webcomponentPrefix:e,languageServices:r,outDir:u,base:a.base});
|
|
332
|
+
await cr(d)}if(await cr({...a,publicDir:u,mode:"production"}),s)for(let d of xh(ge(a.build.outDir)).filter(h=>h!=="index.html"))Rs(ge(a.build.outDir,d),{recursive:!0});else{const d=ge(a.build.outDir,"index.html");Ot(d)&&sa(d,ge(a.build.outDir,"404.html"))}};function yc(t){if(t.resolvedUrls)return Yo(t.resolvedUrls.network)??Yo(t.resolvedUrls.local)}function _c(t){if(!t.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");St([ee.green("LikeC4 served at:"),"",ee.dim("Local: ")+
|
|
333
|
+
t.resolvedUrls.local.join(`
|
|
334
|
+
`+"".padEnd(9," ")),t.resolvedUrls.network.length?ee.dim("Network: ")+t.resolvedUrls.network.join(`
|
|
335
|
+
`+"".padEnd(9," ")):void 0].filter(e=>hh(e)).join(`
|
|
336
|
+
`))}class $c extends Error{constructor(e){super(`${e} is locked`)}}const Yt={old:new Set,young:new Set},Cm=1e3*15,Jr=1024,Qr=65535;let wr;const Pm=()=>{const t=ar.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(t))for(const n of r)e.add(n.address);return e},vc=t=>new Promise((e,r)=>{const n=Wh.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{const{port:s}=n.address();n.close(()=>{e(s)})})}),bc=async(t,e)=>{if(t.host||t.port===0)return vc(t);for(const r of e)
|
|
337
|
+
try{await vc({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},Im=function*(t){t&&(yield*t),yield 0};async function bi(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){const s=t.exclude;if(typeof s[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const i of s){if(typeof i!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
|
|
338
|
+
responding to the port you want excluded.");if(!Number.isSafeInteger(i))throw new TypeError(`Number ${i} in the exclude option is not a safe integer and can't be used`)}r=new Set(s)}wr===void 0&&(wr=setTimeout(()=>{wr=void 0,Yt.old=Yt.young,Yt.young=new Set},Cm),wr.unref&&wr.unref());const n=Pm();for(const s of Im(e))try{if(r.has(s))continue;let i=await bc({...t,port:s},n);for(;Yt.old.has(i)||Yt.young.has(i);){if(s!==0)throw new $c(s);i=await bc({...t,port:s},n)}return Yt.young.add(i),i}catch(i){
|
|
339
|
+
if(!["EADDRINUSE","EACCES"].includes(i.code)&&!(i instanceof $c))throw i}throw new Error("No available ports found")}function Zr(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<Jr||t>Qr)throw new RangeError(`'from' must be between ${Jr} and ${Qr}`);if(e<Jr||e>Qr)throw new RangeError(`'to' must be between ${Jr} and ${Qr}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,s){for(let i=n;i<=
|
|
340
|
+
s;i++)yield i}(t,e)}async function wc({buildWebcomponent:t=!0,hmr:e=!0,webcomponentPrefix:r="likec4",languageServices:n,likec4AssetsDir:s,openBrowser:i,listen:o,...a}){s??=await Tr(ir(jr(),".likec4-assets-"));const{isDev:u,...l}=await $i({...a,languageServices:n,likec4AssetsDir:s,webcomponentPrefix:r}),c=await bi({port:[5173,...Zr(61e3,61010),...Zr(62002,62010)]}),d=await bi({port:Zr(24678,24690)}),h=await Js();let y;if(t){const _=await vi({webcomponentPrefix:r,languageServices:n,outDir:h,base:l.
|
|
341
|
+
base});y=cr({..._,logLevel:"warn"}).catch(f=>(at.warn("webcomponent build failed",{err:f}),at.warn("Ignoring error and continuing"),Promise.resolve()))}const b=await Vh({...l,define:Object.assign({},l.define,e&&{"process.env.NODE_ENV":'"development"'}),mode:e?"development":l.mode,publicDir:h,server:{host:o??"127.0.0.1",allowedHosts:!0,port:c,hmr:e&&{overlay:!0,port:d},fs:{strict:!1},open:i??!u}});return await b.listen(),y&&await y,b}async function Nm({browserContext:t,views:e,output:r,logger:n,timeout:s,
|
|
342
|
+
maxAttempts:i,outputType:o,theme:a}){let u;const l=e.map(h=>({view:h,attempt:1})),c=[];let d;for(;d=l.shift();){const{view:h,attempt:y}=d,b=`/export/${encodeURIComponent(h.id)}`;try{if(y>1){u&&(u.close({runBeforeUnload:!0}).catch(m=>n.error(`failed to close page: ${m}`)),u=void 0);const p=Xo(y*200,{min:200,max:1e3});n.info(ee.cyan(b)+ee.dim(` attempt ${y} of ${i} after ${p}ms`)),await Kh(p)}else h.hasLayoutDrift&&n.warn(ee.yellow("Drift detected, manual layout can not be applied, view may be inv\
|
|
343
|
+
alid: ")+ee.red(h.id)),n.info(ee.cyan(b));u??=await t.newPage(),await u.setViewportSize({width:h.bounds.width+20*2,height:h.bounds.height+20*2}),await u.goto(b+`?padding=20&theme=${a}`);const _=u.getByRole("presentation");await _.waitFor(),h.nodes.some(p=>ph(p.icon)&&p.icon.toLowerCase().startsWith("http"))&&await Tm(u,s);let f=".";o==="relative"&&(f=h.relativePath??".",f.includes("/")?f=f.slice(0,f.lastIndexOf("/")):f=".");const g=ge(r,f,`${h.id}.png`);await _.screenshot({path:g,omitBackground:!0}),
|
|
344
|
+
c.push({view:h,path:g})}catch(_){u?.close({runBeforeUnload:!0}).catch(f=>n.error(`failed to close page: ${f}`)),n.error(ee.red("failed "+b+`
|
|
345
|
+
`+_)),y<i&&(l.push({view:h,attempt:y+1}),n.info(ee.dim(`retry ${b}`))),u=void 0}}return c}async function Tm(t,e){let r=await t.locator("//img").all();if(!r.length)return;const n=r.map(s=>s.evaluate(i=>i.complete||new Promise((o,a)=>{i.onload=o,i.onerror=a}),{timeout:Math.max(3e4,e)}));await Promise.allSettled(n)}async function Ec({logger:t,serverUrl:e,theme:r="light",timeoutMs:n=15e3,views:s,output:i,outputType:o="relative",maxAttempts:a=3}){t.info(`${ee.cyan("export output")} ${ee.dim(i)}`),t.info(
|
|
346
|
+
`${ee.cyan("from server")} ${ee.dim(e)}`);const u=ua.executablePath();t.info(ee.cyan("Start chromium")),t.info(ee.dim(u));const l=await ua.launch();t.info(ee.cyan("Color scheme: ")+r);const c=await l.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:e,ignoreHTTPSErrors:!0,reducedMotion:"reduce",isMobile:!1});c.setDefaultNavigationTimeout(n),c.setDefaultTimeout(n);try{return await Nm({browserContext:c,views:s,output:i,outputType:o,logger:t,maxAttempts:a,timeout:n,theme:r})}finally{t.info(ee.cyan(
|
|
347
|
+
"close chromium")),await c.close(),await l.close()}}async function Sc({path:t,useDotBin:e,theme:r="light",output:n,outputType:s,serverUrl:i,ignore:o=!1,timeoutMs:a=1e4,maxAttempts:u=3}){const l=tt("c4:export"),c=Eh(),d=await rt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});d.ensureSingleProject(),n??=d.workspace;const h=await d.diagrams();if(!Bh(h,1))throw l.warn("no views found"),new Error("no views found");let y;if(!i&&(l.info(ee.cyan("start preview server")),y=await wc({languageServices:d,
|
|
348
|
+
buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,hmr:!1}),i=yc(y),!i))throw l.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");try{const b=await Ec({logger:l,serverUrl:i,theme:r,timeoutMs:a,views:h,output:n,outputType:s,maxAttempts:u}),{pretty:_}=mh(c);if(b.length>0&&l.info(ee.green(`exported ${b.length} views in ${_}`)),b.length!==h.length&&(o&&b.length>0?l.info(ee.dim("ignore")+" "+ee.red(`failed ${h.length-b.length} out of ${h.length}\
|
|
349
|
+
views`)):l.error(ee.red(`failed ${h.length-b.length} out of ${h.length} views`))),b.length!==h.length&&(b.length===0||!o))throw new Error(`Failed ${h.length-b.length} out of ${h.length} views`)}finally{y&&(l.info(ee.cyan("stop server")),await y.close().catch(b=>{l.error(b)}))}}const{cyan:Rc,dim:Ac}=ee;async function jm({path:t,useDotBin:e,useHashHistory:r,webcomponentPrefix:n,useOverview:s=!1,output:i,outputSingleFile:o,base:a}){const u=tt("c4:build"),l=await rt.fromWorkspace(t,{graphviz:e?"bin\
|
|
350
|
+
ary":"wasm",logger:"vite"}),c=i??ge(l.workspace,"dist");let d=ge(c,"assets");if(s)try{d=ge(c,"assets","previews"),await ct(d,{recursive:!0}),u.info(`${Rc("Generate previews")} ${Ac(d)}
|
|
351
|
+
`),await Sc({path:t,useDotBin:e,output:d,outputType:"flat",ignore:!0})}catch(h){u.error(ee.red("Failed to generate previews")),u.error(h),u.warn(ee.yellow("Ignore previews and continue build")),Rs(d,{recursive:!0,force:!0}),s=!1}await Om({base:a,useHashHistory:o||r,customLogger:u,useOverviewGraph:s,webcomponentPrefix:n,languageServices:l,likec4AssetsDir:d,outputDir:i,outputSingleFile:o}),s&&(u.info(`${Rc("clean previews")} ${Ac(d)}`),Rs(d,{recursive:!0,force:!0}))}const Lm={command:"build [path]",
|
|
352
|
+
aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("path",br).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:ge}).option("base",Ka).option("use-hash-history",Wa).option("use-dot",Ye).option("webcomponent-prefix",Ws).option("use-overview",Ya).option("output-single-file",Qp).example(`${ee.green("$0 build -o ./build ./src")}`,ee.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async t=>{
|
|
353
|
+
await jm({path:t.path,output:t.output,base:t.base,useHashHistory:t["use-hash-history"],useDotBin:t["use-dot"],useOverview:t["use-overview"]??!1,webcomponentPrefix:t["webcomponent-prefix"],outputSingleFile:t["output-single-file"]??!1})}},qt=t=>{const e=typeof t;return t!==null&&(e==="object"||e==="function")},wi=new Set(["__proto__","prototype","constructor"]),Dm=new Set("0123456789");function en(t){const e=[];let r="",n="start",s=!1;for(const i of t)switch(i){case"\\":{if(n==="index")throw new Error(
|
|
354
|
+
"Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(wi.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(wi.has(r))return[];e.push(
|
|
355
|
+
r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Dm.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i}}switch(s&&(r+="\\"),n){case"property":{if(wi.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not \
|
|
356
|
+
closed");case"start":{e.push("");break}}return e}function Ei(t,e){if(typeof e!="number"&&Array.isArray(t)){const r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function Oc(t,e){if(Ei(t,e))throw new Error("Cannot use string index")}function xm(t,e,r){if(!qt(t)||typeof e!="string")return r===void 0?t:r;const n=en(e);if(n.length===0)return r;for(let s=0;s<n.length;s++){const i=n[s];if(Ei(t,i)?t=s===n.length-1?void 0:null:t=t[i],t==null){if(s!==n.length-1)return r;break}}return t===
|
|
357
|
+
void 0?r:t}function Cc(t,e,r){if(!qt(t)||typeof e!="string")return t;const n=t,s=en(e);for(let i=0;i<s.length;i++){const o=s[i];Oc(t,o),i===s.length-1?t[o]=r:qt(t[o])||(t[o]=typeof s[i+1]=="number"?[]:{}),t=t[o]}return n}function Mm(t,e){if(!qt(t)||typeof e!="string")return!1;const r=en(e);for(let n=0;n<r.length;n++){const s=r[n];if(Oc(t,s),n===r.length-1)return delete t[s],!0;if(t=t[s],!qt(t))return!1}}function km(t,e){if(!qt(t)||typeof e!="string")return!1;const r=en(e);if(r.length===0)return!1;
|
|
358
|
+
for(const n of r){if(!qt(t)||!(n in t)||Ei(t,n))return!1;t=t[n]}return!0}const _t=ar.homedir(),Si=ar.tmpdir(),{env:Xt}=Re,qm=t=>{const e=$e.join(_t,"Library");return{data:$e.join(e,"Application Support",t),config:$e.join(e,"Preferences",t),cache:$e.join(e,"Caches",t),log:$e.join(e,"Logs",t),temp:$e.join(Si,t)}},Hm=t=>{const e=Xt.APPDATA||$e.join(_t,"AppData","Roaming"),r=Xt.LOCALAPPDATA||$e.join(_t,"AppData","Local");return{data:$e.join(r,t,"Data"),config:$e.join(e,t,"Config"),cache:$e.join(r,t,
|
|
359
|
+
"Cache"),log:$e.join(r,t,"Log"),temp:$e.join(Si,t)}},Um=t=>{const e=$e.basename(_t);return{data:$e.join(Xt.XDG_DATA_HOME||$e.join(_t,".local","share"),t),config:$e.join(Xt.XDG_CONFIG_HOME||$e.join(_t,".config"),t),cache:$e.join(Xt.XDG_CACHE_HOME||$e.join(_t,".cache"),t),log:$e.join(Xt.XDG_STATE_HOME||$e.join(_t,".local","state"),t),temp:$e.join(Si,e,t)}};function Fm(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),Re.
|
|
360
|
+
platform==="darwin"?qm(t):Re.platform==="win32"?Hm(t):Um(t)}const $t=(t,e)=>function(...n){return t.apply(void 0,n).catch(e)},lt=(t,e)=>function(...n){try{return t.apply(void 0,n)}catch(s){return e(s)}},zm=Re.getuid?!Re.getuid():!1,Vm=1e4,qe=()=>{},be={isChangeErrorOk:t=>{if(!be.isNodeError(t))return!1;const{code:e}=t;return e==="ENOSYS"||!zm&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!be.isNodeError(t))return!1;const{code:e}=t;return e==="EMFILE"||e===
|
|
361
|
+
"ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:t=>{if(!be.isNodeError(t))throw t;if(!be.isChangeErrorOk(t))throw t}};class Gm{constructor(){this.interval=25,this.intervalId=void 0,this.limit=Vm,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=e=>{this.
|
|
362
|
+
queueWaiting.add(e),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=e=>{this.queueWaiting.delete(e),this.queueActive.delete(e)},this.schedule=()=>new Promise(e=>{const r=()=>this.remove(n),n=()=>e(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const e of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(e),this.queueActive.add(e),e()}}}}}const Bm=new Gm,vt=(t,e)=>function(n){
|
|
363
|
+
return function s(...i){return Bm.schedule().then(o=>{const a=l=>(o(),l),u=l=>{if(o(),Date.now()>=n)throw l;if(e(l)){const c=Math.round(100*Math.random());return new Promise(h=>setTimeout(h,c)).then(()=>s.apply(void 0,i))}throw l};return t.apply(void 0,i).then(a,u)})}},bt=(t,e)=>function(n){return function s(...i){try{return t.apply(void 0,i)}catch(o){if(Date.now()>n)throw o;if(e(o))return s.apply(void 0,i);throw o}}},Ne={attempt:{chmod:$t(Ie(pe.chmod),be.onChangeError),chown:$t(Ie(pe.chown),be.
|
|
364
|
+
onChangeError),close:$t(Ie(pe.close),qe),fsync:$t(Ie(pe.fsync),qe),mkdir:$t(Ie(pe.mkdir),qe),realpath:$t(Ie(pe.realpath),qe),stat:$t(Ie(pe.stat),qe),unlink:$t(Ie(pe.unlink),qe),chmodSync:lt(pe.chmodSync,be.onChangeError),chownSync:lt(pe.chownSync,be.onChangeError),closeSync:lt(pe.closeSync,qe),existsSync:lt(pe.existsSync,qe),fsyncSync:lt(pe.fsync,qe),mkdirSync:lt(pe.mkdirSync,qe),realpathSync:lt(pe.realpathSync,qe),statSync:lt(pe.statSync,qe),unlinkSync:lt(pe.unlinkSync,qe)},retry:{close:vt(Ie(pe.
|
|
365
|
+
close),be.isRetriableError),fsync:vt(Ie(pe.fsync),be.isRetriableError),open:vt(Ie(pe.open),be.isRetriableError),readFile:vt(Ie(pe.readFile),be.isRetriableError),rename:vt(Ie(pe.rename),be.isRetriableError),stat:vt(Ie(pe.stat),be.isRetriableError),write:vt(Ie(pe.write),be.isRetriableError),writeFile:vt(Ie(pe.writeFile),be.isRetriableError),closeSync:bt(pe.closeSync,be.isRetriableError),fsyncSync:bt(pe.fsyncSync,be.isRetriableError),openSync:bt(pe.openSync,be.isRetriableError),readFileSync:bt(pe.readFileSync,
|
|
366
|
+
be.isRetriableError),renameSync:bt(pe.renameSync,be.isRetriableError),statSync:bt(pe.statSync,be.isRetriableError),writeSync:bt(pe.writeSync,be.isRetriableError),writeFileSync:bt(pe.writeFileSync,be.isRetriableError)}},Wm="utf8",Pc=438,Km=511,Ym={},Xm=ar.userInfo().uid,Jm=ar.userInfo().gid,Qm=1e3,Zm=!!Re.getuid;Re.getuid&&Re.getuid();const Ic=128,eg=t=>t instanceof Error&&"code"in t,Nc=t=>typeof t=="string",Ri=t=>t===void 0,tg=Re.platform==="linux",Tc=Re.platform==="win32",Ai=["SIGABRT","SIGALRM",
|
|
367
|
+
"SIGHUP","SIGINT","SIGTERM"];Tc||Ai.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),tg&&Ai.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class rg{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const r of this.callbacks)r();e&&(Tc&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Re.kill(Re.pid,"SIGTERM"):Re.kill(Re.pid,e))}},this.hook=()=>{Re.once("exit",()=>this.exit());for(const e of Ai)try{Re.once(
|
|
368
|
+
e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}const ng=new rg,sg=ng.register,Te={store:{},create:t=>{const e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),s=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${t}${s}`},get:(t,e,r=!0)=>{const n=Te.truncate(e(t));return n in Te.store?Te.get(t,e,r):(Te.store[n]=r,[n,()=>delete Te.store[n]])},purge:t=>{Te.store[t]&&(delete Te.store[t],Ne.attempt.unlink(t))},
|
|
369
|
+
purgeSync:t=>{Te.store[t]&&(delete Te.store[t],Ne.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(const t in Te.store)Te.purgeSync(t)},truncate:t=>{const e=$e.basename(t);if(e.length<=Ic)return t;const r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!r)return t;const n=e.length-Ic;return`${t.slice(0,-e.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};sg(Te.purgeSyncAll);function jc(t,e,r=Ym){if(Nc(r))return jc(t,e,{encoding:r});const n=Date.now()+((r.timeout??Qm)||-1);let s=null,
|
|
370
|
+
i=null,o=null;try{const a=Ne.attempt.realpathSync(t),u=!!a;t=a||t,[i,s]=Te.get(t,r.tmpCreate||Te.create,r.tmpPurge!==!1);const l=Zm&&Ri(r.chown),c=Ri(r.mode);if(u&&(l||c)){const d=Ne.attempt.statSync(t);d&&(r={...r},l&&(r.chown={uid:d.uid,gid:d.gid}),c&&(r.mode=d.mode))}if(!u){const d=$e.dirname(t);Ne.attempt.mkdirSync(d,{mode:Km,recursive:!0})}o=Ne.retry.openSync(n)(i,"w",r.mode||Pc),r.tmpCreated&&r.tmpCreated(i),Nc(e)?Ne.retry.writeSync(n)(o,e,0,r.encoding||Wm):Ri(e)||Ne.retry.writeSync(n)(o,e,
|
|
371
|
+
0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?Ne.retry.fsyncSync(n)(o):Ne.attempt.fsync(o)),Ne.retry.closeSync(n)(o),o=null,r.chown&&(r.chown.uid!==Xm||r.chown.gid!==Jm)&&Ne.attempt.chownSync(i,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Pc&&Ne.attempt.chmodSync(i,r.mode);try{Ne.retry.renameSync(n)(i,t)}catch(d){if(!eg(d)||d.code!=="ENAMETOOLONG")throw d;Ne.retry.renameSync(n)(i,Te.truncate(t))}s(),i=null}finally{o&&Ne.attempt.closeSync(o),i&&Te.purge(i)}}var tn={exports:{}},Oi={},ft={},Ht={},Ci={},
|
|
372
|
+
Pi={},Ii={},Lc;function rn(){return Lc||(Lc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(p){if(super(),!t.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){
|
|
373
|
+
return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((m,$)=>`${m}${$}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((m,$)=>($ instanceof r&&(m[$.str]=(m[$.str]||0)+1),m),
|
|
374
|
+
{})}}t._Code=n,t.nil=new n("");function s(g,...p){const m=[g[0]];let $=0;for(;$<p.length;)a(m,p[$]),m.push(g[++$]);return new n(m)}t._=s;const i=new n("+");function o(g,...p){const m=[y(g[0])];let $=0;for(;$<p.length;)m.push(i),a(m,p[$]),m.push(i,y(g[++$]));return u(m),new n(m)}t.str=o;function a(g,p){p instanceof n?g.push(...p._items):p instanceof r?g.push(p):g.push(d(p))}t.addCodeArg=a;function u(g){let p=1;for(;p<g.length-1;){if(g[p]===i){const m=l(g[p-1],g[p+1]);if(m!==void 0){g.splice(p-1,3,
|
|
375
|
+
m);continue}g[p++]="+"}p++}}function l(g,p){if(p==='""')return g;if(g==='""')return p;if(typeof g=="string")return p instanceof r||g[g.length-1]!=='"'?void 0:typeof p!="string"?`${g.slice(0,-1)}${p}"`:p[0]==='"'?g.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(g instanceof r))return`"${g}${p.slice(1)}`}function c(g,p){return p.emptyStr()?g:g.emptyStr()?p:o`${g}${p}`}t.strConcat=c;function d(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:y(Array.isArray(g)?g.join(
|
|
376
|
+
","):g)}function h(g){return new n(y(g))}t.stringify=h;function y(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=y;function b(g){return typeof g=="string"&&t.IDENTIFIER.test(g)?new n(`.${g}`):s`[${g}]`}t.getProperty=b;function _(g){if(typeof g=="string"&&t.IDENTIFIER.test(g))return new n(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}t.getEsmExportName=_;function f(g){return new n(g.toString())}t.
|
|
377
|
+
regexpCode=f}(Ii)),Ii}var Ni={},Dc;function xc(){return Dc||(Dc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=rn();class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};
|
|
378
|
+
class s{constructor({prefixes:l,parent:c}={}){this._names={},this._prefixes=l,this._parent=c}toName(l){return l instanceof e.Name?l:this.name(l)}name(l){return new e.Name(this._newName(l))}_newName(l){const c=this._names[l]||this._nameGroup(l);return`${l}${c.index++}`}_nameGroup(l){var c,d;if(!((d=(c=this._parent)===null||c===void 0?void 0:c._prefixes)===null||d===void 0)&&d.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this.
|
|
379
|
+
_names[l]={prefix:l,index:0}}}t.Scope=s;class i extends e.Name{constructor(l,c){super(c),this.prefix=l}setValue(l,{property:c,itemIndex:d}){this.value=l,this.scopePath=(0,e._)`.${new e.Name(c)}[${d}]`}}t.ValueScopeName=i;const o=(0,e._)`\n`;class a extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:e.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,c){var d;if(c.ref===void 0)throw new Error("CodeGen: ref must be passed\
|
|
380
|
+
in value");const h=this.toName(l),{prefix:y}=h,b=(d=c.key)!==null&&d!==void 0?d:c.ref;let _=this._values[y];if(_){const p=_.get(b);if(p)return p}else _=this._values[y]=new Map;_.set(b,h);const f=this._scope[y]||(this._scope[y]=[]),g=f.length;return f[g]=c.ref,h.setValue(c,{property:y,itemIndex:g}),h}getValue(l,c){const d=this._values[l];if(d)return d.get(c)}scopeRefs(l,c=this._values){return this._reduceValues(c,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,e.
|
|
381
|
+
_)`${l}${d.scopePath}`})}scopeCode(l=this._values,c,d){return this._reduceValues(l,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},c,d)}_reduceValues(l,c,d={},h){let y=e.nil;for(const b in l){const _=l[b];if(!_)continue;const f=d[b]=d[b]||new Map;_.forEach(g=>{if(f.has(g))return;f.set(g,n.Started);let p=c(g);if(p){const m=this.opts.es5?t.varKinds.var:t.varKinds.const;y=(0,e._)`${y}${m} ${g} = ${p};${this.opts._n}`}else if(p=h?.(g))y=(0,e._)`${y}${p}${this.
|
|
382
|
+
opts._n}`;else throw new r(g);f.set(g,n.Completed)})}return y}}t.ValueScope=a}(Ni)),Ni}var Mc;function he(){return Mc||(Mc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=rn(),r=xc();var n=rn();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,
|
|
769
383
|
get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,
|
|
770
|
-
get:function(){return n.Name}});var
|
|
771
|
-
_Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class
|
|
772
|
-
return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends
|
|
773
|
-
lhs} ${this.op}= ${this.rhs};`+w}}class l extends
|
|
774
|
-
;`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,
|
|
775
|
-
const{nodes:
|
|
776
|
-
super.optimizeNodes();const w=this.condition;if(w===!0)return this.nodes;let
|
|
777
|
-
const w=super.names;return
|
|
778
|
-
es5?r.varKinds.var:this.varKind,{name:
|
|
779
|
-
super.names,this.iterable.names)}}class
|
|
780
|
-
(w=this.catch)===null||w===void 0||w.optimizeNodes(),(
|
|
781
|
-
render(w)}}
|
|
782
|
-
`:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
return this._for(new m(w),
|
|
786
|
-
if(this.opts.ownProperties)return this.forOf(w,(0,e._)`Object.keys(${
|
|
787
|
-
atch" and "finally"');const
|
|
788
|
-
w!==void 0&&
|
|
789
|
-
const
|
|
790
|
-
(
|
|
791
|
-
void 0)}}function M
|
|
792
|
-
|
|
793
|
-
"boolean"?
|
|
794
|
-
return!1}
|
|
795
|
-
return v.replace(/~1/g,"/").replace(/~0/g,"~")}
|
|
796
|
-
()=>{v.if((0,t._)`${
|
|
797
|
-
()=>v.assign(
|
|
798
|
-
|
|
799
|
-
checkStrictMode
|
|
800
|
-
Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return
|
|
801
|
-
keyword:f,schemaType:g})=>g?(0,e.str)`"${f}" keyword must be ${g} ($data)`:(0,e.str)`"${f}" keyword is invalid ($data)`};function
|
|
802
|
-
()=>f.if(g,()=>f.assign((0,e._)`${n.default.vErrors}.length`,g),()=>f.assign(n.default.vErrors,null)))}t.resetErrorsCount=o;function a({gen:f,keyword:g,schemaValue:p,data:m,errsCount
|
|
803
|
-
(0,e._)`${
|
|
804
|
-
(0,e._)`${m}.errors`,g),p.return(!1))}const c={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function d(f,g,p){const{createErrors:m}=f.it;return m===!1?(0,e._)`{}`:h(f,g,p)}function h(f,g,p={}){const{gen:m,it
|
|
805
|
-
(0,e.str)`${f}${(0,r.getErrorPath)(g,r.Type.Str)}`:f;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,p)]}function
|
|
806
|
-
g(f):g||(0,e._)`{}`]),I.messages&&m.push([c.message,typeof p=="function"?p(f):p]),I.verbose&&m.push([c.schema,
|
|
807
|
-
ct"&&l.$async===!0?u.return(r.default.data):(u.assign((0,e._)`${c}.errors`,null),u.return(!0))}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
function
|
|
811
|
-
p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&m.push("null")}return m}
|
|
812
|
-
|
|
813
|
-
if(
|
|
814
|
-
|| (${I} == "string" && ${
|
|
815
|
-
|| (${I} === "string" && ${
|
|
816
|
-
|| ${I} === "boolean" || ${
|
|
817
|
-
I((0,n._)`!(${m} % 1) && !isNaN(${m})`);break;case"number":
|
|
818
|
-
|
|
819
|
-
it:p}}return
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}
|
|
823
|
-
return p?Object.keys(p).filter(m=>m!=="__proto__"):[]}
|
|
824
|
-
I.opts.dynamicRef&&
|
|
825
|
-
data
|
|
826
|
-
!
|
|
827
|
-
const t=
|
|
828
|
-
|
|
829
|
-
return
|
|
830
|
-
if((0,t._)`Array.isArray(${
|
|
831
|
-
stringify)(
|
|
832
|
-
f ${g}: ${p.join(",")}`);if(f.validateSchema&&!f.validateSchema(h[g])){const
|
|
833
|
-
schemaPath:l,errSchemaPath:c,topSchemaRef:d}){if(o!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const h=
|
|
834
|
-
c===void 0||d===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:d,errSchemaPath:c}}throw new Error('either "keyword" or "schema" must be passed')}
|
|
835
|
-
g=h.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0);
|
|
836
|
-
n;function i
|
|
837
|
-
n;
|
|
838
|
-
exports:{}},
|
|
839
|
-
{default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(n,i,
|
|
840
|
-
typeof
|
|
841
|
-
"pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function
|
|
842
|
-
let f=0;for(const g in
|
|
843
|
-
if(typeof
|
|
844
|
-
|
|
845
|
-
e=
|
|
846
|
-
_)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${
|
|
847
|
-
|
|
848
|
-
$comment&&
|
|
849
|
-
|
|
850
|
-
checkUnknownRules)(
|
|
851
|
-
in the schema root")}function L
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
removeDotSegments:h,normalizeIPv4:r,normalizeIPv6:
|
|
883
|
-
https";return(p.port===(m?443:80)||p.port==="")&&(p.port=void 0),p.path||(p.path="/"),p}function
|
|
884
|
-
if(!p.path)return p.error="URN can not be parsed",p;const
|
|
885
|
-
uuid
|
|
886
|
-
"urn:uuid":{scheme:"urn:uuid",parse:l,serialize:c,skipNormalize:!0}};return
|
|
887
|
-
(f
|
|
888
|
-
g.path
|
|
889
|
-
f.toLowerCase()===g.toLowerCase()}function c(f,g){const p={host:f.host,scheme:f.scheme,userinfo:f.userinfo,port:f.port,path:f.path,query:f.query,nid:f.nid,nss:f.nss,uuid:f.uuid,fragment:f.fragment,reference:f.reference,resourceName:f.resourceName,secure:f.secure,error:""},m=Object.assign({},g)
|
|
890
|
-
join(":")))),m.reference!=="suffix"&&p.scheme
|
|
891
|
-
fromCharCode(g)));function h(f){let g=0;for(let p=0,m=f.length;p<m;++p)if(g=f.charCodeAt(p),g>126||d[g])return!0;return!1}const
|
|
892
|
-
|
|
893
|
-
"uri",p.reference&&p.reference!=="suffix"&&p.reference!==m.reference&&(m.error=m.error||"URI is not a "+p.reference+" reference.");const
|
|
894
|
-
m.host!==void 0&&(m.host=unescape(m.host)),m.path&&(m.path=escape(unescape(m.path))),m.fragment&&(m.fragment=encodeURI(decodeURIComponent(m.fragment)))),
|
|
895
|
-
return t.code='require("ajv/dist/runtime/uri").default',
|
|
896
|
-
defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=
|
|
384
|
+
get:function(){return n.Name}});var s=xc();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e.
|
|
385
|
+
_Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(w,R){return this}}class o extends i{constructor(w,R,C){super(),this.varKind=w,this.name=R,this.rhs=C}render({es5:w,_n:R}){const C=w?r.varKinds.var:this.varKind,Y=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${Y};`+R}optimizeNames(w,R){if(w[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,w,R)),this}get names(){
|
|
386
|
+
return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(w,R,C){super(),this.lhs=w,this.rhs=R,this.sideEffects=C}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,R){if(!(this.lhs instanceof e.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=x(this.rhs,w,R),this}get names(){const w=this.lhs instanceof e.Name?{}:{...this.lhs.names};return j(w,this.rhs)}}class u extends a{constructor(w,R,C,Y){super(w,C,Y),this.op=R}render({_n:w}){return`${this.
|
|
387
|
+
lhs} ${this.op}= ${this.rhs};`+w}}class l extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}}class c extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}}class d extends i{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}}class h extends i{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code}\
|
|
388
|
+
;`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,R){return this.code=x(this.code,w,R),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class y extends i{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((R,C)=>R+C.render(w),"")}optimizeNodes(){const{nodes:w}=this;let R=w.length;for(;R--;){const C=w[R].optimizeNodes();Array.isArray(C)?w.splice(R,1,...C):C?w[R]=C:w.splice(R,1)}return w.length>0?this:void 0}optimizeNames(w,R){
|
|
389
|
+
const{nodes:C}=this;let Y=C.length;for(;Y--;){const Q=C[Y];Q.optimizeNames(w,R)||(H(w,Q.names),C.splice(Y,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((w,R)=>k(w,R.names),{})}}class b extends y{render(w){return"{"+w._n+super.render(w)+"}"+w._n}}class _ extends y{}class f extends b{}f.kind="else";class g extends b{constructor(w,R){super(R),this.condition=w}render(w){let R=`if(${this.condition})`+super.render(w);return this.else&&(R+="else "+this.else.render(w)),R}optimizeNodes(){
|
|
390
|
+
super.optimizeNodes();const w=this.condition;if(w===!0)return this.nodes;let R=this.else;if(R){const C=R.optimizeNodes();R=this.else=Array.isArray(C)?new f(C):C}if(R)return w===!1?R instanceof g?R:R.nodes:this.nodes.length?this:new g(K(w),R instanceof g?[R]:R.nodes);if(!(w===!1||!this.nodes.length))return this}optimizeNames(w,R){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(w,R),!!(super.optimizeNames(w,R)||this.else))return this.condition=x(this.condition,w,R),this}get names(){
|
|
391
|
+
const w=super.names;return j(w,this.condition),this.else&&k(w,this.else.names),w}}g.kind="if";class p extends b{}p.kind="for";class m extends p{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,R){if(super.optimizeNames(w,R))return this.iteration=x(this.iteration,w,R),this}get names(){return k(super.names,this.iteration.names)}}class $ extends p{constructor(w,R,C,Y){super(),this.varKind=w,this.name=R,this.from=C,this.to=Y}render(w){const R=w.
|
|
392
|
+
es5?r.varKinds.var:this.varKind,{name:C,from:Y,to:Q}=this;return`for(${R} ${C}=${Y}; ${C}<${Q}; ${C}++)`+super.render(w)}get names(){const w=j(super.names,this.from);return j(w,this.to)}}class v extends p{constructor(w,R,C,Y){super(),this.loop=w,this.varKind=R,this.name=C,this.iterable=Y}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,R){if(super.optimizeNames(w,R))return this.iterable=x(this.iterable,w,R),this}get names(){return k(
|
|
393
|
+
super.names,this.iterable.names)}}class E extends b{constructor(w,R,C){super(),this.name=w,this.args=R,this.async=C}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}}E.kind="func";class S extends y{render(w){return"return "+super.render(w)}}S.kind="return";class I extends b{render(w){let R="try"+super.render(w);return this.catch&&(R+=this.catch.render(w)),this.finally&&(R+=this.finally.render(w)),R}optimizeNodes(){var w,R;return super.optimizeNodes(),
|
|
394
|
+
(w=this.catch)===null||w===void 0||w.optimizeNodes(),(R=this.finally)===null||R===void 0||R.optimizeNodes(),this}optimizeNames(w,R){var C,Y;return super.optimizeNames(w,R),(C=this.catch)===null||C===void 0||C.optimizeNames(w,R),(Y=this.finally)===null||Y===void 0||Y.optimizeNames(w,R),this}get names(){const w=super.names;return this.catch&&k(w,this.catch.names),this.finally&&k(w,this.finally.names),w}}class F extends b{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.
|
|
395
|
+
render(w)}}F.kind="catch";class B extends b{render(w){return"finally"+super.render(w)}}B.kind="finally";class D{constructor(w,R={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...R,_n:R.lines?`
|
|
396
|
+
`:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,R){const C=this._extScope.value(w,R);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(w,R){return this._extScope.getValue(w,R)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,R,C,Y){
|
|
397
|
+
const Q=this._scope.toName(R);return C!==void 0&&Y&&(this._constants[Q.str]=C),this._leafNode(new o(w,Q,C)),Q}const(w,R,C){return this._def(r.varKinds.const,w,R,C)}let(w,R,C){return this._def(r.varKinds.let,w,R,C)}var(w,R,C){return this._def(r.varKinds.var,w,R,C)}assign(w,R,C){return this._leafNode(new a(w,R,C))}add(w,R){return this._leafNode(new u(w,t.operators.ADD,R))}code(w){return typeof w=="function"?w():w!==e.nil&&this._leafNode(new h(w)),this}object(...w){const R=["{"];for(const[C,Y]of w)
|
|
398
|
+
R.length>1&&R.push(","),R.push(C),(C!==Y||this.opts.es5)&&(R.push(":"),(0,e.addCodeArg)(R,Y));return R.push("}"),new e._Code(R)}if(w,R,C){if(this._blockNode(new g(w)),R&&C)this.code(R).else().code(C).endIf();else if(R)this.code(R).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new g(w))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(g,f)}_for(w,R){return this._blockNode(w),R&&this.code(R).endFor(),this}for(w,R){
|
|
399
|
+
return this._for(new m(w),R)}forRange(w,R,C,Y,Q=this.opts.es5?r.varKinds.var:r.varKinds.let){const ie=this._scope.toName(w);return this._for(new $(Q,ie,R,C),()=>Y(ie))}forOf(w,R,C,Y=r.varKinds.const){const Q=this._scope.toName(w);if(this.opts.es5){const ie=R instanceof e.Name?R:this.var("_arr",R);return this.forRange("_i",0,(0,e._)`${ie}.length`,oe=>{this.var(Q,(0,e._)`${ie}[${oe}]`),C(Q)})}return this._for(new v("of",Y,Q,R),()=>C(Q))}forIn(w,R,C,Y=this.opts.es5?r.varKinds.var:r.varKinds.const){
|
|
400
|
+
if(this.opts.ownProperties)return this.forOf(w,(0,e._)`Object.keys(${R})`,C);const Q=this._scope.toName(w);return this._for(new v("in",Y,Q,R),()=>C(Q))}endFor(){return this._endBlockNode(p)}label(w){return this._leafNode(new l(w))}break(w){return this._leafNode(new c(w))}return(w){const R=new S;if(this._blockNode(R),this.code(w),R.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(w,R,C){if(!R&&!C)throw new Error('CodeGen: "try" without "c\
|
|
401
|
+
atch" and "finally"');const Y=new I;if(this._blockNode(Y),this.code(w),R){const Q=this.name("e");this._currNode=Y.catch=new F(Q),R(Q)}return C&&(this._currNode=Y.finally=new B,this.code(C)),this._endBlockNode(F,B)}throw(w){return this._leafNode(new d(w))}block(w,R){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(R),this}endBlock(w){const R=this._blockStarts.pop();if(R===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-R;if(C<0||
|
|
402
|
+
w!==void 0&&C!==w)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${w} expected`);return this._nodes.length=R,this}func(w,R=e.nil,C,Y){return this._blockNode(new E(w,R,C)),Y&&this.code(Y).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,R){
|
|
403
|
+
const C=this._currNode;if(C instanceof w||R&&C instanceof R)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${R?`${w.kind}/${R.kind}`:w.kind}"`)}_elseNode(w){const R=this._currNode;if(!(R instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=R.else=w,this}get _root(){return this._nodes[0]}get _currNode(){const w=this._nodes;return w[w.length-1]}set _currNode(w){const R=this._nodes;R[R.length-1]=w}}t.CodeGen=D;function k(M,w){for(const R in w)M[R]=
|
|
404
|
+
(M[R]||0)+(w[R]||0);return M}function j(M,w){return w instanceof e._CodeOrName?k(M,w.names):M}function x(M,w,R){if(M instanceof e.Name)return C(M);if(!Y(M))return M;return new e._Code(M._items.reduce((Q,ie)=>(ie instanceof e.Name&&(ie=C(ie)),ie instanceof e._Code?Q.push(...ie._items):Q.push(ie),Q),[]));function C(Q){const ie=R[Q.str];return ie===void 0||w[Q.str]!==1?Q:(delete w[Q.str],ie)}function Y(Q){return Q instanceof e._Code&&Q._items.some(ie=>ie instanceof e.Name&&w[ie.str]===1&&R[ie.str]!==
|
|
405
|
+
void 0)}}function H(M,w){for(const R in w)M[R]=(M[R]||0)-(w[R]||0)}function K(M){return typeof M=="boolean"||typeof M=="number"||M===null?!M:(0,e._)`!${z(M)}`}t.not=K;const G=A(t.operators.AND);function X(...M){return M.reduce(G)}t.and=X;const se=A(t.operators.OR);function U(...M){return M.reduce(se)}t.or=U;function A(M){return(w,R)=>w===e.nil?R:R===e.nil?w:(0,e._)`${z(w)} ${M} ${z(R)}`}function z(M){return M instanceof e.Name?M:(0,e._)`(${M})`}}(Pi)),Pi}var me={},kc;function ye(){if(kc)return me;
|
|
406
|
+
kc=1,Object.defineProperty(me,"__esModule",{value:!0}),me.checkStrictMode=me.getErrorPath=me.Type=me.useFunc=me.setEvaluated=me.evaluatedPropsToName=me.mergeEvaluated=me.eachItem=me.unescapeJsonPointer=me.escapeJsonPointer=me.escapeFragment=me.unescapeFragment=me.schemaRefOrVal=me.schemaHasRulesButRef=me.schemaHasRules=me.checkUnknownRules=me.alwaysValidSchema=me.toHash=void 0;const t=he(),e=rn();function r(v){const E={};for(const S of v)E[S]=!0;return E}me.toHash=r;function n(v,E){return typeof E==
|
|
407
|
+
"boolean"?E:Object.keys(E).length===0?!0:(s(v,E),!i(E,v.self.RULES.all))}me.alwaysValidSchema=n;function s(v,E=v.schema){const{opts:S,self:I}=v;if(!S.strictSchema||typeof E=="boolean")return;const F=I.RULES.keywords;for(const B in E)F[B]||$(v,`unknown keyword: "${B}"`)}me.checkUnknownRules=s;function i(v,E){if(typeof v=="boolean")return!v;for(const S in v)if(E[S])return!0;return!1}me.schemaHasRules=i;function o(v,E){if(typeof v=="boolean")return!v;for(const S in v)if(S!=="$ref"&&E.all[S])return!0;
|
|
408
|
+
return!1}me.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:E},S,I,F){if(!F){if(typeof S=="number"||typeof S=="boolean")return S;if(typeof S=="string")return(0,t._)`${S}`}return(0,t._)`${v}${E}${(0,t.getProperty)(I)}`}me.schemaRefOrVal=a;function u(v){return d(decodeURIComponent(v))}me.unescapeFragment=u;function l(v){return encodeURIComponent(c(v))}me.escapeFragment=l;function c(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}me.escapeJsonPointer=c;function d(v){
|
|
409
|
+
return v.replace(/~1/g,"/").replace(/~0/g,"~")}me.unescapeJsonPointer=d;function h(v,E){if(Array.isArray(v))for(const S of v)E(S);else E(v)}me.eachItem=h;function y({mergeNames:v,mergeToName:E,mergeValues:S,resultToName:I}){return(F,B,D,k)=>{const j=D===void 0?B:D instanceof t.Name?(B instanceof t.Name?v(F,B,D):E(F,B,D),D):B instanceof t.Name?(E(F,D,B),B):S(B,D);return k===t.Name&&!(j instanceof t.Name)?I(F,j):j}}me.mergeEvaluated={props:y({mergeNames:(v,E,S)=>v.if((0,t._)`${S} !== true && ${E} !== undefined`,
|
|
410
|
+
()=>{v.if((0,t._)`${E} === true`,()=>v.assign(S,!0),()=>v.assign(S,(0,t._)`${S} || {}`).code((0,t._)`Object.assign(${S}, ${E})`))}),mergeToName:(v,E,S)=>v.if((0,t._)`${S} !== true`,()=>{E===!0?v.assign(S,!0):(v.assign(S,(0,t._)`${S} || {}`),_(v,S,E))}),mergeValues:(v,E)=>v===!0?!0:{...v,...E},resultToName:b}),items:y({mergeNames:(v,E,S)=>v.if((0,t._)`${S} !== true && ${E} !== undefined`,()=>v.assign(S,(0,t._)`${E} === true ? true : ${S} > ${E} ? ${S} : ${E}`)),mergeToName:(v,E,S)=>v.if((0,t._)`${S} !== true`,
|
|
411
|
+
()=>v.assign(S,E===!0?!0:(0,t._)`${S} > ${E} ? ${S} : ${E}`)),mergeValues:(v,E)=>v===!0?!0:Math.max(v,E),resultToName:(v,E)=>v.var("items",E)})};function b(v,E){if(E===!0)return v.var("props",!0);const S=v.var("props",(0,t._)`{}`);return E!==void 0&&_(v,S,E),S}me.evaluatedPropsToName=b;function _(v,E,S){Object.keys(S).forEach(I=>v.assign((0,t._)`${E}${(0,t.getProperty)(I)}`,!0))}me.setEvaluated=_;const f={};function g(v,E){return v.scopeValue("func",{ref:E,code:f[E.code]||(f[E.code]=new e._Code(
|
|
412
|
+
E.code))})}me.useFunc=g;var p;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(p||(me.Type=p={}));function m(v,E,S){if(v instanceof t.Name){const I=E===p.Num;return S?I?(0,t._)`"[" + ${v} + "]"`:(0,t._)`"['" + ${v} + "']"`:I?(0,t._)`"/" + ${v}`:(0,t._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return S?(0,t.getProperty)(v).toString():"/"+c(v)}me.getErrorPath=m;function $(v,E,S=v.opts.strictSchema){if(S){if(E=`strict mode: ${E}`,S===!0)throw new Error(E);v.self.logger.warn(E)}}return me.
|
|
413
|
+
checkStrictMode=$,me}var nn={},qc;function Xe(){if(qc)return nn;qc=1,Object.defineProperty(nn,"__esModule",{value:!0});const t=he(),e={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.
|
|
414
|
+
Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return nn.default=e,nn}var Hc;function sn(){return Hc||(Hc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=he(),r=ye(),n=Xe();t.keywordError={message:({keyword:f})=>(0,e.str)`must pass "${f}" keyword validation`},t.keyword$DataError={message:({
|
|
415
|
+
keyword:f,schemaType:g})=>g?(0,e.str)`"${f}" keyword must be ${g} ($data)`:(0,e.str)`"${f}" keyword is invalid ($data)`};function s(f,g=t.keywordError,p,m){const{it:$}=f,{gen:v,compositeRule:E,allErrors:S}=$,I=d(f,g,p);m??(E||S)?u(v,I):l($,(0,e._)`[${I}]`)}t.reportError=s;function i(f,g=t.keywordError,p){const{it:m}=f,{gen:$,compositeRule:v,allErrors:E}=m,S=d(f,g,p);u($,S),v||E||l(m,n.default.vErrors)}t.reportExtraError=i;function o(f,g){f.assign(n.default.errors,g),f.if((0,e._)`${n.default.vErrors} !== null`,
|
|
416
|
+
()=>f.if(g,()=>f.assign((0,e._)`${n.default.vErrors}.length`,g),()=>f.assign(n.default.vErrors,null)))}t.resetErrorsCount=o;function a({gen:f,keyword:g,schemaValue:p,data:m,errsCount:$,it:v}){if($===void 0)throw new Error("ajv implementation error");const E=f.name("err");f.forRange("i",$,n.default.errors,S=>{f.const(E,(0,e._)`${n.default.vErrors}[${S}]`),f.if((0,e._)`${E}.instancePath === undefined`,()=>f.assign((0,e._)`${E}.instancePath`,(0,e.strConcat)(n.default.instancePath,v.errorPath))),f.assign(
|
|
417
|
+
(0,e._)`${E}.schemaPath`,(0,e.str)`${v.errSchemaPath}/${g}`),v.opts.verbose&&(f.assign((0,e._)`${E}.schema`,p),f.assign((0,e._)`${E}.data`,m))})}t.extendErrors=a;function u(f,g){const p=f.const("err",g);f.if((0,e._)`${n.default.vErrors} === null`,()=>f.assign(n.default.vErrors,(0,e._)`[${p}]`),(0,e._)`${n.default.vErrors}.push(${p})`),f.code((0,e._)`${n.default.errors}++`)}function l(f,g){const{gen:p,validateName:m,schemaEnv:$}=f;$.$async?p.throw((0,e._)`new ${f.ValidationError}(${g})`):(p.assign(
|
|
418
|
+
(0,e._)`${m}.errors`,g),p.return(!1))}const c={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function d(f,g,p){const{createErrors:m}=f.it;return m===!1?(0,e._)`{}`:h(f,g,p)}function h(f,g,p={}){const{gen:m,it:$}=f,v=[y($,p),b(f,p)];return _(f,g,v),m.object(...v)}function y({errorPath:f},{instancePath:g}){const p=g?
|
|
419
|
+
(0,e.str)`${f}${(0,r.getErrorPath)(g,r.Type.Str)}`:f;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,p)]}function b({keyword:f,it:{errSchemaPath:g}},{schemaPath:p,parentSchema:m}){let $=m?g:(0,e.str)`${g}/${f}`;return p&&($=(0,e.str)`${$}${(0,r.getErrorPath)(p,r.Type.Str)}`),[c.schemaPath,$]}function _(f,{params:g,message:p},m){const{keyword:$,data:v,schemaValue:E,it:S}=f,{opts:I,propertyName:F,topSchemaRef:B,schemaPath:D}=S;m.push([c.keyword,$],[c.params,typeof g=="function"?
|
|
420
|
+
g(f):g||(0,e._)`{}`]),I.messages&&m.push([c.message,typeof p=="function"?p(f):p]),I.verbose&&m.push([c.schema,E],[c.parentSchema,(0,e._)`${B}${D}`],[n.default.data,v]),F&&m.push([c.propertyName,F])}}(Ci)),Ci}var Uc;function ig(){if(Uc)return Ht;Uc=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.boolOrEmptySchema=Ht.topBoolOrEmptySchema=void 0;const t=sn(),e=he(),r=Xe(),n={message:"boolean schema is false"};function s(a){const{gen:u,schema:l,validateName:c}=a;l===!1?o(a,!1):typeof l=="obje\
|
|
421
|
+
ct"&&l.$async===!0?u.return(r.default.data):(u.assign((0,e._)`${c}.errors`,null),u.return(!0))}Ht.topBoolOrEmptySchema=s;function i(a,u){const{gen:l,schema:c}=a;c===!1?(l.var(u,!1),o(a)):l.var(u,!0)}Ht.boolOrEmptySchema=i;function o(a,u){const{gen:l,data:c}=a,d={gen:l,keyword:"false schema",data:c,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(d,n,void 0,u)}return Ht}var Pe={},Ut={},Fc;function zc(){if(Fc)return Ut;Fc=1,Object.defineProperty(Ut,"__esModule",{value:!0}),
|
|
422
|
+
Ut.getRules=Ut.isJSONType=void 0;const t=["string","number","integer","boolean","null","object","array"],e=new Set(t);function r(s){return typeof s=="string"&&e.has(s)}Ut.isJSONType=r;function n(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return Ut.getRules=n,Ut}var dt={},
|
|
423
|
+
Vc;function Gc(){if(Vc)return dt;Vc=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.shouldUseRule=dt.shouldUseGroup=dt.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){const o=s.RULES.types[i];return o&&o!==!0&&e(n,o)}dt.schemaHasRulesForType=t;function e(n,s){return s.rules.some(i=>r(n,i))}dt.shouldUseGroup=e;function r(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(o=>n[o]!==void 0))}return dt.shouldUseRule=r,dt}var Bc;
|
|
424
|
+
function on(){if(Bc)return Pe;Bc=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.reportTypeError=Pe.checkDataTypes=Pe.checkDataType=Pe.coerceAndCheckDataType=Pe.getJSONTypes=Pe.getSchemaTypes=Pe.DataType=void 0;const t=zc(),e=Gc(),r=sn(),n=he(),s=ye();var i;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(i||(Pe.DataType=i={}));function o(p){const m=a(p.type);if(m.includes("null")){if(p.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!m.length&&
|
|
425
|
+
p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&m.push("null")}return m}Pe.getSchemaTypes=o;function a(p){const m=Array.isArray(p)?p:p?[p]:[];if(m.every(t.isJSONType))return m;throw new Error("type must be JSONType or JSONType[]: "+m.join(","))}Pe.getJSONTypes=a;function u(p,m){const{gen:$,data:v,opts:E}=p,S=c(m,E.coerceTypes),I=m.length>0&&!(S.length===0&&m.length===1&&(0,e.schemaHasRulesForType)(p,m[0]));if(I){const F=b(m,v,E.strictNumbers,i.Wrong);
|
|
426
|
+
$.if(F,()=>{S.length?d(p,m,S):f(p)})}return I}Pe.coerceAndCheckDataType=u;const l=new Set(["string","number","integer","boolean","null"]);function c(p,m){return m?p.filter($=>l.has($)||m==="array"&&$==="array"):[]}function d(p,m,$){const{gen:v,data:E,opts:S}=p,I=v.let("dataType",(0,n._)`typeof ${E}`),F=v.let("coerced",(0,n._)`undefined`);S.coerceTypes==="array"&&v.if((0,n._)`${I} == 'object' && Array.isArray(${E}) && ${E}.length == 1`,()=>v.assign(E,(0,n._)`${E}[0]`).assign(I,(0,n._)`typeof ${E}`).
|
|
427
|
+
if(b(m,E,S.strictNumbers),()=>v.assign(F,E))),v.if((0,n._)`${F} !== undefined`);for(const D of $)(l.has(D)||D==="array"&&S.coerceTypes==="array")&&B(D);v.else(),f(p),v.endIf(),v.if((0,n._)`${F} !== undefined`,()=>{v.assign(E,F),h(p,F)});function B(D){switch(D){case"string":v.elseIf((0,n._)`${I} == "number" || ${I} == "boolean"`).assign(F,(0,n._)`"" + ${E}`).elseIf((0,n._)`${E} === null`).assign(F,(0,n._)`""`);return;case"number":v.elseIf((0,n._)`${I} == "boolean" || ${E} === null
|
|
428
|
+
|| (${I} == "string" && ${E} && ${E} == +${E})`).assign(F,(0,n._)`+${E}`);return;case"integer":v.elseIf((0,n._)`${I} === "boolean" || ${E} === null
|
|
429
|
+
|| (${I} === "string" && ${E} && ${E} == +${E} && !(${E} % 1))`).assign(F,(0,n._)`+${E}`);return;case"boolean":v.elseIf((0,n._)`${E} === "false" || ${E} === 0 || ${E} === null`).assign(F,!1).elseIf((0,n._)`${E} === "true" || ${E} === 1`).assign(F,!0);return;case"null":v.elseIf((0,n._)`${E} === "" || ${E} === 0 || ${E} === false`),v.assign(F,null);return;case"array":v.elseIf((0,n._)`${I} === "string" || ${I} === "number"
|
|
430
|
+
|| ${I} === "boolean" || ${E} === null`).assign(F,(0,n._)`[${E}]`)}}}function h({gen:p,parentData:m,parentDataProperty:$},v){p.if((0,n._)`${m} !== undefined`,()=>p.assign((0,n._)`${m}[${$}]`,v))}function y(p,m,$,v=i.Correct){const E=v===i.Correct?n.operators.EQ:n.operators.NEQ;let S;switch(p){case"null":return(0,n._)`${m} ${E} null`;case"array":S=(0,n._)`Array.isArray(${m})`;break;case"object":S=(0,n._)`${m} && typeof ${m} == "object" && !Array.isArray(${m})`;break;case"integer":S=
|
|
431
|
+
I((0,n._)`!(${m} % 1) && !isNaN(${m})`);break;case"number":S=I();break;default:return(0,n._)`typeof ${m} ${E} ${p}`}return v===i.Correct?S:(0,n.not)(S);function I(F=n.nil){return(0,n.and)((0,n._)`typeof ${m} == "number"`,F,$?(0,n._)`isFinite(${m})`:n.nil)}}Pe.checkDataType=y;function b(p,m,$,v){if(p.length===1)return y(p[0],m,$,v);let E;const S=(0,s.toHash)(p);if(S.array&&S.object){const I=(0,n._)`typeof ${m} != "object"`;E=S.null?I:(0,n._)`!${m} || ${I}`,delete S.null,delete S.array,delete S.object}else
|
|
432
|
+
E=n.nil;S.number&&delete S.integer;for(const I in S)E=(0,n.and)(E,y(I,m,$,v));return E}Pe.checkDataTypes=b;const _={message:({schema:p})=>`must be ${p}`,params:({schema:p,schemaValue:m})=>typeof p=="string"?(0,n._)`{type: ${p}}`:(0,n._)`{type: ${m}}`};function f(p){const m=g(p);(0,r.reportError)(m,_)}Pe.reportTypeError=f;function g(p){const{gen:m,data:$,schema:v}=p,E=(0,s.schemaRefOrVal)(p,v,"type");return{gen:m,keyword:"type",data:$,schema:v.type,schemaCode:E,schemaValue:E,parentSchema:v,params:{},
|
|
433
|
+
it:p}}return Pe}var Er={},Wc;function og(){if(Wc)return Er;Wc=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.assignDefaults=void 0;const t=he(),e=ye();function r(s,i){const{properties:o,items:a}=s.schema;if(i==="object"&&o)for(const u in o)n(s,u,o[u].default);else i==="array"&&Array.isArray(a)&&a.forEach((u,l)=>n(s,l,u.default))}Er.assignDefaults=r;function n(s,i,o){const{gen:a,compositeRule:u,data:l,opts:c}=s;if(o===void 0)return;const d=(0,t._)`${l}${(0,t.getProperty)(i)}`;if(u){(0,e.checkStrictMode)(
|
|
434
|
+
s,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;c.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),a.if(h,(0,t._)`${d} = ${(0,t.stringify)(o)}`)}return Er}var Je={},ve={},Kc;function Qe(){if(Kc)return ve;Kc=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.validateUnion=ve.validateArray=ve.usePattern=ve.callValidateCode=ve.schemaProperties=ve.allSchemaProperties=ve.noPropertyInData=ve.propertyInData=ve.isOwnProperty=ve.hasPropFunc=ve.reportMissingProp=
|
|
435
|
+
ve.checkMissingProp=ve.checkReportMissingProp=void 0;const t=he(),e=ye(),r=Xe(),n=ye();function s(p,m){const{gen:$,data:v,it:E}=p;$.if(c($,v,m,E.opts.ownProperties),()=>{p.setParams({missingProperty:(0,t._)`${m}`},!0),p.error()})}ve.checkReportMissingProp=s;function i({gen:p,data:m,it:{opts:$}},v,E){return(0,t.or)(...v.map(S=>(0,t.and)(c(p,m,S,$.ownProperties),(0,t._)`${E} = ${S}`)))}ve.checkMissingProp=i;function o(p,m){p.setParams({missingProperty:m},!0),p.error()}ve.reportMissingProp=o;function a(p){
|
|
436
|
+
return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}ve.hasPropFunc=a;function u(p,m,$){return(0,t._)`${a(p)}.call(${m}, ${$})`}ve.isOwnProperty=u;function l(p,m,$,v){const E=(0,t._)`${m}${(0,t.getProperty)($)} !== undefined`;return v?(0,t._)`${E} && ${u(p,m,$)}`:E}ve.propertyInData=l;function c(p,m,$,v){const E=(0,t._)`${m}${(0,t.getProperty)($)} === undefined`;return v?(0,t.or)(E,(0,t.not)(u(p,m,$))):E}ve.noPropertyInData=c;function d(p){
|
|
437
|
+
return p?Object.keys(p).filter(m=>m!=="__proto__"):[]}ve.allSchemaProperties=d;function h(p,m){return d(m).filter($=>!(0,e.alwaysValidSchema)(p,m[$]))}ve.schemaProperties=h;function y({schemaCode:p,data:m,it:{gen:$,topSchemaRef:v,schemaPath:E,errorPath:S},it:I},F,B,D){const k=D?(0,t._)`${p}, ${m}, ${v}${E}`:m,j=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,S)],[r.default.parentData,I.parentData],[r.default.parentDataProperty,I.parentDataProperty],[r.default.rootData,r.default.rootData]];
|
|
438
|
+
I.opts.dynamicRef&&j.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const x=(0,t._)`${k}, ${$.object(...j)}`;return B!==t.nil?(0,t._)`${F}.call(${B}, ${x})`:(0,t._)`${F}(${x})`}ve.callValidateCode=y;const b=(0,t._)`new RegExp`;function _({gen:p,it:{opts:m}},$){const v=m.unicodeRegExp?"u":"",{regExp:E}=m.code,S=E($,v);return p.scopeValue("pattern",{key:S.toString(),ref:S,code:(0,t._)`${E.code==="new RegExp"?b:(0,n.useFunc)(p,E)}(${$}, ${v})`})}ve.usePattern=_;function f(p){const{gen:m,
|
|
439
|
+
data:$,keyword:v,it:E}=p,S=m.name("valid");if(E.allErrors){const F=m.let("valid",!0);return I(()=>m.assign(F,!1)),F}return m.var(S,!0),I(()=>m.break()),S;function I(F){const B=m.const("len",(0,t._)`${$}.length`);m.forRange("i",0,B,D=>{p.subschema({keyword:v,dataProp:D,dataPropType:e.Type.Num},S),m.if((0,t.not)(S),F)})}}ve.validateArray=f;function g(p){const{gen:m,schema:$,keyword:v,it:E}=p;if(!Array.isArray($))throw new Error("ajv implementation error");if($.some(B=>(0,e.alwaysValidSchema)(E,B))&&
|
|
440
|
+
!E.opts.unevaluated)return;const I=m.let("valid",!1),F=m.name("_valid");m.block(()=>$.forEach((B,D)=>{const k=p.subschema({keyword:v,schemaProp:D,compositeRule:!0},F);m.assign(I,(0,t._)`${I} || ${F}`),p.mergeValidEvaluated(k,F)||m.if((0,t.not)(I))})),p.result(I,()=>p.reset(),()=>p.error(!0))}return ve.validateUnion=g,ve}var Yc;function ag(){if(Yc)return Je;Yc=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.validateKeywordUsage=Je.validSchemaType=Je.funcKeywordCode=Je.macroKeywordCode=void 0;
|
|
441
|
+
const t=he(),e=Xe(),r=Qe(),n=sn();function s(h,y){const{gen:b,keyword:_,schema:f,parentSchema:g,it:p}=h,m=y.macro.call(p.self,f,g,p),$=l(b,_,m);p.opts.validateSchema!==!1&&p.self.validateSchema(m,!0);const v=b.name("valid");h.subschema({schema:m,schemaPath:t.nil,errSchemaPath:`${p.errSchemaPath}/${_}`,topSchemaRef:$,compositeRule:!0},v),h.pass(v,()=>h.error(!0))}Je.macroKeywordCode=s;function i(h,y){var b;const{gen:_,keyword:f,schema:g,parentSchema:p,$data:m,it:$}=h;u($,y);const v=!m&&y.compile?
|
|
442
|
+
y.compile.call($.self,g,p,$):y.validate,E=l(_,f,v),S=_.let("valid");h.block$data(S,I),h.ok((b=y.valid)!==null&&b!==void 0?b:S);function I(){if(y.errors===!1)D(),y.modifying&&o(h),k(()=>h.error());else{const j=y.async?F():B();y.modifying&&o(h),k(()=>a(h,j))}}function F(){const j=_.let("ruleErrs",null);return _.try(()=>D((0,t._)`await `),x=>_.assign(S,!1).if((0,t._)`${x} instanceof ${$.ValidationError}`,()=>_.assign(j,(0,t._)`${x}.errors`),()=>_.throw(x))),j}function B(){const j=(0,t._)`${E}.errors`;
|
|
443
|
+
return _.assign(j,null),D(t.nil),j}function D(j=y.async?(0,t._)`await `:t.nil){const x=$.opts.passContext?e.default.this:e.default.self,H=!("compile"in y&&!m||y.schema===!1);_.assign(S,(0,t._)`${j}${(0,r.callValidateCode)(h,E,x,H)}`,y.modifying)}function k(j){var x;_.if((0,t.not)((x=y.valid)!==null&&x!==void 0?x:S),j)}}Je.funcKeywordCode=i;function o(h){const{gen:y,data:b,it:_}=h;y.if(_.parentData,()=>y.assign(b,(0,t._)`${_.parentData}[${_.parentDataProperty}]`))}function a(h,y){const{gen:b}=h;b.
|
|
444
|
+
if((0,t._)`Array.isArray(${y})`,()=>{b.assign(e.default.vErrors,(0,t._)`${e.default.vErrors} === null ? ${y} : ${e.default.vErrors}.concat(${y})`).assign(e.default.errors,(0,t._)`${e.default.vErrors}.length`),(0,n.extendErrors)(h)},()=>h.error())}function u({schemaEnv:h},y){if(y.async&&!h.$async)throw new Error("async keyword in sync schema")}function l(h,y,b){if(b===void 0)throw new Error(`keyword "${y}" failed to compile`);return h.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,t.
|
|
445
|
+
stringify)(b)})}function c(h,y,b=!1){return!y.length||y.some(_=>_==="array"?Array.isArray(h):_==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==_||b&&typeof h>"u")}Je.validSchemaType=c;function d({schema:h,opts:y,self:b,errSchemaPath:_},f,g){if(Array.isArray(f.keyword)?!f.keyword.includes(g):f.keyword!==g)throw new Error("ajv implementation error");const p=f.dependencies;if(p?.some(m=>!Object.prototype.hasOwnProperty.call(h,m)))throw new Error(`parent schema must have dependencies o\
|
|
446
|
+
f ${g}: ${p.join(",")}`);if(f.validateSchema&&!f.validateSchema(h[g])){const $=`keyword "${g}" value is invalid at path "${_}": `+b.errorsText(f.validateSchema.errors);if(y.validateSchema==="log")b.logger.error($);else throw new Error($)}}return Je.validateKeywordUsage=d,Je}var ht={},Xc;function cg(){if(Xc)return ht;Xc=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.extendSubschemaMode=ht.extendSubschemaData=ht.getSubschema=void 0;const t=he(),e=ye();function r(i,{keyword:o,schemaProp:a,schema:u,
|
|
447
|
+
schemaPath:l,errSchemaPath:c,topSchemaRef:d}){if(o!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const h=i.schema[o];return a===void 0?{schema:h,schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${o}`}:{schema:h[a],schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${o}/${(0,e.escapeFragment)(a)}`}}if(u!==void 0){if(l===void 0||
|
|
448
|
+
c===void 0||d===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:d,errSchemaPath:c}}throw new Error('either "keyword" or "schema" must be passed')}ht.getSubschema=r;function n(i,o,{dataProp:a,dataPropType:u,data:l,dataTypes:c,propertyName:d}){if(l!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=o;if(a!==void 0){const{errorPath:b,dataPathArr:_,opts:f}=o,
|
|
449
|
+
g=h.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0);y(g),i.errorPath=(0,t.str)`${b}${(0,e.getErrorPath)(a,u,f.jsPropertySyntax)}`,i.parentDataProperty=(0,t._)`${a}`,i.dataPathArr=[..._,i.parentDataProperty]}if(l!==void 0){const b=l instanceof t.Name?l:h.let("data",l,!0);y(b),d!==void 0&&(i.propertyName=d)}c&&(i.dataTypes=c);function y(b){i.data=b,i.dataLevel=o.dataLevel+1,i.dataTypes=[],o.definedProperties=new Set,i.parentData=o.data,i.dataNames=[...o.dataNames,b]}}ht.extendSubschemaData=
|
|
450
|
+
n;function s(i,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:u,createErrors:l,allErrors:c}){u!==void 0&&(i.compositeRule=u),l!==void 0&&(i.createErrors=l),c!==void 0&&(i.allErrors=c),i.jtdDiscriminator=o,i.jtdMetadata=a}return ht.extendSubschemaMode=s,ht}var je={},Ti,Jc;function Qc(){return Jc||(Jc=1,Ti=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=
|
|
451
|
+
n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}),Ti}var ji={
|
|
452
|
+
exports:{}},Zc;function ug(){if(Zc)return ji.exports;Zc=1;var t=ji.exports=function(n,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var o=typeof i=="function"?i:i.pre||function(){},a=i.post||function(){};e(s,o,a,n,"",n)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords=
|
|
453
|
+
{default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(n,s,i,o,a,u,l,c,d,h){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,a,u,l,c,d,h);for(var y in o){var b=o[y];if(Array.isArray(b)){if(y in t.arrayKeywords)for(var _=0;_<b.length;_++)e(n,s,i,b[_],a+"/"+y+"/"+_,u,a,y,o,_)}else if(y in t.propsKeywords){if(b&&
|
|
454
|
+
typeof b=="object")for(var f in b)e(n,s,i,b[f],a+"/"+y+"/"+r(f),u,a,y,o,f)}else(y in t.keywords||n.allKeys&&!(y in t.skipKeywords))&&e(n,s,i,b,a+"/"+y,u,a,y,o)}i(o,a,u,l,c,d,h)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return ji.exports}var eu;function an(){if(eu)return je;eu=1,Object.defineProperty(je,"__esModule",{value:!0}),je.getSchemaRefs=je.resolveUrl=je.normalizeId=je._getFullPath=je.getFullPath=je.inlineRef=void 0;const t=ye(),e=Qc(),r=ug(),n=new Set(["type","format",
|
|
455
|
+
"pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(_,f=!0){return typeof _=="boolean"?!0:f===!0?!o(_):f?a(_)<=f:!1}je.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(_){for(const f in _){if(i.has(f))return!0;const g=_[f];if(Array.isArray(g)&&g.some(o)||typeof g=="object"&&o(g))return!0}return!1}function a(_){
|
|
456
|
+
let f=0;for(const g in _){if(g==="$ref")return 1/0;if(f++,!n.has(g)&&(typeof _[g]=="object"&&(0,t.eachItem)(_[g],p=>f+=a(p)),f===1/0))return 1/0}return f}function u(_,f="",g){g!==!1&&(f=d(f));const p=_.parse(f);return l(_,p)}je.getFullPath=u;function l(_,f){return _.serialize(f).split("#")[0]+"#"}je._getFullPath=l;const c=/#\/?$/;function d(_){return _?_.replace(c,""):""}je.normalizeId=d;function h(_,f,g){return g=d(g),_.resolve(f,g)}je.resolveUrl=h;const y=/^[a-z_][-a-z0-9._]*$/i;function b(_,f){
|
|
457
|
+
if(typeof _=="boolean")return{};const{schemaId:g,uriResolver:p}=this.opts,m=d(_[g]||f),$={"":m},v=u(p,m,!1),E={},S=new Set;return r(_,{allKeys:!0},(B,D,k,j)=>{if(j===void 0)return;const x=v+D;let H=$[j];typeof B[g]=="string"&&(H=K.call(this,B[g])),G.call(this,B.$anchor),G.call(this,B.$dynamicAnchor),$[D]=H;function K(X){const se=this.opts.uriResolver.resolve;if(X=d(H?se(H,X):X),S.has(X))throw F(X);S.add(X);let U=this.refs[X];return typeof U=="string"&&(U=this.refs[U]),typeof U=="object"?I(B,U.schema,
|
|
458
|
+
X):X!==d(x)&&(X[0]==="#"?(I(B,E[X],X),E[X]=B):this.refs[X]=x),X}function G(X){if(typeof X=="string"){if(!y.test(X))throw new Error(`invalid anchor "${X}"`);K.call(this,`#${X}`)}}}),E;function I(B,D,k){if(D!==void 0&&!e(B,D))throw F(k)}function F(B){return new Error(`reference "${B}" resolves to more than one schema`)}}return je.getSchemaRefs=b,je}var tu;function Sr(){if(tu)return ft;tu=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.getData=ft.KeywordCxt=ft.validateFunctionCode=void 0;const t=ig(),
|
|
459
|
+
e=on(),r=Gc(),n=on(),s=og(),i=ag(),o=cg(),a=he(),u=Xe(),l=an(),c=ye(),d=sn();function h(L){if(v(L)&&(S(L),$(L))){f(L);return}y(L,()=>(0,t.topBoolOrEmptySchema)(L))}ft.validateFunctionCode=h;function y({gen:L,validateName:q,schema:J,schemaEnv:ne,opts:P},T){P.code.es5?L.func(q,(0,a._)`${u.default.data}, ${u.default.valCxt}`,ne.$async,()=>{L.code((0,a._)`"use strict"; ${p(J,P)}`),_(L,P),L.code(T)}):L.func(q,(0,a._)`${u.default.data}, ${b(P)}`,ne.$async,()=>L.code(p(J,P)).code(T))}function b(L){return(0,a.
|
|
460
|
+
_)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${L.dynamicRef?(0,a._)`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function _(L,q){L.if(u.default.valCxt,()=>{L.var(u.default.instancePath,(0,a._)`${u.default.valCxt}.${u.default.instancePath}`),L.var(u.default.parentData,(0,a._)`${u.default.valCxt}.${u.default.parentData}`),L.var(u.default.parentDataProperty,(0,a._)`${u.default.valCxt}.${u.default.parentDataProperty}`),
|
|
461
|
+
L.var(u.default.rootData,(0,a._)`${u.default.valCxt}.${u.default.rootData}`),q.dynamicRef&&L.var(u.default.dynamicAnchors,(0,a._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{L.var(u.default.instancePath,(0,a._)`""`),L.var(u.default.parentData,(0,a._)`undefined`),L.var(u.default.parentDataProperty,(0,a._)`undefined`),L.var(u.default.rootData,u.default.data),q.dynamicRef&&L.var(u.default.dynamicAnchors,(0,a._)`{}`)})}function f(L){const{schema:q,opts:J,gen:ne}=L;y(L,()=>{J.$comment&&q.
|
|
462
|
+
$comment&&j(L),B(L),ne.let(u.default.vErrors,null),ne.let(u.default.errors,0),J.unevaluated&&g(L),I(L),x(L)})}function g(L){const{gen:q,validateName:J}=L;L.evaluated=q.const("evaluated",(0,a._)`${J}.evaluated`),q.if((0,a._)`${L.evaluated}.dynamicProps`,()=>q.assign((0,a._)`${L.evaluated}.props`,(0,a._)`undefined`)),q.if((0,a._)`${L.evaluated}.dynamicItems`,()=>q.assign((0,a._)`${L.evaluated}.items`,(0,a._)`undefined`))}function p(L,q){const J=typeof L=="object"&&L[q.schemaId];return J&&(q.code.source||
|
|
463
|
+
q.code.process)?(0,a._)`/*# sourceURL=${J} */`:a.nil}function m(L,q){if(v(L)&&(S(L),$(L))){E(L,q);return}(0,t.boolOrEmptySchema)(L,q)}function $({schema:L,self:q}){if(typeof L=="boolean")return!L;for(const J in L)if(q.RULES.all[J])return!0;return!1}function v(L){return typeof L.schema!="boolean"}function E(L,q){const{schema:J,gen:ne,opts:P}=L;P.$comment&&J.$comment&&j(L),D(L),k(L);const T=ne.const("_errs",u.default.errors);I(L,T),ne.var(q,(0,a._)`${T} === ${u.default.errors}`)}function S(L){(0,c.
|
|
464
|
+
checkUnknownRules)(L),F(L)}function I(L,q){if(L.opts.jtd)return K(L,[],!1,q);const J=(0,e.getSchemaTypes)(L.schema),ne=(0,e.coerceAndCheckDataType)(L,J);K(L,J,!ne,q)}function F(L){const{schema:q,errSchemaPath:J,opts:ne,self:P}=L;q.$ref&&ne.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(q,P.RULES)&&P.logger.warn(`$ref: keywords ignored in schema at path "${J}"`)}function B(L){const{schema:q,opts:J}=L;q.default!==void 0&&J.useDefaults&&J.strictSchema&&(0,c.checkStrictMode)(L,"default is ignored\
|
|
465
|
+
in the schema root")}function D(L){const q=L.schema[L.opts.schemaId];q&&(L.baseId=(0,l.resolveUrl)(L.opts.uriResolver,L.baseId,q))}function k(L){if(L.schema.$async&&!L.schemaEnv.$async)throw new Error("async schema in sync schema")}function j({gen:L,schemaEnv:q,schema:J,errSchemaPath:ne,opts:P}){const T=J.$comment;if(P.$comment===!0)L.code((0,a._)`${u.default.self}.logger.log(${T})`);else if(typeof P.$comment=="function"){const Z=(0,a.str)`${ne}/$comment`,W=L.scopeValue("root",{ref:q.root});L.code(
|
|
466
|
+
(0,a._)`${u.default.self}.opts.$comment(${T}, ${Z}, ${W}.schema)`)}}function x(L){const{gen:q,schemaEnv:J,validateName:ne,ValidationError:P,opts:T}=L;J.$async?q.if((0,a._)`${u.default.errors} === 0`,()=>q.return(u.default.data),()=>q.throw((0,a._)`new ${P}(${u.default.vErrors})`)):(q.assign((0,a._)`${ne}.errors`,u.default.vErrors),T.unevaluated&&H(L),q.return((0,a._)`${u.default.errors} === 0`))}function H({gen:L,evaluated:q,props:J,items:ne}){J instanceof a.Name&&L.assign((0,a._)`${q}.props`,J),
|
|
467
|
+
ne instanceof a.Name&&L.assign((0,a._)`${q}.items`,ne)}function K(L,q,J,ne){const{gen:P,schema:T,data:Z,allErrors:W,opts:N,self:te}=L,{RULES:V}=te;if(T.$ref&&(N.ignoreKeywordsWithRef||!(0,c.schemaHasRulesButRef)(T,V))){P.block(()=>Y(L,"$ref",V.all.$ref.definition));return}N.jtd||X(L,q),P.block(()=>{for(const le of V.rules)re(le);re(V.post)});function re(le){(0,r.shouldUseGroup)(T,le)&&(le.type?(P.if((0,n.checkDataType)(le.type,Z,N.strictNumbers)),G(L,le),q.length===1&&q[0]===le.type&&J&&(P.else(),
|
|
468
|
+
(0,n.reportTypeError)(L)),P.endIf()):G(L,le),W||P.if((0,a._)`${u.default.errors} === ${ne||0}`))}}function G(L,q){const{gen:J,schema:ne,opts:{useDefaults:P}}=L;P&&(0,s.assignDefaults)(L,q.type),J.block(()=>{for(const T of q.rules)(0,r.shouldUseRule)(ne,T)&&Y(L,T.keyword,T.definition,q.type)})}function X(L,q){L.schemaEnv.meta||!L.opts.strictTypes||(se(L,q),L.opts.allowUnionTypes||U(L,q),A(L,L.dataTypes))}function se(L,q){if(q.length){if(!L.dataTypes.length){L.dataTypes=q;return}q.forEach(J=>{M(L.
|
|
469
|
+
dataTypes,J)||R(L,`type "${J}" not allowed by context "${L.dataTypes.join(",")}"`)}),w(L,q)}}function U(L,q){q.length>1&&!(q.length===2&&q.includes("null"))&&R(L,"use allowUnionTypes to allow union type keyword")}function A(L,q){const J=L.self.RULES.all;for(const ne in J){const P=J[ne];if(typeof P=="object"&&(0,r.shouldUseRule)(L.schema,P)){const{type:T}=P.definition;T.length&&!T.some(Z=>z(q,Z))&&R(L,`missing type "${T.join(",")}" for keyword "${ne}"`)}}}function z(L,q){return L.includes(q)||q===
|
|
470
|
+
"number"&&L.includes("integer")}function M(L,q){return L.includes(q)||q==="integer"&&L.includes("number")}function w(L,q){const J=[];for(const ne of L.dataTypes)M(q,ne)?J.push(ne):q.includes("integer")&&ne==="number"&&J.push("integer");L.dataTypes=J}function R(L,q){const J=L.schemaEnv.baseId+L.errSchemaPath;q+=` at "${J}" (strictTypes)`,(0,c.checkStrictMode)(L,q,L.opts.strictTypes)}class C{constructor(q,J,ne){if((0,i.validateKeywordUsage)(q,J,ne),this.gen=q.gen,this.allErrors=q.allErrors,this.keyword=
|
|
471
|
+
ne,this.data=q.data,this.schema=q.schema[ne],this.$data=J.$data&&q.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,c.schemaRefOrVal)(q,this.schema,ne,this.$data),this.schemaType=J.schemaType,this.parentSchema=q.schema,this.params={},this.it=q,this.def=J,this.$data)this.schemaCode=q.gen.const("vSchema",oe(this.$data,q));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,J.schemaType,J.allowUndefined))throw new Error(`${ne} value must be ${JSON.stringify(J.schemaType)}`);
|
|
472
|
+
("code"in J?J.trackErrors:J.errors!==!1)&&(this.errsCount=q.gen.const("_errs",u.default.errors))}result(q,J,ne){this.failResult((0,a.not)(q),J,ne)}failResult(q,J,ne){this.gen.if(q),ne?ne():this.error(),J?(this.gen.else(),J(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(q,J){this.failResult((0,a.not)(q),void 0,J)}fail(q){if(q===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(q),this.error(),this.allErrors?this.gen.endIf():this.gen.
|
|
473
|
+
else()}fail$data(q){if(!this.$data)return this.fail(q);const{schemaCode:J}=this;this.fail((0,a._)`${J} !== undefined && (${(0,a.or)(this.invalid$data(),q)})`)}error(q,J,ne){if(J){this.setParams(J),this._error(q,ne),this.setParams({});return}this._error(q,ne)}_error(q,J){(q?d.reportExtraError:d.reportError)(this,this.def.error,J)}$dataError(){(0,d.reportError)(this,this.def.$dataError||d.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');
|
|
474
|
+
(0,d.resetErrorsCount)(this.gen,this.errsCount)}ok(q){this.allErrors||this.gen.if(q)}setParams(q,J){J?Object.assign(this.params,q):this.params=q}block$data(q,J,ne=a.nil){this.gen.block(()=>{this.check$data(q,ne),J()})}check$data(q=a.nil,J=a.nil){if(!this.$data)return;const{gen:ne,schemaCode:P,schemaType:T,def:Z}=this;ne.if((0,a.or)((0,a._)`${P} === undefined`,J)),q!==a.nil&&ne.assign(q,!0),(T.length||Z.validateSchema)&&(ne.elseIf(this.invalid$data()),this.$dataError(),q!==a.nil&&ne.assign(q,!1)),
|
|
475
|
+
ne.else()}invalid$data(){const{gen:q,schemaCode:J,schemaType:ne,def:P,it:T}=this;return(0,a.or)(Z(),W());function Z(){if(ne.length){if(!(J instanceof a.Name))throw new Error("ajv implementation error");const N=Array.isArray(ne)?ne:[ne];return(0,a._)`${(0,n.checkDataTypes)(N,J,T.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function W(){if(P.validateSchema){const N=q.scopeValue("validate$data",{ref:P.validateSchema});return(0,a._)`!${N}(${J})`}return a.nil}}subschema(q,J){const ne=(0,o.getSubschema)(
|
|
476
|
+
this.it,q);(0,o.extendSubschemaData)(ne,this.it,q),(0,o.extendSubschemaMode)(ne,q);const P={...this.it,...ne,items:void 0,props:void 0};return m(P,J),P}mergeEvaluated(q,J){const{it:ne,gen:P}=this;ne.opts.unevaluated&&(ne.props!==!0&&q.props!==void 0&&(ne.props=c.mergeEvaluated.props(P,q.props,ne.props,J)),ne.items!==!0&&q.items!==void 0&&(ne.items=c.mergeEvaluated.items(P,q.items,ne.items,J)))}mergeValidEvaluated(q,J){const{it:ne,gen:P}=this;if(ne.opts.unevaluated&&(ne.props!==!0||ne.items!==!0))
|
|
477
|
+
return P.if(J,()=>this.mergeEvaluated(q,a.Name)),!0}}ft.KeywordCxt=C;function Y(L,q,J,ne){const P=new C(L,J,q);"code"in J?J.code(P,ne):P.$data&&J.validate?(0,i.funcKeywordCode)(P,J):"macro"in J?(0,i.macroKeywordCode)(P,J):(J.compile||J.validate)&&(0,i.funcKeywordCode)(P,J)}const Q=/^\/(?:[^~]|~0|~1)*$/,ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oe(L,{dataLevel:q,dataNames:J,dataPathArr:ne}){let P,T;if(L==="")return u.default.rootData;if(L[0]==="/"){if(!Q.test(L))throw new Error(`Invalid JSON\
|
|
478
|
+
-pointer: ${L}`);P=L,T=u.default.rootData}else{const te=ie.exec(L);if(!te)throw new Error(`Invalid JSON-pointer: ${L}`);const V=+te[1];if(P=te[2],P==="#"){if(V>=q)throw new Error(N("property/index",V));return ne[q-V]}if(V>q)throw new Error(N("data",V));if(T=J[q-V],!P)return T}let Z=T;const W=P.split("/");for(const te of W)te&&(T=(0,a._)`${T}${(0,a.getProperty)((0,c.unescapeJsonPointer)(te))}`,Z=(0,a._)`${Z} && ${T}`);return Z;function N(te,V){return`Cannot access ${te} ${V} levels up, current le\
|
|
479
|
+
vel is ${q}`}}return ft.getData=oe,ft}var cn={},ru;function un(){if(ru)return cn;ru=1,Object.defineProperty(cn,"__esModule",{value:!0});class t extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return cn.default=t,cn}var ln={},nu;function Rr(){if(nu)return ln;nu=1,Object.defineProperty(ln,"__esModule",{value:!0});const t=an();class e extends Error{constructor(n,s,i,o){super(o||`can't resolve reference ${i} from id ${s}`),this.missingRef=(0,t.resolveUrl)(
|
|
480
|
+
n,s,i),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(n,this.missingRef))}}return ln.default=e,ln}var He={},su;function fn(){if(su)return He;su=1,Object.defineProperty(He,"__esModule",{value:!0}),He.resolveSchema=He.getCompilingSchema=He.resolveRef=He.compileSchema=He.SchemaEnv=void 0;const t=he(),e=un(),r=Xe(),n=an(),s=ye(),i=Sr();class o{constructor(g){var p;this.refs={},this.dynamicAnchors={};let m;typeof g.schema=="object"&&(m=g.schema),this.schema=g.schema,this.schemaId=g.schemaId,this.
|
|
481
|
+
root=g.root||this,this.baseId=(p=g.baseId)!==null&&p!==void 0?p:(0,n.normalizeId)(m?.[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=m?.$async,this.refs={}}}He.SchemaEnv=o;function a(f){const g=c.call(this,f);if(g)return g;const p=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:m,lines:$}=this.opts.code,{ownProperties:v}=this.opts,E=new t.CodeGen(this.scope,{es5:m,lines:$,ownProperties:v});let S;f.$async&&(S=E.scopeValue("Erro\
|
|
482
|
+
r",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const I=E.scopeName("validate");f.validateName=I;const F={gen:E,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:E.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:{ref:f.schema}),
|
|
483
|
+
validateName:I,ValidationError:S,schema:f.schema,schemaEnv:f,rootId:p,baseId:f.baseId||p,schemaPath:t.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let B;try{this._compilations.add(f),(0,i.validateFunctionCode)(F),E.optimize(this.opts.code.optimize);const D=E.toString();B=`${E.scopeRefs(r.default.scope)}return ${D}`,this.opts.code.process&&(B=this.opts.code.process(B,f));const j=new Function(`${r.default.self}`,`${r.default.scope}`,B)(this,
|
|
484
|
+
this.scope.get());if(this.scope.value(I,{ref:j}),j.errors=null,j.schema=f.schema,j.schemaEnv=f,f.$async&&(j.$async=!0),this.opts.code.source===!0&&(j.source={validateName:I,validateCode:D,scopeValues:E._values}),this.opts.unevaluated){const{props:x,items:H}=F;j.evaluated={props:x instanceof t.Name?void 0:x,items:H instanceof t.Name?void 0:H,dynamicProps:x instanceof t.Name,dynamicItems:H instanceof t.Name},j.source&&(j.source.evaluated=(0,t.stringify)(j.evaluated))}return f.validate=j,f}catch(D){
|
|
485
|
+
throw delete f.validate,delete f.validateName,B&&this.logger.error("Error compiling schema, function code:",B),D}finally{this._compilations.delete(f)}}He.compileSchema=a;function u(f,g,p){var m;p=(0,n.resolveUrl)(this.opts.uriResolver,g,p);const $=f.refs[p];if($)return $;let v=h.call(this,f,p);if(v===void 0){const E=(m=f.localRefs)===null||m===void 0?void 0:m[p],{schemaId:S}=this.opts;E&&(v=new o({schema:E,schemaId:S,root:f,baseId:g}))}if(v!==void 0)return f.refs[p]=l.call(this,v)}He.resolveRef=
|
|
486
|
+
u;function l(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:a.call(this,f)}function c(f){for(const g of this._compilations)if(d(g,f))return g}He.getCompilingSchema=c;function d(f,g){return f.schema===g.schema&&f.root===g.root&&f.baseId===g.baseId}function h(f,g){let p;for(;typeof(p=this.refs[g])=="string";)g=p;return p||this.schemas[g]||y.call(this,f,g)}function y(f,g){const p=this.opts.uriResolver.parse(g),m=(0,n._getFullPath)(this.opts.uriResolver,p);let $=(0,n.getFullPath)(
|
|
487
|
+
this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&m===$)return _.call(this,p,f);const v=(0,n.normalizeId)(m),E=this.refs[v]||this.schemas[v];if(typeof E=="string"){const S=y.call(this,f,E);return typeof S?.schema!="object"?void 0:_.call(this,p,S)}if(typeof E?.schema=="object"){if(E.validate||a.call(this,E),v===(0,n.normalizeId)(g)){const{schema:S}=E,{schemaId:I}=this.opts,F=S[I];return F&&($=(0,n.resolveUrl)(this.opts.uriResolver,$,F)),new o({schema:S,schemaId:I,root:f,baseId:$})}
|
|
488
|
+
return _.call(this,p,E)}}He.resolveSchema=y;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(f,{baseId:g,schema:p,root:m}){var $;if((($=f.fragment)===null||$===void 0?void 0:$[0])!=="/")return;for(const S of f.fragment.slice(1).split("/")){if(typeof p=="boolean")return;const I=p[(0,s.unescapeFragment)(S)];if(I===void 0)return;p=I;const F=typeof p=="object"&&p[this.opts.schemaId];!b.has(S)&&F&&(g=(0,n.resolveUrl)(this.opts.uriResolver,g,F))}let v;
|
|
489
|
+
if(typeof p!="boolean"&&p.$ref&&!(0,s.schemaHasRulesButRef)(p,this.RULES)){const S=(0,n.resolveUrl)(this.opts.uriResolver,g,p.$ref);v=y.call(this,m,S)}const{schemaId:E}=this.opts;if(v=v||new o({schema:p,schemaId:E,root:m,baseId:g}),v.schema!==v.root.schema)return v}return He}const iu="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",ou="Meta-schema for $data reference (JSON AnySchema extension proposal)",au="object",cu=["$data"],uu={$data:{type:"string",anyOf:[{format:"\
|
|
490
|
+
relative-json-pointer"},{format:"json-pointer"}]}},lu=!1,lg={$id:iu,description:ou,type:au,required:cu,properties:uu,additionalProperties:lu},fg={__proto__:null,$id:iu,additionalProperties:lu,default:lg,description:ou,properties:uu,required:cu,type:au},dg=nt(fg);var dn={},Ar={exports:{}},Li,fu;function hg(){return fu||(fu=1,Li={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),Li}var Di,du;function pg(){if(du)return Di;du=1;const{HEX:t}=hg(),
|
|
491
|
+
e=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function r(_){if(a(_,".")<3)return{host:_,isIPV4:!1};const f=_.match(e)||[],[g]=f;return g?{host:o(g,"."),isIPV4:!0}:{host:_,isIPV4:!1}}function n(_,f=!1){let g="",p=!0;for(const m of _){if(t[m]===void 0)return;m!=="0"&&p===!0&&(p=!1),p||(g+=m)}return f&&g.length===0&&(g="0"),g}function s(_){let f=0;const g={error:!1,address:"",zone:""},p=[],m=[];let $=!1,v=!1,E=!1;function S(){if(m.length){if($===!1){const I=n(
|
|
492
|
+
m);if(I!==void 0)p.push(I);else return g.error=!0,!1}m.length=0}return!0}for(let I=0;I<_.length;I++){const F=_[I];if(!(F==="["||F==="]"))if(F===":"){if(v===!0&&(E=!0),!S())break;if(f++,p.push(":"),f>7){g.error=!0;break}I-1>=0&&_[I-1]===":"&&(v=!0);continue}else if(F==="%"){if(!S())break;$=!0}else{m.push(F);continue}}return m.length&&($?g.zone=m.join(""):E?p.push(m.join("")):p.push(n(m))),g.address=p.join(""),g}function i(_){if(a(_,":")<2)return{host:_,isIPV6:!1};const f=s(_);if(f.error)return{host:_,
|
|
493
|
+
isIPV6:!1};{let g=f.address,p=f.address;return f.zone&&(g+="%"+f.zone,p+="%25"+f.zone),{host:g,escapedHost:p,isIPV6:!0}}}function o(_,f){let g="",p=!0;const m=_.length;for(let $=0;$<m;$++){const v=_[$];v==="0"&&p?($+1<=m&&_[$+1]===f||$+1===m)&&(g+=v,p=!1):(v===f?p=!0:p=!1,g+=v)}return g}function a(_,f){let g=0;for(let p=0;p<_.length;p++)_[p]===f&&g++;return g}const u=/^\.\.?\//u,l=/^\/\.(?:\/|$)/u,c=/^\/\.\.(?:\/|$)/u,d=/^\/?(?:.|\n)*?(?=\/|$)/u;function h(_){const f=[];for(;_.length;)if(_.match(
|
|
494
|
+
u))_=_.replace(u,"");else if(_.match(l))_=_.replace(l,"/");else if(_.match(c))_=_.replace(c,"/"),f.pop();else if(_==="."||_==="..")_="";else{const g=_.match(d);if(g){const p=g[0];_=_.slice(p.length),f.push(p)}else throw new Error("Unexpected dot segment condition")}return f.join("")}function y(_,f){const g=f!==!0?escape:unescape;return _.scheme!==void 0&&(_.scheme=g(_.scheme)),_.userinfo!==void 0&&(_.userinfo=g(_.userinfo)),_.host!==void 0&&(_.host=g(_.host)),_.path!==void 0&&(_.path=g(_.path)),
|
|
495
|
+
_.query!==void 0&&(_.query=g(_.query)),_.fragment!==void 0&&(_.fragment=g(_.fragment)),_}function b(_){const f=[];if(_.userinfo!==void 0&&(f.push(_.userinfo),f.push("@")),_.host!==void 0){let g=unescape(_.host);const p=r(g);if(p.isIPV4)g=p.host;else{const m=i(p.host);m.isIPV6===!0?g=`[${m.escapedHost}]`:g=_.host}f.push(g)}return(typeof _.port=="number"||typeof _.port=="string")&&(f.push(":"),f.push(String(_.port))),f.length?f.join(""):void 0}return Di={recomposeAuthority:b,normalizeComponentEncoding:y,
|
|
496
|
+
removeDotSegments:h,normalizeIPv4:r,normalizeIPv6:i,stringArrayToHexStripped:n},Di}var xi,hu;function mg(){if(hu)return xi;hu=1;const t=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(p){return typeof p.secure=="boolean"?p.secure:String(p.scheme).toLowerCase()==="wss"}function n(p){return p.host||(p.error=p.error||"HTTP URIs must have a host."),p}function s(p){const m=String(p.scheme).toLowerCase()==="\
|
|
497
|
+
https";return(p.port===(m?443:80)||p.port==="")&&(p.port=void 0),p.path||(p.path="/"),p}function i(p){return p.secure=r(p),p.resourceName=(p.path||"/")+(p.query?"?"+p.query:""),p.path=void 0,p.query=void 0,p}function o(p){if((p.port===(r(p)?443:80)||p.port==="")&&(p.port=void 0),typeof p.secure=="boolean"&&(p.scheme=p.secure?"wss":"ws",p.secure=void 0),p.resourceName){const[m,$]=p.resourceName.split("?");p.path=m&&m!=="/"?m:void 0,p.query=$,p.resourceName=void 0}return p.fragment=void 0,p}function a(p,m){
|
|
498
|
+
if(!p.path)return p.error="URN can not be parsed",p;const $=p.path.match(e);if($){const v=m.scheme||p.scheme||"urn";p.nid=$[1].toLowerCase(),p.nss=$[2];const E=`${v}:${m.nid||p.nid}`,S=g[E];p.path=void 0,S&&(p=S.parse(p,m))}else p.error=p.error||"URN can not be parsed.";return p}function u(p,m){const $=m.scheme||p.scheme||"urn",v=p.nid.toLowerCase(),E=`${$}:${m.nid||v}`,S=g[E];S&&(p=S.serialize(p,m));const I=p,F=p.nss;return I.path=`${v||m.nid}:${F}`,m.skipEscape=!0,I}function l(p,m){const $=p;return $.
|
|
499
|
+
uuid=$.nss,$.nss=void 0,!m.tolerant&&(!$.uuid||!t.test($.uuid))&&($.error=$.error||"UUID is not valid."),$}function c(p){const m=p;return m.nss=(p.uuid||"").toLowerCase(),m}const d={scheme:"http",domainHost:!0,parse:n,serialize:s},h={scheme:"https",domainHost:d.domainHost,parse:n,serialize:s},y={scheme:"ws",domainHost:!0,parse:i,serialize:o},b={scheme:"wss",domainHost:y.domainHost,parse:y.parse,serialize:y.serialize},g={http:d,https:h,ws:y,wss:b,urn:{scheme:"urn",parse:a,serialize:u,skipNormalize:!0},
|
|
500
|
+
"urn:uuid":{scheme:"urn:uuid",parse:l,serialize:c,skipNormalize:!0}};return xi=g,xi}var pu;function gg(){if(pu)return Ar.exports;pu=1;const{normalizeIPv6:t,normalizeIPv4:e,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:s}=pg(),i=mg();function o(f,g){return typeof f=="string"?f=c(b(f,g),g):typeof f=="object"&&(f=b(c(f,g),g)),f}function a(f,g,p){const m=Object.assign({scheme:"null"},p),$=u(b(f,m),b(g,m),m,!0);return c($,{...m,skipEscape:!0})}function u(f,g,p,m){const $={};return m||
|
|
501
|
+
(f=b(c(f,p),p),g=b(c(g,p),p)),p=p||{},!p.tolerant&&g.scheme?($.scheme=g.scheme,$.userinfo=g.userinfo,$.host=g.host,$.port=g.port,$.path=r(g.path||""),$.query=g.query):(g.userinfo!==void 0||g.host!==void 0||g.port!==void 0?($.userinfo=g.userinfo,$.host=g.host,$.port=g.port,$.path=r(g.path||""),$.query=g.query):(g.path?(g.path.charAt(0)==="/"?$.path=r(g.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?$.path="/"+g.path:f.path?$.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+
|
|
502
|
+
g.path:$.path=g.path,$.path=r($.path)),$.query=g.query):($.path=f.path,g.query!==void 0?$.query=g.query:$.query=f.query),$.userinfo=f.userinfo,$.host=f.host,$.port=f.port),$.scheme=f.scheme),$.fragment=g.fragment,$}function l(f,g,p){return typeof f=="string"?(f=unescape(f),f=c(s(b(f,p),!0),{...p,skipEscape:!0})):typeof f=="object"&&(f=c(s(f,!0),{...p,skipEscape:!0})),typeof g=="string"?(g=unescape(g),g=c(s(b(g,p),!0),{...p,skipEscape:!0})):typeof g=="object"&&(g=c(s(g,!0),{...p,skipEscape:!0})),
|
|
503
|
+
f.toLowerCase()===g.toLowerCase()}function c(f,g){const p={host:f.host,scheme:f.scheme,userinfo:f.userinfo,port:f.port,path:f.path,query:f.query,nid:f.nid,nss:f.nss,uuid:f.uuid,fragment:f.fragment,reference:f.reference,resourceName:f.resourceName,secure:f.secure,error:""},m=Object.assign({},g),$=[],v=i[(m.scheme||p.scheme||"").toLowerCase()];v&&v.serialize&&v.serialize(p,m),p.path!==void 0&&(m.skipEscape?p.path=unescape(p.path):(p.path=escape(p.path),p.scheme!==void 0&&(p.path=p.path.split("%3A").
|
|
504
|
+
join(":")))),m.reference!=="suffix"&&p.scheme&&$.push(p.scheme,":");const E=n(p);if(E!==void 0&&(m.reference!=="suffix"&&$.push("//"),$.push(E),p.path&&p.path.charAt(0)!=="/"&&$.push("/")),p.path!==void 0){let S=p.path;!m.absolutePath&&(!v||!v.absolutePath)&&(S=r(S)),E===void 0&&(S=S.replace(/^\/\//u,"/%2F")),$.push(S)}return p.query!==void 0&&$.push("?",p.query),p.fragment!==void 0&&$.push("#",p.fragment),$.join("")}const d=Array.from({length:127},(f,g)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.
|
|
505
|
+
fromCharCode(g)));function h(f){let g=0;for(let p=0,m=f.length;p<m;++p)if(g=f.charCodeAt(p),g>126||d[g])return!0;return!1}const y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(f,g){const p=Object.assign({},g),m={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},$=f.indexOf("%")!==-1;let v=!1;p.reference==="suffix"&&(f=(p.scheme?p.scheme+":":"")+"//"+f);const E=f.match(
|
|
506
|
+
y);if(E){if(m.scheme=E[1],m.userinfo=E[3],m.host=E[4],m.port=parseInt(E[5],10),m.path=E[6]||"",m.query=E[7],m.fragment=E[8],isNaN(m.port)&&(m.port=E[5]),m.host){const I=e(m.host);if(I.isIPV4===!1){const F=t(I.host);m.host=F.host.toLowerCase(),v=F.isIPV6}else m.host=I.host,v=!0}m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&m.query===void 0&&!m.path?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference=
|
|
507
|
+
"uri",p.reference&&p.reference!=="suffix"&&p.reference!==m.reference&&(m.error=m.error||"URI is not a "+p.reference+" reference.");const S=i[(p.scheme||m.scheme||"").toLowerCase()];if(!p.unicodeSupport&&(!S||!S.unicodeSupport)&&m.host&&(p.domainHost||S&&S.domainHost)&&v===!1&&h(m.host))try{m.host=URL.domainToASCII(m.host.toLowerCase())}catch(I){m.error=m.error||"Host's domain name can not be converted to ASCII: "+I}(!S||S&&!S.skipNormalize)&&($&&m.scheme!==void 0&&(m.scheme=unescape(m.scheme)),$&&
|
|
508
|
+
m.host!==void 0&&(m.host=unescape(m.host)),m.path&&(m.path=escape(unescape(m.path))),m.fragment&&(m.fragment=encodeURI(decodeURIComponent(m.fragment)))),S&&S.parse&&S.parse(m,p)}else m.error=m.error||"URI can not be parsed.";return m}const _={SCHEMES:i,normalize:o,resolve:a,resolveComponents:u,equal:l,serialize:c,parse:b};return Ar.exports=_,Ar.exports.default=_,Ar.exports.fastUri=_,Ar.exports}var mu;function yg(){if(mu)return dn;mu=1,Object.defineProperty(dn,"__esModule",{value:!0});const t=gg();
|
|
509
|
+
return t.code='require("ajv/dist/runtime/uri").default',dn.default=t,dn}var gu;function yu(){return gu||(gu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Sr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=he();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.
|
|
510
|
+
defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=un(),s=Rr(),i=zc(),o=fn(),a=he(),u=an(),l=on(),c=ye(),d=dg,h=yg(),y=(U,A)=>new RegExp(U,A);y.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],_=new Set(
|
|
897
511
|
["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code:\
|
|
898
512
|
{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."},
|
|
899
|
-
g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function m(
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
"object"?
|
|
905
|
-
await
|
|
906
|
-
const
|
|
907
|
-
must be string`)}return
|
|
908
|
-
|
|
909
|
-
this.refs,
|
|
910
|
-
id parameter")}}addVocabulary(
|
|
911
|
-
|
|
912
|
-
return typeof
|
|
913
|
-
se(
|
|
914
|
-
(0,u.normalizeId)(
|
|
915
|
-
ementation error");return
|
|
916
|
-
this.addSchema(
|
|
917
|
-
if(
|
|
918
|
-
'keyword with "post" flag cannot have "type"');const{RULES:
|
|
919
|
-
rules.splice(
|
|
920
|
-
NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return
|
|
921
|
-
default(h.opts.uriResolver,
|
|
922
|
-
function a(l,c){const{gen:d}=l;return c.validate?d.scopeValue("validate",{ref:c.validate}):(0,r._)`${d.scopeValue("wrapper",{ref:c})}.validate`}
|
|
923
|
-
ValidationError})`,()=>
|
|
924
|
-
|
|
925
|
-
"__esModule",{value:!0});const t=
|
|
926
|
-
str)`must be ${r[
|
|
927
|
-
error:{message:({schemaCode:n})=>(0,t.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,t._)`{multipleOf: ${n}}`},code(n){const{gen:
|
|
928
|
-
const r=e.length;let n=0,
|
|
929
|
-
return(0,t.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:
|
|
930
|
-
type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:
|
|
931
|
-
"maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:
|
|
932
|
-
defineProperty(
|
|
933
|
-
properties,{definedProperties:m}=
|
|
934
|
-
reportMissingProp)(
|
|
935
|
-
s","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:
|
|
936
|
-
const t=
|
|
937
|
-
parentSchema:d,schemaCode:h,it:
|
|
938
|
-
"indices",(0,e._)`{}`);a.for((0,e._)`;${
|
|
939
|
-
()=>{o.error(),a.assign(
|
|
940
|
-
return
|
|
941
|
-
(
|
|
942
|
-
if(
|
|
943
|
-
const t=
|
|
944
|
-
!0;const h=a.const("len",(0,t._)`${l}.length`);if(u===!1)
|
|
945
|
-
if(
|
|
946
|
-
items=e.mergeEvaluated.items(u,a.length,h.items));const
|
|
947
|
-
h,v,g.strictTuples)}}}return
|
|
948
|
-
olean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,t.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,t._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:u,it:l}=o,{prefixItems:c}=u;l.items=!0,!(0,e.alwaysValidSchema)(l,a)&&(c?(0,n.validateAdditionalItems)(o,c):o.ok((0,r.validateArray)(o)))}};return
|
|
949
|
-
type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:
|
|
950
|
-
h===void 0?1:h,d=
|
|
951
|
-
c===1?g(
|
|
952
|
-
|
|
513
|
+
g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function m(U){var A,z,M,w,R,C,Y,Q,ie,oe,L,q,J,ne,P,T,Z,W,N,te,V,re,le,_e,we;const ot=U.strict,pt=(A=U.code)===null||A===void 0?void 0:A.optimize,Wo=pt===!0||pt===void 0?1:pt||0,Ko=(M=(z=U.code)===null||z===void 0?void 0:z.regExp)!==null&&M!==void 0?M:y,ch=(w=U.uriResolver)!==null&&w!==void 0?w:h.default;return{strictSchema:(C=(R=U.strictSchema)!==null&&R!==void 0?R:
|
|
514
|
+
ot)!==null&&C!==void 0?C:!0,strictNumbers:(Q=(Y=U.strictNumbers)!==null&&Y!==void 0?Y:ot)!==null&&Q!==void 0?Q:!0,strictTypes:(oe=(ie=U.strictTypes)!==null&&ie!==void 0?ie:ot)!==null&&oe!==void 0?oe:"log",strictTuples:(q=(L=U.strictTuples)!==null&&L!==void 0?L:ot)!==null&&q!==void 0?q:"log",strictRequired:(ne=(J=U.strictRequired)!==null&&J!==void 0?J:ot)!==null&&ne!==void 0?ne:!1,code:U.code?{...U.code,optimize:Wo,regExp:Ko}:{optimize:Wo,regExp:Ko},loopRequired:(P=U.loopRequired)!==null&&P!==void 0?
|
|
515
|
+
P:p,loopEnum:(T=U.loopEnum)!==null&&T!==void 0?T:p,meta:(Z=U.meta)!==null&&Z!==void 0?Z:!0,messages:(W=U.messages)!==null&&W!==void 0?W:!0,inlineRefs:(N=U.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:(te=U.schemaId)!==null&&te!==void 0?te:"$id",addUsedSchema:(V=U.addUsedSchema)!==null&&V!==void 0?V:!0,validateSchema:(re=U.validateSchema)!==null&&re!==void 0?re:!0,validateFormats:(le=U.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(_e=U.unicodeRegExp)!==null&&_e!==void 0?_e:!0,int32range:(we=
|
|
516
|
+
U.int32range)!==null&&we!==void 0?we:!0,uriResolver:ch}}class ${constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,...m(A)};const{es5:z,lines:M}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:_,es5:z,lines:M}),this.logger=k(A.logger);const w=A.validateFormats;A.validateFormats=!1,this.RULES=(0,i.getRules)(),v.call(this,f,A,"NOT SUPPORTED"),v.call(this,g,A,"DEPRECATED","warn"),this._metaOpts=
|
|
517
|
+
B.call(this),A.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&F.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),S.call(this),A.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:A,meta:z,schemaId:M}=this.opts;let w=d;M==="id"&&(w={...d},w.id=w.$id,delete w.$id),z&&A&&this.addMetaSchema(w,w[M],!1)}defaultMeta(){const{meta:A,schemaId:z}=this.opts;return this.opts.defaultMeta=typeof A==
|
|
518
|
+
"object"?A[z]||A:void 0}validate(A,z){let M;if(typeof A=="string"){if(M=this.getSchema(A),!M)throw new Error(`no schema with key or ref "${A}"`)}else M=this.compile(A);const w=M(z);return"$async"in M||(this.errors=M.errors),w}compile(A,z){const M=this._addSchema(A,z);return M.validate||this._compileSchemaEnv(M)}compileAsync(A,z){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:M}=this.opts;return w.call(this,A,z);async function w(oe,L){
|
|
519
|
+
await R.call(this,oe.$schema);const q=this._addSchema(oe,L);return q.validate||C.call(this,q)}async function R(oe){oe&&!this.getSchema(oe)&&await w.call(this,{$ref:oe},!0)}async function C(oe){try{return this._compileSchemaEnv(oe)}catch(L){if(!(L instanceof s.default))throw L;return Y.call(this,L),await Q.call(this,L.missingSchema),C.call(this,oe)}}function Y({missingSchema:oe,missingRef:L}){if(this.refs[oe])throw new Error(`AnySchema ${oe} is loaded but ${L} cannot be resolved`)}async function Q(oe){
|
|
520
|
+
const L=await ie.call(this,oe);this.refs[oe]||await R.call(this,L.$schema),this.refs[oe]||this.addSchema(L,oe,z)}async function ie(oe){const L=this._loading[oe];if(L)return L;try{return await(this._loading[oe]=M(oe))}finally{delete this._loading[oe]}}}addSchema(A,z,M,w=this.opts.validateSchema){if(Array.isArray(A)){for(const C of A)this.addSchema(C,void 0,M,w);return this}let R;if(typeof A=="object"){const{schemaId:C}=this.opts;if(R=A[C],R!==void 0&&typeof R!="string")throw new Error(`schema ${C}\
|
|
521
|
+
must be string`)}return z=(0,u.normalizeId)(z||R),this._checkUnique(z),this.schemas[z]=this._addSchema(A,M,z,w,!0),this}addMetaSchema(A,z,M=this.opts.validateSchema){return this.addSchema(A,z,!0,M),this}validateSchema(A,z){if(typeof A=="boolean")return!0;let M;if(M=A.$schema,M!==void 0&&typeof M!="string")throw new Error("$schema must be a string");if(M=M||this.opts.defaultMeta||this.defaultMeta(),!M)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const w=this.validate(
|
|
522
|
+
M,A);if(!w&&z){const R="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(R);else throw new Error(R)}return w}getSchema(A){let z;for(;typeof(z=E.call(this,A))=="string";)A=z;if(z===void 0){const{schemaId:M}=this.opts,w=new o.SchemaEnv({schema:{},schemaId:M});if(z=o.resolveSchema.call(this,w,A),!z)return;this.refs[A]=z}return z.validate||this._compileSchemaEnv(z)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(
|
|
523
|
+
this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const z=E.call(this,A);return typeof z=="object"&&this._cache.delete(z.schema),delete this.schemas[A],delete this.refs[A],this}case"object":{const z=A;this._cache.delete(z);let M=A[this.opts.schemaId];return M&&(M=(0,u.normalizeId)(M),delete this.schemas[M],delete this.refs[M]),this}default:throw new Error("ajv.removeSchema: inval\
|
|
524
|
+
id parameter")}}addVocabulary(A){for(const z of A)this.addKeyword(z);return this}addKeyword(A,z){let M;if(typeof A=="string")M=A,typeof z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),z.keyword=M);else if(typeof A=="object"&&z===void 0){if(z=A,M=z.keyword,Array.isArray(M)&&!M.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(x.call(this,M,z),!z)return(0,c.eachItem)(
|
|
525
|
+
M,R=>H.call(this,R)),this;G.call(this,z);const w={...z,type:(0,l.getJSONTypes)(z.type),schemaType:(0,l.getJSONTypes)(z.schemaType)};return(0,c.eachItem)(M,w.type.length===0?R=>H.call(this,R,w):R=>w.type.forEach(C=>H.call(this,R,w,C))),this}getKeyword(A){const z=this.RULES.all[A];return typeof z=="object"?z.definition:!!z}removeKeyword(A){const{RULES:z}=this;delete z.keywords[A],delete z.all[A];for(const M of z.rules){const w=M.rules.findIndex(R=>R.keyword===A);w>=0&&M.rules.splice(w,1)}return this}addFormat(A,z){
|
|
526
|
+
return typeof z=="string"&&(z=new RegExp(z)),this.formats[A]=z,this}errorsText(A=this.errors,{separator:z=", ",dataVar:M="data"}={}){return!A||A.length===0?"No errors":A.map(w=>`${M}${w.instancePath} ${w.message}`).reduce((w,R)=>w+z+R)}$dataMetaSchema(A,z){const M=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const w of z){const R=w.split("/").slice(1);let C=A;for(const Y of R)C=C[Y];for(const Y in M){const Q=M[Y];if(typeof Q!="object")continue;const{$data:ie}=Q.definition,oe=C[Y];ie&&oe&&(C[Y]=
|
|
527
|
+
se(oe))}}return A}_removeAllSchemas(A,z){for(const M in A){const w=A[M];(!z||z.test(M))&&(typeof w=="string"?delete A[M]:w&&!w.meta&&(this._cache.delete(w.schema),delete A[M]))}}_addSchema(A,z,M,w=this.opts.validateSchema,R=this.opts.addUsedSchema){let C;const{schemaId:Y}=this.opts;if(typeof A=="object")C=A[Y];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let Q=this._cache.get(A);if(Q!==void 0)return Q;M=
|
|
528
|
+
(0,u.normalizeId)(C||M);const ie=u.getSchemaRefs.call(this,A,M);return Q=new o.SchemaEnv({schema:A,schemaId:Y,meta:z,baseId:M,localRefs:ie}),this._cache.set(Q.schema,Q),R&&!M.startsWith("#")&&(M&&this._checkUnique(M),this.refs[M]=Q),w&&this.validateSchema(A,!0),Q}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" already exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):o.compileSchema.call(this,A),!A.validate)throw new Error("ajv impl\
|
|
529
|
+
ementation error");return A.validate}_compileMetaSchema(A){const z=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,A)}finally{this.opts=z}}}$.ValidationError=n.default,$.MissingRefError=s.default,t.default=$;function v(U,A,z,M="error"){for(const w in U){const R=w;R in A&&this.logger[M](`${z}: option ${w}. ${U[R]}`)}}function E(U){return U=(0,u.normalizeId)(U),this.schemas[U]||this.refs[U]}function S(){const U=this.opts.schemas;if(U)if(Array.isArray(U))this.addSchema(U);else for(const A in U)
|
|
530
|
+
this.addSchema(U[A],A)}function I(){for(const U in this.opts.formats){const A=this.opts.formats[U];A&&this.addFormat(U,A)}}function F(U){if(Array.isArray(U)){this.addVocabulary(U);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in U){const z=U[A];z.keyword||(z.keyword=A),this.addKeyword(z)}}function B(){const U={...this.opts};for(const A of b)delete U[A];return U}const D={log(){},warn(){},error(){}};function k(U){if(U===!1)return D;if(U===void 0)return console;
|
|
531
|
+
if(U.log&&U.warn&&U.error)return U;throw new Error("logger must implement log, warn and error methods")}const j=/^[a-z_$][a-z0-9_$:-]*$/i;function x(U,A){const{RULES:z}=this;if((0,c.eachItem)(U,M=>{if(z.keywords[M])throw new Error(`Keyword ${M} is already defined`);if(!j.test(M))throw new Error(`Keyword ${M} has invalid name`)}),!!A&&A.$data&&!("code"in A||"validate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function H(U,A,z){var M;const w=A?.post;if(z&&w)throw new Error(
|
|
532
|
+
'keyword with "post" flag cannot have "type"');const{RULES:R}=this;let C=w?R.post:R.rules.find(({type:Q})=>Q===z);if(C||(C={type:z,rules:[]},R.rules.push(C)),R.keywords[U]=!0,!A)return;const Y={keyword:U,definition:{...A,type:(0,l.getJSONTypes)(A.type),schemaType:(0,l.getJSONTypes)(A.schemaType)}};A.before?K.call(this,C,Y,A.before):C.rules.push(Y),R.all[U]=Y,(M=A.implements)===null||M===void 0||M.forEach(Q=>this.addKeyword(Q))}function K(U,A,z){const M=U.rules.findIndex(w=>w.keyword===z);M>=0?U.
|
|
533
|
+
rules.splice(M,0,A):(U.rules.push(A),this.logger.warn(`rule ${z} is not defined`))}function G(U){let{metaSchema:A}=U;A!==void 0&&(U.$data&&this.opts.$data&&(A=se(A)),U.validateSchema=this.compile(A,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function se(U){return{anyOf:[U,X]}}}(Oi)),Oi}var hn={},pn={},mn={},_u;function _g(){if(_u)return mn;_u=1,Object.defineProperty(mn,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('\
|
|
534
|
+
NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return mn.default=t,mn}var wt={},$u;function Mi(){if($u)return wt;$u=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.callRef=wt.getValidate=void 0;const t=Rr(),e=Qe(),r=he(),n=Xe(),s=fn(),i=ye(),o={keyword:"$ref",schemaType:"string",code(l){const{gen:c,schema:d,it:h}=l,{baseId:y,schemaEnv:b,validateName:_,opts:f,self:g}=h,{root:p}=b;if((d==="#"||d==="#/")&&y===p.baseId)return $();const m=s.resolveRef.call(g,p,y,d);if(m===void 0)throw new t.
|
|
535
|
+
default(h.opts.uriResolver,y,d);if(m instanceof s.SchemaEnv)return v(m);return E(m);function $(){if(b===p)return u(l,_,b,b.$async);const S=c.scopeValue("root",{ref:p});return u(l,(0,r._)`${S}.validate`,p,p.$async)}function v(S){const I=a(l,S);u(l,I,S,S.$async)}function E(S){const I=c.scopeValue("schema",f.code.source===!0?{ref:S,code:(0,r.stringify)(S)}:{ref:S}),F=c.name("valid"),B=l.subschema({schema:S,dataTypes:[],schemaPath:r.nil,topSchemaRef:I,errSchemaPath:d},F);l.mergeEvaluated(B),l.ok(F)}}};
|
|
536
|
+
function a(l,c){const{gen:d}=l;return c.validate?d.scopeValue("validate",{ref:c.validate}):(0,r._)`${d.scopeValue("wrapper",{ref:c})}.validate`}wt.getValidate=a;function u(l,c,d,h){const{gen:y,it:b}=l,{allErrors:_,schemaEnv:f,opts:g}=b,p=g.passContext?n.default.this:r.nil;h?m():$();function m(){if(!f.$async)throw new Error("async schema referenced by sync schema");const S=y.let("valid");y.try(()=>{y.code((0,r._)`await ${(0,e.callValidateCode)(l,c,p)}`),E(c),_||y.assign(S,!0)},I=>{y.if((0,r._)`!(${I} instanceof ${b.
|
|
537
|
+
ValidationError})`,()=>y.throw(I)),v(I),_||y.assign(S,!1)}),l.ok(S)}function $(){l.result((0,e.callValidateCode)(l,c,p),()=>E(c),()=>v(c))}function v(S){const I=(0,r._)`${S}.errors`;y.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),y.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function E(S){var I;if(!b.opts.unevaluated)return;const F=(I=d?.validate)===null||I===void 0?void 0:I.evaluated;if(b.props!==!0)if(F&&!F.dynamicProps)
|
|
538
|
+
F.props!==void 0&&(b.props=i.mergeEvaluated.props(y,F.props,b.props));else{const B=y.var("props",(0,r._)`${S}.evaluated.props`);b.props=i.mergeEvaluated.props(y,B,b.props,r.Name)}if(b.items!==!0)if(F&&!F.dynamicItems)F.items!==void 0&&(b.items=i.mergeEvaluated.items(y,F.items,b.items));else{const B=y.var("items",(0,r._)`${S}.evaluated.items`);b.items=i.mergeEvaluated.items(y,B,b.items,r.Name)}}}return wt.callRef=u,wt.default=o,wt}var vu;function bu(){if(vu)return pn;vu=1,Object.defineProperty(pn,
|
|
539
|
+
"__esModule",{value:!0});const t=_g(),e=Mi(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return pn.default=r,pn}var gn={},yn={},wu;function $g(){if(wu)return yn;wu=1,Object.defineProperty(yn,"__esModule",{value:!0});const t=he(),e=t.operators,r={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},n={message:({keyword:i,schemaCode:o})=>(0,t.
|
|
540
|
+
str)`must be ${r[i].okStr} ${o}`,params:({keyword:i,schemaCode:o})=>(0,t._)`{comparison: ${r[i].okStr}, limit: ${o}}`},s={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(i){const{keyword:o,data:a,schemaCode:u}=i;i.fail$data((0,t._)`${a} ${r[o].fail} ${u} || isNaN(${a})`)}};return yn.default=s,yn}var _n={},Eu;function vg(){if(Eu)return _n;Eu=1,Object.defineProperty(_n,"__esModule",{value:!0});const t=he(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,
|
|
541
|
+
error:{message:({schemaCode:n})=>(0,t.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,t._)`{multipleOf: ${n}}`},code(n){const{gen:s,data:i,schemaCode:o,it:a}=n,u=a.opts.multipleOfPrecision,l=s.let("res"),c=u?(0,t._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${u}`:(0,t._)`${l} !== parseInt(${l})`;n.fail$data((0,t._)`(${o} === 0 || (${l} = ${i}/${o}, ${c}))`)}};return _n.default=r,_n}var $n={},vn={},Su;function bg(){if(Su)return vn;Su=1,Object.defineProperty(vn,"__esModule",{value:!0});function t(e){
|
|
542
|
+
const r=e.length;let n=0,s=0,i;for(;s<r;)n++,i=e.charCodeAt(s++),i>=55296&&i<=56319&&s<r&&(i=e.charCodeAt(s),(i&64512)===56320&&s++);return n}return vn.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',vn}var Ru;function wg(){if(Ru)return $n;Ru=1,Object.defineProperty($n,"__esModule",{value:!0});const t=he(),e=ye(),r=bg(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:o}){const a=i==="maxLength"?"more":"fewer";
|
|
543
|
+
return(0,t.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:i})=>(0,t._)`{limit: ${i}}`},code(i){const{keyword:o,data:a,schemaCode:u,it:l}=i,c=o==="maxLength"?t.operators.GT:t.operators.LT,d=l.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,e.useFunc)(i.gen,r.default)}(${a})`;i.fail$data((0,t._)`${d} ${c} ${u}`)}};return $n.default=s,$n}var bn={},Au;function Eg(){if(Au)return bn;Au=1,Object.defineProperty(bn,"__esModule",{value:!0});const t=Qe(),e=he(),n={keyword:"pattern",
|
|
544
|
+
type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,e.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,e._)`{pattern: ${s}}`},code(s){const{data:i,$data:o,schema:a,schemaCode:u,it:l}=s,c=l.opts.unicodeRegExp?"u":"",d=o?(0,e._)`(new RegExp(${u}, ${c}))`:(0,t.usePattern)(s,a);s.fail$data((0,e._)`!${d}.test(${i})`)}};return bn.default=n,bn}var wn={},Ou;function Sg(){if(Ou)return wn;Ou=1,Object.defineProperty(wn,"__esModule",{value:!0});const t=he(),r={keyword:[
|
|
545
|
+
"maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const i=n==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${s} properties`},params:({schemaCode:n})=>(0,t._)`{limit: ${n}}`},code(n){const{keyword:s,data:i,schemaCode:o}=n,a=s==="maxProperties"?t.operators.GT:t.operators.LT;n.fail$data((0,t._)`Object.keys(${i}).length ${a} ${o}`)}};return wn.default=r,wn}var En={},Cu;function Rg(){if(Cu)return En;Cu=1,Object.
|
|
546
|
+
defineProperty(En,"__esModule",{value:!0});const t=Qe(),e=he(),r=ye(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,e.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,e._)`{missingProperty: ${i}}`},code(i){const{gen:o,schema:a,schemaCode:u,data:l,$data:c,it:d}=i,{opts:h}=d;if(!c&&a.length===0)return;const y=a.length>=h.loopRequired;if(d.allErrors?b():_(),h.strictRequired){const p=i.parentSchema.
|
|
547
|
+
properties,{definedProperties:m}=i.it;for(const $ of a)if(p?.[$]===void 0&&!m.has($)){const v=d.schemaEnv.baseId+d.errSchemaPath,E=`required property "${$}" is not defined at "${v}" (strictRequired)`;(0,r.checkStrictMode)(d,E,d.opts.strictRequired)}}function b(){if(y||c)i.block$data(e.nil,f);else for(const p of a)(0,t.checkReportMissingProp)(i,p)}function _(){const p=o.let("missing");if(y||c){const m=o.let("valid",!0);i.block$data(m,()=>g(p,m)),i.ok(m)}else o.if((0,t.checkMissingProp)(i,a,p)),(0,t.
|
|
548
|
+
reportMissingProp)(i,p),o.else()}function f(){o.forOf("prop",u,p=>{i.setParams({missingProperty:p}),o.if((0,t.noPropertyInData)(o,l,p,h.ownProperties),()=>i.error())})}function g(p,m){i.setParams({missingProperty:p}),o.forOf(p,u,()=>{o.assign(m,(0,t.propertyInData)(o,l,p,h.ownProperties)),o.if((0,e.not)(m),()=>{i.error(),o.break()})},e.nil)}}};return En.default=s,En}var Sn={},Pu;function Ag(){if(Pu)return Sn;Pu=1,Object.defineProperty(Sn,"__esModule",{value:!0});const t=he(),r={keyword:["maxItem\
|
|
549
|
+
s","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const i=n==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${s} items`},params:({schemaCode:n})=>(0,t._)`{limit: ${n}}`},code(n){const{keyword:s,data:i,schemaCode:o}=n,a=s==="maxItems"?t.operators.GT:t.operators.LT;n.fail$data((0,t._)`${i}.length ${a} ${o}`)}};return Sn.default=r,Sn}var Rn={},An={},Iu;function ki(){if(Iu)return An;Iu=1,Object.defineProperty(An,"__esModule",{value:!0});
|
|
550
|
+
const t=Qc();return t.code='require("ajv/dist/runtime/equal").default',An.default=t,An}var Nu;function Og(){if(Nu)return Rn;Nu=1,Object.defineProperty(Rn,"__esModule",{value:!0});const t=on(),e=he(),r=ye(),n=ki(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:a}})=>(0,e.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0,e._)`{i: ${o}, j: ${a}}`},code(o){const{gen:a,data:u,$data:l,schema:c,
|
|
551
|
+
parentSchema:d,schemaCode:h,it:y}=o;if(!l&&!c)return;const b=a.let("valid"),_=d.items?(0,t.getSchemaTypes)(d.items):[];o.block$data(b,f,(0,e._)`${h} === false`),o.ok(b);function f(){const $=a.let("i",(0,e._)`${u}.length`),v=a.let("j");o.setParams({i:$,j:v}),a.assign(b,!0),a.if((0,e._)`${$} > 1`,()=>(g()?p:m)($,v))}function g(){return _.length>0&&!_.some($=>$==="object"||$==="array")}function p($,v){const E=a.name("item"),S=(0,t.checkDataTypes)(_,E,y.opts.strictNumbers,t.DataType.Wrong),I=a.const(
|
|
552
|
+
"indices",(0,e._)`{}`);a.for((0,e._)`;${$}--;`,()=>{a.let(E,(0,e._)`${u}[${$}]`),a.if(S,(0,e._)`continue`),_.length>1&&a.if((0,e._)`typeof ${E} == "string"`,(0,e._)`${E} += "_"`),a.if((0,e._)`typeof ${I}[${E}] == "number"`,()=>{a.assign(v,(0,e._)`${I}[${E}]`),o.error(),a.assign(b,!1).break()}).code((0,e._)`${I}[${E}] = ${$}`)})}function m($,v){const E=(0,r.useFunc)(a,n.default),S=a.name("outer");a.label(S).for((0,e._)`;${$}--;`,()=>a.for((0,e._)`${v} = ${$}; ${v}--;`,()=>a.if((0,e._)`${E}(${u}[${$}], ${u}[${v}])`,
|
|
553
|
+
()=>{o.error(),a.assign(b,!1).break(S)})))}}};return Rn.default=i,Rn}var On={},Tu;function Cg(){if(Tu)return On;Tu=1,Object.defineProperty(On,"__esModule",{value:!0});const t=he(),e=ye(),r=ki(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,t._)`{allowedValue: ${i}}`},code(i){const{gen:o,data:a,$data:u,schemaCode:l,schema:c}=i;u||c&&typeof c=="object"?i.fail$data((0,t._)`!${(0,e.useFunc)(o,r.default)}(${a}, ${l})`):i.fail((0,t._)`${c} !== ${a}`)}};
|
|
554
|
+
return On.default=s,On}var Cn={},ju;function Pg(){if(ju)return Cn;ju=1,Object.defineProperty(Cn,"__esModule",{value:!0});const t=he(),e=ye(),r=ki(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,t._)`{allowedValues: ${i}}`},code(i){const{gen:o,data:a,$data:u,schema:l,schemaCode:c,it:d}=i;if(!u&&l.length===0)throw new Error("enum must have non-empty array");const h=l.length>=d.opts.loopEnum;let y;const b=()=>y??
|
|
555
|
+
(y=(0,e.useFunc)(o,r.default));let _;if(h||u)_=o.let("valid"),i.block$data(_,f);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const p=o.const("vSchema",c);_=(0,t.or)(...l.map((m,$)=>g(p,$)))}i.pass(_);function f(){o.assign(_,!1),o.forOf("v",c,p=>o.if((0,t._)`${b()}(${a}, ${p})`,()=>o.assign(_,!0).break()))}function g(p,m){const $=l[m];return typeof $=="object"&&$!==null?(0,t._)`${b()}(${a}, ${p}[${m}])`:(0,t._)`${a} === ${$}`}}};return Cn.default=s,Cn}var Lu;function Du(){
|
|
556
|
+
if(Lu)return gn;Lu=1,Object.defineProperty(gn,"__esModule",{value:!0});const t=$g(),e=vg(),r=wg(),n=Eg(),s=Sg(),i=Rg(),o=Ag(),a=Og(),u=Cg(),l=Pg(),c=[t.default,e.default,r.default,n.default,s.default,i.default,o.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];return gn.default=c,gn}var Pn={},Jt={},xu;function Mu(){if(xu)return Jt;xu=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.validateAdditionalItems=void 0;
|
|
557
|
+
const t=he(),e=ye(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){const{parentSchema:o,it:a}=i,{items:u}=o;if(!Array.isArray(u)){(0,e.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(i,u)}};function s(i,o){const{gen:a,schema:u,data:l,keyword:c,it:d}=i;d.items=
|
|
558
|
+
!0;const h=a.const("len",(0,t._)`${l}.length`);if(u===!1)i.setParams({len:o.length}),i.pass((0,t._)`${h} <= ${o.length}`);else if(typeof u=="object"&&!(0,e.alwaysValidSchema)(d,u)){const b=a.var("valid",(0,t._)`${h} <= ${o.length}`);a.if((0,t.not)(b),()=>y(b)),i.ok(b)}function y(b){a.forRange("i",o.length,h,_=>{i.subschema({keyword:c,dataProp:_,dataPropType:e.Type.Num},b),d.allErrors||a.if((0,t.not)(b),()=>a.break())})}}return Jt.validateAdditionalItems=s,Jt.default=n,Jt}var In={},Qt={},ku;function qu(){
|
|
559
|
+
if(ku)return Qt;ku=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.validateTuple=void 0;const t=he(),e=ye(),r=Qe(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:o,it:a}=i;if(Array.isArray(o))return s(i,"additionalItems",o);a.items=!0,!(0,e.alwaysValidSchema)(a,o)&&i.ok((0,r.validateArray)(i))}};function s(i,o,a=i.schema){const{gen:u,parentSchema:l,data:c,keyword:d,it:h}=i;_(l),h.opts.unevaluated&&a.length&&h.items!==!0&&(h.
|
|
560
|
+
items=e.mergeEvaluated.items(u,a.length,h.items));const y=u.name("valid"),b=u.const("len",(0,t._)`${c}.length`);a.forEach((f,g)=>{(0,e.alwaysValidSchema)(h,f)||(u.if((0,t._)`${b} > ${g}`,()=>i.subschema({keyword:d,schemaProp:g,dataProp:g},y)),i.ok(y))});function _(f){const{opts:g,errSchemaPath:p}=h,m=a.length,$=m===f.minItems&&(m===f.maxItems||f[o]===!1);if(g.strictTuples&&!$){const v=`"${d}" is ${m}-tuple, but minItems or maxItems/${o} are not specified or different at path "${p}"`;(0,e.checkStrictMode)(
|
|
561
|
+
h,v,g.strictTuples)}}}return Qt.validateTuple=s,Qt.default=n,Qt}var Hu;function Ig(){if(Hu)return In;Hu=1,Object.defineProperty(In,"__esModule",{value:!0});const t=qu(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,t.validateTuple)(r,"items")};return In.default=e,In}var Nn={},Uu;function Ng(){if(Uu)return Nn;Uu=1,Object.defineProperty(Nn,"__esModule",{value:!0});const t=he(),e=ye(),r=Qe(),n=Mu(),i={keyword:"items",type:"array",schemaType:["object","bo\
|
|
562
|
+
olean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,t.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,t._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:u,it:l}=o,{prefixItems:c}=u;l.items=!0,!(0,e.alwaysValidSchema)(l,a)&&(c?(0,n.validateAdditionalItems)(o,c):o.ok((0,r.validateArray)(o)))}};return Nn.default=i,Nn}var Tn={},Fu;function Tg(){if(Fu)return Tn;Fu=1,Object.defineProperty(Tn,"__esModule",{value:!0});const t=he(),e=ye(),n={keyword:"contains",
|
|
563
|
+
type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:i}})=>i===void 0?(0,t.str)`must contain at least ${s} valid item(s)`:(0,t.str)`must contain at least ${s} and no more than ${i} valid item(s)`,params:({params:{min:s,max:i}})=>i===void 0?(0,t._)`{minContains: ${s}}`:(0,t._)`{minContains: ${s}, maxContains: ${i}}`},code(s){const{gen:i,schema:o,parentSchema:a,data:u,it:l}=s;let c,d;const{minContains:h,maxContains:y}=a;l.opts.next?(c=
|
|
564
|
+
h===void 0?1:h,d=y):c=1;const b=i.const("len",(0,t._)`${u}.length`);if(s.setParams({min:c,max:d}),d===void 0&&c===0){(0,e.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&c>d){(0,e.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,e.alwaysValidSchema)(l,o)){let m=(0,t._)`${b} >= ${c}`;d!==void 0&&(m=(0,t._)`${m} && ${b} <= ${d}`),s.pass(m);return}l.items=!0;const _=i.name("valid");d===void 0&&
|
|
565
|
+
c===1?g(_,()=>i.if(_,()=>i.break())):c===0?(i.let(_,!0),d!==void 0&&i.if((0,t._)`${u}.length > 0`,f)):(i.let(_,!1),f()),s.result(_,()=>s.reset());function f(){const m=i.name("_valid"),$=i.let("count",0);g(m,()=>i.if(m,()=>p($)))}function g(m,$){i.forRange("i",0,b,v=>{s.subschema({keyword:"contains",dataProp:v,dataPropType:e.Type.Num,compositeRule:!0},m),$()})}function p(m){i.code((0,t._)`${m}++`),d===void 0?i.if((0,t._)`${m} >= ${c}`,()=>i.assign(_,!0).break()):(i.if((0,t._)`${m} > ${d}`,()=>i.assign(
|
|
566
|
+
_,!1).break()),c===1?i.assign(_,!0):i.if((0,t._)`${m} >= ${c}`,()=>i.assign(_,!0)))}}};return Tn.default=n,Tn}var qi={},zu;function Hi(){return zu||(zu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=he(),r=ye(),n=Qe();t.error={message:({params:{property:u,depsCount:l,deps:c}})=>{const d=l===1?"property":"properties";return(0,e.str)`must have ${d} ${c} when property ${u} is present`},params:({params:{property:u,depsCount:l,
|
|
953
567
|
deps:c,missingProperty:d}})=>(0,e._)`{property: ${u},
|
|
954
568
|
missingProperty: ${d},
|
|
955
569
|
depsCount: ${l},
|
|
956
|
-
deps: ${c}}`};const
|
|
957
|
-
u.setParams({property
|
|
958
|
-
u.mergeValidEvaluated(f
|
|
959
|
-
lid");
|
|
960
|
-
message:"must NOT have additional properties",params:({params:o})=>(0,e._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:u,parentSchema:l,data:c,errsCount:d,it:h}=o;if(!d)throw new Error("ajv implementation error");const{allErrors:
|
|
961
|
-
a.forIn("key",c,
|
|
962
|
-
!1){o.setParams({additionalProperty:
|
|
963
|
-
function
|
|
964
|
-
r.mergeEvaluated.props(o,(0,r.toHash)(d),c.props));const h=d.filter(f=>!(0,r.alwaysValidSchema)(c,a[f]));if(h.length===0)return;const
|
|
965
|
-
|
|
966
|
-
"valid");c.props!==!0&&!(c.props instanceof e.Name)&&(c.props=(0,n.evaluatedPropsToName)(o,c.props));const{props:f}=c;g();function g(){for(const
|
|
967
|
-
ies",schemaProp
|
|
968
|
-
not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return
|
|
969
|
-
const t=
|
|
970
|
-
!0));function
|
|
971
|
-
schema:
|
|
972
|
-
ifClause}" schema`,params:({params:
|
|
973
|
-
error(!0));function
|
|
974
|
-
e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:
|
|
975
|
-
a.default,
|
|
976
|
-
getProperty)(u)}`,h=c.errSchemaPath==="#"?c.validateName:o(a);l.if((0,t._)`!${d}`,()=>l.assign(d,h))}
|
|
977
|
-
void 0;const t=
|
|
978
|
-
function h(
|
|
979
|
-
|
|
980
|
-
ct",schemaType:"object",error:t.error,code:r=>(0,t.validatePropertyDeps)(r)};return
|
|
981
|
-
schemaType:"number",code({keyword:r,parentSchema:n,it:
|
|
982
|
-
operties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:
|
|
983
|
-
c.props=!0,
|
|
984
|
-
|
|
985
|
-
"object"&&!(0,e.alwaysValidSchema)(u,o)){const h=
|
|
986
|
-
|
|
987
|
-
code:d.code.formats}),p=
|
|
988
|
-
_)`(typeof ${
|
|
989
|
-
u)}`:void 0,
|
|
990
|
-
|
|
991
|
-
e=
|
|
992
|
-
e=
|
|
993
|
-
propertyName;if(typeof
|
|
994
|
-
u.assign(
|
|
995
|
-
default(h.opts.uriResolver,h.baseId,
|
|
996
|
-
"properties/${
|
|
997
|
-
s://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},
|
|
998
|
-
|
|
999
|
-
anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},
|
|
1000
|
-
$comment:
|
|
570
|
+
deps: ${c}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){const[l,c]=i(u);o(u,l),a(u,c)}};function i({schema:u}){const l={},c={};for(const d in u){if(d==="__proto__")continue;const h=Array.isArray(u[d])?l:c;h[d]=u[d]}return[l,c]}function o(u,l=u.schema){const{gen:c,data:d,it:h}=u;if(Object.keys(l).length===0)return;const y=c.let("missing");for(const b in l){const _=l[b];if(_.length===0)continue;const f=(0,n.propertyInData)(c,d,b,h.opts.ownProperties);
|
|
571
|
+
u.setParams({property:b,depsCount:_.length,deps:_.join(", ")}),h.allErrors?c.if(f,()=>{for(const g of _)(0,n.checkReportMissingProp)(u,g)}):(c.if((0,e._)`${f} && (${(0,n.checkMissingProp)(u,_,y)})`),(0,n.reportMissingProp)(u,y),c.else())}}t.validatePropertyDeps=o;function a(u,l=u.schema){const{gen:c,data:d,keyword:h,it:y}=u,b=c.name("valid");for(const _ in l)(0,r.alwaysValidSchema)(y,l[_])||(c.if((0,n.propertyInData)(c,d,_,y.opts.ownProperties),()=>{const f=u.subschema({keyword:h,schemaProp:_},b);
|
|
572
|
+
u.mergeValidEvaluated(f,b)},()=>c.var(b,!0)),u.ok(b))}t.validateSchemaDeps=a,t.default=s}(qi)),qi}var jn={},Vu;function jg(){if(Vu)return jn;Vu=1,Object.defineProperty(jn,"__esModule",{value:!0});const t=he(),e=ye(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,t._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:i,schema:o,data:a,it:u}=s;if((0,e.alwaysValidSchema)(u,o))return;const l=i.name("va\
|
|
573
|
+
lid");i.forIn("key",a,c=>{s.setParams({propertyName:c}),s.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},l),i.if((0,t.not)(l),()=>{s.error(!0),u.allErrors||i.break()})}),s.ok(l)}};return jn.default=n,jn}var Ln={},Gu;function Bu(){if(Gu)return Ln;Gu=1,Object.defineProperty(Ln,"__esModule",{value:!0});const t=Qe(),e=he(),r=Xe(),n=ye(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{
|
|
574
|
+
message:"must NOT have additional properties",params:({params:o})=>(0,e._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:u,parentSchema:l,data:c,errsCount:d,it:h}=o;if(!d)throw new Error("ajv implementation error");const{allErrors:y,opts:b}=h;if(h.props=!0,b.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,u))return;const _=(0,t.allSchemaProperties)(l.properties),f=(0,t.allSchemaProperties)(l.patternProperties);g(),o.ok((0,e._)`${d} === ${r.default.errors}`);function g(){
|
|
575
|
+
a.forIn("key",c,E=>{!_.length&&!f.length?$(E):a.if(p(E),()=>$(E))})}function p(E){let S;if(_.length>8){const I=(0,n.schemaRefOrVal)(h,l.properties,"properties");S=(0,t.isOwnProperty)(a,I,E)}else _.length?S=(0,e.or)(..._.map(I=>(0,e._)`${E} === ${I}`)):S=e.nil;return f.length&&(S=(0,e.or)(S,...f.map(I=>(0,e._)`${(0,t.usePattern)(o,I)}.test(${E})`))),(0,e.not)(S)}function m(E){a.code((0,e._)`delete ${c}[${E}]`)}function $(E){if(b.removeAdditional==="all"||b.removeAdditional&&u===!1){m(E);return}if(u===
|
|
576
|
+
!1){o.setParams({additionalProperty:E}),o.error(),y||a.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(h,u)){const S=a.name("valid");b.removeAdditional==="failing"?(v(E,S,!1),a.if((0,e.not)(S),()=>{o.reset(),m(E)})):(v(E,S),y||a.if((0,e.not)(S),()=>a.break()))}}function v(E,S,I){const F={keyword:"additionalProperties",dataProp:E,dataPropType:n.Type.Str};I===!1&&Object.assign(F,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(F,S)}}};return Ln.default=i,Ln}var Dn={},Wu;
|
|
577
|
+
function Lg(){if(Wu)return Dn;Wu=1,Object.defineProperty(Dn,"__esModule",{value:!0});const t=Sr(),e=Qe(),r=ye(),n=Bu(),s={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,parentSchema:u,data:l,it:c}=i;c.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(c,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(a);for(const f of d)c.definedProperties.add(f);c.opts.unevaluated&&d.length&&c.props!==!0&&(c.props=
|
|
578
|
+
r.mergeEvaluated.props(o,(0,r.toHash)(d),c.props));const h=d.filter(f=>!(0,r.alwaysValidSchema)(c,a[f]));if(h.length===0)return;const y=o.name("valid");for(const f of h)b(f)?_(f):(o.if((0,e.propertyInData)(o,l,f,c.opts.ownProperties)),_(f),c.allErrors||o.else().var(y,!0),o.endIf()),i.it.definedProperties.add(f),i.ok(y);function b(f){return c.opts.useDefaults&&!c.compositeRule&&a[f].default!==void 0}function _(f){i.subschema({keyword:"properties",schemaProp:f,dataProp:f},y)}}};return Dn.default=s,
|
|
579
|
+
Dn}var xn={},Ku;function Dg(){if(Ku)return xn;Ku=1,Object.defineProperty(xn,"__esModule",{value:!0});const t=Qe(),e=he(),r=ye(),n=ye(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,data:u,parentSchema:l,it:c}=i,{opts:d}=c,h=(0,t.allSchemaProperties)(a),y=h.filter($=>(0,r.alwaysValidSchema)(c,a[$]));if(h.length===0||y.length===h.length&&(!c.opts.unevaluated||c.props===!0))return;const b=d.strictSchema&&!d.allowMatchingProperties&&l.properties,_=o.name(
|
|
580
|
+
"valid");c.props!==!0&&!(c.props instanceof e.Name)&&(c.props=(0,n.evaluatedPropsToName)(o,c.props));const{props:f}=c;g();function g(){for(const $ of h)b&&p($),c.allErrors?m($):(o.var(_,!0),m($),o.if(_))}function p($){for(const v in b)new RegExp($).test(v)&&(0,r.checkStrictMode)(c,`property ${v} matches pattern ${$} (use allowMatchingProperties)`)}function m($){o.forIn("key",u,v=>{o.if((0,e._)`${(0,t.usePattern)(i,$)}.test(${v})`,()=>{const E=y.includes($);E||i.subschema({keyword:"patternPropert\
|
|
581
|
+
ies",schemaProp:$,dataProp:v,dataPropType:n.Type.Str},_),c.opts.unevaluated&&f!==!0?o.assign((0,e._)`${f}[${v}]`,!0):!E&&!c.allErrors&&o.if((0,e.not)(_),()=>o.break())})})}}};return xn.default=s,xn}var Mn={},Yu;function xg(){if(Yu)return Mn;Yu=1,Object.defineProperty(Mn,"__esModule",{value:!0});const t=ye(),e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:i}=r;if((0,t.alwaysValidSchema)(i,s)){r.fail();return}const o=n.name("valid");r.subschema({keyword:"\
|
|
582
|
+
not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return Mn.default=e,Mn}var kn={},Xu;function Mg(){if(Xu)return kn;Xu=1,Object.defineProperty(kn,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Qe().validateUnion,error:{message:"must match a schema in anyOf"}};return kn.default=e,kn}var qn={},Ju;function kg(){if(Ju)return qn;Ju=1,Object.defineProperty(qn,"__esModule",{value:!0});
|
|
583
|
+
const t=he(),e=ye(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,t._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:i,schema:o,parentSchema:a,it:u}=s;if(!Array.isArray(o))throw new Error("ajv implementation error");if(u.opts.discriminator&&a.discriminator)return;const l=o,c=i.let("valid",!1),d=i.let("passing",null),h=i.name("_valid");s.setParams({passing:d}),i.block(y),s.result(c,()=>s.reset(),()=>s.error(
|
|
584
|
+
!0));function y(){l.forEach((b,_)=>{let f;(0,e.alwaysValidSchema)(u,b)?i.var(h,!0):f=s.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},h),_>0&&i.if((0,t._)`${h} && ${c}`).assign(c,!1).assign(d,(0,t._)`[${d}, ${_}]`).else(),i.if(h,()=>{i.assign(c,!0),i.assign(d,_),f&&s.mergeEvaluated(f,t.Name)})})}}};return qn.default=n,qn}var Hn={},Qu;function qg(){if(Qu)return Hn;Qu=1,Object.defineProperty(Hn,"__esModule",{value:!0});const t=ye(),e={keyword:"allOf",schemaType:"array",code(r){const{gen:n,
|
|
585
|
+
schema:s,it:i}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=n.name("valid");s.forEach((a,u)=>{if((0,t.alwaysValidSchema)(i,a))return;const l=r.subschema({keyword:"allOf",schemaProp:u},o);r.ok(o),r.mergeEvaluated(l)})}};return Hn.default=e,Hn}var Un={},Zu;function Hg(){if(Zu)return Un;Zu=1,Object.defineProperty(Un,"__esModule",{value:!0});const t=he(),e=ye(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,t.str)`must match "${i.
|
|
586
|
+
ifClause}" schema`,params:({params:i})=>(0,t._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:o,parentSchema:a,it:u}=i;a.then===void 0&&a.else===void 0&&(0,e.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const l=s(u,"then"),c=s(u,"else");if(!l&&!c)return;const d=o.let("valid",!0),h=o.name("_valid");if(y(),i.reset(),l&&c){const _=o.let("ifClause");i.setParams({ifClause:_}),o.if(h,b("then",_),b("else",_))}else l?o.if(h,b("then")):o.if((0,t.not)(h),b("else"));i.pass(d,()=>i.
|
|
587
|
+
error(!0));function y(){const _=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);i.mergeEvaluated(_)}function b(_,f){return()=>{const g=i.subschema({keyword:_},h);o.assign(d,h),i.mergeValidEvaluated(g,d),f?o.assign(f,(0,t._)`${_}`):i.setParams({ifClause:_})}}}};function s(i,o){const a=i.schema[o];return a!==void 0&&!(0,e.alwaysValidSchema)(i,a)}return Un.default=n,Un}var Fn={},el;function Ug(){if(el)return Fn;el=1,Object.defineProperty(Fn,"__esModule",{value:!0});const t=ye(),
|
|
588
|
+
e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return Fn.default=e,Fn}var tl;function rl(){if(tl)return Pn;tl=1,Object.defineProperty(Pn,"__esModule",{value:!0});const t=Mu(),e=Ig(),r=qu(),n=Ng(),s=Tg(),i=Hi(),o=jg(),a=Bu(),u=Lg(),l=Dg(),c=xg(),d=Mg(),h=kg(),y=qg(),b=Hg(),_=Ug();function f(g=!1){const p=[c.default,d.default,h.default,y.default,b.default,_.default,o.default,
|
|
589
|
+
a.default,i.default,u.default,l.default];return g?p.push(e.default,n.default):p.push(t.default,r.default),p.push(s.default),p}return Pn.default=f,Pn}var zn={},Zt={},nl;function sl(){if(nl)return Zt;nl=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.dynamicAnchor=void 0;const t=he(),e=Xe(),r=fn(),n=Mi(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>i(a,a.schema)};function i(a,u){const{gen:l,it:c}=a;c.schemaEnv.root.dynamicAnchors[u]=!0;const d=(0,t._)`${e.default.dynamicAnchors}${(0,t.
|
|
590
|
+
getProperty)(u)}`,h=c.errSchemaPath==="#"?c.validateName:o(a);l.if((0,t._)`!${d}`,()=>l.assign(d,h))}Zt.dynamicAnchor=i;function o(a){const{schemaEnv:u,schema:l,self:c}=a.it,{root:d,baseId:h,localRefs:y,meta:b}=u.root,{schemaId:_}=c.opts,f=new r.SchemaEnv({schema:l,schemaId:_,root:d,baseId:h,localRefs:y,meta:b});return r.compileSchema.call(c,f),(0,n.getValidate)(a,f)}return Zt.default=s,Zt}var er={},il;function ol(){if(il)return er;il=1,Object.defineProperty(er,"__esModule",{value:!0}),er.dynamicRef=
|
|
591
|
+
void 0;const t=he(),e=Xe(),r=Mi(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,o){const{gen:a,keyword:u,it:l}=i;if(o[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);const c=o.slice(1);if(l.allErrors)d();else{const y=a.let("valid",!1);d(y),i.ok(y)}function d(y){if(l.schemaEnv.root.dynamicAnchors[c]){const b=a.let("_v",(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(b,h(b,y),h(l.validateName,y))}else h(l.validateName,y)()}
|
|
592
|
+
function h(y,b){return b?()=>a.block(()=>{(0,r.callRef)(i,y),a.let(b,!0)}):()=>(0,r.callRef)(i,y)}}return er.dynamicRef=s,er.default=n,er}var Vn={},al;function Fg(){if(al)return Vn;al=1,Object.defineProperty(Vn,"__esModule",{value:!0});const t=sl(),e=ye(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,e.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return Vn.default=r,Vn}var Gn={},cl;function zg(){if(cl)return Gn;cl=1,Object.defineProperty(
|
|
593
|
+
Gn,"__esModule",{value:!0});const t=ol(),e={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,t.dynamicRef)(r,r.schema)};return Gn.default=e,Gn}var ul;function Vg(){if(ul)return zn;ul=1,Object.defineProperty(zn,"__esModule",{value:!0});const t=sl(),e=ol(),r=Fg(),n=zg(),s=[t.default,e.default,r.default,n.default];return zn.default=s,zn}var Bn={},Wn={},ll;function Gg(){if(ll)return Wn;ll=1,Object.defineProperty(Wn,"__esModule",{value:!0});const t=Hi(),e={keyword:"dependentRequired",type:"obje\
|
|
594
|
+
ct",schemaType:"object",error:t.error,code:r=>(0,t.validatePropertyDeps)(r)};return Wn.default=e,Wn}var Kn={},fl;function Bg(){if(fl)return Kn;fl=1,Object.defineProperty(Kn,"__esModule",{value:!0});const t=Hi(),e={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,t.validateSchemaDeps)(r)};return Kn.default=e,Kn}var Yn={},dl;function Wg(){if(dl)return Yn;dl=1,Object.defineProperty(Yn,"__esModule",{value:!0});const t=ye(),e={keyword:["maxContains","minContains"],type:"array",
|
|
595
|
+
schemaType:"number",code({keyword:r,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${r}" without "contains" is ignored`)}};return Yn.default=e,Yn}var hl;function Kg(){if(hl)return Bn;hl=1,Object.defineProperty(Bn,"__esModule",{value:!0});const t=Gg(),e=Bg(),r=Wg(),n=[t.default,e.default,r.default];return Bn.default=n,Bn}var Xn={},Jn={},pl;function Yg(){if(pl)return Jn;pl=1,Object.defineProperty(Jn,"__esModule",{value:!0});const t=he(),e=ye(),r=Xe(),s={keyword:"unevaluatedPr\
|
|
596
|
+
operties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:i})=>(0,t._)`{unevaluatedProperty: ${i.unevaluatedProperty}}`},code(i){const{gen:o,schema:a,data:u,errsCount:l,it:c}=i;if(!l)throw new Error("ajv implementation error");const{allErrors:d,props:h}=c;h instanceof t.Name?o.if((0,t._)`${h} !== true`,()=>o.forIn("key",u,f=>o.if(b(h,f),()=>y(f)))):h!==!0&&o.forIn("key",u,f=>h===void 0?y(f):o.if(_(h,f),()=>y(f))),
|
|
597
|
+
c.props=!0,i.ok((0,t._)`${l} === ${r.default.errors}`);function y(f){if(a===!1){i.setParams({unevaluatedProperty:f}),i.error(),d||o.break();return}if(!(0,e.alwaysValidSchema)(c,a)){const g=o.name("valid");i.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:e.Type.Str},g),d||o.if((0,t.not)(g),()=>o.break())}}function b(f,g){return(0,t._)`!${f} || !${f}[${g}]`}function _(f,g){const p=[];for(const m in f)f[m]===!0&&p.push((0,t._)`${g} !== ${m}`);return(0,t.and)(...p)}}};return Jn.default=
|
|
598
|
+
s,Jn}var Qn={},ml;function Xg(){if(ml)return Qn;ml=1,Object.defineProperty(Qn,"__esModule",{value:!0});const t=he(),e=ye(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){const{gen:i,schema:o,data:a,it:u}=s,l=u.items||0;if(l===!0)return;const c=i.const("len",(0,t._)`${a}.length`);if(o===!1)s.setParams({len:l}),s.fail((0,t._)`${c} > ${l}`);else if(typeof o==
|
|
599
|
+
"object"&&!(0,e.alwaysValidSchema)(u,o)){const h=i.var("valid",(0,t._)`${c} <= ${l}`);i.if((0,t.not)(h),()=>d(h,l)),s.ok(h)}u.items=!0;function d(h,y){i.forRange("i",y,c,b=>{s.subschema({keyword:"unevaluatedItems",dataProp:b,dataPropType:e.Type.Num},h),u.allErrors||i.if((0,t.not)(h),()=>i.break())})}}};return Qn.default=n,Qn}var gl;function Jg(){if(gl)return Xn;gl=1,Object.defineProperty(Xn,"__esModule",{value:!0});const t=Yg(),e=Xg(),r=[t.default,e.default];return Xn.default=r,Xn}var Zn={},es={},
|
|
600
|
+
yl;function Qg(){if(yl)return es;yl=1,Object.defineProperty(es,"__esModule",{value:!0});const t=he(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,t.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,t._)`{format: ${n}}`},code(n,s){const{gen:i,data:o,$data:a,schema:u,schemaCode:l,it:c}=n,{opts:d,errSchemaPath:h,schemaEnv:y,self:b}=c;if(!d.validateFormats)return;a?_():f();function _(){const g=i.scopeValue("formats",{ref:b.formats,
|
|
601
|
+
code:d.code.formats}),p=i.const("fDef",(0,t._)`${g}[${l}]`),m=i.let("fType"),$=i.let("format");i.if((0,t._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>i.assign(m,(0,t._)`${p}.type || "string"`).assign($,(0,t._)`${p}.validate`),()=>i.assign(m,(0,t._)`"string"`).assign($,p)),n.fail$data((0,t.or)(v(),E()));function v(){return d.strictSchema===!1?t.nil:(0,t._)`${l} && !${$}`}function E(){const S=y.$async?(0,t._)`(${p}.async ? await ${$}(${o}) : ${$}(${o}))`:(0,t._)`${$}(${o})`,I=(0,t.
|
|
602
|
+
_)`(typeof ${$} == "function" ? ${S} : ${$}.test(${o}))`;return(0,t._)`${$} && ${$} !== true && ${m} === ${s} && !${I}`}}function f(){const g=b.formats[u];if(!g){v();return}if(g===!0)return;const[p,m,$]=E(g);p===s&&n.pass(S());function v(){if(d.strictSchema===!1){b.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${u}" ignored in schema at path "${h}"`}}function E(I){const F=I instanceof RegExp?(0,t.regexpCode)(I):d.code.formats?(0,t._)`${d.code.formats}${(0,t.getProperty)(
|
|
603
|
+
u)}`:void 0,B=i.scopeValue("formats",{key:u,ref:I,code:F});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,t._)`${B}.validate`]:["string",I,B]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!y.$async)throw new Error("async format in sync schema");return(0,t._)`await ${$}(${o})`}return typeof m=="function"?(0,t._)`${$}(${o})`:(0,t._)`${$}.test(${o})`}}}};return es.default=r,es}var _l;function $l(){if(_l)return Zn;_l=1,Object.defineProperty(
|
|
604
|
+
Zn,"__esModule",{value:!0});const e=[Qg().default];return Zn.default=e,Zn}var Ft={},vl;function bl(){return vl||(vl=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.contentVocabulary=Ft.metadataVocabulary=void 0,Ft.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ft.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ft}var wl;function Zg(){if(wl)return hn;wl=1,Object.defineProperty(hn,"__esModule",{value:!0});const t=bu(),
|
|
605
|
+
e=Du(),r=rl(),n=Vg(),s=Kg(),i=Jg(),o=$l(),a=bl(),u=[n.default,t.default,e.default,(0,r.default)(!0),o.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];return hn.default=u,hn}var ts={},Or={},El;function ey(){if(El)return Or;El=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.DiscrError=void 0;var t;return function(e){e.Tag="tag",e.Mapping="mapping"}(t||(Or.DiscrError=t={})),Or}var Sl;function Rl(){if(Sl)return ts;Sl=1,Object.defineProperty(ts,"__esModule",{value:!0});const t=he(),
|
|
606
|
+
e=ey(),r=fn(),n=Rr(),s=ye(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:u}})=>a===e.DiscrError.Tag?`tag "${u}" must be string`:`value of tag "${u}" must be in oneOf`,params:({params:{discrError:a,tag:u,tagName:l}})=>(0,t._)`{error: ${a}, tag: ${l}, tagValue: ${u}}`},code(a){const{gen:u,data:l,schema:c,parentSchema:d,it:h}=a,{oneOf:y}=d;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=c.
|
|
607
|
+
propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!y)throw new Error("discriminator: requires oneOf keyword");const _=u.let("valid",!1),f=u.const("tag",(0,t._)`${l}${(0,t.getProperty)(b)}`);u.if((0,t._)`typeof ${f} == "string"`,()=>g(),()=>a.error(!1,{discrError:e.DiscrError.Tag,tag:f,tagName:b})),a.ok(_);function g(){const $=m();u.if(!1);for(const v in $)u.elseIf((0,t._)`${f} === ${v}`),
|
|
608
|
+
u.assign(_,p($[v]));u.else(),a.error(!1,{discrError:e.DiscrError.Mapping,tag:f,tagName:b}),u.endIf()}function p($){const v=u.name("valid"),E=a.subschema({keyword:"oneOf",schemaProp:$},v);return a.mergeEvaluated(E,t.Name),v}function m(){var $;const v={},E=I(d);let S=!0;for(let D=0;D<y.length;D++){let k=y[D];if(k?.$ref&&!(0,s.schemaHasRulesButRef)(k,h.self.RULES)){const x=k.$ref;if(k=r.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,x),k instanceof r.SchemaEnv&&(k=k.schema),k===void 0)throw new n.
|
|
609
|
+
default(h.opts.uriResolver,h.baseId,x)}const j=($=k?.properties)===null||$===void 0?void 0:$[b];if(typeof j!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);S=S&&(E||I(k)),F(j,D)}if(!S)throw new Error(`discriminator: "${b}" must be required`);return v;function I({required:D}){return Array.isArray(D)&&D.includes(b)}function F(D,k){if(D.const)B(D.const,k);else if(D.enum)for(const j of D.enum)B(j,k);else throw new Error(`discriminator:\
|
|
610
|
+
"properties/${b}" must have "const" or "enum"`)}function B(D,k){if(typeof D!="string"||D in v)throw new Error(`discriminator: "${b}" values must be unique strings`);v[D]=k}}}};return ts.default=o,ts}var rs={};const Al="https://json-schema.org/draft/2020-12/schema",Ol="https://json-schema.org/draft/2020-12/schema",Cl={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"http\
|
|
611
|
+
s://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},Pl="meta",Il="Core and Validation specifications meta-schema",Nl=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],Tl=["object","boolean"],
|
|
612
|
+
jl="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",Ll={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{
|
|
613
|
+
anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},ty={$schema:Al,$id:Ol,$vocabulary:Cl,$dynamicAnchor:Pl,title:Il,allOf:Nl,type:Tl,$comment:jl,properties:Ll},ry={__proto__:null,
|
|
614
|
+
$comment:jl,$dynamicAnchor:Pl,$id:Ol,$schema:Al,$vocabulary:Cl,allOf:Nl,default:ty,properties:Ll,title:Il,type:Tl},ny=nt(ry),Dl="https://json-schema.org/draft/2020-12/schema",xl="https://json-schema.org/draft/2020-12/meta/applicator",Ml={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},kl="meta",ql="Applicator vocabulary meta-schema",Hl=["object","boolean"],Ul={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"\
|
|
1001
615
|
#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs\
|
|
1002
|
-
/schemaArray"},not:{$dynamicRef:"#meta"}},
|
|
1003
|
-
unevaluated":!0},
|
|
1004
|
-
tent",
|
|
1005
|
-
ma",
|
|
1006
|
-
type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},
|
|
1007
|
-
$schema:
|
|
1008
|
-
$id:
|
|
1009
|
-
examples:{type:"array",items:!0}}
|
|
616
|
+
/schemaArray"},not:{$dynamicRef:"#meta"}},Fl={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},sy={$schema:Dl,$id:xl,$vocabulary:Ml,$dynamicAnchor:kl,title:ql,type:Hl,properties:Ul,$defs:Fl},iy={__proto__:null,$defs:Fl,$dynamicAnchor:kl,$id:xl,$schema:Dl,$vocabulary:Ml,default:sy,properties:Ul,title:ql,type:Hl},oy=nt(iy),zl="https://json-schema.org/draft/2020-12/schema",Vl="https://json-schema.org/draft/2020-12/meta/unevaluated",Gl={"https://json-schema.org/draft/2020-12/vocab/\
|
|
617
|
+
unevaluated":!0},Bl="meta",Wl="Unevaluated applicator vocabulary meta-schema",Kl=["object","boolean"],Yl={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},ay={$schema:zl,$id:Vl,$vocabulary:Gl,$dynamicAnchor:Bl,title:Wl,type:Kl,properties:Yl},cy={__proto__:null,$dynamicAnchor:Bl,$id:Vl,$schema:zl,$vocabulary:Gl,default:ay,properties:Yl,title:Wl,type:Kl},uy=nt(cy),Xl="https://json-schema.org/draft/2020-12/schema",Jl="https://json-schema.org/draft/2020-12/meta/con\
|
|
618
|
+
tent",Ql={"https://json-schema.org/draft/2020-12/vocab/content":!0},Zl="meta",ef="Content vocabulary meta-schema",tf=["object","boolean"],rf={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},ly={$schema:Xl,$id:Jl,$vocabulary:Ql,$dynamicAnchor:Zl,title:ef,type:tf,properties:rf},fy={__proto__:null,$dynamicAnchor:Zl,$id:Jl,$schema:Xl,$vocabulary:Ql,default:ly,properties:rf,title:ef,type:tf},dy=nt(fy),nf="https://json-schema.org/draft/2020-12/sche\
|
|
619
|
+
ma",sf="https://json-schema.org/draft/2020-12/meta/core",of={"https://json-schema.org/draft/2020-12/vocab/core":!0},af="meta",cf="Core vocabulary meta-schema",uf=["object","boolean"],lf={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{
|
|
620
|
+
type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},ff={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},hy={$schema:nf,$id:sf,$vocabulary:of,$dynamicAnchor:af,title:cf,type:uf,properties:lf,$defs:ff},py={__proto__:null,$defs:ff,$dynamicAnchor:af,$id:sf,
|
|
621
|
+
$schema:nf,$vocabulary:of,default:hy,properties:lf,title:cf,type:uf},my=nt(py),df="https://json-schema.org/draft/2020-12/schema",hf="https://json-schema.org/draft/2020-12/meta/format-annotation",pf={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},mf="meta",gf="Format vocabulary meta-schema for annotation results",yf=["object","boolean"],_f={format:{type:"string"}},gy={$schema:df,$id:hf,$vocabulary:pf,$dynamicAnchor:mf,title:gf,type:yf,properties:_f},yy={__proto__:null,$dynamicAnchor:mf,
|
|
622
|
+
$id:hf,$schema:df,$vocabulary:pf,default:gy,properties:_f,title:gf,type:yf},_y=nt(yy),$f="https://json-schema.org/draft/2020-12/schema",vf="https://json-schema.org/draft/2020-12/meta/meta-data",bf={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},wf="meta",Ef="Meta-data vocabulary meta-schema",Sf=["object","boolean"],Rf={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},
|
|
623
|
+
examples:{type:"array",items:!0}},$y={$schema:$f,$id:vf,$vocabulary:bf,$dynamicAnchor:wf,title:Ef,type:Sf,properties:Rf},vy={__proto__:null,$dynamicAnchor:wf,$id:vf,$schema:$f,$vocabulary:bf,default:$y,properties:Rf,title:Ef,type:Sf},by=nt(vy),Af="https://json-schema.org/draft/2020-12/schema",Of="https://json-schema.org/draft/2020-12/meta/validation",Cf={"https://json-schema.org/draft/2020-12/vocab/validation":!0},Pf="meta",If="Validation vocabulary meta-schema",Nf=["object","boolean"],Tf={type:{
|
|
1010
624
|
anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{
|
|
1011
|
-
$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},
|
|
1012
|
-
#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},
|
|
1013
|
-
dule",{value:!0});const t=
|
|
1014
|
-
o="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(
|
|
1015
|
-
(this.getSchema(o)?o:void 0)}}e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=
|
|
1016
|
-
e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var c=
|
|
1017
|
-
return
|
|
625
|
+
$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},jf={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"\
|
|
626
|
+
#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},wy={$schema:Af,$id:Of,$vocabulary:Cf,$dynamicAnchor:Pf,title:If,type:Nf,properties:Tf,$defs:jf},Ey={__proto__:null,$defs:jf,$dynamicAnchor:Pf,$id:Of,$schema:Af,$vocabulary:Cf,default:wy,properties:Tf,title:If,type:Nf},Sy=nt(Ey);var Lf;function Ry(){if(Lf)return rs;Lf=1,Object.defineProperty(rs,"__esMo\
|
|
627
|
+
dule",{value:!0});const t=ny,e=oy,r=uy,n=dy,s=my,i=_y,o=by,a=Sy,u=["/properties"];function l(c){return[t,e,r,n,s,d(this,i),o,d(this,a)].forEach(h=>this.addMetaSchema(h,void 0,!1)),this;function d(h,y){return c?h.$dataMetaSchema(y,u):y}}return rs.default=l,rs}var Df;function Ay(){return Df||(Df=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;const r=yu(),n=Zg(),s=Rl(),i=Ry(),
|
|
628
|
+
o="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(y={}){super({...y,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:y,meta:b}=this.opts;b&&(i.default.call(this,y),this.refs["http://json-schema.org/schema"]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
629
|
+
(this.getSchema(o)?o:void 0)}}e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=Sr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=he();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(
|
|
630
|
+
e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var c=un();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return c.default}});var d=Rr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}(tn,tn.exports)),tn.exports}var Oy=Ay(),ns={exports:{}},Ui={},xf;function Cy(){
|
|
631
|
+
return xf||(xf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(D,k){return{validate:D,compare:k}}t.fullFormats={date:e(i,o),time:e(u(!0),l),"date-time":e(h(!0),y),"iso-time":e(u(),c),"iso-date-time":e(h(),b),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
|
|
1018
632
|
"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
|
|
1019
633
|
email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
1020
|
-
regex:
|
|
1021
|
-
o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
|
|
1022
|
-
email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(
|
|
1023
|
-
function u(
|
|
1024
|
-
|
|
1025
|
-
function g(
|
|
1026
|
-
|
|
1027
|
-
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},
|
|
634
|
+
regex:B,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:m,int32:{type:"number",validate:E},int64:{type:"number",validate:S},float:{type:"number",validate:I},double:{type:"number",validate:I},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
635
|
+
o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,y),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,b),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
636
|
+
email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(D){return D%4===0&&(D%100!==0||D%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(D){const k=n.exec(D);if(!k)return!1;const j=+k[1],x=+k[2],H=+k[3];return x>=1&&x<=12&&H>=1&&H<=(x===2&&r(j)?29:s[x])}function o(D,k){if(D&&k)return D>k?1:D<k?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
637
|
+
function u(D){return function(j){const x=a.exec(j);if(!x)return!1;const H=+x[1],K=+x[2],G=+x[3],X=x[4],se=x[5]==="-"?-1:1,U=+(x[6]||0),A=+(x[7]||0);if(U>23||A>59||D&&!X)return!1;if(H<=23&&K<=59&&G<60)return!0;const z=K-A*se,M=H-U*se-(z<0?1:0);return(M===23||M===-1)&&(z===59||z===-1)&&G<61}}function l(D,k){if(!(D&&k))return;const j=new Date("2020-01-01T"+D).valueOf(),x=new Date("2020-01-01T"+k).valueOf();if(j&&x)return j-x}function c(D,k){if(!(D&&k))return;const j=a.exec(D),x=a.exec(k);if(j&&x)return D=
|
|
638
|
+
j[1]+j[2]+j[3],k=x[1]+x[2]+x[3],D>k?1:D<k?-1:0}const d=/t|\s/i;function h(D){const k=u(D);return function(x){const H=x.split(d);return H.length===2&&i(H[0])&&k(H[1])}}function y(D,k){if(!(D&&k))return;const j=new Date(D).valueOf(),x=new Date(k).valueOf();if(j&&x)return j-x}function b(D,k){if(!(D&&k))return;const[j,x]=D.split(d),[H,K]=k.split(d),G=o(j,H);if(G!==void 0)return G||l(x,K)}const _=/\/|:/,f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
639
|
+
function g(D){return _.test(D)&&f.test(D)}const p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(D){return p.lastIndex=0,p.test(D)}const $=-2147483648,v=2**31-1;function E(D){return Number.isInteger(D)&&D<=v&&D>=$}function S(D){return Number.isInteger(D)}function I(){return!0}const F=/[^\\]\\Z/;function B(D){if(F.test(D))return!1;try{return new RegExp(D),!0}catch{return!1}}}(Ui)),Ui}var Fi={},ss={exports:{}},is={},Mf;function Py(){if(Mf)return is;Mf=1,Object.defineProperty(
|
|
640
|
+
is,"__esModule",{value:!0});const t=bu(),e=Du(),r=rl(),n=$l(),s=bl(),i=[t.default,e.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return is.default=i,is}const kf="http://json-schema.org/draft-07/schema#",qf="http://json-schema.org/draft-07/schema#",Hf="Core schema meta-schema",Uf={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},
|
|
641
|
+
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ff=["object","boolean"],zf={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},
|
|
1028
642
|
maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolea\
|
|
1029
643
|
n",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"\
|
|
1030
644
|
object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/def\
|
|
1031
|
-
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},
|
|
1032
|
-
|
|
1033
|
-
(this.getSchema(a)?a:void 0)}}e.Ajv=u,t.exports=e=u,t.exports.Ajv=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var l=
|
|
1034
|
-
"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var d=
|
|
1035
|
-
defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=
|
|
1036
|
-
{keyword:Object.keys(
|
|
1037
|
-
p(
|
|
1038
|
-
a);t.default=o}(
|
|
1039
|
-
throw new Error(`Unknown format "${l}"`);return h};function u(l,c,d,h){var
|
|
1040
|
-
e,r);!
|
|
1041
|
-
${e}`,
|
|
1042
|
-
e,
|
|
1043
|
-
void 0),
|
|
1044
|
-
MAX_SAFE_BUILD_LENGTH:
|
|
1045
|
-
MAX_LENGTH:
|
|
1046
|
-
`\\d*[a-zA-Z-]${h}*`),
|
|
1047
|
-
PRERELEASEIDENTIFIER]})*))`),
|
|
1048
|
-
GEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),
|
|
1049
|
-
$`),
|
|
1050
|
-
$`),
|
|
1051
|
-
"$1$2$3",
|
|
1052
|
-
|
|
1053
|
-
"string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",c,d),this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease;const h=c.trim().match(d.loose?n[
|
|
1054
|
-
on");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");h[4]?this.prerelease=h[4].split(".").map(
|
|
645
|
+
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Iy={$schema:kf,$id:qf,title:Hf,definitions:Uf,type:Ff,properties:zf,default:!0},Ny={__proto__:null,$id:qf,$schema:kf,default:Iy,definitions:Uf,properties:zf,title:Hf,type:Ff},Ty=nt(Ny);var Vf;function jy(){return Vf||(Vf=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const r=yu(),n=Py(),s=Rl(),
|
|
646
|
+
i=Ty,o=["/properties"],a="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(b,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
647
|
+
(this.getSchema(a)?a:void 0)}}e.Ajv=u,t.exports=e=u,t.exports.Ajv=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var l=Sr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=he();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,
|
|
648
|
+
"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var d=un();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=Rr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}(ss,ss.exports)),ss.exports}var Gf;function Ly(){return Gf||(Gf=1,function(t){Object.
|
|
649
|
+
defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=jy(),r=he(),n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},i={message:({keyword:a,schemaCode:u})=>(0,r.str)`should be ${s[a].okStr} ${u}`,params:({keyword:a,schemaCode:u})=>(0,r._)`{comparison: ${s[a].okStr}, limit: ${u}}`};t.formatLimitDefinition=
|
|
650
|
+
{keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:i,code(a){const{gen:u,data:l,schemaCode:c,keyword:d,it:h}=a,{opts:y,self:b}=h;if(!y.validateFormats)return;const _=new e.KeywordCxt(h,b.RULES.all.format.definition,"format");_.$data?f():g();function f(){const m=u.scopeValue("formats",{ref:b.formats,code:y.code.formats}),$=u.const("fmt",(0,r._)`${m}[${_.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${$} != "object"`,(0,r._)`${$} instanceof RegExp`,(0,r._)`typeof ${$}.compare != "function"`,
|
|
651
|
+
p($)))}function g(){const m=_.schema,$=b.formats[m];if(!$||$===!0)return;if(typeof $!="object"||$ instanceof RegExp||typeof $.compare!="function")throw new Error(`"${d}": format "${m}" does not define "compare" function`);const v=u.scopeValue("formats",{key:m,ref:$,code:y.code.formats?(0,r._)`${y.code.formats}${(0,r.getProperty)(m)}`:void 0});a.fail$data(p(v))}function p(m){return(0,r._)`${m}.compare(${l}, ${c}) ${s[d].fail} 0`}},dependencies:["format"]};const o=a=>(a.addKeyword(t.formatLimitDefinition),
|
|
652
|
+
a);t.default=o}(Fi)),Fi}var Bf;function Dy(){return Bf||(Bf=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=Cy(),n=Ly(),s=he(),i=new s.Name("fullFormats"),o=new s.Name("fastFormats"),a=(l,c={keywords:!0})=>{if(Array.isArray(c))return u(l,c,r.fullFormats,i),l;const[d,h]=c.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,i],y=c.formats||r.formatNames;return u(l,y,d,h),c.keywords&&(0,n.default)(l),l};a.get=(l,c="full")=>{const h=(c==="fast"?r.fastFormats:r.fullFormats)[l];if(!h)
|
|
653
|
+
throw new Error(`Unknown format "${l}"`);return h};function u(l,c,d,h){var y,b;(y=(b=l.opts.code).formats)!==null&&y!==void 0||(b.formats=(0,s._)`require("ajv-formats/dist/formats").${h}`);for(const _ of c)l.addFormat(_,d[_])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}(ns,ns.exports)),ns.exports}var xy=Dy();const My=_s(xy),ky=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const s=Object.getOwnPropertyDescriptor(t,r),i=Object.getOwnPropertyDescriptor(
|
|
654
|
+
e,r);!qy(s,i)&&n||Object.defineProperty(t,r,i)},qy=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Hy=(t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},Uy=(t,e)=>`/* Wrapped ${t}*/
|
|
655
|
+
${e}`,Fy=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),zy=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Vy=(t,e,r)=>{const n=r===""?"":`with ${r.trim()}() `,s=Uy.bind(null,n,e.toString());Object.defineProperty(s,"name",zy);const{writable:i,enumerable:o,configurable:a}=Fy;Object.defineProperty(t,"toString",{value:s,writable:i,enumerable:o,configurable:a})};function Gy(t,e,{ignoreNonConfigurable:r=!1}={}){const{name:n}=t;for(const s of Reflect.ownKeys(e))ky(t,
|
|
656
|
+
e,s,r);return Hy(t,e),Vy(t,e,n),t}const Wf=(t,e={})=>{if(typeof t!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:s=!1,after:i=!0}=e;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!s&&!i)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,u;const l=function(...c){const d=this,h=()=>{o=void 0,a&&(clearTimeout(a),a=
|
|
657
|
+
void 0),i&&(u=t.apply(d,c))},y=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),i&&(u=t.apply(d,c))},b=s&&!o;return clearTimeout(o),o=setTimeout(h,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout(y,n)),b&&(u=t.apply(d,c)),u};return Gy(l,t),l.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},l};var os={exports:{}},zi,Kf;function as(){if(Kf)return zi;Kf=1;const t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,s=e-6;return zi={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:n,
|
|
658
|
+
MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},zi}var Vi,Yf;function cs(){return Yf||(Yf=1,Vi=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Vi}var Xf;function Cr(){return Xf||(Xf=1,function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,
|
|
659
|
+
MAX_LENGTH:s}=as(),i=cs();e=t.exports={};const o=e.re=[],a=e.safeRe=[],u=e.src=[],l=e.safeSrc=[],c=e.t={};let d=0;const h="[a-zA-Z0-9-]",y=[["\\s",1],["\\d",s],[h,n]],b=f=>{for(const[g,p]of y)f=f.split(`${g}*`).join(`${g}{0,${p}}`).split(`${g}+`).join(`${g}{1,${p}}`);return f},_=(f,g,p)=>{const m=b(g),$=d++;i(f,$,g),c[f]=$,u[$]=g,l[$]=m,o[$]=new RegExp(g,p?"g":void 0),a[$]=new RegExp(m,p?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",
|
|
660
|
+
`\\d*[a-zA-Z-]${h}*`),_("MAINVERSION",`(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${u[c.NUMERICIDENTIFIER]}|${u[c.NONNUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${u[c.NUMERICIDENTIFIERLOOSE]}|${u[c.NONNUMERICIDENTIFIER]})`),_("PRERELEASE",`(?:-(${u[c.PRERELEASEIDENTIFIER]}(?:\\.${u[c.
|
|
661
|
+
PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${u[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[c.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${h}+`),_("BUILD",`(?:\\+(${u[c.BUILDIDENTIFIER]}(?:\\.${u[c.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${u[c.MAINVERSION]}${u[c.PRERELEASE]}?${u[c.BUILD]}?`),_("FULL",`^${u[c.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${u[c.MAINVERSIONLOOSE]}${u[c.PRERELEASELOOSE]}?${u[c.BUILD]}?`),_("LOOSE",`^${u[c.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRAN\
|
|
662
|
+
GEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${u[c.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:${u[c.PRERELEASE]})?${u[c.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:${u[c.PRERELEASELOOSE]})?${u[c.BUILD]}?)?)?`),_("XRANGE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAIN]}\
|
|
663
|
+
$`),_("XRANGELOOSE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),_("COERCE",`${u[c.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",u[c.COERCEPLAIN]+`(?:${u[c.PRERELEASE]})?(?:${u[c.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",u[c.COERCE],!0),_("COERCERTLFULL",u[c.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${u[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",_("TILDE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAIN]}\
|
|
664
|
+
$`),_("TILDELOOSE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${u[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",_("CARET",`^${u[c.LONECARET]}${u[c.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${u[c.LONECARET]}${u[c.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${u[c.GTLT]}\\s*(${u[c.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]}|${u[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=
|
|
665
|
+
"$1$2$3",_("HYPHENRANGE",`^\\s*(${u[c.XRANGEPLAIN]})\\s+-\\s+(${u[c.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${u[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[c.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(os,os.exports)),os.exports}var Gi,Jf;function Bi(){if(Jf)return Gi;Jf=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return Gi=n=>n?typeof n!="object"?t:n:e,Gi}var Wi,Qf;function Zf(){if(Qf)return Wi;
|
|
666
|
+
Qf=1;const t=/^[0-9]+$/,e=(n,s)=>{const i=t.test(n),o=t.test(s);return i&&o&&(n=+n,s=+s),n===s?0:i&&!o?-1:o&&!i?1:n<s?-1:1};return Wi={compareIdentifiers:e,rcompareIdentifiers:(n,s)=>e(s,n)},Wi}var Ki,ed;function Le(){if(ed)return Ki;ed=1;const t=cs(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=as(),{safeRe:n,safeSrc:s,t:i}=Cr(),o=Bi(),{compareIdentifiers:a}=Zf();class u{constructor(c,d){if(d=o(d),c instanceof u){if(c.loose===!!d.loose&&c.includePrerelease===!!d.includePrerelease)return c;c=c.version}else if(typeof c!=
|
|
667
|
+
"string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",c,d),this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease;const h=c.trim().match(d.loose?n[i.LOOSE]:n[i.FULL]);if(!h)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+h[1],this.minor=+h[2],this.patch=+h[3],this.major>r||this.major<0)throw new TypeError("Invalid major versi\
|
|
668
|
+
on");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");h[4]?this.prerelease=h[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const b=+y;if(b>=0&&b<r)return b}return y}):this.prerelease=[],this.build=h[5]?h[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){
|
|
1055
669
|
return this.version}compare(c){if(t("SemVer.compare",this.version,this.options,c),!(c instanceof u)){if(typeof c=="string"&&c===this.version)return 0;c=new u(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof u||(c=new u(c,this.options)),a(this.major,c.major)||a(this.minor,c.minor)||a(this.patch,c.patch)}comparePre(c){if(c instanceof u||(c=new u(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.
|
|
1056
|
-
prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let d=0;do{const h=this.prerelease[d],
|
|
1057
|
-
if(h===void 0)return-1;if(h===
|
|
670
|
+
prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let d=0;do{const h=this.prerelease[d],y=c.prerelease[d];if(t("prerelease compare",d,h,y),h===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(h===void 0)return-1;if(h===y)continue;return a(h,y)}while(++d)}compareBuild(c){c instanceof u||(c=new u(c,this.options));let d=0;do{const h=this.build[d],y=c.build[d];if(t("build compare",d,h,y),h===void 0&&y===void 0)return 0;if(y===void 0)return 1;
|
|
671
|
+
if(h===void 0)return-1;if(h===y)continue;return a(h,y)}while(++d)}inc(c,d,h){if(c.startsWith("pre")){if(!d&&h===!1)throw new Error("invalid increment argument: identifier is empty");if(d){const y=new RegExp(`^${this.options.loose?s[i.PRERELEASELOOSE]:s[i.PRERELEASE]}$`),b=`-${d}`.match(y);if(!b||b[1]!==d)throw new Error(`invalid identifier: ${d}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",d,h);break;case"preminor":this.prerelease.length=
|
|
1058
672
|
0,this.patch=0,this.minor++,this.inc("pre",d,h);break;case"prepatch":this.prerelease.length=0,this.inc("patch",d,h),this.inc("pre",d,h);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",d,h),this.inc("pre",d,h);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];
|
|
1059
|
-
break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const
|
|
1060
|
-
ady exists");this.prerelease.push(
|
|
1061
|
-
|
|
1062
|
-
if(
|
|
1063
|
-
(r,n)=>new t(r,n).major,
|
|
1064
|
-
return
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
<=":return
|
|
1068
|
-
|
|
1069
|
-
map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const
|
|
1070
|
-
this.includePrerelease=!!
|
|
1071
|
-
void 0){this.formatted="";for(let
|
|
1072
|
-
o("hyphen replace",
|
|
1073
|
-
"")&&
|
|
1074
|
-
tildeTrimReplace:d,caretTrimReplace:h}=
|
|
1075
|
-
TILDELOOSE]:u[l.TILDE];return
|
|
1076
|
-
o("caret",
|
|
1077
|
-
.${
|
|
1078
|
-
(
|
|
1079
|
-
1}.0-0`:
|
|
1080
|
-
return t}constructor(c,d){if(d=r(d),c instanceof e){if(c.loose===!!d.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,d),this.options=d,this.loose=!!d.loose,this.parse(c),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const d=this.options.loose?n[
|
|
1081
|
-
""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=t}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===t||c===t)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return
|
|
1082
|
-
value,d).test(c.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||
|
|
1083
|
-
semver,">",c.semver,d)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}
|
|
1084
|
-
return
|
|
1085
|
-
"0.0.0");if(
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
1;const t=
|
|
1089
|
-
"string"?n.raw:String(n);return c.length<d.length?c:n},
|
|
1090
|
-
d=o:d=a}if(h.length===1&&h[0].semver===r){if(
|
|
1091
|
-
let p,m
|
|
1092
|
-
if(p=l(
|
|
1093
|
-
d.semver,h.semver,
|
|
1094
|
-
|
|
1095
|
-
RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},
|
|
1096
|
-
if(!
|
|
1097
|
-
\`${typeof t}\``)}const
|
|
1098
|
-
const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=
|
|
1099
|
-
...r.ajvOptions});
|
|
1100
|
-
store,
|
|
1101
|
-
type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${
|
|
1102
|
-
|
|
1103
|
-
return this._handleChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{const e=
|
|
1104
|
-
if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return
|
|
1105
|
-
o),
|
|
1106
|
-
"; "))}_ensureDirectory(){
|
|
1107
|
-
throw n}}_watch(){this._ensureDirectory(),
|
|
1108
|
-
toVersion:a,finalVersion:r,versions:
|
|
1109
|
-
return
|
|
1110
|
-
${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}}class
|
|
1111
|
-
Headers(e);for(const[
|
|
1112
|
-
entries(
|
|
1113
|
-
BodyInit type")return!1;throw
|
|
1114
|
-
fetch:!0},
|
|
1115
|
-
|
|
1116
|
-
e&&(e.throwIfAborted(),e.addEventListener("abort",
|
|
1117
|
-
_fetch();for(const u of n._options.hooks.afterResponse){const l=await u(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new
|
|
1118
|
-
"Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},o=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(
|
|
1119
|
-
return l[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:
|
|
1120
|
-
!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(
|
|
1121
|
-
signal??this._input.signal;n?.aborted&&this.abortController.abort(n?.reason),n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(
|
|
1122
|
-
Request(this._input,this._options),this._options.searchParams){const
|
|
1123
|
-
new globalThis.Request(new globalThis.Request(
|
|
1124
|
-
includes(e.response.status)){let
|
|
1125
|
-
min(this._calculateRetryDelay(r),
|
|
1126
|
-
_options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):
|
|
1127
|
-
r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){const{done:u,value:l}=await o.read();if(u){
|
|
1128
|
-
on"&&(r=r(t??{})),
|
|
1129
|
-
env.NODE_ENV||"",
|
|
673
|
+
break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(h)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let b=this.prerelease.length;for(;--b>=0;)typeof this.prerelease[b]=="number"&&(this.prerelease[b]++,b=-2);if(b===-1){if(d===this.prerelease.join(".")&&h===!1)throw new Error("invalid increment argument: identifier alre\
|
|
674
|
+
ady exists");this.prerelease.push(y)}}if(d){let b=[d,y];h===!1&&(b=[d]),a(this.prerelease[0],d)===0?isNaN(this.prerelease[1])&&(this.prerelease=b):this.prerelease=b}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ki=u,Ki}var Yi,td;function tr(){if(td)return Yi;td=1;const t=Le();return Yi=(r,n,s=!1)=>{if(r instanceof t)return r;try{return new t(r,n)}catch(i){if(!s)return null;throw i}},
|
|
675
|
+
Yi}var Xi,rd;function By(){if(rd)return Xi;rd=1;const t=tr();return Xi=(r,n)=>{const s=t(r,n);return s?s.version:null},Xi}var Ji,nd;function Wy(){if(nd)return Ji;nd=1;const t=tr();return Ji=(r,n)=>{const s=t(r.trim().replace(/^[=v]+/,""),n);return s?s.version:null},Ji}var Qi,sd;function Ky(){if(sd)return Qi;sd=1;const t=Le();return Qi=(r,n,s,i,o)=>{typeof s=="string"&&(o=i,i=s,s=void 0);try{return new t(r instanceof t?r.version:r,s).inc(n,i,o).version}catch{return null}},Qi}var Zi,id;function Yy(){
|
|
676
|
+
if(id)return Zi;id=1;const t=tr();return Zi=(r,n)=>{const s=t(r,null,!0),i=t(n,null,!0),o=s.compare(i);if(o===0)return null;const a=o>0,u=a?s:i,l=a?i:s,c=!!u.prerelease.length;if(!!l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(l.compareMain(u)===0)return l.minor&&!l.patch?"minor":"patch"}const h=c?"pre":"";return s.major!==i.major?h+"major":s.minor!==i.minor?h+"minor":s.patch!==i.patch?h+"patch":"prerelease"},Zi}var eo,od;function Xy(){if(od)return eo;od=1;const t=Le();return eo=
|
|
677
|
+
(r,n)=>new t(r,n).major,eo}var to,ad;function Jy(){if(ad)return to;ad=1;const t=Le();return to=(r,n)=>new t(r,n).minor,to}var ro,cd;function Qy(){if(cd)return ro;cd=1;const t=Le();return ro=(r,n)=>new t(r,n).patch,ro}var no,ud;function Zy(){if(ud)return no;ud=1;const t=tr();return no=(r,n)=>{const s=t(r,n);return s&&s.prerelease.length?s.prerelease:null},no}var so,ld;function Ze(){if(ld)return so;ld=1;const t=Le();return so=(r,n,s)=>new t(r,s).compare(new t(n,s)),so}var io,fd;function e_(){if(fd)
|
|
678
|
+
return io;fd=1;const t=Ze();return io=(r,n,s)=>t(n,r,s),io}var oo,dd;function t_(){if(dd)return oo;dd=1;const t=Ze();return oo=(r,n)=>t(r,n,!0),oo}var ao,hd;function co(){if(hd)return ao;hd=1;const t=Le();return ao=(r,n,s)=>{const i=new t(r,s),o=new t(n,s);return i.compare(o)||i.compareBuild(o)},ao}var uo,pd;function r_(){if(pd)return uo;pd=1;const t=co();return uo=(r,n)=>r.sort((s,i)=>t(s,i,n)),uo}var lo,md;function n_(){if(md)return lo;md=1;const t=co();return lo=(r,n)=>r.sort((s,i)=>t(i,s,n)),
|
|
679
|
+
lo}var fo,gd;function us(){if(gd)return fo;gd=1;const t=Ze();return fo=(r,n,s)=>t(r,n,s)>0,fo}var ho,yd;function po(){if(yd)return ho;yd=1;const t=Ze();return ho=(r,n,s)=>t(r,n,s)<0,ho}var mo,_d;function $d(){if(_d)return mo;_d=1;const t=Ze();return mo=(r,n,s)=>t(r,n,s)===0,mo}var go,vd;function bd(){if(vd)return go;vd=1;const t=Ze();return go=(r,n,s)=>t(r,n,s)!==0,go}var yo,wd;function _o(){if(wd)return yo;wd=1;const t=Ze();return yo=(r,n,s)=>t(r,n,s)>=0,yo}var $o,Ed;function vo(){if(Ed)return $o;
|
|
680
|
+
Ed=1;const t=Ze();return $o=(r,n,s)=>t(r,n,s)<=0,$o}var bo,Sd;function Rd(){if(Sd)return bo;Sd=1;const t=$d(),e=bd(),r=us(),n=_o(),s=po(),i=vo();return bo=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return t(a,l,c);case"!=":return e(a,l,c);case">":return r(a,l,c);case">=":return n(a,l,c);case"<":return s(a,l,c);case"\
|
|
681
|
+
<=":return i(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},bo}var wo,Ad;function s_(){if(Ad)return wo;Ad=1;const t=Le(),e=tr(),{safeRe:r,t:n}=Cr();return wo=(i,o)=>{if(i instanceof t)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;o=o||{};let a=null;if(!o.rtl)a=i.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const y=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let b;for(;(b=y.exec(i))&&(!a||a.index+a[0].length!==i.length);)(!a||
|
|
682
|
+
b.index+b[0].length!==a.index+a[0].length)&&(a=b),y.lastIndex=b.index+b[1].length+b[2].length;y.lastIndex=-1}if(a===null)return null;const u=a[2],l=a[3]||"0",c=a[4]||"0",d=o.includePrerelease&&a[5]?`-${a[5]}`:"",h=o.includePrerelease&&a[6]?`+${a[6]}`:"";return e(`${u}.${l}.${c}${d}${h}`,o)},wo}var Eo,Od;function i_(){if(Od)return Eo;Od=1;class t{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.
|
|
683
|
+
map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(r,n)}return this}}return Eo=t,Eo}var So,Cd;function et(){if(Cd)return So;Cd=1;const t=/\s+/g;class e{constructor(H,K){if(K=s(K),H instanceof e)return H.loose===!!K.loose&&H.includePrerelease===!!K.includePrerelease?H:new e(H.raw,K);if(H instanceof i)return this.raw=H.value,this.set=[[H]],this.formatted=void 0,this;if(this.options=K,this.loose=!!K.loose,
|
|
684
|
+
this.includePrerelease=!!K.includePrerelease,this.raw=H.trim().replace(t," "),this.set=this.raw.split("||").map(G=>this.parseRange(G.trim())).filter(G=>G.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const G=this.set[0];if(this.set=this.set.filter(X=>!_(X[0])),this.set.length===0)this.set=[G];else if(this.set.length>1){for(const X of this.set)if(X.length===1&&f(X[0])){this.set=[X];break}}}this.formatted=void 0}get range(){if(this.formatted===
|
|
685
|
+
void 0){this.formatted="";for(let H=0;H<this.set.length;H++){H>0&&(this.formatted+="||");const K=this.set[H];for(let G=0;G<K.length;G++)G>0&&(this.formatted+=" "),this.formatted+=K[G].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(H){const G=((this.options.includePrerelease&&y)|(this.options.loose&&b))+":"+H,X=n.get(G);if(X)return X;const se=this.options.loose,U=se?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];H=H.replace(U,k(this.options.includePrerelease)),
|
|
686
|
+
o("hyphen replace",H),H=H.replace(u[l.COMPARATORTRIM],c),o("comparator trim",H),H=H.replace(u[l.TILDETRIM],d),o("tilde trim",H),H=H.replace(u[l.CARETTRIM],h),o("caret trim",H);let A=H.split(" ").map(R=>p(R,this.options)).join(" ").split(/\s+/).map(R=>D(R,this.options));se&&(A=A.filter(R=>(o("loose invalid filter",R,this.options),!!R.match(u[l.COMPARATORLOOSE])))),o("range list",A);const z=new Map,M=A.map(R=>new i(R,this.options));for(const R of M){if(_(R))return[R];z.set(R.value,R)}z.size>1&&z.has(
|
|
687
|
+
"")&&z.delete("");const w=[...z.values()];return n.set(G,w),w}intersects(H,K){if(!(H instanceof e))throw new TypeError("a Range is required");return this.set.some(G=>g(G,K)&&H.set.some(X=>g(X,K)&&G.every(se=>X.every(U=>se.intersects(U,K)))))}test(H){if(!H)return!1;if(typeof H=="string")try{H=new a(H,this.options)}catch{return!1}for(let K=0;K<this.set.length;K++)if(j(this.set[K],H,this.options))return!0;return!1}}So=e;const r=i_(),n=new r,s=Bi(),i=ls(),o=cs(),a=Le(),{safeRe:u,t:l,comparatorTrimReplace:c,
|
|
688
|
+
tildeTrimReplace:d,caretTrimReplace:h}=Cr(),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:b}=as(),_=x=>x.value==="<0.0.0-0",f=x=>x.value==="",g=(x,H)=>{let K=!0;const G=x.slice();let X=G.pop();for(;K&&G.length;)K=G.every(se=>X.intersects(se,H)),X=G.pop();return K},p=(x,H)=>(o("comp",x,H),x=E(x,H),o("caret",x),x=$(x,H),o("tildes",x),x=I(x,H),o("xrange",x),x=B(x,H),o("stars",x),x),m=x=>!x||x.toLowerCase()==="x"||x==="*",$=(x,H)=>x.trim().split(/\s+/).map(K=>v(K,H)).join(" "),v=(x,H)=>{const K=H.loose?u[l.
|
|
689
|
+
TILDELOOSE]:u[l.TILDE];return x.replace(K,(G,X,se,U,A)=>{o("tilde",x,G,X,se,U,A);let z;return m(X)?z="":m(se)?z=`>=${X}.0.0 <${+X+1}.0.0-0`:m(U)?z=`>=${X}.${se}.0 <${X}.${+se+1}.0-0`:A?(o("replaceTilde pr",A),z=`>=${X}.${se}.${U}-${A} <${X}.${+se+1}.0-0`):z=`>=${X}.${se}.${U} <${X}.${+se+1}.0-0`,o("tilde return",z),z})},E=(x,H)=>x.trim().split(/\s+/).map(K=>S(K,H)).join(" "),S=(x,H)=>{o("caret",x,H);const K=H.loose?u[l.CARETLOOSE]:u[l.CARET],G=H.includePrerelease?"-0":"";return x.replace(K,(X,se,U,A,z)=>{
|
|
690
|
+
o("caret",x,X,se,U,A,z);let M;return m(se)?M="":m(U)?M=`>=${se}.0.0${G} <${+se+1}.0.0-0`:m(A)?se==="0"?M=`>=${se}.${U}.0${G} <${se}.${+U+1}.0-0`:M=`>=${se}.${U}.0${G} <${+se+1}.0.0-0`:z?(o("replaceCaret pr",z),se==="0"?U==="0"?M=`>=${se}.${U}.${A}-${z} <${se}.${U}.${+A+1}-0`:M=`>=${se}.${U}.${A}-${z} <${se}.${+U+1}.0-0`:M=`>=${se}.${U}.${A}-${z} <${+se+1}.0.0-0`):(o("no pr"),se==="0"?U==="0"?M=`>=${se}.${U}.${A}${G} <${se}.${U}.${+A+1}-0`:M=`>=${se}.${U}.${A}${G} <${se}.${+U+1}.0-0`:M=`>=${se}.${U}\
|
|
691
|
+
.${A} <${+se+1}.0.0-0`),o("caret return",M),M})},I=(x,H)=>(o("replaceXRanges",x,H),x.split(/\s+/).map(K=>F(K,H)).join(" ")),F=(x,H)=>{x=x.trim();const K=H.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return x.replace(K,(G,X,se,U,A,z)=>{o("xRange",x,G,X,se,U,A,z);const M=m(se),w=M||m(U),R=w||m(A),C=R;return X==="="&&C&&(X=""),z=H.includePrerelease?"-0":"",M?X===">"||X==="<"?G="<0.0.0-0":G="*":X&&C?(w&&(U=0),A=0,X===">"?(X=">=",w?(se=+se+1,U=0,A=0):(U=+U+1,A=0)):X==="<="&&(X="<",w?se=+se+1:U=+U+1),X==="<"&&
|
|
692
|
+
(z="-0"),G=`${X+se}.${U}.${A}${z}`):w?G=`>=${se}.0.0${z} <${+se+1}.0.0-0`:R&&(G=`>=${se}.${U}.0${z} <${se}.${+U+1}.0-0`),o("xRange return",G),G})},B=(x,H)=>(o("replaceStars",x,H),x.trim().replace(u[l.STAR],"")),D=(x,H)=>(o("replaceGTE0",x,H),x.trim().replace(u[H.includePrerelease?l.GTE0PRE:l.GTE0],"")),k=x=>(H,K,G,X,se,U,A,z,M,w,R,C)=>(m(G)?K="":m(X)?K=`>=${G}.0.0${x?"-0":""}`:m(se)?K=`>=${G}.${X}.0${x?"-0":""}`:U?K=`>=${K}`:K=`>=${K}${x?"-0":""}`,m(M)?z="":m(w)?z=`<${+M+1}.0.0-0`:m(R)?z=`<${M}.${+w+
|
|
693
|
+
1}.0-0`:C?z=`<=${M}.${w}.${R}-${C}`:x?z=`<${M}.${w}.${+R+1}-0`:z=`<=${z}`,`${K} ${z}`.trim()),j=(x,H,K)=>{for(let G=0;G<x.length;G++)if(!x[G].test(H))return!1;if(H.prerelease.length&&!K.includePrerelease){for(let G=0;G<x.length;G++)if(o(x[G].semver),x[G].semver!==i.ANY&&x[G].semver.prerelease.length>0){const X=x[G].semver;if(X.major===H.major&&X.minor===H.minor&&X.patch===H.patch)return!0}return!1}return!0};return So}var Ro,Pd;function ls(){if(Pd)return Ro;Pd=1;const t=Symbol("SemVer ANY");class e{static get ANY(){
|
|
694
|
+
return t}constructor(c,d){if(d=r(d),c instanceof e){if(c.loose===!!d.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,d),this.options=d,this.loose=!!d.loose,this.parse(c),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const d=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=c.match(d);if(!h)throw new TypeError(`Invalid comparator: ${c}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=
|
|
695
|
+
""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=t}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===t||c===t)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return i(c,this.operator,this.semver,this.options)}intersects(c,d){if(!(c instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,d).test(this.value):c.operator===""?c.value===""?!0:new u(this.
|
|
696
|
+
value,d).test(c.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||i(this.semver,"<",c.semver,d)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||i(this.
|
|
697
|
+
semver,">",c.semver,d)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}Ro=e;const r=Bi(),{safeRe:n,t:s}=Cr(),i=Rd(),o=cs(),a=Le(),u=et();return Ro}var Ao,Id;function fs(){if(Id)return Ao;Id=1;const t=et();return Ao=(r,n,s)=>{try{n=new t(n,s)}catch{return!1}return n.test(r)},Ao}var Oo,Nd;function o_(){if(Nd)return Oo;Nd=1;const t=et();return Oo=(r,n)=>new t(r,n).set.map(s=>s.map(i=>i.value).join(" ").trim().split(" ")),Oo}var Co,Td;function a_(){if(Td)return Co;Td=1;const t=Le(),e=et();
|
|
698
|
+
return Co=(n,s,i)=>{let o=null,a=null,u=null;try{u=new e(s,i)}catch{return null}return n.forEach(l=>{u.test(l)&&(!o||a.compare(l)===-1)&&(o=l,a=new t(o,i))}),o},Co}var Po,jd;function c_(){if(jd)return Po;jd=1;const t=Le(),e=et();return Po=(n,s,i)=>{let o=null,a=null,u=null;try{u=new e(s,i)}catch{return null}return n.forEach(l=>{u.test(l)&&(!o||a.compare(l)===1)&&(o=l,a=new t(o,i))}),o},Po}var Io,Ld;function u_(){if(Ld)return Io;Ld=1;const t=Le(),e=et(),r=us();return Io=(s,i)=>{s=new e(s,i);let o=new t(
|
|
699
|
+
"0.0.0");if(s.test(o)||(o=new t("0.0.0-0"),s.test(o)))return o;o=null;for(let a=0;a<s.set.length;++a){const u=s.set[a];let l=null;u.forEach(c=>{const d=new t(c.semver.version);switch(c.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||r(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),l&&(!o||r(o,l))&&(o=l)}return o&&s.test(o)?o:null},Io}var No,Dd;function l_(){if(Dd)return No;
|
|
700
|
+
Dd=1;const t=et();return No=(r,n)=>{try{return new t(r,n).range||"*"}catch{return null}},No}var To,xd;function jo(){if(xd)return To;xd=1;const t=Le(),e=ls(),{ANY:r}=e,n=et(),s=fs(),i=us(),o=po(),a=vo(),u=_o();return To=(c,d,h,y)=>{c=new t(c,y),d=new n(d,y);let b,_,f,g,p;switch(h){case">":b=i,_=a,f=o,g=">",p=">=";break;case"<":b=o,_=u,f=i,g="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(c,d,y))return!1;for(let m=0;m<d.set.length;++m){const $=d.set[m];let v=null,
|
|
701
|
+
E=null;if($.forEach(S=>{S.semver===r&&(S=new e(">=0.0.0")),v=v||S,E=E||S,b(S.semver,v.semver,y)?v=S:f(S.semver,E.semver,y)&&(E=S)}),v.operator===g||v.operator===p||(!E.operator||E.operator===g)&&_(c,E.semver))return!1;if(E.operator===p&&f(c,E.semver))return!1}return!0},To}var Lo,Md;function f_(){if(Md)return Lo;Md=1;const t=jo();return Lo=(r,n,s)=>t(r,n,">",s),Lo}var Do,kd;function d_(){if(kd)return Do;kd=1;const t=jo();return Do=(r,n,s)=>t(r,n,"<",s),Do}var xo,qd;function h_(){if(qd)return xo;qd=
|
|
702
|
+
1;const t=et();return xo=(r,n,s)=>(r=new t(r,s),n=new t(n,s),r.intersects(n,s)),xo}var Mo,Hd;function p_(){if(Hd)return Mo;Hd=1;const t=fs(),e=Ze();return Mo=(r,n,s)=>{const i=[];let o=null,a=null;const u=r.sort((h,y)=>e(h,y,s));for(const h of u)t(h,n,s)?(a=h,o||(o=h)):(a&&i.push([o,a]),a=null,o=null);o&&i.push([o,null]);const l=[];for(const[h,y]of i)h===y?l.push(h):!y&&h===u[0]?l.push("*"):y?h===u[0]?l.push(`<=${y}`):l.push(`${h} - ${y}`):l.push(`>=${h}`);const c=l.join(" || "),d=typeof n.raw==
|
|
703
|
+
"string"?n.raw:String(n);return c.length<d.length?c:n},Mo}var ko,Ud;function m_(){if(Ud)return ko;Ud=1;const t=et(),e=ls(),{ANY:r}=e,n=fs(),s=Ze(),i=(d,h,y={})=>{if(d===h)return!0;d=new t(d,y),h=new t(h,y);let b=!1;e:for(const _ of d.set){for(const f of h.set){const g=u(_,f,y);if(b=b||g!==null,g)continue e}if(b)return!1}return!0},o=[new e(">=0.0.0-0")],a=[new e(">=0.0.0")],u=(d,h,y)=>{if(d===h)return!0;if(d.length===1&&d[0].semver===r){if(h.length===1&&h[0].semver===r)return!0;y.includePrerelease?
|
|
704
|
+
d=o:d=a}if(h.length===1&&h[0].semver===r){if(y.includePrerelease)return!0;h=a}const b=new Set;let _,f;for(const I of d)I.operator===">"||I.operator===">="?_=l(_,I,y):I.operator==="<"||I.operator==="<="?f=c(f,I,y):b.add(I.semver);if(b.size>1)return null;let g;if(_&&f){if(g=s(_.semver,f.semver,y),g>0)return null;if(g===0&&(_.operator!==">="||f.operator!=="<="))return null}for(const I of b){if(_&&!n(I,String(_),y)||f&&!n(I,String(f),y))return null;for(const F of h)if(!n(I,String(F),y))return!1;return!0}
|
|
705
|
+
let p,m,$,v,E=f&&!y.includePrerelease&&f.semver.prerelease.length?f.semver:!1,S=_&&!y.includePrerelease&&_.semver.prerelease.length?_.semver:!1;E&&E.prerelease.length===1&&f.operator==="<"&&E.prerelease[0]===0&&(E=!1);for(const I of h){if(v=v||I.operator===">"||I.operator===">=",$=$||I.operator==="<"||I.operator==="<=",_){if(S&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===S.major&&I.semver.minor===S.minor&&I.semver.patch===S.patch&&(S=!1),I.operator===">"||I.operator===">="){
|
|
706
|
+
if(p=l(_,I,y),p===I&&p!==_)return!1}else if(_.operator===">="&&!n(_.semver,String(I),y))return!1}if(f){if(E&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===E.major&&I.semver.minor===E.minor&&I.semver.patch===E.patch&&(E=!1),I.operator==="<"||I.operator==="<="){if(m=c(f,I,y),m===I&&m!==f)return!1}else if(f.operator==="<="&&!n(f.semver,String(I),y))return!1}if(!I.operator&&(f||_)&&g!==0)return!1}return!(_&&$&&!f&&g!==0||f&&v&&!_&&g!==0||S||E)},l=(d,h,y)=>{if(!d)return h;const b=s(
|
|
707
|
+
d.semver,h.semver,y);return b>0?d:b<0||h.operator===">"&&d.operator===">="?h:d},c=(d,h,y)=>{if(!d)return h;const b=s(d.semver,h.semver,y);return b<0?d:b>0||h.operator==="<"&&d.operator==="<="?h:d};return ko=i,ko}var qo,Fd;function g_(){if(Fd)return qo;Fd=1;const t=Cr(),e=as(),r=Le(),n=Zf(),s=tr(),i=By(),o=Wy(),a=Ky(),u=Yy(),l=Xy(),c=Jy(),d=Qy(),h=Zy(),y=Ze(),b=e_(),_=t_(),f=co(),g=r_(),p=n_(),m=us(),$=po(),v=$d(),E=bd(),S=_o(),I=vo(),F=Rd(),B=s_(),D=ls(),k=et(),j=fs(),x=o_(),H=a_(),K=c_(),G=u_(),
|
|
708
|
+
X=l_(),se=jo(),U=f_(),A=d_(),z=h_(),M=p_(),w=m_();return qo={parse:s,valid:i,clean:o,inc:a,diff:u,major:l,minor:c,patch:d,prerelease:h,compare:y,rcompare:b,compareLoose:_,compareBuild:f,sort:g,rsort:p,gt:m,lt:$,eq:v,neq:E,gte:S,lte:I,cmp:F,coerce:B,Comparator:D,Range:k,satisfies:j,toComparators:x,maxSatisfying:H,minSatisfying:K,minVersion:G,validRange:X,outside:se,gtr:U,ltr:A,intersects:z,simplifyRange:M,subset:w,SemVer:r,re:t.re,src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:e.SEMVER_SPEC_VERSION,RELEASE_TYPES:e.
|
|
709
|
+
RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},qo}var Ho=g_();const rr=_s(Ho),y_=Object.prototype.toString,__="[object Uint8Array]",$_="[object ArrayBuffer]";function zd(t,e,r){return t?t.constructor===e?!0:y_.call(t)===r:!1}function Vd(t){return zd(t,Uint8Array,__)}function v_(t){return zd(t,ArrayBuffer,$_)}function b_(t){return Vd(t)||v_(t)}function w_(t){if(!Vd(t))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof t}\``)}function E_(t){
|
|
710
|
+
if(!b_(t))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}function Gd(t,e){if(t.length===0)return new Uint8Array(0);e??=t.reduce((s,i)=>s+i.length,0);const r=new Uint8Array(e);let n=0;for(const s of t)w_(s),r.set(s,n),n+=s.length;return r}const Bd={utf8:new globalThis.TextDecoder("utf8")};function Wd(t,e="utf8"){return E_(t),Bd[e]??=new globalThis.TextDecoder(e),Bd[e].decode(t)}function S_(t){if(typeof t!="string")throw new TypeError(`Expected \`string\`, got\
|
|
711
|
+
\`${typeof t}\``)}const R_=new globalThis.TextEncoder;function Uo(t){return S_(t),R_.encode(t)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const A_=My.default,Kd="aes-256-cbc",nr=()=>Object.create(null),O_=t=>t!=null,C_=(t,e)=>{const r=new Set(["undefined","symbol","function"]),n=typeof e;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${t}\` is not allowed as it's not supported by JSON`)},ds="__internal__",Fo=`${ds}.migrations.version`;class P_{path;events;#n;#t;#e;#r={};constructor(e={}){
|
|
712
|
+
const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=Fm(r.projectName,{suffix:r.projectSuffix}).config}if(this.#e=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError("The `schema` option must be an object.");const o=new Oy.Ajv2020({allErrors:!0,useDefaults:!0,
|
|
713
|
+
...r.ajvOptions});A_(o);const a={...r.rootSchema,type:"object",properties:r.schema};this.#n=o.compile(a);for(const[u,l]of Object.entries(r.schema??{}))l?.default&&(this.#r[u]=l.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#t=r.encryptionKey;const n=r.fileExtension?`.${r.fileExtension}`:"";this.path=$e.resolve(r.cwd,`${r.configName??"config"}${n}`);const s=this.
|
|
714
|
+
store,i=Object.assign(nr(),r.defaults,s);if(r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(i);try{Xh.deepEqual(s,i)}catch{this.store=i}r.watch&&this._watch()}get(e,r){if(this.#e.accessPropertiesByDotNotation)return this._get(e,r);const{store:n}=this;return e in n?n[e]:r}set(e,r){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of \
|
|
715
|
+
type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${ds} key, as it's used to manage this module internal operations.`);const{store:n}=this,s=(i,o)=>{C_(i,o),this.#e.accessPropertiesByDotNotation?Cc(n,i,o):n[i]=o};if(typeof e=="object"){const i=e;for(const[o,a]of Object.entries(i))s(o,a)}else s(e,r);this.store=n}has(e){return this.#e.accessPropertiesByDotNotation?
|
|
716
|
+
km(this.store,e):e in this.store}reset(...e){for(const r of e)O_(this.#r[r])&&this.set(r,this.#r[r])}delete(e){const{store:r}=this;this.#e.accessPropertiesByDotNotation?Mm(r,e):delete r[e],this.store=r}clear(){this.store=nr();for(const e of Object.keys(this.#r))this.reset(e)}onDidChange(e,r){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);
|
|
717
|
+
return this._handleChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{const e=pe.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(e),n=this._deserialize(r);return this._validate(n),Object.assign(nr(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),nr();
|
|
718
|
+
if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return nr();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[e,r]of Object.entries(this.store))yield[e,r]}_encryptData(e){if(!this.#t)return typeof e=="string"?e:Wd(e);try{const r=e.slice(0,16),n=ur.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),s=ur.createDecipheriv(Kd,n,r),i=e.slice(17),o=typeof i=="string"?Uo(i):i;return Wd(Gd([s.update(
|
|
719
|
+
o),s.final()]))}catch{}return e.toString()}_handleChange(e,r){let n=e();const s=()=>{const i=n,o=e();Yh(o,i)||(n=o,r.call(this,o,i))};return this.events.addEventListener("change",s),()=>{this.events.removeEventListener("change",s)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0," ");_validate(e){if(!this.#n||this.#n(e)||!this.#n.errors)return;const n=this.#n.errors.map(({instancePath:s,message:i=""})=>`\`${s.slice(1)}\` ${i}`);throw new Error("Config schema violation: "+n.join(
|
|
720
|
+
"; "))}_ensureDirectory(){pe.mkdirSync($e.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(this.#t){const n=ur.randomBytes(16),s=ur.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),i=ur.createCipheriv(Kd,s,n);r=Gd([n,Uo(":"),i.update(Uo(r)),i.final()])}if(Re.env.SNAP)pe.writeFileSync(this.path,r,{mode:this.#e.configFileMode});else try{jc(this.path,r,{mode:this.#e.configFileMode})}catch(n){if(n?.code==="EXDEV"){pe.writeFileSync(this.path,r,{mode:this.#e.configFileMode});return}
|
|
721
|
+
throw n}}_watch(){this._ensureDirectory(),pe.existsSync(this.path)||this._write(nr()),Re.platform==="win32"?pe.watch(this.path,{persistent:!1},Wf(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):pe.watchFile(this.path,{persistent:!1},Wf(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(e,r,n){let s=this._get(Fo,"0.0.0");const i=Object.keys(e).filter(a=>this._shouldPerformMigration(a,s,r));let o={...this.store};for(const a of i)try{n&&n(this,{fromVersion:s,
|
|
722
|
+
toVersion:a,finalVersion:r,versions:i});const u=e[a];u?.(this),this._set(Fo,a),s=a,o={...this.store}}catch(u){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${u}`)}(this._isVersionInRangeFormat(s)||!rr.eq(s,r))&&this._set(Fo,r)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===ds?!0:typeof e!="string"?!1:this.#e.accessPropertiesByDotNotation?!!e.startsWith(`${ds}.`):!1}_isVersionInRangeFormat(e){
|
|
723
|
+
return rr.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&rr.satisfies(r,e)?!1:rr.satisfies(n,e):!(rr.lte(e,r)||rr.gt(e,n))}_get(e,r){return xm(this.store,e,r)}_set(e,r){const{store:n}=this;Cc(n,e,r),this.store=n}}class Yd extends Error{response;request;options;constructor(e,r,n){const s=e.status||e.status===0?e.status:"",i=e.statusText||"",o=`${s} ${i}`.trim(),a=o?`status code ${o}`:"an unknown error";super(`Request failed with ${a}: ${r.method}\
|
|
724
|
+
${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}}class Xd extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}const Pr=t=>t!==null&&typeof t=="object",hs=(...t)=>{for(const e of t)if((!Pr(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return zo({},...t)},Jd=(t={},e={})=>{const r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,s=new globalThis.
|
|
725
|
+
Headers(e);for(const[i,o]of s.entries())n&&o==="undefined"||o===void 0?r.delete(i):r.set(i,o);return r};function ps(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:zo(t[r]??[],e[r]??[])}const Qd=(t={},e={})=>({beforeRequest:ps(t,e,"beforeRequest"),beforeRetry:ps(t,e,"beforeRetry"),afterResponse:ps(t,e,"afterResponse"),beforeError:ps(t,e,"beforeError")}),zo=(...t)=>{let e={},r={},n={};for(const s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(Pr(s)){for(let[i,o]of Object.
|
|
726
|
+
entries(s))Pr(o)&&i in e&&(o=zo(e[i],o)),e={...e,[i]:o};Pr(s.hooks)&&(n=Qd(n,s.hooks),e.hooks=n),Pr(s.headers)&&(r=Jd(r,s.headers),e.headers=r)}return e},I_=(()=>{let t=!1,e=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(s){if(s instanceof Error&&s.message==="unsupported\
|
|
727
|
+
BodyInit type")return!1;throw s}return t&&!e})(),N_=typeof globalThis.AbortController=="function",T_=typeof globalThis.ReadableStream=="function",j_=typeof globalThis.FormData=="function",Zd=["get","post","put","patch","head","delete"],L_={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Vo=2147483647,eh=Symbol("stop"),D_={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,
|
|
728
|
+
fetch:!0},x_={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},M_=t=>Zd.includes(t)?t.toUpperCase():t,k_=["get","put","head","delete","options","trace"],q_=[408,413,429,500,502,503,504],H_=[413,429,503],th={limit:2,methods:k_,statusCodes:q_,afterStatusCodes:H_,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},
|
|
729
|
+
U_=(t={})=>{if(typeof t=="number")return{...th,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...th,...t}};async function F_(t,e,r,n){return new Promise((s,i)=>{const o=setTimeout(()=>{r&&r.abort(),i(new Xd(t))},n.timeout);n.fetch(t,e).then(s).catch(i).then(()=>{clearTimeout(o)})})}async function z_(t,{signal:e}){return new Promise((r,n)=>{
|
|
730
|
+
e&&(e.throwIfAborted(),e.addEventListener("abort",s,{once:!0}));function s(){clearTimeout(i),n(e.reason)}const i=setTimeout(()=>{e?.removeEventListener("abort",s),r()},t)})}const V_=(t,e)=>{const r={};for(const n in e)!(n in x_)&&!(n in D_)&&!(n in t)&&(r[n]=e[n]);return r};class ys{static create(e,r){const n=new ys(e,r),s=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Vo)throw new RangeError(`The \`timeout\` option cannot be greater than ${Vo}`);await Promise.resolve();let a=await n.
|
|
731
|
+
_fetch();for(const u of n._options.hooks.afterResponse){const l=await u(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new Yd(a,n.request,n._options);for(const l of n._options.hooks.beforeError)u=await l(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!T_)throw new Error(
|
|
732
|
+
"Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},o=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(s):s();for(const[a,u]of Object.entries(L_))o[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);const l=await o;if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}
|
|
733
|
+
return l[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:Jd(this._input.headers,r.headers),hooks:Qd({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:M_(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:U_(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&
|
|
734
|
+
!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(N_){this.abortController=new globalThis.AbortController;const n=this._options.
|
|
735
|
+
signal??this._input.signal;n?.aborted&&this.abortController.abort(n?.reason),n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(I_&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.
|
|
736
|
+
Request(this._input,this._options),this._options.searchParams){const s="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);(j_&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=
|
|
737
|
+
new globalThis.Request(new globalThis.Request(i,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof Xd)throw e;if(e instanceof Yd){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;const n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.
|
|
738
|
+
includes(e.response.status)){let s=Number(n)*1e3;Number.isNaN(s)?s=Date.parse(n)-Date.now():s>=Date.parse("2024-01-01")&&(s-=Date.now());const i=this._options.retry.maxRetryAfter??s;return s<i?s:i}if(e.response.status===413)throw e}const r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){const n=Math.
|
|
739
|
+
min(this._calculateRetryDelay(r),Vo);if(this._retryCount<1)throw r;await z_(n,{signal:this._options.signal});for(const s of this._options.hooks.beforeRetry)if(await s({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===eh)return;return this._retry(e)}}async _fetch(){for(const n of this._options.hooks.beforeRequest){const s=await n(this.request,this._options);if(s instanceof Request){this.request=s;break}if(s instanceof Response)return s}const e=V_(this.request,this.
|
|
740
|
+
_options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):F_(r,e,this.abortController,this._options)}_stream(e,r){const n=Number(e.headers.get("content-length"))||0;let s=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:s},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(i){const o=e.body.getReader();r&&
|
|
741
|
+
r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){const{done:u,value:l}=await o.read();if(u){i.close();return}if(r){s+=l.byteLength;const c=n===0?0:s/n;r({percent:c,transferredBytes:s,totalBytes:n},l)}i.enqueue(l),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}}const Go=t=>{const e=(r,n)=>ys.create(r,hs(t,n));for(const r of Zd)e[r]=(n,s)=>ys.create(n,hs(t,s,{method:r}));return e.create=r=>Go(hs(r)),e.extend=r=>(typeof r=="functi\
|
|
742
|
+
on"&&(r=r(t??{})),Go(hs(t,r))),e.stop=eh,e},G_=Go(),ms=Object.create(null),Ir=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?ms:globalThis),Et=new Proxy(ms,{get(t,e){return Ir()[e]??ms[e]},has(t,e){const r=Ir();return e in r||e in ms},set(t,e,r){const n=Ir(!0);return n[e]=r,!0},deleteProperty(t,e){if(!e)return!1;const r=Ir(!0);return delete r[e],!0},ownKeys(){const t=Ir(!0);return Object.keys(t)}}),rh=typeof process<"u"&&process.env&&process.
|
|
743
|
+
env.NODE_ENV||"",B_=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRON\
|
|
1130
744
|
E"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCE\
|
|
1131
|
-
L_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function
|
|
1132
|
-
name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const
|
|
1133
|
-
(
|
|
1134
|
-
userAgent==="Cloudflare-Workers"
|
|
1135
|
-
eck-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:
|
|
1136
|
-
return(await
|
|
1137
|
-
${
|
|
1138
|
-
await
|
|
1139
|
-
d)}`),u++}catch(c){n.error(`error while generating ${l.id}`,{error:c})}u>0&&n.info(`${
|
|
1140
|
-
d2":case"mermaid":{await
|
|
1141
|
-
ts");if(r&&(a=
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
"
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
outfile",{alias:"o",type:"string",desc:"<file> path to output file (.
|
|
1168
|
-
|
|
1169
|
-
|
|
745
|
+
L_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function W_(){if(globalThis.process?.env)for(const t of B_){const e=t[1]||t[0];if(globalThis.process?.env[e])return{
|
|
746
|
+
name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const nh=W_();nh.name;function zt(t){return t?t!=="false":!1}const K_=globalThis.process?.platform||"",sh=zt(Et.CI)||nh.ci!==!1,ih=zt(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);zt(Et.DEBUG);const Y_=rh==="test"||zt(Et.TEST),X_=zt(Et.MINIMAL)||sh||Y_||!ih,J_=/^win/i.test(K_);!zt(Et.NO_COLOR)&&(zt(Et.FORCE_COLOR)||
|
|
747
|
+
(ih||J_)&&Et.TERM);const Q_=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(Q_?.split(".")[0]);const Z_=globalThis.process||Object.create(null),oh={versions:{}};new Proxy(Z_,{get(t,e){if(e==="env")return Et;if(e in t)return t[e];if(e in oh)return oh[e]}});const e$=globalThis.process?.release?.name==="node",t$=!!globalThis.Bun||!!globalThis.process?.versions?.bun,r$=!!globalThis.Deno,n$=!!globalThis.fastly,s$=!!globalThis.Netlify,i$=!!globalThis.EdgeRuntime,o$=globalThis.navigator?.
|
|
748
|
+
userAgent==="Cloudflare-Workers",a$=[[s$,"netlify"],[i$,"edge-light"],[o$,"workerd"],[n$,"fastly"],[r$,"deno"],[t$,"bun"],[e$,"node"]];function c$(){const t=a$.find(e=>e[0]);if(t)return{name:t[1]}}const u$=c$();u$?.name;const Bo=new P_({projectName:gh,serialize:t=>Jo.stringify(t,null,2),deserialize:t=>Jo.parse(t)}),l$=1e3*60*60*24,ah="check-update";function f$(){if(X_||rh===ah)return;const t=Bo.get("lastUpdateCheck"),e=Bo.get("latestVersion");if(yh(e)||_h(t)||t+l$<Date.now())try{$h("likec4",["ch\
|
|
749
|
+
eck-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:ah}}).catch(()=>{})}catch{}e&&Ho.gt(e,Vt)&&St(["Update available: ",ee.dim(Vt),ee.reset(" \u2192 "),ee.green(e)].join(""))}async function d$(){try{const t=await h$();Cs(t,"No version found in latest npm"),Bo.set({lastUpdateCheck:Date.now(),latestVersion:t}),Ho.gt(t,Vt)?St(["Update available: ",ee.dim(Vt),ee.reset(" \u2192 "),ee.green(t)].join("")):St(ee.dim("Up to date: ")+" "+ee.green(Vt))}catch(t){Qo.error(vh(t))}}async function h$(){
|
|
750
|
+
return(await G_("https://registry.npmjs.org/likec4/latest",{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},keepalive:!0}).json()).version}async function p$(t,e,r){const n=".ts";e=e??ge(t.workspace,"likec4.generated"+n),or(e)!==n&&(e=e+n),await ct(Rt(e),{recursive:!0});const s=await t.diagrams(),i=qh([...s]);await Ct(e,i),r.info(`${ee.dim("generated")} ${At(process.cwd(),e)}`)}async function m$(t,e,r){await ct(e,{recursive:!0}),r.info(`${ee.dim("format")}\
|
|
751
|
+
${ee.green("dot")}`),r.info(`${ee.dim("outdir")} ${e}`);const n=new Set,s=await t.viewsService.computedViews();let i=0;for(const o of s)try{const a=await t.viewsService.layouter.dot(o),u=o.relativePath??"";u!==""&&!n.has(u)&&(await ct(ge(e,u),{recursive:!0}),n.add(u));const l=ge(e,u,o.id+".dot");await Ct(l,a),r.info(`${ee.dim("generated")} ${At(process.cwd(),l)}`),i++}catch(a){Qo.error(`error while generating ${o.id}`,{error:a})}i>0&&r.info(`${ee.dim("total")} ${i} files`)}async function g$(t,e,r,n){
|
|
752
|
+
await ct(r,{recursive:!0}),n.info(`${ee.dim("format")} ${ee.green(e)}`),n.info(`${ee.dim("outdir")} ${r}`);let s,i;switch(e){case"d2":s=".d2",i=Uh;break;case"mermaid":s=".mmd",i=Hh;break;default:aa(e)}const o=new Set,a=await t.diagrams();let u=0;for(const l of a)try{let c=l.relativePath??".";c.includes("/")?c=c.slice(0,c.lastIndexOf("/")):c=".",c!==""&&!o.has(c)&&(await ct(ge(r,c),{recursive:!0}),o.add(c));const d=ge(r,c,l.id+s),h=i(l);await Ct(d,h),n.info(`${ee.dim("generated")} ${At(process.cwd(),
|
|
753
|
+
d)}`),u++}catch(c){n.error(`error while generating ${l.id}`,{error:c})}u>0&&n.info(`${ee.dim("total")} ${u} files`)}async function gs({path:t,useDotBin:e,...r}){const n=tt("c4:codegen"),s=sr(n),i=await rt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});if(i.ensureSingleProject(),(await i.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await p$(i,r.outfile,n);break}case"dot":{await m$(
|
|
754
|
+
i,r.outdir??t,n);break}case"d2":case"mermaid":{await g$(i,r.format,r.outdir??t,n);break}default:aa(r)}s.stopAndLog()}async function y$({path:t,useDotBin:e,outfile:r}){const n=tt("c4:codegen"),s=sr(n),i=await rt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});i.ensureSingleProject(),n.info(`${ee.dim("format")} ${ee.green("model")}`);const o=await i.layoutedModel();for(const d of o.views())d.$view.hasLayoutDrift&&n.warn(ee.yellow("drift detected, manual layout can not be applied, view:")+
|
|
755
|
+
" "+ee.red(d.id));let a=ge(i.workspace,"likec4-model.ts");if(r&&(a=Ss(r)?r:ge(r),Ot(r)&&(await As(r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);const u=Nr(a);n.info(`${ee.dim("filename")} ${u}`);const l=or(u).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(l))throw n.error(`output file ${r} has extension "${l}"`),new Error(`output file ${r} must be a .ts, .mts or .cts file`);const c=Rt(a);n.info(`${ee.dim("outdir")} ${c}`),await ct(c,{recursive:!0}),await Ct(a,Fh(
|
|
756
|
+
o),{encoding:"utf-8"}),St($s(`
|
|
757
|
+
${ee.dim("Source with LikeC4Model generated:")}
|
|
758
|
+
${At(vs(),a)}
|
|
759
|
+
|
|
760
|
+
${ee.dim("How to use:")}
|
|
761
|
+
${ee.underline("https://likec4.dev/tooling/code-generation/model/")}
|
|
762
|
+
`).trim(),{padding:2,borderColor:"green",borderStyle:"round"}),s.stopAndLog()}async function _$({languageServices:t,outDir:e,filename:r="likec4-react.mjs"}){const n=Ks,s=Xs();return n.info(`${ee.cyan("likec4 app root")} ${ee.dim(s)}`),n.info(ee.cyan("outDir")+" "+ee.dim(e)),{customLogger:n,root:s,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:Zs()},esbuild:{banner:`'use client'
|
|
763
|
+
`+Ys.banner,footer:Ys.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!1,target:"es2022",copyPublicDir:!1,chunkSizeWarningLimit:Qs,lib:{entry:"react/likec4.tsx",fileName(i,o){return r},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/rea\
|
|
764
|
+
ct","likec4/model","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(i,o){i.code!=="SOURCEMAP_ERROR"&&o(i)}}},plugins:[oa({}),Os({languageServices:t.languageServices,useOverviewGraph:!1})]}}async function $$({path:t,useDotBin:e,outfile:r}){const n=tt("c4:codegen"),s=sr(n),i=await rt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});i.ensureSingleProject(),n.info(`${ee.dim("format")} ${ee.green("react")}`);const o=await i.diagrams();
|
|
765
|
+
if(o.length===0)throw process.exitCode=1,new Error("no views found");o.forEach(y=>{y.hasLayoutDrift&&n.warn(ee.yellow("drift detected, manual layout can not be applied, view:")+" "+ee.red(y.id))});let a=ge(i.workspace,"likec4-views.js");if(r&&(a=Ss(r)?r:ge(r),Ot(r)&&(await As(r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);const u=Rt(a);n.info(`${ee.dim("outdir")} ${u}`);const l=Nr(a);n.info(`${ee.dim("filename")} ${l}`);const c=or(l).toLocaleLowerCase();if(![".js",".mjs",
|
|
766
|
+
".jsx"].includes(c))throw n.error(`output file ${r} has extension "${c}"`),new Error(`output file ${r} must be a .js, .jsx or .mjs`);const d=await _$({languageServices:i,outDir:u,filename:l});await cr({...d,logLevel:"warn"});const h=await i.layoutedModel();await Ct(ge(u,Nr(a,c)+(c===".mjs"?".d.mts":".d.ts")),zh(h)),St($s(`
|
|
767
|
+
${ee.dim("Source generated:")}
|
|
768
|
+
${At(vs(),a)}
|
|
769
|
+
|
|
770
|
+
${ee.dim("How to use:")}
|
|
771
|
+
${ee.underline("https://likec4.dev/tooling/code-generation/react/")}
|
|
772
|
+
`),{padding:2,borderColor:"green",borderStyle:"round"}),s.stopAndLog()}async function v$({path:t,useDotBin:e,webcomponentPrefix:r="likec4",outfile:n}){const s=tt("c4:codegen"),i=sr(s),o=await rt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});o.ensureSingleProject(),s.info(`${ee.dim("format")} ${ee.green("webcomponent")}`);const a=await o.diagrams();if(!Zo(a,1))throw s.warn("no views found"),process.exitCode=1,new Error("no views found");a.forEach(b=>{b.hasLayoutDrift&&s.warn(ee.yellow(
|
|
773
|
+
"drift detected, manual layout can not be applied, view:")+" "+ee.red(b.id))});let u=ge(o.workspace,"likec4-views.js");if(n&&(u=Ss(n)?n:ge(n),Ot(n)&&(await As(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);at.debug(`${ee.dim("outfilepath")} ${u}`);const l=Nr(u);at.debug(`${ee.dim("filename")} ${l}`);const c=or(l).toLocaleLowerCase();if(c!==".js"&&c!==".mjs")throw at.warn(`output file ${n} has extension "${c}"`),new Error(`output file ${n} must be a .js or .mjs`);const d=await Js();
|
|
774
|
+
at.debug(`${ee.dim("created temp public")} ${d}`);const h=await vi({languageServices:o,outDir:d,filename:l,webcomponentPrefix:r,base:"/"});at.debug(`${ee.dim("vite build webcomponent")}`),await cr({...h,logLevel:"warn"});const y=ge(d,l);if(!Ot(y))throw new Error(`output file not found: ${y}`);await ct(Rt(u),{recursive:!0}),await Mh(y,u),s.info(`${ee.dim("generated")} ${u}`),at.debug(`${ee.dim("remove temp public")}`),await kh(d,{recursive:!0,force:!0}),St($s(`
|
|
775
|
+
${ee.dim("Webcomponents generated to:")}
|
|
776
|
+
${At(vs(),u)}
|
|
777
|
+
|
|
778
|
+
${ee.dim("Setup and usage instructions:")}
|
|
779
|
+
${ee.blue("https://likec4.dev/tooling/code-generation/webcomponent/")}
|
|
780
|
+
`)),i.stopAndLog()}const b$={command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:t=>t.positional("path",br).command("react [path]","generate react component to render likec4 view",e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:Ue}).option("use-dot",Ye),async e=>{await $$({useDotBin:e.useDotBin,path:e.path,outfile:e.outfile})}).command({command:"w\
|
|
781
|
+
ebcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:Ue}).option("webcomponent-prefix",Ws).option("use-dot",Ye),handler:async e=>{await v$({useDotBin:e.useDotBin,path:e.path,outfile:e.outfile,webcomponentPrefix:e.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:e=>e.option("\
|
|
782
|
+
outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:Ue}).option("use-dot",Ye),handler:async e=>{await y$({path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).command({command:"views-data [path]",aliases:["views"],describe:"generate likec4 views data (.ts)",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:Ue}).option("use-dot",Ye),handler:async e=>{await gs({format:"views",path:e.path,useDotBin:e.
|
|
783
|
+
useDotBin,outfile:e.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:e=>e.option("outdir",Wr).option("use-dot",Ye),handler:async e=>{await gs({format:"dot",path:e.path,useDotBin:e.useDotBin,outdir:e.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:e=>e.option("outdir",Wr).option("use-dot",Ye),handler:async e=>{await gs({format:"d2",path:e.path,useDotBin:e.useDotBin,outdir:e.outdir})}}).command({command:"mermaid [path]",
|
|
784
|
+
aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:e=>e.option("outdir",Wr).option("use-dot",Ye),handler:async e=>{await gs({format:"mermaid",useDotBin:e.useDotBin,path:e.path,outdir:e.outdir})}}).epilog(`${ee.bold("Examples:")}
|
|
1170
785
|
likec4 gen react -o dist/likec4-views.mjs ./src/likec4
|
|
1171
786
|
likec4 gen model -o likec4-model.ts
|
|
1172
787
|
likec4 gen webcomponent -o likec4.js --webcomponent-prefix c4 --use-dot-bin ./src
|
|
@@ -1174,28 +789,28 @@ aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:e=>e.option("ou
|
|
|
1174
789
|
likec4 gen ts --outfile ../likec4.ts
|
|
1175
790
|
likec4 gen mmd --outdir assets/
|
|
1176
791
|
likec4 gen dot -o out .
|
|
1177
|
-
`),handler:()=>{}};async function
|
|
1178
|
-
bold("Usage:")} $0 export <format> [path]`).positional("path",
|
|
1179
|
-
t",desc:"(sec) timeout for playwright ",default:10},"max-attempts":{type:"number",describe:"",desc:"(number) max attempts to export failing view",default:3},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server"}}).epilog(`${
|
|
1180
|
-
${
|
|
1181
|
-
${
|
|
1182
|
-
|
|
1183
|
-
${
|
|
1184
|
-
${
|
|
1185
|
-
`),handler:async e=>{
|
|
1186
|
-
n",normalize:!0,coerce:
|
|
1187
|
-
${
|
|
1188
|
-
${
|
|
1189
|
-
|
|
1190
|
-
${
|
|
1191
|
-
${
|
|
1192
|
-
`),handler:async e=>{await
|
|
1193
|
-
logger:"vite"}),
|
|
1194
|
-
if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"},listen:{alias:"l",type:"string",desc:"ip address of the network interface to listen on"}}).coerce(["path","output"],
|
|
1195
|
-
useHashHistory:n,useOverview:
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
"
|
|
1200
|
-
|
|
1201
|
-
|
|
792
|
+
`),handler:()=>{}};async function w$({path:t,useDotBin:e,outfile:r}){const n=tt("c4:export"),s=sr(n),i=await rt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});i.ensureSingleProject();const o=await i.layoutedModel();or(r)!==".json"&&(r=r+".json"),await ct(Rt(r),{recursive:!0});const a=JSON.stringify(o.$model,null,2);await Ct(r,a),n.info(`${ee.dim("generated")} ${At(process.cwd(),r)}`),s.stopAndLog("\u2713 export in ")}const E$={command:"export <format> [path]",describe:"Export to ima\
|
|
793
|
+
ges or JSON",builder:t=>t.usage(`${ee.bold("Usage:")} $0 export <format> [path]`).positional("path",br).command({command:"png [path]",describe:"export views to PNG",builder:e=>e.option("output",Wr).option("theme",{choices:["light","dark"],desc:"color-scheme to use, default is light"}).option("flat",{boolean:!0,type:"boolean",desc:"ignore sources structure and export all PNGs in output directory"}).option("use-dot",Ye).options({ignore:{boolean:!0,alias:"i",desc:"continue if some views failed to e\
|
|
794
|
+
xport"},timeout:{type:"number",alias:"t",desc:"(sec) timeout for playwright ",default:10},"max-attempts":{type:"number",describe:"",desc:"(number) max attempts to export failing view",default:3},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server"}}).epilog(`${ee.bold("Examples:")}
|
|
795
|
+
${ee.green("$0 export png")}
|
|
796
|
+
${ee.gray("Search for likec4 files in current directory and output PNG next to sources")}
|
|
797
|
+
|
|
798
|
+
${ee.green("$0 export png --theme dark -o ./png src/likec4 ")}
|
|
799
|
+
${ee.gray("Search for likec4 files in src/likec4 and output PNG with dark theme to png folder")}
|
|
800
|
+
`),handler:async e=>{Cs(e.timeout>=1,"timeout must be >= 1"),Cs(e["max-attempts"]>=1,"max-attempts must be >= 1"),await Sc({path:e.path,useDotBin:e.useDotBin,output:e.output,timeoutMs:e.timeout*1e3,maxAttempts:e.maxAttempts,ignore:e.ignore===!0,outputType:e.flat?"flat":"relative",serverUrl:e.serverUrl,theme:e.theme??"light"})}}).command({command:"json [path]",describe:"export model to JSON",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.jso\
|
|
801
|
+
n",normalize:!0,coerce:ge}).option("use-dot",Ye).epilog(`${ee.bold("Examples:")}
|
|
802
|
+
${ee.green("$0 export json")}
|
|
803
|
+
${ee.gray("Search for likec4 files in current directory and output JSON to likec4.json")}
|
|
804
|
+
|
|
805
|
+
${ee.green("$0 export json -o ./generated/likec4.json src/likec4 ")}
|
|
806
|
+
${ee.gray("Search for likec4 files in src/likec4 and output JSON to generated/likec4.json")}
|
|
807
|
+
`),handler:async e=>{await w$({path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).updateStrings({"Commands:":ee.bold("Formats:")}),handler:()=>{}};async function S$(t){const{isDev:e,...r}=await $i({...t,likec4AssetsDir:"",webcomponentPrefix:void 0}),n=await bi({port:Zr(62001,62010)}),s=t?.open??!1;return await Gh({...r,mode:"production",preview:{host:t.listen??"127.0.0.1",allowedHosts:!0,port:n,open:s}})}async function R$({path:t,output:e,base:r,listen:n}){const s=await rt.fromWorkspace(t,
|
|
808
|
+
{logger:"vite"}),i=await S$({base:r,languageServices:s,outputDir:e,open:!0,listen:n});_c(i)}const A$={command:"preview [path]",describe:"Start local server to preview production build",builder:t=>t.positional("path",{type:"string",desc:`Directory with LikeC4 source files
|
|
809
|
+
if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"},listen:{alias:"l",type:"string",desc:"ip address of the network interface to listen on"}}).coerce(["path","output"],Ue).default("path",Ue("."),".").default("listen","127.0.0.1","localhost"),async handler(t){await R$(t)}};async function O$({path:t,useDotBin:e,webcomponentPrefix:r,
|
|
810
|
+
useHashHistory:n,useOverview:s=!1,base:i,listen:o}){process.env.NODE_ENV="development";const a=await rt.fromWorkspace(t,{graphviz:e?"binary":"wasm"}),u=await Tr(ir(jr(),".likec4-assets-")),l=await wc({buildWebcomponent:!0,hmr:!0,base:i,webcomponentPrefix:r,languageServices:a,useHashHistory:n,useOverviewGraph:s,likec4AssetsDir:u,listen:o});if(l.config.logger.clearScreen("info"),_c(l),!s)return;const c=await a.diagrams();if(Zo(c,1)){const d=tt("c4:export"),h=yc(l);if(!h){d.error("no preview server\
|
|
811
|
+
url");return}d.info(ee.cyan("wait 5sec before generating previews")),await ca(5e3);try{await Ec({serverUrl:h,logger:d,views:c,theme:"light",output:u,outputType:"flat"}),await ca(1e3),d.info(ee.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(y){d.error(ee.red("Failed to generate previews")),d.error(y)}}else l.config.logger.warn("no views found, no previews generated")}const C$={command:"start [path]",aliases:["serve","dev"],describe:"Start local dev \
|
|
812
|
+
server to preview LikeC4 views",builder:t=>t.positional("path",br).option("base",Ka).option("webcomponent-prefix",Ws).option("use-hash-history",Wa).option("use-overview",Ya).option("use-dot",Ye).option("listen",Zp),handler:async t=>{await O$({path:t.path,useDotBin:t["use-dot"],base:t.base,useOverview:t["use-overview"]??!1,webcomponentPrefix:t["webcomponent-prefix"],useHashHistory:t["use-hash-history"],listen:t.listen})}};async function P$({path:t,ignoreLayout:e}){const r=await rt.fromWorkspace(t,
|
|
813
|
+
{logger:"vite"}),n=tt("c4:views");let s=!0;return s=await i(r)&&s,s=(e||await o(r,n))&&s,s?0:ea(1);function i(a){return a.getErrors().length===0}async function o(a,u){const l=await a.diagrams();let c=!1;for(const d of l)d.hasLayoutDrift===!0&&(c=!0,u.error(ee.red(`Layout drift detected on view '${d.id}' at ${ge(t,d.relativePath??".")}`)));return!c}}const I$={command:"validate [path]",aliases:[],describe:"Validate model syntax and manual layout",builder:t=>t.positional("path",br).option("ignore-l\
|
|
814
|
+
ayout",{alias:["skip-layout"],boolean:!0,default:!1,description:"do not validate layout of views"}),handler:async t=>{await P$({path:t.path,ignoreLayout:t["ignore-layout"]})}};async function N$(){return await bh({sinks:{console:wh()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:"info"}]}),f$(),await Jp(gp(Rh)).scriptName("likec4").usage("Usage: $0 <command>").command(C$).command(Lm).command(b$).command(E$).command(A$).command(I$).command({command:"check-update",describe:"Check for u\
|
|
815
|
+
pdates",handler:async()=>{await d$()}}).help("help").version(Vt).alias("v","version").alias("h","help").demandCommand(1,"Please run with valid command").strict().recommendCommands().showHelpOnFail(!0,"Something is wrong, run with --help").updateStrings({"Options:":ee.bold("Options:"),"Positionals:":ee.bold("Arguments:"),"Commands:":ee.bold("Commands:"),"Examples:":ee.bold("Examples:")}).wrap(Xo(Sh.columns-20,{min:80,max:120})).parseAsync()}N$().catch(()=>{ea(1)}),process.on("unhandledRejection",
|
|
816
|
+
t=>{console.error("Unhandled rejection",t)});
|