likec4 1.42.1 → 1.44.0
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__/src/likec4.js +5251 -5644
- package/__app__/src/main.js +64 -46
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +6533 -27430
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +150 -265
- package/dist/cli/index.mjs +536 -534
- package/dist/config/index.d.mts +1 -1
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.CaOUU1HJ.d.mts → likec4.97TpL3Hf.d.mts} +10903 -2490
- package/dist/shared/{likec4.D51sTGt6.mjs → likec4.BSr9pG1Z.mjs} +2489 -2502
- package/dist/shared/{likec4.BEwUtMsL.mjs → likec4.CXaeDwoC.mjs} +1 -1
- package/dist/shared/likec4.CyRRoRaV.d.mts +4040 -0
- package/dist/shared/likec4.H8IcXBiE.mjs +177 -0
- package/dist/vite-plugin/index.d.mts +3 -3
- package/dist/vite-plugin/index.mjs +1 -1
- package/package.json +40 -39
- package/react/index.d.ts +3687 -1751
- package/react/index.js +8061 -4772
- package/dist/shared/likec4.B5Q51Z1F.mjs +0 -543
- package/dist/shared/likec4.BCSBNe4z.d.mts +0 -6808
package/dist/cli/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as Te,r as
|
|
3
|
-
import{b as Uo,t as Fo,a as
|
|
4
|
-
fileURLToPath as
|
|
5
|
-
import Pt from"node:crypto";import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{cwd:e})}const
|
|
2
|
+
import{h as Te,r as Tf,k as tt,l as mn,m as wt,u as j,w as No,o as Nf,p as Of,q as Ae,s as Oo,v as Mt,x as We,y as If,d as Io,z as jo,A as jf,c as Lf,L as Pe,B as Df,j as Lo,C as qf,D as Do,E as De,F as xf,G as Mf,e as Hf,H as at,U as yn,I as it,J as gn,K as vn,M as qo,Q as xo}from"../shared/likec4.BSr9pG1Z.mjs";import se,{existsSync as He,copyFileSync as Mo,readdirSync as Uf,rmSync as $n,statSync as Ff}from"node:fs";import me,{hrtime as Vf,cwd as Ht,exit as Ho,argv as zf,stdout as Gf}from"node:process";
|
|
3
|
+
import{b as Uo,t as Fo,a as Bf,d as bt}from"../shared/likec4.CB2-Uaub.mjs";import{env as Vo,isMinimal as Kf,nodeENV as Wf,isDevelopment as Xf}from"std-env";import Jf from"yargs";import{hideBin as Yf}from"yargs/helpers";import ie,{resolve as oe,dirname as qe,join as Et,relative as Ue,sep as zo,extname as St,isAbsolute as _n,basename as Ut}from"node:path";import Go,{mkdtemp as Ft,writeFile as Xe,mkdir as xe,stat as wn,copyFile as Qf,rm as Zf}from"node:fs/promises";import Rt,{tmpdir as Vt}from"node:os";
|
|
4
|
+
import{fileURLToPath as Bo}from"node:url";import bn from"@vitejs/plugin-react";import Ko from"util";import En,{resolve as ct}from"path";import{j as Wo,e as Xo,C as ed,t as Jo,N as ut,L as Sn,g as td,a as rd,b as nd}from"../shared/likec4.CXaeDwoC.mjs";import{build as At,createServer as sd,preview as od}from"vite";import ad from"node:module";import id from"node:net";import{setTimeout as cd}from"node:timers/promises";import{invariant as Rn,nonexhaustive as An}from"@likec4/core";import{promisify as ve,
|
|
5
|
+
isDeepStrictEqual as ud}from"node:util";import Pt from"node:crypto";import ld from"node:assert";import{b as lt}from"../shared/likec4.H8IcXBiE.mjs";import{isDeploymentRelationModel as fd,isRelationModel as dd,isDeploymentElementModel as pd,isLikeC4ViewModel as hd,isElementModel as md}from"@likec4/core/model";import{compareNatural as yd,sortNaturalByFqn as gd,invariant as vd,delay as Yo}from"@likec4/core/utils";let Pn;function $d(){try{return se.statSync("/.dockerenv"),!0}catch{return!1}}function _d(){
|
|
6
|
+
try{return se.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function wd(){return Pn===void 0&&(Pn=$d()||_d()),Pn}let Cn;const bd=()=>{try{return se.statSync("/run/.containerenv"),!0}catch{return!1}};function Fe(){return Cn===void 0&&(Cn=bd()||wd()),Cn}const be={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:oe},Re={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:Fe()?"enabled in container, disab\
|
|
7
|
+
le by --no-use-dot":'use graphviz binaries ("dot" should be on PATH)',default:Fe()},Qo={boolean:!0,type:"boolean",desc:"use `@likec4/core` package in types",default:!1},Zo={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},zt={alias:"o",type:"string",desc:"output directory",normalize:!0,nargs:1,coerce:oe},kn={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4",nargs:1},ea={alias:"t",type:"st\
|
|
8
|
+
ring",desc:'base title of the app pages (default is "LikeC4")',default:"LikeC4",nargs:1},ta={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"',nargs:1},Ed={boolean:!0,type:"boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},Sd={alias:"l",type:"string",desc:Fe()?"listen 0.0.0.0 by default in container":"ip address of the network interface to listen on",default:Fe()?"0.0.0.0":"localhost",nargs:1},Rd={type:"\
|
|
9
|
+
number",desc:"port number for the dev server (default is 5173, or PORT environment variable)",nargs:1},Gt={alias:"p",type:"string",desc:'LikeC4 project, name eg. "my-project" or path to the project folder',nargs:1},ra=e=>e instanceof URL?Bo(e):e;function Ad(e,{cwd:t=me.cwd(),type:r="file",stopAt:n}={}){let i=ie.resolve(ra(t)??"");const{root:o}=ie.parse(i);for(n=ie.resolve(i,ra(n)??o);i&&i!==n&&i!==o;){const a=ie.isAbsolute(e)?e:ie.join(i,e);try{const s=se.statSync(a,{throwIfNoEntry:!1});if(r==="\
|
|
10
|
+
file"&&s?.isFile()||r==="directory"&&s?.isDirectory())return a}catch{}i=ie.dirname(i)}}function Pd({cwd:e=me.cwd()}={}){return Ad("package.json",{cwd:e})}const Cd=Te("vite"),Bt=qe(Bo(import.meta.url)),kd=`
|
|
11
11
|
/* prettier-ignore-start */
|
|
12
12
|
/* eslint-disable */
|
|
13
13
|
|
|
@@ -16,68 +16,68 @@ roject, name eg. "my-project" or path to the project folder',nargs:1},ta=e=>e in
|
|
|
16
16
|
* DO NOT EDIT MANUALLY!
|
|
17
17
|
******************************************************************************/
|
|
18
18
|
|
|
19
|
-
`.trimStart(),
|
|
19
|
+
`.trimStart(),Td=`
|
|
20
20
|
|
|
21
21
|
/* prettier-ignore-end */
|
|
22
|
-
`,Tn={banner:
|
|
22
|
+
`,Tn={banner:kd,footer:Td};function na(){const e=Pd({cwd:Bt});if(!e)throw new Error("likec4 package folder not found");return qe(e)}function Nn(){const e=na(),t=[oe(e,"__app__"),oe(Bt,"../__app__"),oe(Bt,"../../__app__"),oe(Bt,"../../dist/__app__")],r=Tf(t,He);if(!r)throw tt.error(`likec4 app root does not exist, tried:
|
|
23
23
|
${t.join(`
|
|
24
24
|
`)}`),new Error("likec4 app root does not exist");return r}async function On(){const e=await Ft(Et(Vt(),".likec4-public-"));return await Xe(Et(e,"likec4-views.js"),`// generated by likec4
|
|
25
|
-
`),e}const In=1e4;function jn(){const e=
|
|
25
|
+
`),e}const In=1e4;function jn(){const e=na();return{"likec4/icons":oe(e,"icons"),"likec4/react":oe(e,"react/index.js"),"likec4/model":oe(e,"dist/model/index.mjs"),"likec4/vite-plugin/internal":oe(e,"dist/vite-plugin/internal.mjs")}}var Ln={},sa;function Dn(){return sa||(sa=1,(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,r)=>t.nodes.find(n=>n.type===r),e.exceedsLimit=(t,r,n=1,i)=>i===!1||!e.isInteger(t)||
|
|
26
26
|
!e.isInteger(r)?!1:(Number(r)-Number(t))/Number(n)>=i,e.escapeNode=(t,r=0,n)=>{const i=t.nodes[r];i&&(n&&i.type===n||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1,e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===
|
|
27
|
-
!0||t.close===!0,e.reduce=t=>t.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&(n.type="text"),r),[]),e.flatten=(...t)=>{const r=[],n=i=>{for(let
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
p)||S(
|
|
31
|
-
|
|
32
|
-
O),d),x="";if(!f.isPadded&&E&&E.pattern===U.pattern){E.count.length>1&&E.count.pop(),E.count.push(U.count[0]),E.string=E.pattern+y(E.count),w=O+1;continue}f.isPadded&&(x
|
|
33
|
-
return p.some(d=>d[
|
|
34
|
-
`0{0,${d}}`:`0{${d}}`}}return t.cache={},t.clearCache=()=>t.cache={},Hn=t,Hn}var Un,
|
|
35
|
-
"-"?"-":"";w&&(d=d.slice(1)),d=w+d.padStart(w?
|
|
36
|
-
`(${w}${O})`:O},
|
|
37
|
-
be a number`);return[]},p=(d,
|
|
38
|
-
abs(A)),Q=[],q=0;for(;O?E>=P:E<=P;)w.toRegex===!0
|
|
39
|
-
wrap:!1,options:w}):D},f=(d,
|
|
40
|
-
i.escapeInvalid===!0,l=u===!0||c===!0,
|
|
41
|
-
length>1?`(${S})`:S}if(
|
|
42
|
-
(
|
|
43
|
-
or disable the limit.");let
|
|
44
|
-
flatten(u(
|
|
27
|
+
!0||t.close===!0,e.reduce=t=>t.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&(n.type="text"),r),[]),e.flatten=(...t)=>{const r=[],n=i=>{for(let o=0;o<i.length;o++){const a=i[o];if(Array.isArray(a)){n(a);continue}a!==void 0&&r.push(a)}return r};return n(t),r}})(Ln)),Ln}var qn,oa;function xn(){if(oa)return qn;oa=1;const e=Dn();return qn=(t,r={})=>{const n=(i,o={})=>{const a=r.escapeInvalid&&e.isInvalidBrace(o),s=i.invalid===!0&&r.escapeInvalid===!0;let u="";if(i.value)return(a||
|
|
28
|
+
s)&&e.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const c of i.nodes)u+=n(c);return u};return n(t)},qn}var Mn,aa;function Nd(){return aa||(aa=1,Mn=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}),Mn}var Hn,ia;function Od(){if(ia)return Hn;ia=1;const e=Nd(),t=(p,h,f)=>{if(e(p)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(h===void 0||p===
|
|
29
|
+
h)return String(p);if(e(h)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let d={relaxZeros:!0,...f};typeof d.strictZeros=="boolean"&&(d.relaxZeros=d.strictZeros===!1);let v=String(d.relaxZeros),$=String(d.shorthand),w=String(d.capture),E=String(d.wrap),P=p+":"+h+"="+v+$+w+E;if(t.cache.hasOwnProperty(P))return t.cache[P].result;let O=Math.min(p,h),U=Math.max(p,h);if(Math.abs(O-U)===1){let M=p+"|"+h;return d.capture?`(${M})`:d.wrap===!1?M:`(?:${M})`}let x=S(
|
|
30
|
+
p)||S(h),H={min:p,max:h,a:O,b:U},D=[],I=[];if(x&&(H.isPadded=x,H.maxLen=String(H.max).length),O<0){let M=U<0?Math.abs(U):1;I=o(M,Math.abs(O),H,d),O=H.a=0}return U>=0&&(D=o(O,U,H,d)),H.negatives=I,H.positives=D,H.result=r(I,D),d.capture===!0?H.result=`(${H.result})`:d.wrap!==!1&&D.length+I.length>1&&(H.result=`(?:${H.result})`),t.cache[P]=H,H.result};function r(p,h,f){let d=a(p,h,"-",!1)||[],v=a(h,p,"",!1)||[],$=a(p,h,"-?",!0)||[];return d.concat($).concat(v).join("|")}function n(p,h){let f=1,d=1,
|
|
31
|
+
v=l(p,f),$=new Set([h]);for(;p<=v&&v<=h;)$.add(v),f+=1,v=l(p,f);for(v=m(h+1,d)-1;p<v&&v<=h;)$.add(v),d+=1,v=m(h+1,d)-1;return $=[...$],$.sort(u),$}function i(p,h,f){if(p===h)return{pattern:p,count:[],digits:0};let d=s(p,h),v=d.length,$="",w=0;for(let E=0;E<v;E++){let[P,O]=d[E];P===O?$+=P:P!=="0"||O!=="9"?$+=_(P,O):w++}return w&&($+=f.shorthand===!0?"\\d":"[0-9]"),{pattern:$,count:[w],digits:v}}function o(p,h,f,d){let v=n(p,h),$=[],w=p,E;for(let P=0;P<v.length;P++){let O=v[P],U=i(String(w),String(
|
|
32
|
+
O),d),x="";if(!f.isPadded&&E&&E.pattern===U.pattern){E.count.length>1&&E.count.pop(),E.count.push(U.count[0]),E.string=E.pattern+y(E.count),w=O+1;continue}f.isPadded&&(x=g(O,f,d)),U.string=x+U.pattern+y(U.count),$.push(U),w=O+1,E=U}return $}function a(p,h,f,d,v){let $=[];for(let w of p){let{string:E}=w;!d&&!c(h,"string",E)&&$.push(f+E),d&&c(h,"string",E)&&$.push(f+E)}return $}function s(p,h){let f=[];for(let d=0;d<p.length;d++)f.push([p[d],h[d]]);return f}function u(p,h){return p>h?1:h>p?-1:0}function c(p,h,f){
|
|
33
|
+
return p.some(d=>d[h]===f)}function l(p,h){return Number(String(p).slice(0,-h)+"9".repeat(h))}function m(p,h){return p-p%Math.pow(10,h)}function y(p){let[h=0,f=""]=p;return f||h>1?`{${h+(f?","+f:"")}}`:""}function _(p,h,f){return`[${p}${h-p===1?"":"-"}${h}]`}function S(p){return/^-?(0+)\d/.test(p)}function g(p,h,f){if(!h.isPadded)return p;let d=Math.abs(h.maxLen-String(p).length),v=f.relaxZeros!==!1;switch(d){case 0:return"";case 1:return v?"0?":"0";case 2:return v?"0{0,2}":"00";default:return v?
|
|
34
|
+
`0{0,${d}}`:`0{${d}}`}}return t.cache={},t.clearCache=()=>t.cache={},Hn=t,Hn}var Un,ca;function ua(){if(ca)return Un;ca=1;const e=Ko,t=Od(),r=d=>d!==null&&typeof d=="object"&&!Array.isArray(d),n=d=>v=>d===!0?Number(v):String(v),i=d=>typeof d=="number"||typeof d=="string"&&d!=="",o=d=>Number.isInteger(+d),a=d=>{let v=`${d}`,$=-1;if(v[0]==="-"&&(v=v.slice(1)),v==="0")return!1;for(;v[++$]==="0";);return $>0},s=(d,v,$)=>typeof d=="string"||typeof v=="string"?!0:$.stringify===!0,u=(d,v,$)=>{if(v>0){let w=d[0]===
|
|
35
|
+
"-"?"-":"";w&&(d=d.slice(1)),d=w+d.padStart(w?v-1:v,"0")}return $===!1?String(d):d},c=(d,v)=>{let $=d[0]==="-"?"-":"";for($&&(d=d.slice(1),v--);d.length<v;)d="0"+d;return $?"-"+d:d},l=(d,v,$)=>{d.negatives.sort((U,x)=>U<x?-1:U>x?1:0),d.positives.sort((U,x)=>U<x?-1:U>x?1:0);let w=v.capture?"":"?:",E="",P="",O;return d.positives.length&&(E=d.positives.map(U=>c(String(U),$)).join("|")),d.negatives.length&&(P=`-(${w}${d.negatives.map(U=>c(String(U),$)).join("|")})`),E&&P?O=`${E}|${P}`:O=E||P,v.wrap?
|
|
36
|
+
`(${w}${O})`:O},m=(d,v,$,w)=>{if($)return t(d,v,{wrap:!1,...w});let E=String.fromCharCode(d);if(d===v)return E;let P=String.fromCharCode(v);return`[${E}-${P}]`},y=(d,v,$)=>{if(Array.isArray(d)){let w=$.wrap===!0,E=$.capture?"":"?:";return w?`(${E}${d.join("|")})`:d.join("|")}return t(d,v,$)},_=(...d)=>new RangeError("Invalid range arguments: "+e.inspect(...d)),S=(d,v,$)=>{if($.strictRanges===!0)throw _([d,v]);return[]},g=(d,v)=>{if(v.strictRanges===!0)throw new TypeError(`Expected step "${d}" to\
|
|
37
|
+
be a number`);return[]},p=(d,v,$=1,w={})=>{let E=Number(d),P=Number(v);if(!Number.isInteger(E)||!Number.isInteger(P)){if(w.strictRanges===!0)throw _([d,v]);return[]}E===0&&(E=0),P===0&&(P=0);let O=E>P,U=String(d),x=String(v),H=String($);$=Math.max(Math.abs($),1);let D=a(U)||a(x)||a(H),I=D?Math.max(U.length,x.length,H.length):0,M=D===!1&&s(d,v,w)===!1,z=w.transform||n(M);if(w.toRegex&&$===1)return m(c(d,I),c(v,I),!0,w);let F={negatives:[],positives:[]},G=A=>F[A<0?"negatives":"positives"].push(Math.
|
|
38
|
+
abs(A)),Q=[],q=0;for(;O?E>=P:E<=P;)w.toRegex===!0&&$>1?G(E):Q.push(u(z(E,q),I,M)),E=O?E-$:E+$,q++;return w.toRegex===!0?$>1?l(F,w,I):y(Q,null,{wrap:!1,...w}):Q},h=(d,v,$=1,w={})=>{if(!o(d)&&d.length>1||!o(v)&&v.length>1)return S(d,v,w);let E=w.transform||(M=>String.fromCharCode(M)),P=`${d}`.charCodeAt(0),O=`${v}`.charCodeAt(0),U=P>O,x=Math.min(P,O),H=Math.max(P,O);if(w.toRegex&&$===1)return m(x,H,!1,w);let D=[],I=0;for(;U?P>=O:P<=O;)D.push(E(P,I)),P=U?P-$:P+$,I++;return w.toRegex===!0?y(D,null,{
|
|
39
|
+
wrap:!1,options:w}):D},f=(d,v,$,w={})=>{if(v==null&&i(d))return[d];if(!i(d)||!i(v))return S(d,v,w);if(typeof $=="function")return f(d,v,1,{transform:$});if(r($))return f(d,v,0,$);let E={...w};return E.capture===!0&&(E.wrap=!0),$=$||E.step||1,o($)?o(d)&&o(v)?p(d,v,$,E):h(d,v,Math.max(Math.abs($),1),E):$!=null&&!r($)?g($,E):f(d,v,1,$)};return Un=f,Un}var Fn,la;function Id(){if(la)return Fn;la=1;const e=ua(),t=Dn();return Fn=(n,i={})=>{const o=(a,s={})=>{const u=t.isInvalidBrace(s),c=a.invalid===!0&&
|
|
40
|
+
i.escapeInvalid===!0,l=u===!0||c===!0,m=i.escapeInvalid===!0?"\\":"";let y="";if(a.isOpen===!0)return m+a.value;if(a.isClose===!0)return console.log("node.isClose",m,a.value),m+a.value;if(a.type==="open")return l?m+a.value:"(";if(a.type==="close")return l?m+a.value:")";if(a.type==="comma")return a.prev.type==="comma"?"":l?a.value:"|";if(a.value)return a.value;if(a.nodes&&a.ranges>0){const _=t.reduce(a.nodes),S=e(..._,{...i,wrap:!1,toRegex:!0,strictZeros:!0});if(S.length!==0)return _.length>1&&S.
|
|
41
|
+
length>1?`(${S})`:S}if(a.nodes)for(const _ of a.nodes)y+=o(_,a);return y};return o(n)},Fn}var Vn,fa;function jd(){if(fa)return Vn;fa=1;const e=ua(),t=xn(),r=Dn(),n=(o="",a="",s=!1)=>{const u=[];if(o=[].concat(o),a=[].concat(a),!a.length)return o;if(!o.length)return s?r.flatten(a).map(c=>`{${c}}`):a;for(const c of o)if(Array.isArray(c))for(const l of c)u.push(n(l,a,s));else for(let l of a)s===!0&&typeof l=="string"&&(l=`{${l}}`),u.push(Array.isArray(l)?n(c,l,s):c+l);return r.flatten(u)};return Vn=
|
|
42
|
+
(o,a={})=>{const s=a.rangeLimit===void 0?1e3:a.rangeLimit,u=(c,l={})=>{c.queue=[];let m=l,y=l.queue;for(;m.type!=="brace"&&m.type!=="root"&&m.parent;)m=m.parent,y=m.queue;if(c.invalid||c.dollar){y.push(n(y.pop(),t(c,a)));return}if(c.type==="brace"&&c.invalid!==!0&&c.nodes.length===2){y.push(n(y.pop(),["{}"]));return}if(c.nodes&&c.ranges>0){const p=r.reduce(c.nodes);if(r.exceedsLimit(...p,a.step,s))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase\
|
|
43
|
+
or disable the limit.");let h=e(...p,a);h.length===0&&(h=t(c,a)),y.push(n(y.pop(),h)),c.nodes=[];return}const _=r.encloseBrace(c);let S=c.queue,g=c;for(;g.type!=="brace"&&g.type!=="root"&&g.parent;)g=g.parent,S=g.queue;for(let p=0;p<c.nodes.length;p++){const h=c.nodes[p];if(h.type==="comma"&&c.type==="brace"){p===1&&S.push(""),S.push("");continue}if(h.type==="close"){y.push(n(y.pop(),S,_));continue}if(h.value&&h.type!=="open"){S.push(n(S.pop(),h.value));continue}h.nodes&&u(h,c)}return S};return r.
|
|
44
|
+
flatten(u(o))},Vn}var zn,da;function Ld(){return da||(da=1,zn={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"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:"\
|
|
45
45
|
\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
46
|
-
`,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"}),zn}var Gn,
|
|
47
|
-
CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:
|
|
48
|
-
let E
|
|
49
|
-
I();continue}if(z===
|
|
50
|
-
type:"brace",open:!0,close:!1,dollar:P.value&&P.value.slice(-1)==="$"||E.dollar===!0,depth:H,commas:0,ranges:0,nodes:[]};E=M(F),w.push(E),M({type:"open",value:D});continue}if(D===c){if(E.type!=="brace"){M({type:"text",value:D});continue}const z="close";E=w.pop(),E.close=!0,M({type:z,value:D}),H--,E=w[w.length-1];continue}if(D===i&&H>0){if(E.ranges>0){E.ranges=0;const z=E.nodes.shift();E.nodes=[z,{type:"text",value:e(E)}]}M({type:"comma",value:D}),E.commas++;continue}if(D===
|
|
46
|
+
`,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"}),zn}var Gn,pa;function Dd(){if(pa)return Gn;pa=1;const e=xn(),{MAX_LENGTH:t,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:i,CHAR_DOT:o,CHAR_LEFT_PARENTHESES:a,CHAR_RIGHT_PARENTHESES:s,
|
|
47
|
+
CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:m,CHAR_DOUBLE_QUOTE:y,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:S,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=Ld();return Gn=(h,f={})=>{if(typeof h!="string")throw new TypeError("Expected a string");const d=f||{},v=typeof d.maxLength=="number"?Math.min(t,d.maxLength):t;if(h.length>v)throw new SyntaxError(`Input length (${h.length}), exceeds max characters (${v})`);const $={type:"root",input:h,nodes:[]},w=[$];
|
|
48
|
+
let E=$,P=$,O=0;const U=h.length;let x=0,H=0,D;const I=()=>h[x++],M=z=>{if(z.type==="text"&&P.type==="dot"&&(P.type="text"),P&&P.type==="text"&&z.type==="text"){P.value+=z.value;return}return E.nodes.push(z),z.parent=E,z.prev=P,P=z,z};for(M({type:"bos"});x<U;)if(E=w[w.length-1],D=I(),!(D===g||D===S)){if(D===r){M({type:"text",value:(f.keepEscaping?D:"")+I()});continue}if(D===m){M({type:"text",value:"\\"+D});continue}if(D===l){O++;let z;for(;x<U&&(z=I());){if(D+=z,z===l){O++;continue}if(z===r){D+=
|
|
49
|
+
I();continue}if(z===m&&(O--,O===0))break}M({type:"text",value:D});continue}if(D===a){E=M({type:"paren",nodes:[]}),w.push(E),M({type:"text",value:D});continue}if(D===s){if(E.type!=="paren"){M({type:"text",value:D});continue}E=w.pop(),M({type:"text",value:D}),E=w[w.length-1];continue}if(D===y||D===_||D===n){const z=D;let F;for(f.keepQuotes!==!0&&(D="");x<U&&(F=I());){if(F===r){D+=F+I();continue}if(F===z){f.keepQuotes===!0&&(D+=F);break}D+=F}M({type:"text",value:D});continue}if(D===u){H++;const F={
|
|
50
|
+
type:"brace",open:!0,close:!1,dollar:P.value&&P.value.slice(-1)==="$"||E.dollar===!0,depth:H,commas:0,ranges:0,nodes:[]};E=M(F),w.push(E),M({type:"open",value:D});continue}if(D===c){if(E.type!=="brace"){M({type:"text",value:D});continue}const z="close";E=w.pop(),E.close=!0,M({type:z,value:D}),H--,E=w[w.length-1];continue}if(D===i&&H>0){if(E.ranges>0){E.ranges=0;const z=E.nodes.shift();E.nodes=[z,{type:"text",value:e(E)}]}M({type:"comma",value:D}),E.commas++;continue}if(D===o&&H>0&&E.commas===0){
|
|
51
51
|
const z=E.nodes;if(H===0||z.length===0){M({type:"text",value:D});continue}if(P.type==="dot"){if(E.range=[],P.value+=D,P.type="range",E.nodes.length!==3&&E.nodes.length!==5){E.invalid=!0,E.ranges=0,P.type="text";continue}E.ranges++,E.args=[];continue}if(P.type==="range"){z.pop();const F=z[z.length-1];F.value+=P.value+D,P=F,E.ranges--;continue}M({type:"dot",value:D});continue}M({type:"text",value:D})}do if(E=w.pop(),E.type!=="root"){E.nodes.forEach(G=>{G.nodes||(G.type==="open"&&(G.isOpen=!0),G.type===
|
|
52
|
-
"close"&&(G.isClose=!0),G.nodes||(G.type="text"),G.invalid=!0)});const z=w[w.length-1],F=z.nodes.indexOf(E);z.nodes.splice(F,1,...E.nodes)}while(w.length>0);return M({type:"eos"})
|
|
53
|
-
|
|
54
|
-
=.)",u="[^/]",c=`(?:${
|
|
55
|
-
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`},
|
|
52
|
+
"close"&&(G.isClose=!0),G.nodes||(G.type="text"),G.invalid=!0)});const z=w[w.length-1],F=z.nodes.indexOf(E);z.nodes.splice(F,1,...E.nodes)}while(w.length>0);return M({type:"eos"}),$},Gn}var Bn,ha;function qd(){if(ha)return Bn;ha=1;const e=xn(),t=Id(),r=jd(),n=Dd(),i=(o,a={})=>{let s=[];if(Array.isArray(o))for(const u of o){const c=i.create(u,a);Array.isArray(c)?s.push(...c):s.push(c)}else s=[].concat(i.create(o,a));return a&&a.expand===!0&&a.nodupes===!0&&(s=[...new Set(s)]),s};return i.parse=(o,a={})=>n(
|
|
53
|
+
o,a),i.stringify=(o,a={})=>e(typeof o=="string"?i.parse(o,a):o,a),i.compile=(o,a={})=>(typeof o=="string"&&(o=i.parse(o,a)),t(o,a)),i.expand=(o,a={})=>{typeof o=="string"&&(o=i.parse(o,a));let s=r(o,a);return a.noempty===!0&&(s=s.filter(Boolean)),a.nodupes===!0&&(s=[...new Set(s)]),s},i.create=(o,a={})=>o===""||o.length<3?[o]:a.expand!==!0?i.compile(o,a):i.expand(o,a),Bn=i,Bn}var Kn={},Wn,ma;function Kt(){if(ma)return Wn;ma=1;const e=En,t="\\\\/",r=`[^${t}]`,n="\\.",i="\\+",o="\\?",a="\\/",s="(?\
|
|
54
|
+
=.)",u="[^/]",c=`(?:${a}|$)`,l=`(?:^|${a})`,m=`${n}{1,2}${c}`,y=`(?!${n})`,_=`(?!${l}${m})`,S=`(?!${n}{0,1}${c})`,g=`(?!${m})`,p=`[^.${a}]`,h=`${u}*?`,f={DOT_LITERAL:n,PLUS_LITERAL:i,QMARK_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:s,QMARK:u,END_ANCHOR:c,DOTS_SLASH:m,NO_DOT:y,NO_DOTS:_,NO_DOT_SLASH:S,NO_DOTS_SLASH:g,QMARK_NO_DOT:p,STAR:h,START_ANCHOR:l},d={...f,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,
|
|
55
|
+
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`},v={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 Wn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:v,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
|
|
56
56
|
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,
|
|
57
57
|
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,
|
|
58
|
-
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:e.sep,extglobChars(
|
|
59
|
-
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:
|
|
60
|
-
|
|
61
|
-
if(
|
|
62
|
-
U=[];let x=d,H=-1,D=0,I=0,M=!1,z=!1,F=!1,G=!1,Q=!1,q=!1,A=!1,L=!1,T=!1,R=!1,b=0,C,B,K={value:"",depth:0,isGlob:!1};const ee=()=>H>=w,re=()=>x.charCodeAt(H+1),k=()=>(C=B,x.charCodeAt(++H));for(;H<w;){B=k();let J;if(B===n){A=K.backslashes=!0,B=k(),B===u&&(q=!0);continue}if(q===!0||B===u){for(b++;ee()!==!0&&(B=k());){if(B===n){A=K.backslashes=!0,k();continue}if(B===u){b++;continue}if(q!==!0&&B===
|
|
63
|
-
!0,F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===_&&(b--,b===0)){q=!1,M=K.isBrace=!0,R=!0;break}}if(E===!0)continue;break}if(B===
|
|
64
|
-
break}if(B===t){if(C===t&&(Q=K.isGlobstar=!0),F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===y){if(F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===l){for(;ee()!==!0&&(J=k());){if(J===n){A=K.backslashes=!0,k();continue}if(J
|
|
65
|
-
continue}break}if(F===!0){if(R=!0,E===!0)continue;break}}
|
|
66
|
-
if(
|
|
67
|
-
if(
|
|
68
|
-
const y={...
|
|
69
|
-
)*?)`,G=y.dot?"":U,Q=y.dot?D:I;let q=y.bash===!0?F(y):M;y.capture&&(q=`(${q})`),typeof y.noext=="boolean"&&(y.noextglob=y.noext);const A={input:l,index:-1,start:0,dot:y.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:p};l=t.removePrefix(l,A),S=l.length;const L=[],T=[],R=[];let b
|
|
58
|
+
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:e.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?d:f}},Wn}var ya;function Wt(){return ya||(ya=1,(function(e){const t=En,r=process.
|
|
59
|
+
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:a}=Kt();e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>o.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(a,"\\$1"),e.toPosixSlashes=s=>s.replace(n,"/"),e.removeBackslashes=s=>s.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const s=process.version.slice(1).split(".").map(Number);return s.length===3&&s[0]>=9||
|
|
60
|
+
s[0]===8&&s[1]>=10},e.isWindows=s=>s&&typeof s.windows=="boolean"?s.windows:r===!0||t.sep==="\\",e.escapeLast=(s,u,c)=>{const l=s.lastIndexOf(u,c);return l===-1?s:s[l-1]==="\\"?e.escapeLast(s,u,l-1):`${s.slice(0,l)}\\${s.slice(l)}`},e.removePrefix=(s,u={})=>{let c=s;return c.startsWith("./")&&(c=c.slice(2),u.prefix="./"),c},e.wrapOutput=(s,u={},c={})=>{const l=c.contains?"":"^",m=c.contains?"":"$";let y=`${l}(?:${s})${m}`;return u.negated===!0&&(y=`(?:^(?!${y}).*$)`),y}})(Kn)),Kn}var Xn,ga;function xd(){
|
|
61
|
+
if(ga)return Xn;ga=1;const e=Wt(),{CHAR_ASTERISK:t,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:i,CHAR_DOT:o,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:s,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:m,CHAR_QUESTION_MARK:y,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:S,CHAR_RIGHT_SQUARE_BRACKET:g}=Kt(),p=d=>d===s||d===n,h=d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)};return Xn=(d,v)=>{const $=v||{},w=d.length-1,E=$.parts===!0||$.scanToEnd===!0,P=[],O=[],
|
|
62
|
+
U=[];let x=d,H=-1,D=0,I=0,M=!1,z=!1,F=!1,G=!1,Q=!1,q=!1,A=!1,L=!1,T=!1,R=!1,b=0,C,B,K={value:"",depth:0,isGlob:!1};const ee=()=>H>=w,re=()=>x.charCodeAt(H+1),k=()=>(C=B,x.charCodeAt(++H));for(;H<w;){B=k();let J;if(B===n){A=K.backslashes=!0,B=k(),B===u&&(q=!0);continue}if(q===!0||B===u){for(b++;ee()!==!0&&(B=k());){if(B===n){A=K.backslashes=!0,k();continue}if(B===u){b++;continue}if(q!==!0&&B===o&&(B=k())===o){if(M=K.isBrace=!0,F=K.isGlob=!0,R=!0,E===!0)continue;break}if(q!==!0&&B===i){if(M=K.isBrace=
|
|
63
|
+
!0,F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===_&&(b--,b===0)){q=!1,M=K.isBrace=!0,R=!0;break}}if(E===!0)continue;break}if(B===s){if(P.push(H),O.push(K),K={value:"",depth:0,isGlob:!1},R===!0)continue;if(C===o&&H===D+1){D+=2;continue}I=H+1;continue}if($.noext!==!0&&(B===m||B===r||B===t||B===y||B===a)===!0&&re()===c){if(F=K.isGlob=!0,G=K.isExtglob=!0,R=!0,B===a&&H===D&&(T=!0),E===!0){for(;ee()!==!0&&(B=k());){if(B===n){A=K.backslashes=!0,B=k();continue}if(B===S){F=K.isGlob=!0,R=!0;break}}continue}
|
|
64
|
+
break}if(B===t){if(C===t&&(Q=K.isGlobstar=!0),F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===y){if(F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===l){for(;ee()!==!0&&(J=k());){if(J===n){A=K.backslashes=!0,k();continue}if(J===g){z=K.isBracket=!0,F=K.isGlob=!0,R=!0;break}}if(E===!0)continue;break}if($.nonegate!==!0&&B===a&&H===D){L=K.negated=!0,D++;continue}if($.noparen!==!0&&B===c){if(F=K.isGlob=!0,E===!0){for(;ee()!==!0&&(B=k());){if(B===c){A=K.backslashes=!0,B=k();continue}if(B===S){R=!0;break}}
|
|
65
|
+
continue}break}if(F===!0){if(R=!0,E===!0)continue;break}}$.noext===!0&&(G=!1,F=!1);let N=x,V="",X="";D>0&&(V=x.slice(0,D),x=x.slice(D),I-=D),N&&F===!0&&I>0?(N=x.slice(0,I),X=x.slice(I)):F===!0?(N="",X=x):N=x,N&&N!==""&&N!=="/"&&N!==x&&p(N.charCodeAt(N.length-1))&&(N=N.slice(0,-1)),$.unescape===!0&&(X&&(X=e.removeBackslashes(X)),N&&A===!0&&(N=e.removeBackslashes(N)));const Z={prefix:V,input:d,start:D,base:N,glob:X,isBrace:M,isBracket:z,isGlob:F,isExtglob:G,isGlobstar:Q,negated:L,negatedExtglob:T};
|
|
66
|
+
if($.tokens===!0&&(Z.maxDepth=0,p(B)||O.push(K),Z.tokens=O),$.parts===!0||$.tokens===!0){let J;for(let ue=0;ue<P.length;ue++){const we=J?J+1:D,Y=P[ue],ne=d.slice(we,Y);$.tokens&&(ue===0&&D!==0?(O[ue].isPrefix=!0,O[ue].value=V):O[ue].value=ne,h(O[ue]),Z.maxDepth+=O[ue].depth),(ue!==0||ne!=="")&&U.push(ne),J=Y}if(J&&J+1<d.length){const ue=d.slice(J+1);U.push(ue),$.tokens&&(O[O.length-1].value=ue,h(O[O.length-1]),Z.maxDepth+=O[O.length-1].depth)}Z.slashes=P,Z.parts=U}return Z},Xn}var Jn,va;function Md(){
|
|
67
|
+
if(va)return Jn;va=1;const e=Kt(),t=Wt(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:o,REPLACEMENTS:a}=e,s=(l,m)=>{if(typeof m.expandRange=="function")return m.expandRange(...l,m);l.sort();const y=`[${l.join("-")}]`;try{new RegExp(y)}catch{return l.map(S=>t.escapeRegex(S)).join("..")}return y},u=(l,m)=>`Missing ${l}: "${m}" - use "\\\\${m}" to match literal characters`,c=(l,m)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=a[l]||l;
|
|
68
|
+
const y={...m},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r;let S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);const g={type:"bos",value:"",output:y.prepend||""},p=[g],h=y.capture?"":"?:",f=t.isWindows(m),d=e.globChars(f),v=e.extglobChars(d),{DOT_LITERAL:$,PLUS_LITERAL:w,SLASH_LITERAL:E,ONE_CHAR:P,DOTS_SLASH:O,NO_DOT:U,NO_DOT_SLASH:x,NO_DOTS_SLASH:H,QMARK:D,QMARK_NO_DOT:I,STAR:M,START_ANCHOR:z}=d,F=Y=>`(${h}(?:(?!${z}${Y.dot?O:$}).\
|
|
69
|
+
)*?)`,G=y.dot?"":U,Q=y.dot?D:I;let q=y.bash===!0?F(y):M;y.capture&&(q=`(${q})`),typeof y.noext=="boolean"&&(y.noextglob=y.noext);const A={input:l,index:-1,start:0,dot:y.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:p};l=t.removePrefix(l,A),S=l.length;const L=[],T=[],R=[];let b=g,C;const B=()=>A.index===S-1,K=A.peek=(Y=1)=>l[A.index+Y],ee=A.advance=()=>l[++A.index]||"",re=()=>l.slice(A.index+1),k=(Y="",ne=0)=>{A.consumed+=
|
|
70
70
|
Y,A.index+=ne},N=Y=>{A.output+=Y.output!=null?Y.output:Y.value,k(Y.value)},V=()=>{let Y=1;for(;K()==="!"&&(K(2)!=="("||K(3)==="?");)ee(),A.start++,Y++;return Y%2===0?!1:(A.negated=!0,A.start++,!0)},X=Y=>{A[Y]++,R.push(Y)},Z=Y=>{A[Y]--,R.pop()},J=Y=>{if(b.type==="globstar"){const ne=A.braces>0&&(Y.type==="comma"||Y.type==="brace"),W=Y.extglob===!0||L.length&&(Y.type==="pipe"||Y.type==="paren");Y.type!=="slash"&&Y.type!=="paren"&&!ne&&!W&&(A.output=A.output.slice(0,-b.output.length),b.type="star",
|
|
71
|
-
b.value="*",b.output=q,A.output+=b.output)}if(L.length&&Y.type!=="paren"&&(L[L.length-1].inner+=Y.value),(Y.value||Y.output)&&N(Y),b&&b.type==="text"&&Y.type==="text"){b.value+=Y.value,b.output=(b.output||"")+Y.value;return}Y.prev=b,p.push(Y),b=Y},ue=(Y,ne)=>{const W={...
|
|
72
|
-
let ne=Y.close+(y.capture?")":""),W;if(Y.type==="negate"){let te=q;if(Y.inner&&Y.inner.length>1&&Y.inner.includes("/")&&(te=F(y)),(te!==q||B()||/^\)+$/.test(re()))&&(ne=Y.close=`)$))${te}`),Y.inner.includes("*")&&(W=re())&&/^\.[^\\/.]+$/.test(W)){const le=c(W,{...
|
|
73
|
-
"\\"?(Y=!0,W):ye==="?"?te?te+ye+(he?D.repeat(he.length):""):Me===0?Q+(he?D.repeat(he.length):""):D.repeat(le.length):ye==="."
|
|
71
|
+
b.value="*",b.output=q,A.output+=b.output)}if(L.length&&Y.type!=="paren"&&(L[L.length-1].inner+=Y.value),(Y.value||Y.output)&&N(Y),b&&b.type==="text"&&Y.type==="text"){b.value+=Y.value,b.output=(b.output||"")+Y.value;return}Y.prev=b,p.push(Y),b=Y},ue=(Y,ne)=>{const W={...v[ne],conditions:1,inner:""};W.prev=b,W.parens=A.parens,W.output=A.output;const te=(y.capture?"(":"")+W.open;X("parens"),J({type:Y,value:ne,output:A.output?"":P}),J({type:"paren",extglob:!0,value:ee(),output:te}),L.push(W)},we=Y=>{
|
|
72
|
+
let ne=Y.close+(y.capture?")":""),W;if(Y.type==="negate"){let te=q;if(Y.inner&&Y.inner.length>1&&Y.inner.includes("/")&&(te=F(y)),(te!==q||B()||/^\)+$/.test(re()))&&(ne=Y.close=`)$))${te}`),Y.inner.includes("*")&&(W=re())&&/^\.[^\\/.]+$/.test(W)){const le=c(W,{...m,fastpaths:!1}).output;ne=Y.close=`)${le})${te})`}Y.prev.type==="bos"&&(A.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:C,output:ne}),Z("parens")};if(y.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let Y=!1,ne=l.replace(o,(W,te,le,ye,he,Me)=>ye===
|
|
73
|
+
"\\"?(Y=!0,W):ye==="?"?te?te+ye+(he?D.repeat(he.length):""):Me===0?Q+(he?D.repeat(he.length):""):D.repeat(le.length):ye==="."?$.repeat(le.length):ye==="*"?te?te+ye+(he?q:""):q:te?W:`\\${W}`);return Y===!0&&(y.unescape===!0?ne=ne.replace(/\\/g,""):ne=ne.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),ne===l&&y.contains===!0?(A.output=l,A):(A.output=t.wrapOutput(ne,A,m),A)}for(;!B();){if(C=ee(),C==="\0")continue;if(C==="\\"){const W=K();if(W==="/"&&y.bash!==!0||W==="."||W===";")continue;if(!W){
|
|
74
74
|
C+="\\",J({type:"text",value:C});continue}const te=/^\\+/.exec(re());let le=0;if(te&&te[0].length>2&&(le=te[0].length,A.index+=le,le%2!==0&&(C+="\\")),y.unescape===!0?C=ee():C+=ee(),A.brackets===0){J({type:"text",value:C});continue}}if(A.brackets>0&&(C!=="]"||b.value==="["||b.value==="[^")){if(y.posix!==!1&&C===":"){const W=b.value.slice(1);if(W.includes("[")&&(b.posix=!0,W.includes(":"))){const te=b.value.lastIndexOf("["),le=b.value.slice(0,te),ye=b.value.slice(te+2),he=n[ye];if(he){b.value=le+
|
|
75
|
-
he,A.backtrack=!0,ee()
|
|
75
|
+
he,A.backtrack=!0,ee(),!g.output&&p.indexOf(b)===1&&(g.output=P);continue}}}(C==="["&&K()!==":"||C==="-"&&K()==="]")&&(C=`\\${C}`),C==="]"&&(b.value==="["||b.value==="[^")&&(C=`\\${C}`),y.posix===!0&&C==="!"&&b.value==="["&&(C="^"),b.value+=C,N({value:C});continue}if(A.quotes===1&&C!=='"'){C=t.escapeRegex(C),b.value+=C,N({value:C});continue}if(C==='"'){A.quotes=A.quotes===1?0:1,y.keepQuotes===!0&&J({type:"text",value:C});continue}if(C==="("){X("parens"),J({type:"paren",value:C});continue}if(C===
|
|
76
76
|
")"){if(A.parens===0&&y.strictBrackets===!0)throw new SyntaxError(u("opening","("));const W=L[L.length-1];if(W&&A.parens===W.parens+1){we(L.pop());continue}J({type:"paren",value:C,output:A.parens?")":"\\)"}),Z("parens");continue}if(C==="["){if(y.nobracket===!0||!re().includes("]")){if(y.nobracket!==!0&&y.strictBrackets===!0)throw new SyntaxError(u("closing","]"));C=`\\${C}`}else X("brackets");J({type:"bracket",value:C});continue}if(C==="]"){if(y.nobracket===!0||b&&b.type==="bracket"&&b.value.length===
|
|
77
77
|
1){J({type:"text",value:C,output:`\\${C}`});continue}if(A.brackets===0){if(y.strictBrackets===!0)throw new SyntaxError(u("opening","["));J({type:"text",value:C,output:`\\${C}`});continue}Z("brackets");const W=b.value.slice(1);if(b.posix!==!0&&W[0]==="^"&&!W.includes("/")&&(C=`/${C}`),b.value+=C,N({value:C}),y.literalBrackets===!1||t.hasRegexChars(W))continue;const te=t.escapeRegex(b.value);if(A.output=A.output.slice(0,-b.value.length),y.literalBrackets===!0){A.output+=te,b.value=te;continue}b.value=
|
|
78
|
-
`(${
|
|
78
|
+
`(${h}${te}|${b.value})`,A.output+=b.value;continue}if(C==="{"&&y.nobrace!==!0){X("braces");const W={type:"brace",value:C,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};T.push(W),J(W);continue}if(C==="}"){const W=T[T.length-1];if(y.nobrace===!0||!W){J({type:"text",value:C,output:C});continue}let te=")";if(W.dots===!0){const le=p.slice(),ye=[];for(let he=le.length-1;he>=0&&(p.pop(),le[he].type!=="brace");he--)le[he].type!=="dots"&&ye.unshift(le[he].value);te=s(ye,y),A.backtrack=
|
|
79
79
|
!0}if(W.comma!==!0&&W.dots!==!0){const le=A.output.slice(0,W.outputIndex),ye=A.tokens.slice(W.tokensIndex);W.value=W.output="\\{",C=te="\\}",A.output=le;for(const he of ye)A.output+=he.output||he.value}J({type:"brace",value:C,output:te}),Z("braces"),T.pop();continue}if(C==="|"){L.length>0&&L[L.length-1].conditions++,J({type:"text",value:C});continue}if(C===","){let W=C;const te=T[T.length-1];te&&R[R.length-1]==="braces"&&(te.comma=!0,W="|"),J({type:"comma",value:C,output:W});continue}if(C==="/"){
|
|
80
|
-
if(b.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",p.pop(),b
|
|
80
|
+
if(b.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",p.pop(),b=g;continue}J({type:"slash",value:C,output:E});continue}if(C==="."){if(A.braces>0&&b.type==="dot"){b.value==="."&&(b.output=$);const W=T[T.length-1];b.type="dots",b.output+=C,b.value+=C,W.dots=!0;continue}if(A.braces+A.parens===0&&b.type!=="bos"&&b.type!=="slash"){J({type:"text",value:C,output:$});continue}J({type:"dot",value:C,output:$});continue}if(C==="?"){if(!(b&&b.value==="(")&&y.noextglob!==!0&&K()===
|
|
81
81
|
"("&&K(2)!=="?"){ue("qmark",C);continue}if(b&&b.type==="paren"){const te=K();let le=C;if(te==="<"&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(b.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(re()))&&(le=`\\${C}`),J({type:"text",value:C,output:le});continue}if(y.dot!==!0&&(b.type==="slash"||b.type==="bos")){J({type:"qmark",value:C,output:I});continue}J({type:"qmark",value:C,output:D});continue}if(C==="!"){if(y.noextglob!==
|
|
82
82
|
!0&&K()==="("&&(K(2)!=="?"||!/[!=<:]/.test(K(3)))){ue("negate",C);continue}if(y.nonegate!==!0&&A.index===0){V();continue}}if(C==="+"){if(y.noextglob!==!0&&K()==="("&&K(2)!=="?"){ue("plus",C);continue}if(b&&b.value==="("||y.regex===!1){J({type:"plus",value:C,output:w});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||A.parens>0){J({type:"plus",value:C});continue}J({type:"plus",value:w});continue}if(C==="@"){if(y.noextglob!==!0&&K()==="("&&K(2)!=="?"){J({type:"at",extglob:!0,
|
|
83
83
|
value:C,output:""});continue}J({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);const W=i.exec(re());W&&(C+=W[0],A.index+=W[0].length),J({type:"text",value:C});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=C,b.output=q,A.backtrack=!0,A.globstar=!0,k(C);continue}let Y=re();if(y.noextglob!==!0&&/^\([^?]/.test(Y)){ue("star",C);continue}if(b.type==="star"){if(y.noglobstar===!0){k(C);continue}const W=b.prev,te=W.prev,le=W.type==="slash"||
|
|
@@ -86,25 +86,25 @@ output=b.output,A.globstar=!0,k(C);continue}if(W.type==="slash"&&W.prev.type!=="
|
|
|
86
86
|
y)}${E}|${E}${Ke})`,b.value+=C,A.output+=W.output+b.output,A.globstar=!0,k(C+ee()),J({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&Y[0]==="/"){b.type="globstar",b.value+=C,b.output=`(?:^|${E}|${F(y)}${E})`,A.output=b.output,A.globstar=!0,k(C+ee()),J({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-b.output.length),b.type="globstar",b.output=F(y),b.value+=C,A.output+=b.output,A.globstar=!0,k(C);continue}const ne={type:"star",value:C,output:q};if(y.bash===!0){
|
|
87
87
|
ne.output=".*?",(b.type==="bos"||b.type==="slash")&&(ne.output=G+ne.output),J(ne);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&y.regex===!0){ne.output=C,J(ne);continue}(A.index===A.start||b.type==="slash"||b.type==="dot")&&(b.type==="dot"?(A.output+=x,b.output+=x):y.dot===!0?(A.output+=H,b.output+=H):(A.output+=G,b.output+=G),K()!=="*"&&(A.output+=P,b.output+=P)),J(ne)}for(;A.brackets>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing","]"));A.output=t.escapeLast(A.output,"["),
|
|
88
88
|
Z("brackets")}for(;A.parens>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing",")"));A.output=t.escapeLast(A.output,"("),Z("parens")}for(;A.braces>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing","}"));A.output=t.escapeLast(A.output,"{"),Z("braces")}if(y.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket")&&J({type:"maybe_slash",value:"",output:`${E}?`}),A.backtrack===!0){A.output="";for(const Y of A.tokens)A.output+=Y.output!=null?Y.output:Y.value,Y.suffix&&(A.output+=
|
|
89
|
-
Y.suffix)}return A};return c.fastpaths=(l,
|
|
90
|
-
noglobstar===!0?D:`(${x}(?:(?!${P}${G.dot?d:p}).)*?)`,M=G=>{switch(G){case"*":return`${O}${f}${D}`;case".*":return`${p}${f}${D}`;case"*.*":return`${O}${D}${p}${f}${D}`;case"*/*":return`${O}${D}${
|
|
91
|
-
z=t.removePrefix(l,H);let F=M(z);return F&&y.strictSlashes!==!0&&(F+=`${
|
|
92
|
-
u),_=l?
|
|
93
|
-
on"&&
|
|
94
|
-
RegExp?u:
|
|
95
|
-
mpty string");let
|
|
96
|
-
{");return u>-1&&
|
|
97
|
-
`No matches found for "${u.join(", ")}"`);if(c.nonull===!0||c.nullglob===!0)return c.unescape?u.map(
|
|
98
|
-
ng: "${e.inspect(
|
|
99
|
-
some(_=>y(_)))return!0}return!1},
|
|
100
|
-
scan(...
|
|
101
|
-
function
|
|
102
|
-
</style>`)}const
|
|
103
|
-
`);const
|
|
104
|
-
y),
|
|
105
|
-
output={});const t=r=>{r.inlineDynamicImports=!0};if(Array.isArray(e.build.rollupOptions.output))for(const r of e.build.rollupOptions.output)t(r);else t(e.build.rollupOptions.output)};function ft(e){return e.length===0?"never":e.sort(
|
|
106
|
-
`).trimStart()}function
|
|
107
|
-
`).trimStart()}function
|
|
89
|
+
Y.suffix)}return A};return c.fastpaths=(l,m)=>{const y={...m},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r,S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);l=a[l]||l;const g=t.isWindows(m),{DOT_LITERAL:p,SLASH_LITERAL:h,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:v,NO_DOTS:$,NO_DOTS_SLASH:w,STAR:E,START_ANCHOR:P}=e.globChars(g),O=y.dot?$:v,U=y.dot?w:v,x=y.capture?"":"?:",H={negated:!1,prefix:""};let D=y.bash===!0?".*?":E;y.capture&&(D=`(${D})`);const I=G=>G.
|
|
90
|
+
noglobstar===!0?D:`(${x}(?:(?!${P}${G.dot?d:p}).)*?)`,M=G=>{switch(G){case"*":return`${O}${f}${D}`;case".*":return`${p}${f}${D}`;case"*.*":return`${O}${D}${p}${f}${D}`;case"*/*":return`${O}${D}${h}${f}${U}${D}`;case"**":return O+I(y);case"**/*":return`(?:${O}${I(y)}${h})?${U}${f}${D}`;case"**/*.*":return`(?:${O}${I(y)}${h})?${U}${D}${p}${f}${D}`;case"**/.*":return`(?:${O}${I(y)}${h})?${p}${f}${D}`;default:{const Q=/^(.*?)\.(\w+)$/.exec(G);if(!Q)return;const q=M(Q[1]);return q?q+p+Q[2]:void 0}}},
|
|
91
|
+
z=t.removePrefix(l,H);let F=M(z);return F&&y.strictSlashes!==!0&&(F+=`${h}?`),F},Jn=c,Jn}var Yn,$a;function Hd(){if($a)return Yn;$a=1;const e=En,t=xd(),r=Md(),n=Wt(),i=Kt(),o=s=>s&&typeof s=="object"&&!Array.isArray(s),a=(s,u,c=!1)=>{if(Array.isArray(s)){const h=s.map(d=>a(d,u,c));return d=>{for(const v of h){const $=v(d);if($)return $}return!1}}const l=o(s)&&s.tokens&&s.input;if(s===""||typeof s!="string"&&!l)throw new TypeError("Expected pattern to be a non-empty string");const m=u||{},y=n.isWindows(
|
|
92
|
+
u),_=l?a.compileRe(s,u):a.makeRe(s,u,!1,!0),S=_.state;delete _.state;let g=()=>!1;if(m.ignore){const h={...u,ignore:null,onMatch:null,onResult:null};g=a(m.ignore,h,c)}const p=(h,f=!1)=>{const{isMatch:d,match:v,output:$}=a.test(h,_,u,{glob:s,posix:y}),w={glob:s,state:S,regex:_,posix:y,input:h,output:$,match:v,isMatch:d};return typeof m.onResult=="function"&&m.onResult(w),d===!1?(w.isMatch=!1,f?w:!1):g(h)?(typeof m.onIgnore=="function"&&m.onIgnore(w),w.isMatch=!1,f?w:!1):(typeof m.onMatch=="functi\
|
|
93
|
+
on"&&m.onMatch(w),f?w:!0)};return c&&(p.state=S),p};return a.test=(s,u,c,{glob:l,posix:m}={})=>{if(typeof s!="string")throw new TypeError("Expected input to be a string");if(s==="")return{isMatch:!1,output:""};const y=c||{},_=y.format||(m?n.toPosixSlashes:null);let S=s===l,g=S&&_?_(s):s;return S===!1&&(g=_?_(s):s,S=g===l),(S===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?S=a.matchBase(s,u,c,m):S=u.exec(g)),{isMatch:!!S,match:S,output:g}},a.matchBase=(s,u,c,l=n.isWindows(c))=>(u instanceof
|
|
94
|
+
RegExp?u:a.makeRe(u,c)).test(e.basename(s)),a.isMatch=(s,u,c)=>a(u,c)(s),a.parse=(s,u)=>Array.isArray(s)?s.map(c=>a.parse(c,u)):r(s,{...u,fastpaths:!1}),a.scan=(s,u)=>t(s,u),a.compileRe=(s,u,c=!1,l=!1)=>{if(c===!0)return s.output;const m=u||{},y=m.contains?"":"^",_=m.contains?"":"$";let S=`${y}(?:${s.output})${_}`;s&&s.negated===!0&&(S=`^(?!${S}).*$`);const g=a.toRegex(S,u);return l===!0&&(g.state=s),g},a.makeRe=(s,u={},c=!1,l=!1)=>{if(!s||typeof s!="string")throw new TypeError("Expected a non-e\
|
|
95
|
+
mpty string");let m={negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(s[0]==="."||s[0]==="*")&&(m.output=r.fastpaths(s,u)),m.output||(m=r(s,u)),a.compileRe(m,u,c,l)},a.toRegex=(s,u)=>{try{const c=u||{};return new RegExp(s,c.flags||(c.nocase?"i":""))}catch(c){if(u&&u.debug===!0)throw c;return/$^/}},a.constants=i,Yn=a,Yn}var Qn,_a;function Ud(){return _a||(_a=1,Qn=Hd()),Qn}var Zn,wa;function Fd(){if(wa)return Zn;wa=1;const e=Ko,t=qd(),r=Ud(),n=Wt(),i=s=>s===""||s==="./",o=s=>{const u=s.indexOf("\
|
|
96
|
+
{");return u>-1&&s.indexOf("}",u)>-1},a=(s,u,c)=>{u=[].concat(u),s=[].concat(s);let l=new Set,m=new Set,y=new Set,_=0,S=h=>{y.add(h.output),c&&c.onResult&&c.onResult(h)};for(let h=0;h<u.length;h++){let f=r(String(u[h]),{...c,onResult:S},!0),d=f.state.negated||f.state.negatedExtglob;d&&_++;for(let v of s){let $=f(v,!0);(d?!$.isMatch:$.isMatch)&&(d?l.add($.output):(l.delete($.output),m.add($.output)))}}let p=(_===u.length?[...y]:[...m]).filter(h=>!l.has(h));if(c&&p.length===0){if(c.failglob===!0)throw new Error(
|
|
97
|
+
`No matches found for "${u.join(", ")}"`);if(c.nonull===!0||c.nullglob===!0)return c.unescape?u.map(h=>h.replace(/\\/g,"")):u}return p};return a.match=a,a.matcher=(s,u)=>r(s,u),a.isMatch=(s,u,c)=>r(u,c)(s),a.any=a.isMatch,a.not=(s,u,c={})=>{u=[].concat(u).map(String);let l=new Set,m=[],y=S=>{c.onResult&&c.onResult(S),m.push(S.output)},_=new Set(a(s,u,{...c,onResult:y}));for(let S of m)_.has(S)||l.add(S);return[...l]},a.contains=(s,u,c)=>{if(typeof s!="string")throw new TypeError(`Expected a stri\
|
|
98
|
+
ng: "${e.inspect(s)}"`);if(Array.isArray(u))return u.some(l=>a.contains(s,l,c));if(typeof u=="string"){if(i(s)||i(u))return!1;if(s.includes(u)||s.startsWith("./")&&s.slice(2).includes(u))return!0}return a.isMatch(s,u,{...c,contains:!0})},a.matchKeys=(s,u,c)=>{if(!n.isObject(s))throw new TypeError("Expected the first argument to be an object");let l=a(Object.keys(s),u,c),m={};for(let y of l)m[y]=s[y];return m},a.some=(s,u,c)=>{let l=[].concat(s);for(let m of[].concat(u)){let y=r(String(m),c);if(l.
|
|
99
|
+
some(_=>y(_)))return!0}return!1},a.every=(s,u,c)=>{let l=[].concat(s);for(let m of[].concat(u)){let y=r(String(m),c);if(!l.every(_=>y(_)))return!1}return!0},a.all=(s,u,c)=>{if(typeof s!="string")throw new TypeError(`Expected a string: "${e.inspect(s)}"`);return[].concat(u).every(l=>r(l,c)(s))},a.capture=(s,u,c)=>{let l=n.isWindows(c),y=r.makeRe(String(s),{...c,capture:!0}).exec(l?n.toPosixSlashes(u):u);if(y)return y.slice(1).map(_=>_===void 0?"":_)},a.makeRe=(...s)=>r.makeRe(...s),a.scan=(...s)=>r.
|
|
100
|
+
scan(...s),a.parse=(s,u)=>{let c=[];for(let l of[].concat(s||[]))for(let m of t(String(l),u))c.push(r.parse(m,u));return c},a.braces=(s,u)=>{if(typeof s!="string")throw new TypeError("Expected a string");return u&&u.nobrace===!0||!o(s)?[s]:t(s,u)},a.braceExpand=(s,u)=>{if(typeof s!="string")throw new TypeError("Expected a string");return a.braces(s,{...u,expand:!0})},a.hasBraces=o,Zn=a,Zn}var Vd=Fd();const ba=mn(Vd),zd={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};
|
|
101
|
+
function Gd(e,t,r,n=!1){const i=t.replaceAll(".","\\."),o=new RegExp(`<script([^>]*?) src="(?:[^"]*?/)?${i}"([^>]*)></script>`),a=/"?__VITE_PRELOAD__"?/g,s=r.replace(a,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),u=e.replace(o,(c,l,m)=>`<script${l}${m}>${s.trim()}</script>`);return n?Yd(u):u}function Bd(e,t,r){const n=t.replaceAll(".","\\."),i=new RegExp(`<link([^>]*?) href="(?:[^"]*?/)?${n}"([^>]*)>`),o=r.replace('@charset "UTF-8";',"");return e.replace(i,(s,u,c)=>`<style${u}${c}>${o.trim()}\
|
|
102
|
+
</style>`)}const Kd=/\.[mc]?js$/,Wd=/\.css$/,Xd=/\.html?$/;function Jd({useRecommendedBuildConfig:e=!0,removeViteModuleLoader:t=!1,inlinePattern:r=[],deleteInlinedFiles:n=!0}=zd){return{name:"vite:singlefile",config:e?Qd:void 0,enforce:"post",generateBundle(i,o){const a=c=>this.info(`NOTE: asset not inlined: ${c}`);this.info(`
|
|
103
|
+
`);const s={html:[],css:[],js:[],other:[]};for(const c of Object.keys(o))Xd.test(c)?s.html.push(c):Wd.test(c)?s.css.push(c):Kd.test(c)?s.js.push(c):s.other.push(c);const u=[];for(const c of s.html){const l=o[c];let m=l.source;for(const y of s.js){if(r.length&&!ba.isMatch(y,r)){a(y);continue}const _=o[y];_.code!=null&&(this.info(`Inlining: ${y}`),u.push(y),m=Gd(m,_.fileName,_.code,t))}for(const y of s.css){if(r.length&&!ba.isMatch(y,r)){a(y);continue}const _=o[y];this.info(`Inlining: ${y}`),u.push(
|
|
104
|
+
y),m=Bd(m,_.fileName,_.source)}l.source=m}if(n)for(const c of u)delete o[c];for(const c of s.other)a(c)}}}const Yd=e=>e.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">'),Qd=e=>{e.build||(e.build={}),e.build.assetsInlineLimit=()=>!0,e.build.chunkSizeWarningLimit=1e8,e.build.cssCodeSplit=!1,e.base="./",e.build.assetsDir="",e.build.rollupOptions||(e.build.rollupOptions={}),e.build.rollupOptions.output||(e.build.rollupOptions.
|
|
105
|
+
output={});const t=r=>{r.inlineDynamicImports=!0};if(Array.isArray(e.build.rollupOptions.output))for(const r of e.build.rollupOptions.output)t(r);else t(e.build.rollupOptions.output)};function ft(e){return e.length===0?"never":e.sort(yd).map(t=>` | ${JSON.stringify(t)}`).join(`
|
|
106
|
+
`).trimStart()}function Ea(e){const t=Uo(e);return t.length===0?"never":Fo(t,gd,Bf(r=>` | ${JSON.stringify(r.id)}`)).join(`
|
|
107
|
+
`).trimStart()}function Sa(e,t={}){const{useCorePackage:r=!1}=t;return`
|
|
108
108
|
import type { Aux, SpecAux } from '${r?"@likec4/core/types":"likec4/model"}';
|
|
109
109
|
|
|
110
110
|
export type $Specs = SpecAux<
|
|
@@ -123,9 +123,9 @@ export type $Specs = SpecAux<
|
|
|
123
123
|
export type $Aux = Aux<
|
|
124
124
|
${JSON.stringify(e.stage)},
|
|
125
125
|
// Elements
|
|
126
|
-
${
|
|
126
|
+
${Ea(e.$data.elements)},
|
|
127
127
|
// Deployments
|
|
128
|
-
${
|
|
128
|
+
${Ea(e.$data.deployments.elements)},
|
|
129
129
|
// Views
|
|
130
130
|
${ft(wt(e.$data.views))},
|
|
131
131
|
// Project ID
|
|
@@ -143,7 +143,7 @@ export type $DeploymentKind = $Aux['DeploymentKind']
|
|
|
143
143
|
export type $Tag = $Aux['Tag']
|
|
144
144
|
export type $Tags = readonly $Aux['Tag'][]
|
|
145
145
|
export type $MetadataKey = $Aux['MetadataKey']
|
|
146
|
-
`.trimStart()}function
|
|
146
|
+
`.trimStart()}function Zd(e,t={}){const r=Sa(e,t),{useCorePackage:n=!1}=t;return`
|
|
147
147
|
/* prettier-ignore-start */
|
|
148
148
|
/* eslint-disable */
|
|
149
149
|
|
|
@@ -158,7 +158,7 @@ ${r}
|
|
|
158
158
|
export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${lt.stringify(e.$data,{space:2,quote:"'"})} as any) as any
|
|
159
159
|
|
|
160
160
|
/* prettier-ignore-end */
|
|
161
|
-
`.trimStart()}function
|
|
161
|
+
`.trimStart()}function ep(e){return Wo(e,t=>Xo`${lt.stringify(t.id)}`,{separator:" | "})}function tp(e){const t=Array.from(e),r=new ed;return r.appendTemplate`
|
|
162
162
|
/******************************************************************************
|
|
163
163
|
* This file was generated
|
|
164
164
|
* DO NOT EDIT MANUALLY!
|
|
@@ -169,10 +169,10 @@ export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${lt.stringify(e.$
|
|
|
169
169
|
// @ts-nocheck
|
|
170
170
|
|
|
171
171
|
import type { DiagramView } from 'likec4'
|
|
172
|
-
`.append(ut,ut),t.length===0?(r.append("export {}",ut),
|
|
173
|
-
export type LikeC4ViewId = ${
|
|
172
|
+
`.append(ut,ut),t.length===0?(r.append("export {}",ut),Jo(r)):(r.appendTemplate`
|
|
173
|
+
export type LikeC4ViewId = ${ep(t)};
|
|
174
174
|
export const LikeC4Views = {
|
|
175
|
-
`.indent({indentation:2,indentedChildren(n){n.appendNewLineIf(t.length>1).append(
|
|
175
|
+
`.indent({indentation:2,indentedChildren(n){n.appendNewLineIf(t.length>1).append(Wo(t,i=>Xo`${lt.stringify(i.id)}: (${lt.stringify(i)} as unknown) as DiagramView`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("} as const satisfies Record<LikeC4ViewId, DiagramView>",ut,ut).appendTemplate`
|
|
176
176
|
export type LikeC4Views = typeof LikeC4Views
|
|
177
177
|
|
|
178
178
|
export function isLikeC4ViewId(value: unknown): value is LikeC4ViewId {
|
|
@@ -184,7 +184,7 @@ export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${lt.stringify(e.$
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
/* prettier-ignore-end */
|
|
187
|
-
`.append(ut),
|
|
187
|
+
`.append(ut),Jo(r))}function rp(e,t={}){const{useCorePackage:r=!1}=t;vd(!e.isParsed(),"can not generate react types for parsed model");const n=Sa(e,t);return`
|
|
188
188
|
/* prettier-ignore-start */
|
|
189
189
|
/* eslint-disable */
|
|
190
190
|
|
|
@@ -240,495 +240,496 @@ export {
|
|
|
240
240
|
ReactLikeC4
|
|
241
241
|
}
|
|
242
242
|
/* prettier-ignore-end */
|
|
243
|
-
`.trimStart()}const es=async({languageServices:e,likec4AssetsDir:t,...r})=>{const n=r.customLogger??
|
|
244
|
-
webcomponentPrefix:u,title:c,root:i,languageServices:e,clearScreen:!1,base:
|
|
245
|
-
likec4/model","likec4/react","likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(u),PAGE_TITLE:JSON.stringify(c),__USE_OVERVIEW_GRAPH__:
|
|
246
|
-
recommended"},...!l&&{input:[oe(i,"index.html"),oe(i,"src","main.js"),oe(i,"src","fonts.css"),oe(i,"src","style.css")],output:{manualChunks:
|
|
247
|
-
languageServices,useOverviewGraph:
|
|
248
|
-
stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Tn,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:In,lib:{entry:"src/webcomponent.js",fileName(
|
|
249
|
-
useOverviewGraph:!1})]}}const
|
|
250
|
-
|
|
251
|
-
viewsService.computedViews(
|
|
252
|
-
"index.html");He(
|
|
253
|
-
all","-g",0]},
|
|
254
|
-
yarn","up","-i",0],execute:["yarn","dlx",0],"execute-local":["yarn","exec",0],global:["npm","i","-g",0],global_uninstall:["npm","uninstall","-g",0]},
|
|
255
|
-
ve","--global",0]},
|
|
256
|
-
install","-g",0],add:["deno","add",0],upgrade:["deno","outdated","--update",0],"upgrade-interactive":["deno","outdated","--update",0],execute:
|
|
257
|
-
"number"?t:[n]);return{command:r[0],args:r.slice(1)}}const
|
|
258
|
-
".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};async function ns(e,t){try{const r=await
|
|
259
|
-
resolve(e.stopDir);i=
|
|
260
|
-
const c=
|
|
261
|
-
e,"utf8"));let n;const i=
|
|
262
|
-
if(
|
|
263
|
-
react"} ${"react-dom"}`,process.exit(1)}}function
|
|
243
|
+
`.trimStart()}const es=async({languageServices:e,likec4AssetsDir:t,...r})=>{const n=r.customLogger??Cd,i=Nn(),o=r?.useOverviewGraph===!0;n.info(`${j.cyan("likec4 app root")} ${j.dim(i)}`);const a=r.outputDir??oe(e.workspace,"dist");n.info(j.cyan("outDir")+" "+j.dim(a));let s="/";r.base&&(s=No(r.base),!Nf(s)&&s!=="./"&&(s=Of(s))),s!=="/"&&n.info(`${j.green("app base url")} ${j.dim(s)}`);const u=r.webcomponentPrefix??"likec4",c=r.title??"LikeC4",l=r.outputSingleFile??!1;return{isDev:!1,likec4AssetsDir:t,
|
|
244
|
+
webcomponentPrefix:u,title:c,root:i,languageServices:e,clearScreen:!1,base:s,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...jn(),"likec4/previews":t}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","@likec4/core/types","@likec4/core/model","@likec4/core/compute-view/relationships","@likec4/core/utils","@likec4/core","\
|
|
245
|
+
likec4/model","likec4/react","likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(u),PAGE_TITLE:JSON.stringify(c),__USE_OVERVIEW_GRAPH__:o?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:a,emptyOutDir:!1,sourcemap:!1,cssMinify:!1,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:In,rollupOptions:{treeshake:{preset:"\
|
|
246
|
+
recommended"},...!l&&{input:[oe(i,"index.html"),oe(i,"src","main.js"),oe(i,"src","fonts.css"),oe(i,"src","style.css")],output:{manualChunks:m=>{if(!(m.endsWith(".css")||m.endsWith(".html")||m.includes("likec4/icons"))){if(m.includes("__app__")){let y=m.match(/__app__\/src\/([\w]+)\.js/)?.[1];return y?y[1]:void 0}if(m.includes("node_modules/likec4")||m.includes("node_modules/@likec4"))return"likec4";if(m.includes("node_modules"))return"vendors"}}}}}},customLogger:n,plugins:[bn(),Sn({languageServices:e.
|
|
247
|
+
languageServices,useOverviewGraph:o}),l?Jd():void 0].filter(Boolean)}};async function ts({languageServices:e,outDir:t,base:r,webcomponentPrefix:n="likec4",filename:i="likec4-views.js"}){const o=Te(["vite","webcomponent"]),a=Nn();return o.info(j.cyan("outDir")+" "+j.dim(t)),{root:a,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:jn(),dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"]},define:{WEBCOMPONENT_PREFIX:JSON.
|
|
248
|
+
stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Tn,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:In,lib:{entry:"src/webcomponent.js",fileName(s,u){return i},formats:["iife"],name:"LikeC4Views"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:o,plugins:[bn(),Sn({languageServices:e.languageServices,
|
|
249
|
+
useOverviewGraph:!1})]}}const np=["favicon.ico","robots.txt"],sp=async({buildWebcomponent:e=!0,webcomponentPrefix:t="likec4",title:r,languageServices:n,likec4AssetsDir:i,outputSingleFile:o,...a})=>{i??=await Ft(Et(Vt(),".likec4-assets-"));const s=await es({...a,languageServices:n,likec4AssetsDir:i,webcomponentPrefix:t,title:r,outputSingleFile:o}),u=await On();for(const l of np){const m=oe(s.root,l);He(m)&&Mo(m,oe(u,l))}const c=n.languageServices.projects();if(c.length===1){const l=await n.viewsService.
|
|
250
|
+
computedViews(),m=await n.diagrams();if(m.length===0)throw process.exitCode=1,new Error("no views found");m.length===l.length?s.customLogger.info(`${j.dim("workspace:")} ${j.green("\u2713 all views layouted")}`):s.customLogger.warn(`${j.dim("workspace:")} ${j.yellow(`\u2717 layouted ${m.length} of ${l.length} views`)}`),m.forEach(y=>{y.hasLayoutDrift&&s.customLogger.warn(j.yellow("drift detected, manual layout can not be applied, view:")+" "+j.red(y.id))})}else for(const l of c){const m=await n.
|
|
251
|
+
viewsService.computedViews(l.id);m.length===0?s.customLogger.warn(`${j.dim("project:")} ${l.id} ${j.yellow("\u2717 no views found")}`):s.customLogger.info(`${j.dim("project:")} ${l.id} ${j.green(`${m.length} views`)}`)}if(e){const l=await ts({webcomponentPrefix:t,languageServices:n,outDir:u,base:s.base});await At(l)}if(await At({...s,publicDir:u,mode:"production"}),o)for(let l of Uf(oe(s.build.outDir)).filter(m=>m!=="index.html"))$n(oe(s.build.outDir,l),{recursive:!0});else{const l=oe(s.build.outDir,
|
|
252
|
+
"index.html");He(l)&&Mo(l,oe(s.build.outDir,"404.html"))}};function rs(e,t){return r=>r.length>1?[e,t,r[0],"--",...r.slice(1)]:[e,t,r[0]]}function op(){return e=>["deno","run",`npm:${e[0]}`,...e.slice(1)]}const ap={agent:["npm",0],run:rs("npm","run"),install:["npm","i",0],frozen:["npm","ci",0],global:["npm","i","-g",0],add:["npm","i",0],upgrade:["npm","update",0],"upgrade-interactive":null,execute:["npx",0],"execute-local":["npx",0],uninstall:["npm","uninstall",0],global_uninstall:["npm","uninst\
|
|
253
|
+
all","-g",0]},Ra={agent:["yarn",0],run:["yarn","run",0],install:["yarn","install",0],frozen:["yarn","install","--frozen-lockfile",0],global:["yarn","global","add",0],add:["yarn","add",0],upgrade:["yarn","upgrade",0],"upgrade-interactive":["yarn","upgrade-interactive",0],execute:["npx",0],"execute-local":rs("yarn","exec"),uninstall:["yarn","remove",0],global_uninstall:["yarn","global","remove",0]},ip={...Ra,frozen:["yarn","install","--immutable",0],upgrade:["yarn","up",0],"upgrade-interactive":["\
|
|
254
|
+
yarn","up","-i",0],execute:["yarn","dlx",0],"execute-local":["yarn","exec",0],global:["npm","i","-g",0],global_uninstall:["npm","uninstall","-g",0]},Aa={agent:["pnpm",0],run:["pnpm","run",0],install:["pnpm","i",0],frozen:["pnpm","i","--frozen-lockfile",0],global:["pnpm","add","-g",0],add:["pnpm","add",0],upgrade:["pnpm","update",0],"upgrade-interactive":["pnpm","update","-i",0],execute:["pnpm","dlx",0],"execute-local":["pnpm","exec",0],uninstall:["pnpm","remove",0],global_uninstall:["pnpm","remo\
|
|
255
|
+
ve","--global",0]},cp={agent:["bun",0],run:["bun","run",0],install:["bun","install",0],frozen:["bun","install","--frozen-lockfile",0],global:["bun","add","-g",0],add:["bun","add",0],upgrade:["bun","update",0],"upgrade-interactive":["bun","update",0],execute:["bun","x",0],"execute-local":["bun","x",0],uninstall:["bun","remove",0],global_uninstall:["bun","remove","-g",0]},up={agent:["deno",0],run:["deno","task",0],install:["deno","install",0],frozen:["deno","install","--frozen",0],global:["deno","\
|
|
256
|
+
install","-g",0],add:["deno","add",0],upgrade:["deno","outdated","--update",0],"upgrade-interactive":["deno","outdated","--update",0],execute:op(),"execute-local":["deno","task","--eval",0],uninstall:["deno","remove",0],global_uninstall:["deno","uninstall","-g",0]},lp={npm:ap,yarn:Ra,"yarn@berry":ip,pnpm:Aa,"pnpm@6":{...Aa,run:rs("pnpm","run")},bun:cp,deno:up};function fp(e,t,r){const n=lp[e][t];return dp(n,r)}function dp(e,t){if(e==null)return null;const r=typeof e=="function"?e(t):e.flatMap(n=>typeof n==
|
|
257
|
+
"number"?t:[n]);return{command:r[0],args:r.slice(1)}}const pp=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],Pa={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},Ca={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",
|
|
258
|
+
".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};async function ns(e,t){try{const r=await Go.stat(e);return t==="file"?r.isFile():r.isDirectory()}catch{return!1}}function*hp(e=me.cwd()){let t=ie.resolve(e);const{root:r}=ie.parse(t);for(;t&&t!==r;)yield t,t=ie.dirname(t)}async function ka(e,t){return!e||!ns(e,"file")?null:await gp(e,t)}async function mp(e={}){const{cwd:t,strategies:r=["lockfile","packageManager-field","devEngines-field"],onUnknown:n}=e;let i;if(typeof e.stopDir=="string"){const o=ie.
|
|
259
|
+
resolve(e.stopDir);i=a=>a===o}else i=e.stopDir;for(const o of hp(t)){for(const a of r)switch(a){case"lockfile":{for(const s of Object.keys(Pa))if(await ns(ie.join(o,s),"file")){const u=Pa[s],c=await ka(ie.join(o,"package.json"),n);return c||{name:u,agent:u}}break}case"packageManager-field":case"devEngines-field":{const s=await ka(ie.join(o,"package.json"),n);if(s)return s;break}case"install-metadata":{for(const s of Object.keys(Ca)){const u=s.endsWith("/")?"dir":"file";if(await ns(ie.join(o,s),u)){
|
|
260
|
+
const c=Ca[s],l=c==="yarn"?vp(s)?"yarn":"yarn@berry":c;return{name:c,agent:l}}}break}}if(i?.(o))break}return null}function yp(e){const t=r=>r?.match(/\d+(\.\d+){0,2}/)?.[0]??r;if(typeof e.packageManager=="string"){const[r,n]=e.packageManager.replace(/^\^/,"").split("@");return{name:r,ver:t(n)}}if(typeof e.devEngines?.packageManager?.name=="string")return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}async function gp(e,t){try{const r=JSON.parse(await Go.readFile(
|
|
261
|
+
e,"utf8"));let n;const i=yp(r);if(i){const o=i.name,a=i.ver;let s=a;return o==="yarn"&&a&&Number.parseInt(a)>1?(n="yarn@berry",s="berry",{name:o,agent:n,version:s}):o==="pnpm"&&a&&Number.parseInt(a)<7?(n="pnpm@6",{name:o,agent:n,version:s}):pp.includes(o)?(n=o,{name:o,agent:n,version:s}):t?.(r.packageManager)??null}}catch{}return null}function vp(e){return e.endsWith(".yarn_integrity")}function Ta(e){try{return!!ad.createRequire(import.meta.url).resolve(e)}catch(t){return Ae.debug(Mt(t)),!1}}async function Ct(){
|
|
262
|
+
if(Ta("react")&&Ta("react-dom")){Ae.debug("react already installed");return}Ae.debug("react not installed");const e=await mp();e||(Ae.error`Package manager not detected, please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));const t=fp(e.agent,"add",["react","react-dom"]);t||(Ae.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));try{await Oo(t.command,t.args,{stdio:"inherit"})}catch(r){Ae.debug(Mt(r)),Ae.error`Please install dependencies manually: ${"\
|
|
263
|
+
react"} ${"react-dom"}`,process.exit(1)}}function Na(e){if(e.resolvedUrls)return Io(e.resolvedUrls.network)??Io(e.resolvedUrls.local)}function Oa(e){if(!e.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");We([j.green("LikeC4 served at:"),"",j.dim("Local: ")+e.resolvedUrls.local.join(`
|
|
264
264
|
`+"".padEnd(9," ")),e.resolvedUrls.network.length?j.dim("Network: ")+e.resolvedUrls.network.join(`
|
|
265
|
-
`+"".padEnd(9," ")):void 0].filter(t=>
|
|
266
|
-
`))}class
|
|
267
|
-
try{await
|
|
268
|
-
responding to the port you want excluded.");if(!Number.isSafeInteger(
|
|
269
|
-
if(!["EADDRINUSE","EACCES"].includes(
|
|
270
|
-
i;
|
|
271
|
-
|
|
272
|
-
base});await At({...
|
|
273
|
-
`failed to close page: ${
|
|
274
|
-
bounds);const d=20;await c.setViewportSize({width:f.width+40+d,height:f.height+40+d}),await c.goto(
|
|
275
|
-
|
|
276
|
-
`+p)),S<
|
|
277
|
-
cDispose")],n===void 0&&(n=t[
|
|
278
|
-
return Promise.resolve(
|
|
279
|
-
`);const{chromium:l}=await import("playwright"),
|
|
280
|
-
`);const _=await y.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:t,bypassCSP:!0,ignoreHTTPSErrors:!0,isMobile:!1});_.setDefaultNavigationTimeout(n),_.setDefaultTimeout(n);try{return await
|
|
281
|
-
timeoutMs:
|
|
282
|
-
rver is not ready, no resolvedUrls");for(const
|
|
283
|
-
|
|
284
|
-
`),O.length!==w.length&&(
|
|
285
|
-
throw TypeError(e)},
|
|
286
|
-
i=
|
|
287
|
-
te",watch:!1}),!0)
|
|
288
|
-
`),await
|
|
289
|
-
var y=
|
|
290
|
-
4 files in 'src' and output static site to 'build'")),handler:async t=>{await
|
|
291
|
-
switch(
|
|
292
|
-
break}if(n==="property"){if(os.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!
|
|
293
|
-
r);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}function as(e,t){if(typeof t!="number"&&Array.isArray(e)){const r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function
|
|
294
|
-
e=e[
|
|
295
|
-
"string")return!1;const r=Qt(t);if(r.length===0)return!1;for(const n of r){if(!rt(e)||!(n in e)||as(e,n))return!1;e=e[n]}return!0}const Je=Rt.homedir(),is=Rt.tmpdir(),{env:pt}=me,
|
|
296
|
-
e,"Data"),config:ie.join(t,e,"Config"),cache:ie.join(r,e,"Cache"),log:ie.join(r,e,"Log"),temp:ie.join(is,e)}},
|
|
297
|
-
ted a string, got ${typeof e}`);return t&&(e+=`-${t}`),me.platform==="darwin"?
|
|
298
|
-
e))return!1;const{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!pe.isNodeError(e))throw e;if(!pe.isChangeErrorOk(e))throw e}};class
|
|
265
|
+
`+"".padEnd(9," ")):void 0].filter(t=>If(t)).join(`
|
|
266
|
+
`))}class Ia extends Error{constructor(t){super(`${t} is locked`)}}const dt={old:new Set,young:new Set},$p=1e3*15,Xt=1024,Jt=65535;let kt;const _p=()=>{const e=Rt.networkInterfaces(),t=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(e))for(const n of r)t.add(n.address);return t},ja=e=>new Promise((t,r)=>{const n=id.createServer();n.unref(),n.on("error",r),n.listen(e,()=>{const{port:i}=n.address();n.close(()=>{t(i)})})}),La=async(e,t)=>{if(e.host||e.port===0)return ja(e);for(const r of t)
|
|
267
|
+
try{await ja({port:e.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return e.port},wp=function*(e){e&&(yield*e),yield 0};async function ss(e){let t,r=new Set;if(e&&(e.port&&(t=typeof e.port=="number"?[e.port]:e.port),e.exclude)){const i=e.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const o of i){if(typeof o!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
|
|
268
|
+
responding to the port you want excluded.");if(!Number.isSafeInteger(o))throw new TypeError(`Number ${o} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}kt===void 0&&(kt=setTimeout(()=>{kt=void 0,dt.old=dt.young,dt.young=new Set},$p),kt.unref&&kt.unref());const n=_p();for(const i of wp(t))try{if(r.has(i))continue;let o=await La({...e,port:i},n);for(;dt.old.has(o)||dt.young.has(o);){if(i!==0)throw new Ia(i);o=await La({...e,port:i},n)}return dt.young.add(o),o}catch(o){
|
|
269
|
+
if(!["EADDRINUSE","EACCES"].includes(o.code)&&!(o instanceof Ia))throw o}throw new Error("No available ports found")}function Yt(e,t){if(!Number.isInteger(e)||!Number.isInteger(t))throw new TypeError("`from` and `to` must be integer numbers");if(e<Xt||e>Jt)throw new RangeError(`'from' must be between ${Xt} and ${Jt}`);if(t<Xt||t>Jt)throw new RangeError(`'to' must be between ${Xt} and ${Jt}`);if(e>t)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,i){for(let o=n;o<=
|
|
270
|
+
i;o++)yield o}(e,t)}async function Da({buildWebcomponent:e=!0,hmr:t=!0,webcomponentPrefix:r="likec4",title:n,languageServices:i,likec4AssetsDir:o,openBrowser:a,listen:s,port:u,...c}){o??=await Ft(Et(Vt(),".likec4-assets-"));const{isDev:l,...m}=await es({...c,languageServices:i,likec4AssetsDir:o,webcomponentPrefix:r,title:n}),y=m.customLogger,_=u??(Vo.PORT?parseInt(Vo.PORT,10):5173),S=await ss({port:[_,...Yt(61e3,61010),...Yt(62002,62010)]}),g=await ss({port:Yt(24678,24690)}),p=await On(),h=s??(Fe()?
|
|
271
|
+
"0.0.0.0":"localhost");t?(y.info(`Enabling HMR: localhost:${g}`),Fe()&&y.info(j.yellow(`ensure port ${g} is published from container`))):y.info("Disabling HMR");const f=await sd({...m,define:t?{...m.define,"process.env.NODE_ENV":'"development"'}:m.define,mode:t?"development":m.mode,publicDir:p,server:{host:h,allowedHosts:!0,port:S,hmr:t&&{overlay:!0,port:g},fs:{strict:!1},open:a??(!l&&!Fe())}});return await f.listen(),e?(y.info("Building webcomponent"),(async()=>{try{const d=await ts({webcomponentPrefix:r,
|
|
272
|
+
languageServices:i,outDir:p,base:m.base});await At({...d,logLevel:"warn"})}catch(d){y.warn(Mt(d)),y.warn("webcomponent build failed, ignoring error and continue")}})()):y.info("Skip webcomponent build"),f}async function bp({browserContext:e,views:t,output:r,logger:n,timeout:i,maxAttempts:o,dynamicVariant:a,outputType:s,theme:u}){let c;const l=t.map(_=>({view:_,attempt:1})),m=[];let y;for(;y=l.shift();){const{view:_,attempt:S}=y,g=`export/${encodeURIComponent(_.id)}/`;try{if(S>1){c&&(c.close({runBeforeUnload:!0}).
|
|
273
|
+
catch($=>n.error(`failed to close page: ${$}`)),c=void 0);const v=jo(S*200,{min:200,max:1e3});n.info(j.cyan(g)+j.dim(` attempt ${S} of ${o} after ${v}ms`)),await cd(v)}else _.hasLayoutDrift&&n.warn(j.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+j.red(_.id));let p=".";s==="relative"&&(p=_.sourcePath??".",p.includes("/")?p=p.slice(0,p.lastIndexOf("/")):p=".");const h=oe(r,p,`${_.id}.png`);c??=await e.newPage();let f=_.bounds;a==="sequence"&&_._type==="dynamic"&&
|
|
274
|
+
(f=_.sequenceLayout.bounds);const d=20;await c.setViewportSize({width:f.width+40+d,height:f.height+40+d}),await c.goto(jf(g,{padding:20,theme:u,dynamic:a})),n.info(j.cyan(g)+j.dim(` -> ${Ue(r,h)}`)),await c.waitForSelector(".react-flow.initialized"),_.nodes.some(v=>Lf(v.icon)&&v.icon.toLowerCase().startsWith("http"))&&await Ep(c,i),await c.getByTestId("export-page").screenshot({animations:"disabled",path:h,omitBackground:!0}),m.push({view:_,path:h})}catch(p){c?.close({runBeforeUnload:!0}).catch(
|
|
275
|
+
h=>n.error(`failed to close page: ${h}`)),n.error(j.red("failed "+g+`
|
|
276
|
+
`+p)),S<o&&(l.push({view:_,attempt:S+1}),n.info(j.dim(`retry ${g}`))),c=void 0}}return m}async function Ep(e,t){let r=await e.locator("//img").all();if(!r.length)return;const n=r.map(i=>i.evaluate(o=>o.complete||new Promise(a=>{o.onload=a,o.onerror=a}),{timeout:Math.max(15e3,t)}));await Promise.allSettled(n)}var qa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),xa=e=>{throw TypeError(e)},Sp=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&xa("Object expected");var n,i;n=t[qa("asyn\
|
|
277
|
+
cDispose")],n===void 0&&(n=t[qa("dispose")],i=n),typeof n!="function"&&xa("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),e.push([r,n,t])}else e.push([r]);return t},Rp=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=a,c.suppressed=s,c},i=a=>t=r?new n(a,t,"An error was suppressed during disposal"):(r=!0,a),o=a=>{for(;a=e.pop();)try{var s=a[1]&&a[1].call(a[2]);if(a[0])
|
|
278
|
+
return Promise.resolve(s).then(o,u=>(i(u),o()))}catch(u){i(u)}if(r)throw t};return o()};async function Ma({logger:e,serverUrl:t,theme:r="light",timeoutMs:n=15e3,views:i,output:o,outputType:a="relative",maxAttempts:s=3,chromiumSandbox:u=!1,sequence:c=!1}){e.info(`${j.dim("output")} ${o}`),e.info(`${j.dim("base url")} ${t}
|
|
279
|
+
`);const{chromium:l}=await import("playwright"),m=l.executablePath();e.info(j.cyan("Start chromium")+" "+j.dim(m));const y=await l.launch({chromiumSandbox:u,headless:!0});e.info(j.cyan("Color scheme: ")+r+`
|
|
280
|
+
`);const _=await y.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:t,bypassCSP:!0,ignoreHTTPSErrors:!0,isMobile:!1});_.setDefaultNavigationTimeout(n),_.setDefaultTimeout(n);try{return await bp({browserContext:_,views:i,output:o,outputType:a,logger:e,maxAttempts:s,dynamicVariant:c?"sequence":"diagram",timeout:n,theme:r})}finally{e.info(j.cyan("close chromium")),await _.close(),await y.close()}}async function Ha({path:e,useDotBin:t,theme:r="light",output:n,outputType:i,serverUrl:o,ignore:a=!1,
|
|
281
|
+
timeoutMs:s=1e4,maxAttempts:u=3,filter:c,sequence:l=!1,chromiumSandbox:m=!1}){var y=[];try{const p=Te("export"),h=Vf(),f=Sp(y,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0);n??=f.workspace;let d;const v=f.languageServices.projects();if(!o&&(p.info(j.cyan("start preview server")),d=await Da({languageServices:f,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,hmr:!1}),o=Na(d),!o))throw p.error("Vite server is not ready, no resolvedUrls"),new Error("Vite se\
|
|
282
|
+
rver is not ready, no resolvedUrls");for(const $ of v){v.length>1&&(p.info(j.dim("---------")),p.info(`${j.dim("project:")} ${$.id}`),p.info(`${j.dim("folder:")} ${$.folder.fsPath}`));let w=await f.diagrams($.id);if(c&&bt(c,1)&&bt(w,1)){const x=Df(c);p.info(`${j.cyan("filter")} ${j.dim(JSON.stringify(c))}`),w=w.filter(H=>x(H.id)?(p.info(`${j.green("include")} ${H.id} \u2705`),!0):(p.info(`${j.gray("skip")} ${j.dim(H.id)}`),!1))}if(!bt(w,1)){p.warn("no views found");continue}let E=v.length>1?No(Lo(
|
|
283
|
+
o,"project",$.id)):o,P=v.length>1?Lo(n,$.id):n;const O=await Ma({logger:p,serverUrl:E,theme:r,timeoutMs:s,views:w,output:P,outputType:i,maxAttempts:u,sequence:l,chromiumSandbox:m}),{pretty:U}=qf(h);if(O.length>0&&p.info(j.green(`exported ${O.length} views in ${U}`)+`
|
|
284
|
+
`),O.length!==w.length&&(a&&O.length>0?p.info(j.dim("ignore")+" "+j.red(`failed ${w.length-O.length} out of ${w.length} views`)):p.error(j.red(`failed ${w.length-O.length} out of ${w.length} views`))),O.length!==w.length&&(O.length===0||!a))throw new Error(`Failed ${w.length-O.length} out of ${w.length} views`)}d&&(p.info(j.cyan("stop server")),await d.close().catch($=>{p.error($)}))}catch(p){var _=p,S=!0}finally{var g=Rp(y,_,S);g&&await g}}var Ua=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Fa=e=>{
|
|
285
|
+
throw TypeError(e)},Ap=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Fa("Object expected");var n,i;n=t[Ua("asyncDispose")],n===void 0&&(n=t[Ua("dispose")],i=n),typeof n!="function"&&Fa("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),e.push([r,n,t])}else e.push([r]);return t},Pp=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=a,c.suppressed=s,c},
|
|
286
|
+
i=a=>t=r?new n(a,t,"An error was suppressed during disposal"):(r=!0,a),o=a=>{for(;a=e.pop();)try{var s=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(s).then(o,u=>(i(u),o()))}catch(u){i(u)}if(r)throw t};return o()};const{cyan:Va,dim:za}=j;async function Cp({path:e,useDotBin:t,useHashHistory:r,webcomponentPrefix:n,title:i,useOverview:o=!1,output:a,outputSingleFile:s,base:u}){var c=[];try{await Ct();const _=Te("c4:build"),S=Ap(c,await Pe.fromWorkspace(e,{graphviz:t?"binary":"wasm",logger:"vi\
|
|
287
|
+
te",watch:!1}),!0),g=a??oe(S.workspace,"dist");let p=oe(g,"assets");if(o)try{p=oe(g,"assets","previews"),await xe(p,{recursive:!0}),_.info(`${Va("Generate previews")} ${za(p)}
|
|
288
|
+
`),await Ha({path:e,useDotBin:t,output:p,outputType:"flat",ignore:!0})}catch(h){_.error(j.red("Failed to generate previews")),_.error(h),_.warn(j.yellow("Ignore previews and continue build")),$n(p,{recursive:!0,force:!0}),o=!1}await sp({base:u,useHashHistory:s||r,customLogger:_,useOverviewGraph:o,webcomponentPrefix:n,title:i,languageServices:S,likec4AssetsDir:p,outputDir:a,outputSingleFile:s}),o&&(_.info(`${Va("clean previews")} ${za(p)}`),$n(p,{recursive:!0,force:!0}))}catch(_){var l=_,m=!0}finally{
|
|
289
|
+
var y=Pp(c,l,m);y&&await y}}const kp=e=>e.command({command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("path",be).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:oe}).option("base",ta).option("use-hash-history",Zo).option("use-dot",Re).option("webcomponent-prefix",kn).option("title",ea).option("output-single-file",Ed).example(`${j.green("$0 build -o ./build ./src")}`,j.gray("Search for likec\
|
|
290
|
+
4 files in 'src' and output static site to 'build'")),handler:async t=>{await Cp({path:t.path,output:t.output,base:t.base,useHashHistory:t["use-hash-history"],useDotBin:t["use-dot"],webcomponentPrefix:t["webcomponent-prefix"],title:t.title,outputSingleFile:t["output-single-file"]??!1})}}),rt=e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},os=new Set(["__proto__","prototype","constructor"]),Tp=new Set("0123456789");function Qt(e){const t=[];let r="",n="start",i=!1;for(const o of e)
|
|
291
|
+
switch(o){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=o),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+=o;break}if(os.has(r))return[];t.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+=o;
|
|
292
|
+
break}if(n==="property"){if(os.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Tp.has(o))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+=o}}switch(i&&(r+="\\"),n){case"property":{if(os.has(r))return[];t.push(
|
|
293
|
+
r);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}function as(e,t){if(typeof t!="number"&&Array.isArray(e)){const r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function Ga(e,t){if(as(e,t))throw new Error("Cannot use string index")}function Np(e,t,r){if(!rt(e)||typeof t!="string")return r===void 0?e:r;const n=Qt(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){const o=n[i];if(as(e,o)?e=i===n.length-1?void 0:null:
|
|
294
|
+
e=e[o],e==null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}function Ba(e,t,r){if(!rt(e)||typeof t!="string")return e;const n=e,i=Qt(t);for(let o=0;o<i.length;o++){const a=i[o];Ga(e,a),o===i.length-1?e[a]=r:rt(e[a])||(e[a]=typeof i[o+1]=="number"?[]:{}),e=e[a]}return n}function Op(e,t){if(!rt(e)||typeof t!="string")return!1;const r=Qt(t);for(let n=0;n<r.length;n++){const i=r[n];if(Ga(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!rt(e))return!1}}function Ip(e,t){if(!rt(e)||typeof t!=
|
|
295
|
+
"string")return!1;const r=Qt(t);if(r.length===0)return!1;for(const n of r){if(!rt(e)||!(n in e)||as(e,n))return!1;e=e[n]}return!0}const Je=Rt.homedir(),is=Rt.tmpdir(),{env:pt}=me,jp=e=>{const t=ie.join(Je,"Library");return{data:ie.join(t,"Application Support",e),config:ie.join(t,"Preferences",e),cache:ie.join(t,"Caches",e),log:ie.join(t,"Logs",e),temp:ie.join(is,e)}},Lp=e=>{const t=pt.APPDATA||ie.join(Je,"AppData","Roaming"),r=pt.LOCALAPPDATA||ie.join(Je,"AppData","Local");return{data:ie.join(r,
|
|
296
|
+
e,"Data"),config:ie.join(t,e,"Config"),cache:ie.join(r,e,"Cache"),log:ie.join(r,e,"Log"),temp:ie.join(is,e)}},Dp=e=>{const t=ie.basename(Je);return{data:ie.join(pt.XDG_DATA_HOME||ie.join(Je,".local","share"),e),config:ie.join(pt.XDG_CONFIG_HOME||ie.join(Je,".config"),e),cache:ie.join(pt.XDG_CACHE_HOME||ie.join(Je,".cache"),e),log:ie.join(pt.XDG_STATE_HOME||ie.join(Je,".local","state"),e),temp:ie.join(is,t,e)}};function qp(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(`Expec\
|
|
297
|
+
ted a string, got ${typeof e}`);return t&&(e+=`-${t}`),me.platform==="darwin"?jp(e):me.platform==="win32"?Lp(e):Dp(e)}const Ye=(e,t)=>function(...n){return e.apply(void 0,n).catch(t)},Ve=(e,t)=>function(...n){try{return e.apply(void 0,n)}catch(i){return t(i)}},xp=me.getuid?!me.getuid():!1,Mp=1e4,Ce=()=>{},pe={isChangeErrorOk:e=>{if(!pe.isNodeError(e))return!1;const{code:t}=e;return t==="ENOSYS"||!xp&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!pe.isNodeError(
|
|
298
|
+
e))return!1;const{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!pe.isNodeError(e))throw e;if(!pe.isChangeErrorOk(e))throw e}};class Hp{constructor(){this.interval=25,this.intervalId=void 0,this.limit=Mp,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),
|
|
299
299
|
delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{const r=()=>this.remove(n),n=()=>t(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.
|
|
300
|
-
add(t),t()}}}}}const
|
|
301
|
-
se.chmod),pe.onChangeError),chown:Ye(
|
|
302
|
-
unlinkSync:Ve(se.unlinkSync,Ce)},retry:{close:Qe(
|
|
303
|
-
se.openSync,pe.isRetriableError),readFileSync:Ze(se.readFileSync,pe.isRetriableError),renameSync:Ze(se.renameSync,pe.isRetriableError),statSync:Ze(se.statSync,pe.isRetriableError),writeSync:Ze(se.writeSync,pe.isRetriableError),writeFileSync:Ze(se.writeFileSync,pe.isRetriableError)}},
|
|
304
|
-
"linux",
|
|
305
|
-
once("exit",()=>this.exit());for(const t of us)try{me.once(t,()=>this.exit(t))}catch{}},this.register=t=>(this.callbacks.add(t),()=>{this.callbacks.delete(t)}),this.hook()}}const
|
|
306
|
-
_e.store[e]&&(delete _e.store[e]
|
|
307
|
-
const n=Date.now()+((r.timeout??
|
|
308
|
-
t,0,r.encoding||
|
|
309
|
-
purge(
|
|
310
|
-
identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((d,
|
|
311
|
-
reduce((d,
|
|
312
|
-
|
|
313
|
-
typeof
|
|
314
|
-
|
|
315
|
-
t"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:c,parent:l}={}){this._names={},this._prefixes=c,this._parent=l}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){const l=this._names[c]||this._nameGroup(c);return`${c}${l.index++}`}_nameGroup(c){var l,
|
|
316
|
-
prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=i;class
|
|
317
|
-
ref===void 0)throw new Error("CodeGen: ref must be passed in value");const y=this.toName(c),{prefix:_}=y,S=(
|
|
318
|
-
throw new Error(`CodeGen: name "${
|
|
319
|
-
opts._n}`}else if(f=y?.(
|
|
300
|
+
add(t),t()}}}}}const Up=new Hp,Qe=(e,t)=>function(n){return function i(...o){return Up.schedule().then(a=>{const s=c=>(a(),c),u=c=>{if(a(),Date.now()>=n)throw c;if(t(c)){const l=Math.round(100*Math.random());return new Promise(y=>setTimeout(y,l)).then(()=>i.apply(void 0,o))}throw c};return e.apply(void 0,o).then(s,u)})}},Ze=(e,t)=>function(n){return function i(...o){try{return e.apply(void 0,o)}catch(a){if(Date.now()>n)throw a;if(t(a))return i.apply(void 0,o);throw a}}},$e={attempt:{chmod:Ye(ve(
|
|
301
|
+
se.chmod),pe.onChangeError),chown:Ye(ve(se.chown),pe.onChangeError),close:Ye(ve(se.close),Ce),fsync:Ye(ve(se.fsync),Ce),mkdir:Ye(ve(se.mkdir),Ce),realpath:Ye(ve(se.realpath),Ce),stat:Ye(ve(se.stat),Ce),unlink:Ye(ve(se.unlink),Ce),chmodSync:Ve(se.chmodSync,pe.onChangeError),chownSync:Ve(se.chownSync,pe.onChangeError),closeSync:Ve(se.closeSync,Ce),existsSync:Ve(se.existsSync,Ce),fsyncSync:Ve(se.fsync,Ce),mkdirSync:Ve(se.mkdirSync,Ce),realpathSync:Ve(se.realpathSync,Ce),statSync:Ve(se.statSync,Ce),
|
|
302
|
+
unlinkSync:Ve(se.unlinkSync,Ce)},retry:{close:Qe(ve(se.close),pe.isRetriableError),fsync:Qe(ve(se.fsync),pe.isRetriableError),open:Qe(ve(se.open),pe.isRetriableError),readFile:Qe(ve(se.readFile),pe.isRetriableError),rename:Qe(ve(se.rename),pe.isRetriableError),stat:Qe(ve(se.stat),pe.isRetriableError),write:Qe(ve(se.write),pe.isRetriableError),writeFile:Qe(ve(se.writeFile),pe.isRetriableError),closeSync:Ze(se.closeSync,pe.isRetriableError),fsyncSync:Ze(se.fsyncSync,pe.isRetriableError),openSync:Ze(
|
|
303
|
+
se.openSync,pe.isRetriableError),readFileSync:Ze(se.readFileSync,pe.isRetriableError),renameSync:Ze(se.renameSync,pe.isRetriableError),statSync:Ze(se.statSync,pe.isRetriableError),writeSync:Ze(se.writeSync,pe.isRetriableError),writeFileSync:Ze(se.writeFileSync,pe.isRetriableError)}},Fp="utf8",Ka=438,Vp=511,zp={},Gp=Rt.userInfo().uid,Bp=Rt.userInfo().gid,Kp=1e3,Wp=!!me.getuid;me.getuid&&me.getuid();const Wa=128,Xp=e=>e instanceof Error&&"code"in e,Xa=e=>typeof e=="string",cs=e=>e===void 0,Jp=me.platform===
|
|
304
|
+
"linux",Ja=me.platform==="win32",us=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];Ja||us.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),Jp&&us.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class Yp{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=t=>{if(!this.exited){this.exited=!0;for(const r of this.callbacks)r();t&&(Ja&&t!=="SIGINT"&&t!=="SIGTERM"&&t!=="SIGKILL"?me.kill(me.pid,"SIGTERM"):me.kill(me.pid,t))}},this.hook=()=>{me.
|
|
305
|
+
once("exit",()=>this.exit());for(const t of us)try{me.once(t,()=>this.exit(t))}catch{}},this.register=t=>(this.callbacks.add(t),()=>{this.callbacks.delete(t)}),this.hook()}}const Qp=new Yp,Zp=Qp.register,_e={store:{},create:e=>{const t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),i=`.tmp-${Date.now().toString().slice(-10)}${t}`;return`${e}${i}`},get:(e,t,r=!0)=>{const n=_e.truncate(t(e));return n in _e.store?_e.get(e,t,r):(_e.store[n]=r,[n,()=>delete _e.store[n]])},purge:e=>{
|
|
306
|
+
_e.store[e]&&(delete _e.store[e],$e.attempt.unlink(e))},purgeSync:e=>{_e.store[e]&&(delete _e.store[e],$e.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(const e in _e.store)_e.purgeSync(e)},truncate:e=>{const t=ie.basename(e);if(t.length<=Wa)return e;const r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;const n=t.length-Wa;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Zp(_e.purgeSyncAll);function Ya(e,t,r=zp){if(Xa(r))return Ya(e,t,{encoding:r});
|
|
307
|
+
const n=Date.now()+((r.timeout??Kp)||-1);let i=null,o=null,a=null;try{const s=$e.attempt.realpathSync(e),u=!!s;e=s||e,[o,i]=_e.get(e,r.tmpCreate||_e.create,r.tmpPurge!==!1);const c=Wp&&cs(r.chown),l=cs(r.mode);if(u&&(c||l)){const m=$e.attempt.statSync(e);m&&(r={...r},c&&(r.chown={uid:m.uid,gid:m.gid}),l&&(r.mode=m.mode))}if(!u){const m=ie.dirname(e);$e.attempt.mkdirSync(m,{mode:Vp,recursive:!0})}a=$e.retry.openSync(n)(o,"w",r.mode||Ka),r.tmpCreated&&r.tmpCreated(o),Xa(t)?$e.retry.writeSync(n)(a,
|
|
308
|
+
t,0,r.encoding||Fp):cs(t)||$e.retry.writeSync(n)(a,t,0,t.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?$e.retry.fsyncSync(n)(a):$e.attempt.fsync(a)),$e.retry.closeSync(n)(a),a=null,r.chown&&(r.chown.uid!==Gp||r.chown.gid!==Bp)&&$e.attempt.chownSync(o,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Ka&&$e.attempt.chmodSync(o,r.mode);try{$e.retry.renameSync(n)(o,e)}catch(m){if(!Xp(m)||m.code!=="ENAMETOOLONG")throw m;$e.retry.renameSync(n)(o,_e.truncate(e))}i(),o=null}finally{a&&$e.attempt.closeSync(a),o&&_e.
|
|
309
|
+
purge(o)}}var Zt={exports:{}},ls={},ze={},nt={},fs={},ds={},ps={},Qa;function er(){return Qa||(Qa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid\
|
|
310
|
+
identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((d,v)=>`${d}${v}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.
|
|
311
|
+
reduce((d,v)=>(v instanceof r&&(d[v.str]=(d[v.str]||0)+1),d),{})}}e._Code=n,e.nil=new n("");function i(h,...f){const d=[h[0]];let v=0;for(;v<f.length;)s(d,f[v]),d.push(h[++v]);return new n(d)}e._=i;const o=new n("+");function a(h,...f){const d=[_(h[0])];let v=0;for(;v<f.length;)d.push(o),s(d,f[v]),d.push(o,_(h[++v]));return u(d),new n(d)}e.str=a;function s(h,f){f instanceof n?h.push(...f._items):f instanceof r?h.push(f):h.push(m(f))}e.addCodeArg=s;function u(h){let f=1;for(;f<h.length-1;){if(h[f]===
|
|
312
|
+
o){const d=c(h[f-1],h[f+1]);if(d!==void 0){h.splice(f-1,3,d);continue}h[f++]="+"}f++}}function c(h,f){if(f==='""')return h;if(h==='""')return f;if(typeof h=="string")return f instanceof r||h[h.length-1]!=='"'?void 0:typeof f!="string"?`${h.slice(0,-1)}${f}"`:f[0]==='"'?h.slice(0,-1)+f.slice(1):void 0;if(typeof f=="string"&&f[0]==='"'&&!(h instanceof r))return`"${h}${f.slice(1)}`}function l(h,f){return f.emptyStr()?h:h.emptyStr()?f:a`${h}${f}`}e.strConcat=l;function m(h){return typeof h=="number"||
|
|
313
|
+
typeof h=="boolean"||h===null?h:_(Array.isArray(h)?h.join(","):h)}function y(h){return new n(_(h))}e.stringify=y;function _(h){return JSON.stringify(h).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=_;function S(h){return typeof h=="string"&&e.IDENTIFIER.test(h)?new n(`.${h}`):i`[${h}]`}e.getProperty=S;function g(h){if(typeof h=="string"&&e.IDENTIFIER.test(h))return new n(`${h}`);throw new Error(`CodeGen: invalid export name: ${h}, use explicit $id name mapping`)}e.getEsmExportName=
|
|
314
|
+
g;function p(h){return new n(h.toString())}e.regexpCode=p})(ps)),ps}var hs={},Za;function ei(){return Za||(Za=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=er();class r extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("cons\
|
|
315
|
+
t"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:c,parent:l}={}){this._names={},this._prefixes=c,this._parent=l}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){const l=this._names[c]||this._nameGroup(c);return`${c}${l.index++}`}_nameGroup(c){var l,m;if(!((m=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||m===void 0)&&m.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: \
|
|
316
|
+
prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=i;class o extends t.Name{constructor(c,l){super(l),this.prefix=c}setValue(c,{property:l,itemIndex:m}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(l)}[${m}]`}}e.ValueScopeName=o;const a=(0,t._)`\n`;class s extends i{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?a:t.nil}}get(){return this._scope}name(c){return new o(c,this._newName(c))}value(c,l){var m;if(l.
|
|
317
|
+
ref===void 0)throw new Error("CodeGen: ref must be passed in value");const y=this.toName(c),{prefix:_}=y,S=(m=l.key)!==null&&m!==void 0?m:l.ref;let g=this._values[_];if(g){const f=g.get(S);if(f)return f}else g=this._values[_]=new Map;g.set(S,y);const p=this._scope[_]||(this._scope[_]=[]),h=p.length;return p[h]=l.ref,y.setValue(l,{property:_,itemIndex:h}),y}getValue(c,l){const m=this._values[c];if(m)return m.get(l)}scopeRefs(c,l=this._values){return this._reduceValues(l,m=>{if(m.scopePath===void 0)
|
|
318
|
+
throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${c}${m.scopePath}`})}scopeCode(c=this._values,l,m){return this._reduceValues(c,y=>{if(y.value===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return y.value.code},l,m)}_reduceValues(c,l,m={},y){let _=t.nil;for(const S in c){const g=c[S];if(!g)continue;const p=m[S]=m[S]||new Map;g.forEach(h=>{if(p.has(h))return;p.set(h,n.Started);let f=l(h);if(f){const d=this.opts.es5?e.varKinds.var:e.varKinds.const;_=(0,t._)`${_}${d} ${h} = ${f};${this.
|
|
319
|
+
opts._n}`}else if(f=y?.(h))_=(0,t._)`${_}${f}${this.opts._n}`;else throw new r(h);p.set(h,n.Completed)})}return _}}e.ValueScope=s})(hs)),hs}var ti;function ae(){return ti||(ti=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=er(),r=ei();var n=er();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n.
|
|
320
320
|
_}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.
|
|
321
|
-
regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=
|
|
322
|
-
_Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class
|
|
323
|
-
str])return this.rhs&&(this.rhs=I(this.rhs,R,b)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class
|
|
324
|
-
super(R,C,B),this.op=b}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class c extends
|
|
325
|
-
this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,b){return this.code=I(this.code,R,b),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class _ extends
|
|
326
|
-
length>0?this:void 0}optimizeNames(R,b){const{nodes:C}=this;let B=C.length;for(;B--;){const K=C[B];K.optimizeNames(R,b)||(M(R,K.names),C.splice(B,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((R,b)=>H(R,b.names),{})}}class S extends _{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class
|
|
327
|
-
"else "+this.else.render(R)),b}optimizeNodes(){super.optimizeNodes();const R=this.condition;if(R===!0)return this.nodes;let b=this.else;if(b){const C=b.optimizeNodes();b=this.else=Array.isArray(C)?new p(C):C}if(b)return R===!1?b instanceof
|
|
328
|
-
condition=I(this.condition,R,b),this}get names(){const R=super.names;return D(R,this.condition),this.else&&H(R,this.else.names),R}}
|
|
329
|
-
R,this.name=b,this.from=C,this.to=B}render(R){const b=R.es5?r.varKinds.var:this.varKind,{name:C,from:B,to:K}=this;return`for(${b} ${C}=${B}; ${C}<${K}; ${C}++)`+super.render(R)}get names(){const R=D(super.names,this.from);return D(R,this.to)}}class
|
|
321
|
+
regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=ei();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t.
|
|
322
|
+
_Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(R,b){return this}}class a extends o{constructor(R,b,C){super(),this.varKind=R,this.name=b,this.rhs=C}render({es5:R,_n:b}){const C=R?r.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${B};`+b}optimizeNames(R,b){if(R[this.name.
|
|
323
|
+
str])return this.rhs&&(this.rhs=I(this.rhs,R,b)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends o{constructor(R,b,C){super(),this.lhs=R,this.rhs=b,this.sideEffects=C}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,b){if(!(this.lhs instanceof t.Name&&!R[this.lhs.str]&&!this.sideEffects))return this.rhs=I(this.rhs,R,b),this}get names(){const R=this.lhs instanceof t.Name?{}:{...this.lhs.names};return D(R,this.rhs)}}class u extends s{constructor(R,b,C,B){
|
|
324
|
+
super(R,C,B),this.op=b}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class c extends o{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}}class l extends o{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}}class m extends o{constructor(R){super(),this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}}class y extends o{constructor(R){super(),
|
|
325
|
+
this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,b){return this.code=I(this.code,R,b),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class _ extends o{constructor(R=[]){super(),this.nodes=R}render(R){return this.nodes.reduce((b,C)=>b+C.render(R),"")}optimizeNodes(){const{nodes:R}=this;let b=R.length;for(;b--;){const C=R[b].optimizeNodes();Array.isArray(C)?R.splice(b,1,...C):C?R[b]=C:R.splice(b,1)}return R.
|
|
326
|
+
length>0?this:void 0}optimizeNames(R,b){const{nodes:C}=this;let B=C.length;for(;B--;){const K=C[B];K.optimizeNames(R,b)||(M(R,K.names),C.splice(B,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((R,b)=>H(R,b.names),{})}}class S extends _{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class g extends _{}class p extends S{}p.kind="else";class h extends S{constructor(R,b){super(b),this.condition=R}render(R){let b=`if(${this.condition})`+super.render(R);return this.else&&(b+=
|
|
327
|
+
"else "+this.else.render(R)),b}optimizeNodes(){super.optimizeNodes();const R=this.condition;if(R===!0)return this.nodes;let b=this.else;if(b){const C=b.optimizeNodes();b=this.else=Array.isArray(C)?new p(C):C}if(b)return R===!1?b instanceof h?b:b.nodes:this.nodes.length?this:new h(z(R),b instanceof h?[b]:b.nodes);if(!(R===!1||!this.nodes.length))return this}optimizeNames(R,b){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(R,b),!!(super.optimizeNames(R,b)||this.else))return this.
|
|
328
|
+
condition=I(this.condition,R,b),this}get names(){const R=super.names;return D(R,this.condition),this.else&&H(R,this.else.names),R}}h.kind="if";class f extends S{}f.kind="for";class d extends f{constructor(R){super(),this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,b){if(super.optimizeNames(R,b))return this.iteration=I(this.iteration,R,b),this}get names(){return H(super.names,this.iteration.names)}}class v extends f{constructor(R,b,C,B){super(),this.varKind=
|
|
329
|
+
R,this.name=b,this.from=C,this.to=B}render(R){const b=R.es5?r.varKinds.var:this.varKind,{name:C,from:B,to:K}=this;return`for(${b} ${C}=${B}; ${C}<${K}; ${C}++)`+super.render(R)}get names(){const R=D(super.names,this.from);return D(R,this.to)}}class $ extends f{constructor(R,b,C,B){super(),this.loop=R,this.varKind=b,this.name=C,this.iterable=B}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,b){if(super.optimizeNames(R,b))return this.
|
|
330
330
|
iterable=I(this.iterable,R,b),this}get names(){return H(super.names,this.iterable.names)}}class w extends S{constructor(R,b,C){super(),this.name=R,this.args=b,this.async=C}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}}w.kind="func";class E extends _{render(R){return"return "+super.render(R)}}E.kind="return";class P extends S{render(R){let b="try"+super.render(R);return this.catch&&(b+=this.catch.render(R)),this.finally&&(b+=this.finally.render(R)),
|
|
331
331
|
b}optimizeNodes(){var R,b;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(b=this.finally)===null||b===void 0||b.optimizeNodes(),this}optimizeNames(R,b){var C,B;return super.optimizeNames(R,b),(C=this.catch)===null||C===void 0||C.optimizeNames(R,b),(B=this.finally)===null||B===void 0||B.optimizeNames(R,b),this}get names(){const R=super.names;return this.catch&&H(R,this.catch.names),this.finally&&H(R,this.finally.names),R}}class O extends S{constructor(R){super(),
|
|
332
332
|
this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}O.kind="catch";class U extends S{render(R){return"finally"+super.render(R)}}U.kind="finally";class x{constructor(R,b={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...b,_n:b.lines?`
|
|
333
|
-
`:""},this._extScope=R,this._scope=new r.Scope({parent:R}),this._nodes=[new
|
|
334
|
-
const K=this._scope.toName(b);return C!==void 0&&B&&(this._constants[K.str]=C),this._leafNode(new
|
|
335
|
-
b.length>1&&b.push(","),b.push(C),(C!==B||this.opts.es5)&&(b.push(":"),(0,t.addCodeArg)(b,B));return b.push("}"),new t._Code(b)}if(R,b,C){if(this._blockNode(new
|
|
336
|
-
return this._for(new d(R),b)}forRange(R,b,C,B,K=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(R);return this._for(new
|
|
337
|
-
if(this.opts.ownProperties)return this.forOf(R,(0,t._)`Object.keys(${b})`,C);const K=this._scope.toName(R);return this._for(new
|
|
338
|
-
atch" and "finally"');const B=new P;if(this._blockNode(B),this.code(R),b){const K=this.name("e");this._currNode=B.catch=new O(K),b(K)}return C&&(this._currNode=B.finally=new U,this.code(C)),this._endBlockNode(O,U)}throw(R){return this._leafNode(new
|
|
333
|
+
`:""},this._extScope=R,this._scope=new r.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,b){const C=this._extScope.value(R,b);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(R,b){return this._extScope.getValue(R,b)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,b,C,B){
|
|
334
|
+
const K=this._scope.toName(b);return C!==void 0&&B&&(this._constants[K.str]=C),this._leafNode(new a(R,K,C)),K}const(R,b,C){return this._def(r.varKinds.const,R,b,C)}let(R,b,C){return this._def(r.varKinds.let,R,b,C)}var(R,b,C){return this._def(r.varKinds.var,R,b,C)}assign(R,b,C){return this._leafNode(new s(R,b,C))}add(R,b){return this._leafNode(new u(R,e.operators.ADD,b))}code(R){return typeof R=="function"?R():R!==t.nil&&this._leafNode(new y(R)),this}object(...R){const b=["{"];for(const[C,B]of R)
|
|
335
|
+
b.length>1&&b.push(","),b.push(C),(C!==B||this.opts.es5)&&(b.push(":"),(0,t.addCodeArg)(b,B));return b.push("}"),new t._Code(b)}if(R,b,C){if(this._blockNode(new h(R)),b&&C)this.code(b).else().code(C).endIf();else if(b)this.code(b).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new h(R))}else(){return this._elseNode(new p)}endIf(){return this._endBlockNode(h,p)}_for(R,b){return this._blockNode(R),b&&this.code(b).endFor(),this}for(R,b){
|
|
336
|
+
return this._for(new d(R),b)}forRange(R,b,C,B,K=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(R);return this._for(new v(K,ee,b,C),()=>B(ee))}forOf(R,b,C,B=r.varKinds.const){const K=this._scope.toName(R);if(this.opts.es5){const ee=b instanceof t.Name?b:this.var("_arr",b);return this.forRange("_i",0,(0,t._)`${ee}.length`,re=>{this.var(K,(0,t._)`${ee}[${re}]`),C(K)})}return this._for(new $("of",B,K,b),()=>C(K))}forIn(R,b,C,B=this.opts.es5?r.varKinds.var:r.varKinds.const){
|
|
337
|
+
if(this.opts.ownProperties)return this.forOf(R,(0,t._)`Object.keys(${b})`,C);const K=this._scope.toName(R);return this._for(new $("in",B,K,b),()=>C(K))}endFor(){return this._endBlockNode(f)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new l(R))}return(R){const b=new E;if(this._blockNode(b),this.code(R),b.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(R,b,C){if(!b&&!C)throw new Error('CodeGen: "try" without "c\
|
|
338
|
+
atch" and "finally"');const B=new P;if(this._blockNode(B),this.code(R),b){const K=this.name("e");this._currNode=B.catch=new O(K),b(K)}return C&&(this._currNode=B.finally=new U,this.code(C)),this._endBlockNode(O,U)}throw(R){return this._leafNode(new m(R))}block(R,b){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(b),this}endBlock(R){const b=this._blockStarts.pop();if(b===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-b;if(C<0||
|
|
339
339
|
R!==void 0&&C!==R)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${R} expected`);return this._nodes.length=b,this}func(R,b=t.nil,C,B){return this._blockNode(new w(R,b,C)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,b){
|
|
340
|
-
const C=this._currNode;if(C instanceof R||b&&C instanceof b)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${b?`${R.kind}/${b.kind}`:R.kind}"`)}_elseNode(R){const b=this._currNode;if(!(b instanceof
|
|
340
|
+
const C=this._currNode;if(C instanceof R||b&&C instanceof b)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${b?`${R.kind}/${b.kind}`:R.kind}"`)}_elseNode(R){const b=this._currNode;if(!(b instanceof h))throw new Error('CodeGen: "else" without "if"');return this._currNode=b.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const b=this._nodes;b[b.length-1]=R}}e.CodeGen=x;function H(T,R){for(const b in R)T[b]=
|
|
341
341
|
(T[b]||0)+(R[b]||0);return T}function D(T,R){return R instanceof t._CodeOrName?H(T,R.names):T}function I(T,R,b){if(T instanceof t.Name)return C(T);if(!B(T))return T;return new t._Code(T._items.reduce((K,ee)=>(ee instanceof t.Name&&(ee=C(ee)),ee instanceof t._Code?K.push(...ee._items):K.push(ee),K),[]));function C(K){const ee=b[K.str];return ee===void 0||R[K.str]!==1?K:(delete R[K.str],ee)}function B(K){return K instanceof t._Code&&K._items.some(ee=>ee instanceof t.Name&&R[ee.str]===1&&b[ee.str]!==
|
|
342
|
-
void 0)}}function M(T,R){for(const b in R)T[b]=(T[b]||0)-(R[b]||0)}function z(T){return typeof T=="boolean"||typeof T=="number"||T===null?!T:(0,t._)`!${L(T)}`}e.not=z;const F=A(e.operators.AND);function G(...T){return T.reduce(F)}e.and=G;const Q=A(e.operators.OR);function q(...T){return T.reduce(Q)}e.or=q;function A(T){return(R,b)=>R===t.nil?b:b===t.nil?R:(0,t._)`${L(R)} ${T} ${L(b)}`}function L(T){return T instanceof t.Name?T:(0,t._)`(${T})`}})(ds)),ds}var ce={},
|
|
343
|
-
|
|
344
|
-
"boolean"?w:Object.keys(w).length===0?!0:(i(
|
|
345
|
-
return!1}ce.schemaHasRulesButRef=
|
|
346
|
-
return
|
|
347
|
-
()=>{
|
|
348
|
-
()
|
|
349
|
-
w.code))})}ce.useFunc=
|
|
350
|
-
checkStrictMode=
|
|
351
|
-
Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return tr.default=t,tr}var
|
|
352
|
-
keyword:p,schemaType:
|
|
353
|
-
()=>p.if(
|
|
354
|
-
(0,t._)`${w}.schemaPath`,(0,t.str)`${
|
|
355
|
-
(0,t._)`${d}.errors`,
|
|
356
|
-
(0,t.str)`${p}${(0,r.getErrorPath)(
|
|
357
|
-
|
|
358
|
-
ect"&&c.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${l}.errors`,null),u.return(!0))}nt.topBoolOrEmptySchema=i;function s
|
|
342
|
+
void 0)}}function M(T,R){for(const b in R)T[b]=(T[b]||0)-(R[b]||0)}function z(T){return typeof T=="boolean"||typeof T=="number"||T===null?!T:(0,t._)`!${L(T)}`}e.not=z;const F=A(e.operators.AND);function G(...T){return T.reduce(F)}e.and=G;const Q=A(e.operators.OR);function q(...T){return T.reduce(Q)}e.or=q;function A(T){return(R,b)=>R===t.nil?b:b===t.nil?R:(0,t._)`${L(R)} ${T} ${L(b)}`}function L(T){return T instanceof t.Name?T:(0,t._)`(${T})`}})(ds)),ds}var ce={},ri;function fe(){if(ri)return ce;
|
|
343
|
+
ri=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.checkStrictMode=ce.getErrorPath=ce.Type=ce.useFunc=ce.setEvaluated=ce.evaluatedPropsToName=ce.mergeEvaluated=ce.eachItem=ce.unescapeJsonPointer=ce.escapeJsonPointer=ce.escapeFragment=ce.unescapeFragment=ce.schemaRefOrVal=ce.schemaHasRulesButRef=ce.schemaHasRules=ce.checkUnknownRules=ce.alwaysValidSchema=ce.toHash=void 0;const e=ae(),t=er();function r($){const w={};for(const E of $)w[E]=!0;return w}ce.toHash=r;function n($,w){return typeof w==
|
|
344
|
+
"boolean"?w:Object.keys(w).length===0?!0:(i($,w),!o(w,$.self.RULES.all))}ce.alwaysValidSchema=n;function i($,w=$.schema){const{opts:E,self:P}=$;if(!E.strictSchema||typeof w=="boolean")return;const O=P.RULES.keywords;for(const U in w)O[U]||v($,`unknown keyword: "${U}"`)}ce.checkUnknownRules=i;function o($,w){if(typeof $=="boolean")return!$;for(const E in $)if(w[E])return!0;return!1}ce.schemaHasRules=o;function a($,w){if(typeof $=="boolean")return!$;for(const E in $)if(E!=="$ref"&&w.all[E])return!0;
|
|
345
|
+
return!1}ce.schemaHasRulesButRef=a;function s({topSchemaRef:$,schemaPath:w},E,P,O){if(!O){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${$}${w}${(0,e.getProperty)(P)}`}ce.schemaRefOrVal=s;function u($){return m(decodeURIComponent($))}ce.unescapeFragment=u;function c($){return encodeURIComponent(l($))}ce.escapeFragment=c;function l($){return typeof $=="number"?`${$}`:$.replace(/~/g,"~0").replace(/\//g,"~1")}ce.escapeJsonPointer=l;function m($){
|
|
346
|
+
return $.replace(/~1/g,"/").replace(/~0/g,"~")}ce.unescapeJsonPointer=m;function y($,w){if(Array.isArray($))for(const E of $)w(E);else w($)}ce.eachItem=y;function _({mergeNames:$,mergeToName:w,mergeValues:E,resultToName:P}){return(O,U,x,H)=>{const D=x===void 0?U:x instanceof e.Name?(U instanceof e.Name?$(O,U,x):w(O,U,x),x):U instanceof e.Name?(w(O,x,U),U):E(U,x);return H===e.Name&&!(D instanceof e.Name)?P(O,D):D}}ce.mergeEvaluated={props:_({mergeNames:($,w,E)=>$.if((0,e._)`${E} !== true && ${w} !== undefined`,
|
|
347
|
+
()=>{$.if((0,e._)`${w} === true`,()=>$.assign(E,!0),()=>$.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${w})`))}),mergeToName:($,w,E)=>$.if((0,e._)`${E} !== true`,()=>{w===!0?$.assign(E,!0):($.assign(E,(0,e._)`${E} || {}`),g($,E,w))}),mergeValues:($,w)=>$===!0?!0:{...$,...w},resultToName:S}),items:_({mergeNames:($,w,E)=>$.if((0,e._)`${E} !== true && ${w} !== undefined`,()=>$.assign(E,(0,e._)`${w} === true ? true : ${E} > ${w} ? ${E} : ${w}`)),mergeToName:($,w,E)=>$.if((0,e._)`${E} !== true`,
|
|
348
|
+
()=>$.assign(E,w===!0?!0:(0,e._)`${E} > ${w} ? ${E} : ${w}`)),mergeValues:($,w)=>$===!0?!0:Math.max($,w),resultToName:($,w)=>$.var("items",w)})};function S($,w){if(w===!0)return $.var("props",!0);const E=$.var("props",(0,e._)`{}`);return w!==void 0&&g($,E,w),E}ce.evaluatedPropsToName=S;function g($,w,E){Object.keys(E).forEach(P=>$.assign((0,e._)`${w}${(0,e.getProperty)(P)}`,!0))}ce.setEvaluated=g;const p={};function h($,w){return $.scopeValue("func",{ref:w,code:p[w.code]||(p[w.code]=new t._Code(
|
|
349
|
+
w.code))})}ce.useFunc=h;var f;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(f||(ce.Type=f={}));function d($,w,E){if($ instanceof e.Name){const P=w===f.Num;return E?P?(0,e._)`"[" + ${$} + "]"`:(0,e._)`"['" + ${$} + "']"`:P?(0,e._)`"/" + ${$}`:(0,e._)`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)($).toString():"/"+l($)}ce.getErrorPath=d;function v($,w,E=$.opts.strictSchema){if(E){if(w=`strict mode: ${w}`,E===!0)throw new Error(w);$.self.logger.warn(w)}}return ce.
|
|
350
|
+
checkStrictMode=v,ce}var tr={},ni;function Ne(){if(ni)return tr;ni=1,Object.defineProperty(tr,"__esModule",{value:!0});const e=ae(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.
|
|
351
|
+
Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return tr.default=t,tr}var si;function rr(){return si||(si=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ae(),r=fe(),n=Ne();e.keywordError={message:({keyword:p})=>(0,t.str)`must pass "${p}" keyword validation`},e.keyword$DataError={message:({
|
|
352
|
+
keyword:p,schemaType:h})=>h?(0,t.str)`"${p}" keyword must be ${h} ($data)`:(0,t.str)`"${p}" keyword is invalid ($data)`};function i(p,h=e.keywordError,f,d){const{it:v}=p,{gen:$,compositeRule:w,allErrors:E}=v,P=m(p,h,f);d??(w||E)?u($,P):c(v,(0,t._)`[${P}]`)}e.reportError=i;function o(p,h=e.keywordError,f){const{it:d}=p,{gen:v,compositeRule:$,allErrors:w}=d,E=m(p,h,f);u(v,E),$||w||c(d,n.default.vErrors)}e.reportExtraError=o;function a(p,h){p.assign(n.default.errors,h),p.if((0,t._)`${n.default.vErrors} !== null`,
|
|
353
|
+
()=>p.if(h,()=>p.assign((0,t._)`${n.default.vErrors}.length`,h),()=>p.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function s({gen:p,keyword:h,schemaValue:f,data:d,errsCount:v,it:$}){if(v===void 0)throw new Error("ajv implementation error");const w=p.name("err");p.forRange("i",v,n.default.errors,E=>{p.const(w,(0,t._)`${n.default.vErrors}[${E}]`),p.if((0,t._)`${w}.instancePath === undefined`,()=>p.assign((0,t._)`${w}.instancePath`,(0,t.strConcat)(n.default.instancePath,$.errorPath))),p.assign(
|
|
354
|
+
(0,t._)`${w}.schemaPath`,(0,t.str)`${$.errSchemaPath}/${h}`),$.opts.verbose&&(p.assign((0,t._)`${w}.schema`,f),p.assign((0,t._)`${w}.data`,d))})}e.extendErrors=s;function u(p,h){const f=p.const("err",h);p.if((0,t._)`${n.default.vErrors} === null`,()=>p.assign(n.default.vErrors,(0,t._)`[${f}]`),(0,t._)`${n.default.vErrors}.push(${f})`),p.code((0,t._)`${n.default.errors}++`)}function c(p,h){const{gen:f,validateName:d,schemaEnv:v}=p;v.$async?f.throw((0,t._)`new ${p.ValidationError}(${h})`):(f.assign(
|
|
355
|
+
(0,t._)`${d}.errors`,h),f.return(!1))}const l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function m(p,h,f){const{createErrors:d}=p.it;return d===!1?(0,t._)`{}`:y(p,h,f)}function y(p,h,f={}){const{gen:d,it:v}=p,$=[_(v,f),S(p,f)];return g(p,h,$),d.object(...$)}function _({errorPath:p},{instancePath:h}){const f=h?
|
|
356
|
+
(0,t.str)`${p}${(0,r.getErrorPath)(h,r.Type.Str)}`:p;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function S({keyword:p,it:{errSchemaPath:h}},{schemaPath:f,parentSchema:d}){let v=d?h:(0,t.str)`${h}/${p}`;return f&&(v=(0,t.str)`${v}${(0,r.getErrorPath)(f,r.Type.Str)}`),[l.schemaPath,v]}function g(p,{params:h,message:f},d){const{keyword:v,data:$,schemaValue:w,it:E}=p,{opts:P,propertyName:O,topSchemaRef:U,schemaPath:x}=E;d.push([l.keyword,v],[l.params,typeof h=="function"?
|
|
357
|
+
h(p):h||(0,t._)`{}`]),P.messages&&d.push([l.message,typeof f=="function"?f(p):f]),P.verbose&&d.push([l.schema,w],[l.parentSchema,(0,t._)`${U}${x}`],[n.default.data,$]),O&&d.push([l.propertyName,O])}})(fs)),fs}var oi;function eh(){if(oi)return nt;oi=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.boolOrEmptySchema=nt.topBoolOrEmptySchema=void 0;const e=rr(),t=ae(),r=Ne(),n={message:"boolean schema is false"};function i(s){const{gen:u,schema:c,validateName:l}=s;c===!1?a(s,!1):typeof c=="obj\
|
|
358
|
+
ect"&&c.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${l}.errors`,null),u.return(!0))}nt.topBoolOrEmptySchema=i;function o(s,u){const{gen:c,schema:l}=s;l===!1?(c.var(u,!1),a(s)):c.var(u,!0)}nt.boolOrEmptySchema=o;function a(s,u){const{gen:c,data:l}=s,m={gen:c,keyword:"false schema",data:l,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:s};(0,e.reportError)(m,n,void 0,u)}return nt}var ge={},st={},ai;function ii(){if(ai)return st;ai=1,Object.defineProperty(st,"__esModule",{value:!0}),
|
|
359
359
|
st.getRules=st.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(i){return typeof i=="string"&&t.has(i)}st.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return st.getRules=n,st}var Ge={},
|
|
360
|
-
|
|
361
|
-
function nr(){if(
|
|
362
|
-
f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&d.push("null")}return d}ge.getSchemaTypes=
|
|
363
|
-
|
|
364
|
-
if(S(d,w,E.strictNumbers),()
|
|
365
|
-
|| (${P} == "string" && ${w} && ${w} == +${w})`).assign(O,(0,n._)`+${w}`);return;case"integer"
|
|
366
|
-
|| (${P} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(O,(0,n._)`+${w}`);return;case"boolean"
|
|
367
|
-
|| ${P} === "boolean" || ${w} === null`).assign(O,(0,n._)`[${w}]`)}}}function y({gen:f,parentData:d,parentDataProperty:
|
|
368
|
-
P((0,n._)`!(${d} % 1) && !isNaN(${d})`);break;case"number":E=P();break;default:return(0,n._)`typeof ${d} ${w} ${f}`}return
|
|
369
|
-
w=n.nil;E.number&&delete E.integer;for(const P in E)w=(0,n.and)(w,_(P,d,
|
|
370
|
-
it:f}}return ge}var Tt={},
|
|
371
|
-
i,`default is ignored for: ${
|
|
372
|
-
de.checkMissingProp=de.checkReportMissingProp=void 0;const e=ae(),t=fe(),r=Ne(),n=fe();function i(f,d){const{gen:
|
|
373
|
-
return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}de.hasPropFunc=
|
|
374
|
-
return f?Object.keys(f).filter(d=>d!=="__proto__"):[]}de.allSchemaProperties=
|
|
375
|
-
P.opts.dynamicRef&&D.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const I=(0,e._)`${H}, ${
|
|
376
|
-
data:
|
|
377
|
-
!w.opts.unevaluated)return;const P=d.let("valid",!1),O=d.name("_valid");d.block(()=>
|
|
378
|
-
const e=ae(),t=Ne(),r=Ie(),n=rr();function i(y,_){const{gen:S,keyword
|
|
379
|
-
_.compile.call(
|
|
380
|
-
return
|
|
360
|
+
ci;function ui(){if(ci)return Ge;ci=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.shouldUseRule=Ge.shouldUseGroup=Ge.schemaHasRulesForType=void 0;function e({schema:n,self:i},o){const a=i.RULES.types[o];return a&&a!==!0&&t(n,a)}Ge.schemaHasRulesForType=e;function t(n,i){return i.rules.some(o=>r(n,o))}Ge.shouldUseGroup=t;function r(n,i){var o;return n[i.keyword]!==void 0||((o=i.definition.implements)===null||o===void 0?void 0:o.some(a=>n[a]!==void 0))}return Ge.shouldUseRule=r,Ge}var li;
|
|
361
|
+
function nr(){if(li)return ge;li=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.reportTypeError=ge.checkDataTypes=ge.checkDataType=ge.coerceAndCheckDataType=ge.getJSONTypes=ge.getSchemaTypes=ge.DataType=void 0;const e=ii(),t=ui(),r=rr(),n=ae(),i=fe();var o;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(o||(ge.DataType=o={}));function a(f){const d=s(f.type);if(d.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!d.length&&
|
|
362
|
+
f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&d.push("null")}return d}ge.getSchemaTypes=a;function s(f){const d=Array.isArray(f)?f:f?[f]:[];if(d.every(e.isJSONType))return d;throw new Error("type must be JSONType or JSONType[]: "+d.join(","))}ge.getJSONTypes=s;function u(f,d){const{gen:v,data:$,opts:w}=f,E=l(d,w.coerceTypes),P=d.length>0&&!(E.length===0&&d.length===1&&(0,t.schemaHasRulesForType)(f,d[0]));if(P){const O=S(d,$,w.strictNumbers,o.Wrong);
|
|
363
|
+
v.if(O,()=>{E.length?m(f,d,E):p(f)})}return P}ge.coerceAndCheckDataType=u;const c=new Set(["string","number","integer","boolean","null"]);function l(f,d){return d?f.filter(v=>c.has(v)||d==="array"&&v==="array"):[]}function m(f,d,v){const{gen:$,data:w,opts:E}=f,P=$.let("dataType",(0,n._)`typeof ${w}`),O=$.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&$.if((0,n._)`${P} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>$.assign(w,(0,n._)`${w}[0]`).assign(P,(0,n._)`typeof ${w}`).
|
|
364
|
+
if(S(d,w,E.strictNumbers),()=>$.assign(O,w))),$.if((0,n._)`${O} !== undefined`);for(const x of v)(c.has(x)||x==="array"&&E.coerceTypes==="array")&&U(x);$.else(),p(f),$.endIf(),$.if((0,n._)`${O} !== undefined`,()=>{$.assign(w,O),y(f,O)});function U(x){switch(x){case"string":$.elseIf((0,n._)`${P} == "number" || ${P} == "boolean"`).assign(O,(0,n._)`"" + ${w}`).elseIf((0,n._)`${w} === null`).assign(O,(0,n._)`""`);return;case"number":$.elseIf((0,n._)`${P} == "boolean" || ${w} === null
|
|
365
|
+
|| (${P} == "string" && ${w} && ${w} == +${w})`).assign(O,(0,n._)`+${w}`);return;case"integer":$.elseIf((0,n._)`${P} === "boolean" || ${w} === null
|
|
366
|
+
|| (${P} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(O,(0,n._)`+${w}`);return;case"boolean":$.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(O,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(O,!0);return;case"null":$.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),$.assign(O,null);return;case"array":$.elseIf((0,n._)`${P} === "string" || ${P} === "number"
|
|
367
|
+
|| ${P} === "boolean" || ${w} === null`).assign(O,(0,n._)`[${w}]`)}}}function y({gen:f,parentData:d,parentDataProperty:v},$){f.if((0,n._)`${d} !== undefined`,()=>f.assign((0,n._)`${d}[${v}]`,$))}function _(f,d,v,$=o.Correct){const w=$===o.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(f){case"null":return(0,n._)`${d} ${w} null`;case"array":E=(0,n._)`Array.isArray(${d})`;break;case"object":E=(0,n._)`${d} && typeof ${d} == "object" && !Array.isArray(${d})`;break;case"integer":E=
|
|
368
|
+
P((0,n._)`!(${d} % 1) && !isNaN(${d})`);break;case"number":E=P();break;default:return(0,n._)`typeof ${d} ${w} ${f}`}return $===o.Correct?E:(0,n.not)(E);function P(O=n.nil){return(0,n.and)((0,n._)`typeof ${d} == "number"`,O,v?(0,n._)`isFinite(${d})`:n.nil)}}ge.checkDataType=_;function S(f,d,v,$){if(f.length===1)return _(f[0],d,v,$);let w;const E=(0,i.toHash)(f);if(E.array&&E.object){const P=(0,n._)`typeof ${d} != "object"`;w=E.null?P:(0,n._)`!${d} || ${P}`,delete E.null,delete E.array,delete E.object}else
|
|
369
|
+
w=n.nil;E.number&&delete E.integer;for(const P in E)w=(0,n.and)(w,_(P,d,v,$));return w}ge.checkDataTypes=S;const g={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:d})=>typeof f=="string"?(0,n._)`{type: ${f}}`:(0,n._)`{type: ${d}}`};function p(f){const d=h(f);(0,r.reportError)(d,g)}ge.reportTypeError=p;function h(f){const{gen:d,data:v,schema:$}=f,w=(0,i.schemaRefOrVal)(f,$,"type");return{gen:d,keyword:"type",data:v,schema:$.type,schemaCode:w,schemaValue:w,parentSchema:$,params:{},
|
|
370
|
+
it:f}}return ge}var Tt={},fi;function th(){if(fi)return Tt;fi=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.assignDefaults=void 0;const e=ae(),t=fe();function r(i,o){const{properties:a,items:s}=i.schema;if(o==="object"&&a)for(const u in a)n(i,u,a[u].default);else o==="array"&&Array.isArray(s)&&s.forEach((u,c)=>n(i,c,u.default))}Tt.assignDefaults=r;function n(i,o,a){const{gen:s,compositeRule:u,data:c,opts:l}=i;if(a===void 0)return;const m=(0,e._)`${c}${(0,e.getProperty)(o)}`;if(u){(0,t.checkStrictMode)(
|
|
371
|
+
i,`default is ignored for: ${m}`);return}let y=(0,e._)`${m} === undefined`;l.useDefaults==="empty"&&(y=(0,e._)`${y} || ${m} === null || ${m} === ""`),s.if(y,(0,e._)`${m} = ${(0,e.stringify)(a)}`)}return Tt}var Oe={},de={},di;function Ie(){if(di)return de;di=1,Object.defineProperty(de,"__esModule",{value:!0}),de.validateUnion=de.validateArray=de.usePattern=de.callValidateCode=de.schemaProperties=de.allSchemaProperties=de.noPropertyInData=de.propertyInData=de.isOwnProperty=de.hasPropFunc=de.reportMissingProp=
|
|
372
|
+
de.checkMissingProp=de.checkReportMissingProp=void 0;const e=ae(),t=fe(),r=Ne(),n=fe();function i(f,d){const{gen:v,data:$,it:w}=f;v.if(l(v,$,d,w.opts.ownProperties),()=>{f.setParams({missingProperty:(0,e._)`${d}`},!0),f.error()})}de.checkReportMissingProp=i;function o({gen:f,data:d,it:{opts:v}},$,w){return(0,e.or)(...$.map(E=>(0,e.and)(l(f,d,E,v.ownProperties),(0,e._)`${w} = ${E}`)))}de.checkMissingProp=o;function a(f,d){f.setParams({missingProperty:d},!0),f.error()}de.reportMissingProp=a;function s(f){
|
|
373
|
+
return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}de.hasPropFunc=s;function u(f,d,v){return(0,e._)`${s(f)}.call(${d}, ${v})`}de.isOwnProperty=u;function c(f,d,v,$){const w=(0,e._)`${d}${(0,e.getProperty)(v)} !== undefined`;return $?(0,e._)`${w} && ${u(f,d,v)}`:w}de.propertyInData=c;function l(f,d,v,$){const w=(0,e._)`${d}${(0,e.getProperty)(v)} === undefined`;return $?(0,e.or)(w,(0,e.not)(u(f,d,v))):w}de.noPropertyInData=l;function m(f){
|
|
374
|
+
return f?Object.keys(f).filter(d=>d!=="__proto__"):[]}de.allSchemaProperties=m;function y(f,d){return m(d).filter(v=>!(0,t.alwaysValidSchema)(f,d[v]))}de.schemaProperties=y;function _({schemaCode:f,data:d,it:{gen:v,topSchemaRef:$,schemaPath:w,errorPath:E},it:P},O,U,x){const H=x?(0,e._)`${f}, ${d}, ${$}${w}`:d,D=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,P.parentData],[r.default.parentDataProperty,P.parentDataProperty],[r.default.rootData,r.default.rootData]];
|
|
375
|
+
P.opts.dynamicRef&&D.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const I=(0,e._)`${H}, ${v.object(...D)}`;return U!==e.nil?(0,e._)`${O}.call(${U}, ${I})`:(0,e._)`${O}(${I})`}de.callValidateCode=_;const S=(0,e._)`new RegExp`;function g({gen:f,it:{opts:d}},v){const $=d.unicodeRegExp?"u":"",{regExp:w}=d.code,E=w(v,$);return f.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${w.code==="new RegExp"?S:(0,n.useFunc)(f,w)}(${v}, ${$})`})}de.usePattern=g;function p(f){const{gen:d,
|
|
376
|
+
data:v,keyword:$,it:w}=f,E=d.name("valid");if(w.allErrors){const O=d.let("valid",!0);return P(()=>d.assign(O,!1)),O}return d.var(E,!0),P(()=>d.break()),E;function P(O){const U=d.const("len",(0,e._)`${v}.length`);d.forRange("i",0,U,x=>{f.subschema({keyword:$,dataProp:x,dataPropType:t.Type.Num},E),d.if((0,e.not)(E),O)})}}de.validateArray=p;function h(f){const{gen:d,schema:v,keyword:$,it:w}=f;if(!Array.isArray(v))throw new Error("ajv implementation error");if(v.some(U=>(0,t.alwaysValidSchema)(w,U))&&
|
|
377
|
+
!w.opts.unevaluated)return;const P=d.let("valid",!1),O=d.name("_valid");d.block(()=>v.forEach((U,x)=>{const H=f.subschema({keyword:$,schemaProp:x,compositeRule:!0},O);d.assign(P,(0,e._)`${P} || ${O}`),f.mergeValidEvaluated(H,O)||d.if((0,e.not)(P))})),f.result(P,()=>f.reset(),()=>f.error(!0))}return de.validateUnion=h,de}var pi;function rh(){if(pi)return Oe;pi=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.validateKeywordUsage=Oe.validSchemaType=Oe.funcKeywordCode=Oe.macroKeywordCode=void 0;
|
|
378
|
+
const e=ae(),t=Ne(),r=Ie(),n=rr();function i(y,_){const{gen:S,keyword:g,schema:p,parentSchema:h,it:f}=y,d=_.macro.call(f.self,p,h,f),v=c(S,g,d);f.opts.validateSchema!==!1&&f.self.validateSchema(d,!0);const $=S.name("valid");y.subschema({schema:d,schemaPath:e.nil,errSchemaPath:`${f.errSchemaPath}/${g}`,topSchemaRef:v,compositeRule:!0},$),y.pass($,()=>y.error(!0))}Oe.macroKeywordCode=i;function o(y,_){var S;const{gen:g,keyword:p,schema:h,parentSchema:f,$data:d,it:v}=y;u(v,_);const $=!d&&_.compile?
|
|
379
|
+
_.compile.call(v.self,h,f,v):_.validate,w=c(g,p,$),E=g.let("valid");y.block$data(E,P),y.ok((S=_.valid)!==null&&S!==void 0?S:E);function P(){if(_.errors===!1)x(),_.modifying&&a(y),H(()=>y.error());else{const D=_.async?O():U();_.modifying&&a(y),H(()=>s(y,D))}}function O(){const D=g.let("ruleErrs",null);return g.try(()=>x((0,e._)`await `),I=>g.assign(E,!1).if((0,e._)`${I} instanceof ${v.ValidationError}`,()=>g.assign(D,(0,e._)`${I}.errors`),()=>g.throw(I))),D}function U(){const D=(0,e._)`${w}.errors`;
|
|
380
|
+
return g.assign(D,null),x(e.nil),D}function x(D=_.async?(0,e._)`await `:e.nil){const I=v.opts.passContext?t.default.this:t.default.self,M=!("compile"in _&&!d||_.schema===!1);g.assign(E,(0,e._)`${D}${(0,r.callValidateCode)(y,w,I,M)}`,_.modifying)}function H(D){var I;g.if((0,e.not)((I=_.valid)!==null&&I!==void 0?I:E),D)}}Oe.funcKeywordCode=o;function a(y){const{gen:_,data:S,it:g}=y;_.if(g.parentData,()=>_.assign(S,(0,e._)`${g.parentData}[${g.parentDataProperty}]`))}function s(y,_){const{gen:S}=y;S.
|
|
381
381
|
if((0,e._)`Array.isArray(${_})`,()=>{S.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${_} : ${t.default.vErrors}.concat(${_})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(y)},()=>y.error())}function u({schemaEnv:y},_){if(_.async&&!y.$async)throw new Error("async keyword in sync schema")}function c(y,_,S){if(S===void 0)throw new Error(`keyword "${_}" failed to compile`);return y.scopeValue("keyword",typeof S=="function"?{ref:S}:{ref:S,code:(0,e.
|
|
382
|
-
stringify)(S)})}function l(y,_,S=!1){return!_.length||_.some(
|
|
383
|
-
f ${
|
|
384
|
-
schemaPath:c,errSchemaPath:l,topSchemaRef:
|
|
385
|
-
l===void 0||
|
|
386
|
-
|
|
387
|
-
n;function i(
|
|
382
|
+
stringify)(S)})}function l(y,_,S=!1){return!_.length||_.some(g=>g==="array"?Array.isArray(y):g==="object"?y&&typeof y=="object"&&!Array.isArray(y):typeof y==g||S&&typeof y>"u")}Oe.validSchemaType=l;function m({schema:y,opts:_,self:S,errSchemaPath:g},p,h){if(Array.isArray(p.keyword)?!p.keyword.includes(h):p.keyword!==h)throw new Error("ajv implementation error");const f=p.dependencies;if(f?.some(d=>!Object.prototype.hasOwnProperty.call(y,d)))throw new Error(`parent schema must have dependencies o\
|
|
383
|
+
f ${h}: ${f.join(",")}`);if(p.validateSchema&&!p.validateSchema(y[h])){const v=`keyword "${h}" value is invalid at path "${g}": `+S.errorsText(p.validateSchema.errors);if(_.validateSchema==="log")S.logger.error(v);else throw new Error(v)}}return Oe.validateKeywordUsage=m,Oe}var Be={},hi;function nh(){if(hi)return Be;hi=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.extendSubschemaMode=Be.extendSubschemaData=Be.getSubschema=void 0;const e=ae(),t=fe();function r(o,{keyword:a,schemaProp:s,schema:u,
|
|
384
|
+
schemaPath:c,errSchemaPath:l,topSchemaRef:m}){if(a!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const y=o.schema[a];return s===void 0?{schema:y,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${a}`}:{schema:y[s],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(s)}`,errSchemaPath:`${o.errSchemaPath}/${a}/${(0,t.escapeFragment)(s)}`}}if(u!==void 0){if(c===void 0||
|
|
385
|
+
l===void 0||m===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:c,topSchemaRef:m,errSchemaPath:l}}throw new Error('either "keyword" or "schema" must be passed')}Be.getSubschema=r;function n(o,a,{dataProp:s,dataPropType:u,data:c,dataTypes:l,propertyName:m}){if(c!==void 0&&s!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:y}=a;if(s!==void 0){const{errorPath:S,dataPathArr:g,opts:p}=a,
|
|
386
|
+
h=y.let("data",(0,e._)`${a.data}${(0,e.getProperty)(s)}`,!0);_(h),o.errorPath=(0,e.str)`${S}${(0,t.getErrorPath)(s,u,p.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${s}`,o.dataPathArr=[...g,o.parentDataProperty]}if(c!==void 0){const S=c instanceof e.Name?c:y.let("data",c,!0);_(S),m!==void 0&&(o.propertyName=m)}l&&(o.dataTypes=l);function _(S){o.data=S,o.dataLevel=a.dataLevel+1,o.dataTypes=[],a.definedProperties=new Set,o.parentData=a.data,o.dataNames=[...a.dataNames,S]}}Be.extendSubschemaData=
|
|
387
|
+
n;function i(o,{jtdDiscriminator:a,jtdMetadata:s,compositeRule:u,createErrors:c,allErrors:l}){u!==void 0&&(o.compositeRule=u),c!==void 0&&(o.createErrors=c),l!==void 0&&(o.allErrors=l),o.jtdDiscriminator=a,o.jtdMetadata=s}return Be.extendSubschemaMode=i,Be}var Ee={},ms={exports:{}},mi;function sh(){if(mi)return ms.exports;mi=1;var e=ms.exports=function(n,i,o){typeof i=="function"&&(o=i,i={}),o=i.cb||o;var a=typeof o=="function"?o:o.pre||function(){},s=o.post||function(){};t(i,a,s,n,"",n)};e.keywords=
|
|
388
388
|
{additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};
|
|
389
|
-
function t(n,i,
|
|
390
|
-
"~1")}return ms.exports}var
|
|
391
|
-
p:!1}Ee.inlineRef=i;const
|
|
392
|
-
u;function c(
|
|
393
|
-
U[
|
|
394
|
-
return new Error(`reference "${U}" resolves to more than one schema`)}}return Ee.getSchemaRefs=S,Ee}var
|
|
395
|
-
opts:Z},J){Z.code.es5?k.func(N,(0,
|
|
396
|
-
k.var(u.default.instancePath,(0,
|
|
397
|
-
parentData,(0,
|
|
398
|
-
()=>N.assign((0,
|
|
399
|
-
function
|
|
389
|
+
function t(n,i,o,a,s,u,c,l,m,y){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,s,u,c,l,m,y);for(var _ in a){var S=a[_];if(Array.isArray(S)){if(_ in e.arrayKeywords)for(var g=0;g<S.length;g++)t(n,i,o,S[g],s+"/"+_+"/"+g,u,s,_,a,g)}else if(_ in e.propsKeywords){if(S&&typeof S=="object")for(var p in S)t(n,i,o,S[p],s+"/"+_+"/"+r(p),u,s,_,a,p)}else(_ in e.keywords||n.allKeys&&!(_ in e.skipKeywords))&&t(n,i,o,S,s+"/"+_,u,s,_,a)}o(a,s,u,c,l,m,y)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,
|
|
390
|
+
"~1")}return ms.exports}var yi;function sr(){if(yi)return Ee;yi=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.getSchemaRefs=Ee.resolveUrl=Ee.normalizeId=Ee._getFullPath=Ee.getFullPath=Ee.inlineRef=void 0;const e=fe(),t=Do(),r=sh(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(g,p=!0){return typeof g=="boolean"?!0:p===!0?!a(g):p?s(g)<=
|
|
391
|
+
p:!1}Ee.inlineRef=i;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(g){for(const p in g){if(o.has(p))return!0;const h=g[p];if(Array.isArray(h)&&h.some(a)||typeof h=="object"&&a(h))return!0}return!1}function s(g){let p=0;for(const h in g){if(h==="$ref")return 1/0;if(p++,!n.has(h)&&(typeof g[h]=="object"&&(0,e.eachItem)(g[h],f=>p+=s(f)),p===1/0))return 1/0}return p}function u(g,p="",h){h!==!1&&(p=m(p));const f=g.parse(p);return c(g,f)}Ee.getFullPath=
|
|
392
|
+
u;function c(g,p){return g.serialize(p).split("#")[0]+"#"}Ee._getFullPath=c;const l=/#\/?$/;function m(g){return g?g.replace(l,""):""}Ee.normalizeId=m;function y(g,p,h){return h=m(h),g.resolve(p,h)}Ee.resolveUrl=y;const _=/^[a-z_][-a-z0-9._]*$/i;function S(g,p){if(typeof g=="boolean")return{};const{schemaId:h,uriResolver:f}=this.opts,d=m(g[h]||p),v={"":d},$=u(f,d,!1),w={},E=new Set;return r(g,{allKeys:!0},(U,x,H,D)=>{if(D===void 0)return;const I=$+x;let M=v[D];typeof U[h]=="string"&&(M=z.call(this,
|
|
393
|
+
U[h])),F.call(this,U.$anchor),F.call(this,U.$dynamicAnchor),v[x]=M;function z(G){const Q=this.opts.uriResolver.resolve;if(G=m(M?Q(M,G):G),E.has(G))throw O(G);E.add(G);let q=this.refs[G];return typeof q=="string"&&(q=this.refs[q]),typeof q=="object"?P(U,q.schema,G):G!==m(I)&&(G[0]==="#"?(P(U,w[G],G),w[G]=U):this.refs[G]=I),G}function F(G){if(typeof G=="string"){if(!_.test(G))throw new Error(`invalid anchor "${G}"`);z.call(this,`#${G}`)}}}),w;function P(U,x,H){if(x!==void 0&&!t(U,x))throw O(H)}function O(U){
|
|
394
|
+
return new Error(`reference "${U}" resolves to more than one schema`)}}return Ee.getSchemaRefs=S,Ee}var gi;function Nt(){if(gi)return ze;gi=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.getData=ze.KeywordCxt=ze.validateFunctionCode=void 0;const e=eh(),t=nr(),r=ui(),n=nr(),i=th(),o=rh(),a=nh(),s=ae(),u=Ne(),c=sr(),l=fe(),m=rr();function y(k){if($(k)&&(E(k),v(k))){p(k);return}_(k,()=>(0,e.topBoolOrEmptySchema)(k))}ze.validateFunctionCode=y;function _({gen:k,validateName:N,schema:V,schemaEnv:X,
|
|
395
|
+
opts:Z},J){Z.code.es5?k.func(N,(0,s._)`${u.default.data}, ${u.default.valCxt}`,X.$async,()=>{k.code((0,s._)`"use strict"; ${f(V,Z)}`),g(k,Z),k.code(J)}):k.func(N,(0,s._)`${u.default.data}, ${S(Z)}`,X.$async,()=>k.code(f(V,Z)).code(J))}function S(k){return(0,s._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${k.dynamicRef?(0,s._)`, ${u.default.dynamicAnchors}={}`:s.nil}}={}`}function g(k,N){k.if(u.default.valCxt,()=>{
|
|
396
|
+
k.var(u.default.instancePath,(0,s._)`${u.default.valCxt}.${u.default.instancePath}`),k.var(u.default.parentData,(0,s._)`${u.default.valCxt}.${u.default.parentData}`),k.var(u.default.parentDataProperty,(0,s._)`${u.default.valCxt}.${u.default.parentDataProperty}`),k.var(u.default.rootData,(0,s._)`${u.default.valCxt}.${u.default.rootData}`),N.dynamicRef&&k.var(u.default.dynamicAnchors,(0,s._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{k.var(u.default.instancePath,(0,s._)`""`),k.var(u.default.
|
|
397
|
+
parentData,(0,s._)`undefined`),k.var(u.default.parentDataProperty,(0,s._)`undefined`),k.var(u.default.rootData,u.default.data),N.dynamicRef&&k.var(u.default.dynamicAnchors,(0,s._)`{}`)})}function p(k){const{schema:N,opts:V,gen:X}=k;_(k,()=>{V.$comment&&N.$comment&&D(k),U(k),X.let(u.default.vErrors,null),X.let(u.default.errors,0),V.unevaluated&&h(k),P(k),I(k)})}function h(k){const{gen:N,validateName:V}=k;k.evaluated=N.const("evaluated",(0,s._)`${V}.evaluated`),N.if((0,s._)`${k.evaluated}.dynamicProps`,
|
|
398
|
+
()=>N.assign((0,s._)`${k.evaluated}.props`,(0,s._)`undefined`)),N.if((0,s._)`${k.evaluated}.dynamicItems`,()=>N.assign((0,s._)`${k.evaluated}.items`,(0,s._)`undefined`))}function f(k,N){const V=typeof k=="object"&&k[N.schemaId];return V&&(N.code.source||N.code.process)?(0,s._)`/*# sourceURL=${V} */`:s.nil}function d(k,N){if($(k)&&(E(k),v(k))){w(k,N);return}(0,e.boolOrEmptySchema)(k,N)}function v({schema:k,self:N}){if(typeof k=="boolean")return!k;for(const V in k)if(N.RULES.all[V])return!0;return!1}
|
|
399
|
+
function $(k){return typeof k.schema!="boolean"}function w(k,N){const{schema:V,gen:X,opts:Z}=k;Z.$comment&&V.$comment&&D(k),x(k),H(k);const J=X.const("_errs",u.default.errors);P(k,J),X.var(N,(0,s._)`${J} === ${u.default.errors}`)}function E(k){(0,l.checkUnknownRules)(k),O(k)}function P(k,N){if(k.opts.jtd)return z(k,[],!1,N);const V=(0,t.getSchemaTypes)(k.schema),X=(0,t.coerceAndCheckDataType)(k,V);z(k,V,!X,N)}function O(k){const{schema:N,errSchemaPath:V,opts:X,self:Z}=k;N.$ref&&X.ignoreKeywordsWithRef&&
|
|
400
400
|
(0,l.schemaHasRulesButRef)(N,Z.RULES)&&Z.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function U(k){const{schema:N,opts:V}=k;N.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,l.checkStrictMode)(k,"default is ignored in the schema root")}function x(k){const N=k.schema[k.opts.schemaId];N&&(k.baseId=(0,c.resolveUrl)(k.opts.uriResolver,k.baseId,N))}function H(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function D({gen:k,schemaEnv:N,
|
|
401
|
-
schema:V,errSchemaPath:X,opts:Z}){const J=V.$comment;if(Z.$comment===!0)k.code((0,
|
|
402
|
-
default.vErrors})`)):(N.assign((0,
|
|
403
|
-
return}Y.jtd||G(k,N),Z.block(()=>{for(const le of W.rules)te(le);te(W.post)});function te(le){(0,r.shouldUseGroup)(J,le)&&(le.type?(Z.if((0,n.checkDataType)(le.type,ue,Y.strictNumbers)),F(k,le),N.length===1&&N[0]===le.type&&V&&(Z.else(),(0,n.reportTypeError)(k)),Z.endIf()):F(k,le),we||Z.if((0,
|
|
401
|
+
schema:V,errSchemaPath:X,opts:Z}){const J=V.$comment;if(Z.$comment===!0)k.code((0,s._)`${u.default.self}.logger.log(${J})`);else if(typeof Z.$comment=="function"){const ue=(0,s.str)`${X}/$comment`,we=k.scopeValue("root",{ref:N.root});k.code((0,s._)`${u.default.self}.opts.$comment(${J}, ${ue}, ${we}.schema)`)}}function I(k){const{gen:N,schemaEnv:V,validateName:X,ValidationError:Z,opts:J}=k;V.$async?N.if((0,s._)`${u.default.errors} === 0`,()=>N.return(u.default.data),()=>N.throw((0,s._)`new ${Z}(${u.
|
|
402
|
+
default.vErrors})`)):(N.assign((0,s._)`${X}.errors`,u.default.vErrors),J.unevaluated&&M(k),N.return((0,s._)`${u.default.errors} === 0`))}function M({gen:k,evaluated:N,props:V,items:X}){V instanceof s.Name&&k.assign((0,s._)`${N}.props`,V),X instanceof s.Name&&k.assign((0,s._)`${N}.items`,X)}function z(k,N,V,X){const{gen:Z,schema:J,data:ue,allErrors:we,opts:Y,self:ne}=k,{RULES:W}=ne;if(J.$ref&&(Y.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(J,W))){Z.block(()=>B(k,"$ref",W.all.$ref.definition));
|
|
403
|
+
return}Y.jtd||G(k,N),Z.block(()=>{for(const le of W.rules)te(le);te(W.post)});function te(le){(0,r.shouldUseGroup)(J,le)&&(le.type?(Z.if((0,n.checkDataType)(le.type,ue,Y.strictNumbers)),F(k,le),N.length===1&&N[0]===le.type&&V&&(Z.else(),(0,n.reportTypeError)(k)),Z.endIf()):F(k,le),we||Z.if((0,s._)`${u.default.errors} === ${X||0}`))}}function F(k,N){const{gen:V,schema:X,opts:{useDefaults:Z}}=k;Z&&(0,i.assignDefaults)(k,N.type),V.block(()=>{for(const J of N.rules)(0,r.shouldUseRule)(X,J)&&B(k,J.keyword,
|
|
404
404
|
J.definition,N.type)})}function G(k,N){k.schemaEnv.meta||!k.opts.strictTypes||(Q(k,N),k.opts.allowUnionTypes||q(k,N),A(k,k.dataTypes))}function Q(k,N){if(N.length){if(!k.dataTypes.length){k.dataTypes=N;return}N.forEach(V=>{T(k.dataTypes,V)||b(k,`type "${V}" not allowed by context "${k.dataTypes.join(",")}"`)}),R(k,N)}}function q(k,N){N.length>1&&!(N.length===2&&N.includes("null"))&&b(k,"use allowUnionTypes to allow union type keyword")}function A(k,N){const V=k.self.RULES.all;for(const X in V){const Z=V[X];
|
|
405
405
|
if(typeof Z=="object"&&(0,r.shouldUseRule)(k.schema,Z)){const{type:J}=Z.definition;J.length&&!J.some(ue=>L(N,ue))&&b(k,`missing type "${J.join(",")}" for keyword "${X}"`)}}}function L(k,N){return k.includes(N)||N==="number"&&k.includes("integer")}function T(k,N){return k.includes(N)||N==="integer"&&k.includes("number")}function R(k,N){const V=[];for(const X of k.dataTypes)T(N,X)?V.push(X):N.includes("integer")&&X==="number"&&V.push("integer");k.dataTypes=V}function b(k,N){const V=k.schemaEnv.baseId+
|
|
406
|
-
k.errSchemaPath;N+=` at "${V}" (strictTypes)`,(0,l.checkStrictMode)(k,N,k.opts.strictTypes)}class C{constructor(N,V,X){if((0,
|
|
407
|
-
N.gen.const("vSchema",re(this.$data,N));else if(this.schemaCode=this.schemaValue,!(0,
|
|
408
|
-
this.gen.else()}pass(N,V){this.failResult((0,
|
|
409
|
-
reportError)(this,this.def.error,V)}$dataError(){(0,
|
|
410
|
-
def:ue}=this;X.if((0,
|
|
411
|
-
return
|
|
412
|
-
!0&&N.items!==void 0&&(X.items=l.mergeEvaluated.items(Z,N.items,X.items,V)))}mergeValidEvaluated(N,V){const{it:X,gen:Z}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Z.if(V,()=>this.mergeEvaluated(N,
|
|
413
|
-
function re(k,{dataLevel:N,dataNames:V,dataPathArr:X}){let Z,J;if(k==="")return u.default.rootData;if(k[0]==="/"){if(!K.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);Z=k,J=u.default.rootData}else{const ne=ee.exec(k);if(!ne)throw new Error(`Invalid JSON-pointer: ${k}`);const W=+ne[1];if(Z=ne[2],Z==="#"){if(W>=N)throw new Error(Y("property/index",W));return X[N-W]}if(W>N)throw new Error(Y("data",W));if(J=V[N-W],!Z)return J}let ue=J;const we=Z.split("/");for(const ne of we)ne&&(J=(0,
|
|
414
|
-
getProperty)((0,l.unescapeJsonPointer)(ne))}`,ue=(0,
|
|
415
|
-
ule",{value:!0});const e=sr();class t extends Error{constructor(n,i,
|
|
416
|
-
class
|
|
417
|
-
{es5:d,lines:
|
|
418
|
-
definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,e.stringify)(p.schema)}:{ref:p.schema}),validateName:P,ValidationError:E,schema:p.schema,schemaEnv:p,rootId:f,baseId:p.baseId||f,schemaPath:e.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let U;try{this._compilations.add(p),(0,
|
|
406
|
+
k.errSchemaPath;N+=` at "${V}" (strictTypes)`,(0,l.checkStrictMode)(k,N,k.opts.strictTypes)}class C{constructor(N,V,X){if((0,o.validateKeywordUsage)(N,V,X),this.gen=N.gen,this.allErrors=N.allErrors,this.keyword=X,this.data=N.data,this.schema=N.schema[X],this.$data=V.$data&&N.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(N,this.schema,X,this.$data),this.schemaType=V.schemaType,this.parentSchema=N.schema,this.params={},this.it=N,this.def=V,this.$data)this.schemaCode=
|
|
407
|
+
N.gen.const("vSchema",re(this.$data,N));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${X} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==!1)&&(this.errsCount=N.gen.const("_errs",u.default.errors))}result(N,V,X){this.failResult((0,s.not)(N),V,X)}failResult(N,V,X){this.gen.if(N),X?X():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():
|
|
408
|
+
this.gen.else()}pass(N,V){this.failResult((0,s.not)(N),void 0,V)}fail(N){if(N===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(N),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(N){if(!this.$data)return this.fail(N);const{schemaCode:V}=this;this.fail((0,s._)`${V} !== undefined && (${(0,s.or)(this.invalid$data(),N)})`)}error(N,V,X){if(V){this.setParams(V),this._error(N,X),this.setParams({});return}this._error(N,X)}_error(N,V){(N?m.reportExtraError:m.
|
|
409
|
+
reportError)(this,this.def.error,V)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(N){this.allErrors||this.gen.if(N)}setParams(N,V){V?Object.assign(this.params,N):this.params=N}block$data(N,V,X=s.nil){this.gen.block(()=>{this.check$data(N,X),V()})}check$data(N=s.nil,V=s.nil){if(!this.$data)return;const{gen:X,schemaCode:Z,schemaType:J,
|
|
410
|
+
def:ue}=this;X.if((0,s.or)((0,s._)`${Z} === undefined`,V)),N!==s.nil&&X.assign(N,!0),(J.length||ue.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),N!==s.nil&&X.assign(N,!1)),X.else()}invalid$data(){const{gen:N,schemaCode:V,schemaType:X,def:Z,it:J}=this;return(0,s.or)(ue(),we());function ue(){if(X.length){if(!(V instanceof s.Name))throw new Error("ajv implementation error");const Y=Array.isArray(X)?X:[X];return(0,s._)`${(0,n.checkDataTypes)(Y,V,J.opts.strictNumbers,n.DataType.Wrong)}`}
|
|
411
|
+
return s.nil}function we(){if(Z.validateSchema){const Y=N.scopeValue("validate$data",{ref:Z.validateSchema});return(0,s._)`!${Y}(${V})`}return s.nil}}subschema(N,V){const X=(0,a.getSubschema)(this.it,N);(0,a.extendSubschemaData)(X,this.it,N),(0,a.extendSubschemaMode)(X,N);const Z={...this.it,...X,items:void 0,props:void 0};return d(Z,V),Z}mergeEvaluated(N,V){const{it:X,gen:Z}=this;X.opts.unevaluated&&(X.props!==!0&&N.props!==void 0&&(X.props=l.mergeEvaluated.props(Z,N.props,X.props,V)),X.items!==
|
|
412
|
+
!0&&N.items!==void 0&&(X.items=l.mergeEvaluated.items(Z,N.items,X.items,V)))}mergeValidEvaluated(N,V){const{it:X,gen:Z}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Z.if(V,()=>this.mergeEvaluated(N,s.Name)),!0}}ze.KeywordCxt=C;function B(k,N,V,X){const Z=new C(k,V,N);"code"in V?V.code(Z,X):Z.$data&&V.validate?(0,o.funcKeywordCode)(Z,V):"macro"in V?(0,o.macroKeywordCode)(Z,V):(V.compile||V.validate)&&(0,o.funcKeywordCode)(Z,V)}const K=/^\/(?:[^~]|~0|~1)*$/,ee=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
413
|
+
function re(k,{dataLevel:N,dataNames:V,dataPathArr:X}){let Z,J;if(k==="")return u.default.rootData;if(k[0]==="/"){if(!K.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);Z=k,J=u.default.rootData}else{const ne=ee.exec(k);if(!ne)throw new Error(`Invalid JSON-pointer: ${k}`);const W=+ne[1];if(Z=ne[2],Z==="#"){if(W>=N)throw new Error(Y("property/index",W));return X[N-W]}if(W>N)throw new Error(Y("data",W));if(J=V[N-W],!Z)return J}let ue=J;const we=Z.split("/");for(const ne of we)ne&&(J=(0,s._)`${J}${(0,s.
|
|
414
|
+
getProperty)((0,l.unescapeJsonPointer)(ne))}`,ue=(0,s._)`${ue} && ${J}`);return ue;function Y(ne,W){return`Cannot access ${ne} ${W} levels up, current level is ${N}`}}return ze.getData=re,ze}var or={},vi;function ar(){if(vi)return or;vi=1,Object.defineProperty(or,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return or.default=e,or}var ir={},$i;function Ot(){if($i)return ir;$i=1,Object.defineProperty(ir,"__esMod\
|
|
415
|
+
ule",{value:!0});const e=sr();class t extends Error{constructor(n,i,o,a){super(a||`can't resolve reference ${o} from id ${i}`),this.missingRef=(0,e.resolveUrl)(n,i,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return ir.default=t,ir}var ke={},_i;function cr(){if(_i)return ke;_i=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.resolveSchema=ke.getCompilingSchema=ke.resolveRef=ke.compileSchema=ke.SchemaEnv=void 0;const e=ae(),t=ar(),r=Ne(),n=sr(),i=fe(),o=Nt();
|
|
416
|
+
class a{constructor(h){var f;this.refs={},this.dynamicAnchors={};let d;typeof h.schema=="object"&&(d=h.schema),this.schema=h.schema,this.schemaId=h.schemaId,this.root=h.root||this,this.baseId=(f=h.baseId)!==null&&f!==void 0?f:(0,n.normalizeId)(d?.[h.schemaId||"$id"]),this.schemaPath=h.schemaPath,this.localRefs=h.localRefs,this.meta=h.meta,this.$async=d?.$async,this.refs={}}}ke.SchemaEnv=a;function s(p){const h=l.call(this,p);if(h)return h;const f=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),
|
|
417
|
+
{es5:d,lines:v}=this.opts.code,{ownProperties:$}=this.opts,w=new e.CodeGen(this.scope,{es5:d,lines:v,ownProperties:$});let E;p.$async&&(E=w.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const P=w.scopeName("validate");p.validateName=P;const O={gen:w,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],
|
|
418
|
+
definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,e.stringify)(p.schema)}:{ref:p.schema}),validateName:P,ValidationError:E,schema:p.schema,schemaEnv:p,rootId:f,baseId:p.baseId||f,schemaPath:e.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let U;try{this._compilations.add(p),(0,o.validateFunctionCode)(O),w.optimize(this.opts.code.optimize);const x=w.toString();U=`${w.scopeRefs(r.default.
|
|
419
419
|
scope)}return ${x}`,this.opts.code.process&&(U=this.opts.code.process(U,p));const D=new Function(`${r.default.self}`,`${r.default.scope}`,U)(this,this.scope.get());if(this.scope.value(P,{ref:D}),D.errors=null,D.schema=p.schema,D.schemaEnv=p,p.$async&&(D.$async=!0),this.opts.code.source===!0&&(D.source={validateName:P,validateCode:x,scopeValues:w._values}),this.opts.unevaluated){const{props:I,items:M}=O;D.evaluated={props:I instanceof e.Name?void 0:I,items:M instanceof e.Name?void 0:M,dynamicProps:I instanceof
|
|
420
|
-
e.Name,dynamicItems:M instanceof e.Name},D.source&&(D.source.evaluated=(0,e.stringify)(D.evaluated))}return p.validate=D,p}catch(x){throw delete p.validate,delete p.validateName,U&&this.logger.error("Error compiling schema, function code:",U),x}finally{this._compilations.delete(p)}}ke.compileSchema=
|
|
421
|
-
opts;w&&(
|
|
422
|
-
|
|
423
|
-
{schemaId:P}=this.opts,O=E[P];return O&&(
|
|
424
|
-
return;f=P;const O=typeof f=="object"&&f[this.opts.schemaId];!S.has(E)&&O&&(
|
|
425
|
-
eta-schema for $data reference (JSON AnySchema extension proposal)",
|
|
426
|
-
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}}),ys}var gs,
|
|
427
|
-
"0"),
|
|
428
|
-
f.push(d.join("")):f.push(n(d))),
|
|
429
|
-
return
|
|
430
|
-
(
|
|
431
|
-
port=="string")&&(p.push(":"),p.push(String(
|
|
432
|
-
"wss"}function n(f){return f.host||(f.error=f.error||"HTTP URIs must have a host."),f}function i(f){const d=String(f.scheme).toLowerCase()==="https";return(f.port===(d?443:80)||f.port==="")&&(f.port=void 0),f.path||(f.path="/"),f}function
|
|
433
|
-
const[d,
|
|
434
|
-
nid
|
|
435
|
-
ss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},
|
|
436
|
-
const d=Object.assign({scheme:"null"},f),
|
|
437
|
-
userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?
|
|
438
|
-
typeof
|
|
439
|
-
f,d),f.path!==void 0&&(d.skipEscape?f.path=unescape(f.path):(f.path=escape(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),d.reference!=="suffix"&&f.scheme&&
|
|
440
|
-
void 0&&
|
|
441
|
-
|
|
442
|
-
same-document":d.scheme===void 0?d.reference="relative":d.fragment===void 0?d.reference="absolute":d.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==d.reference&&(d.error=d.error||"URI is not a "+f.reference+" reference.");const E=
|
|
443
|
-
ot be converted to ASCII: "+P}(!E||E&&!E.skipNormalize)&&(
|
|
444
|
-
exports}var
|
|
445
|
-
get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ar(),i=Ot(),
|
|
446
|
-
_=(q,A)=>new RegExp(q,A);_.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"]
|
|
420
|
+
e.Name,dynamicItems:M instanceof e.Name},D.source&&(D.source.evaluated=(0,e.stringify)(D.evaluated))}return p.validate=D,p}catch(x){throw delete p.validate,delete p.validateName,U&&this.logger.error("Error compiling schema, function code:",U),x}finally{this._compilations.delete(p)}}ke.compileSchema=s;function u(p,h,f){var d;f=(0,n.resolveUrl)(this.opts.uriResolver,h,f);const v=p.refs[f];if(v)return v;let $=y.call(this,p,f);if($===void 0){const w=(d=p.localRefs)===null||d===void 0?void 0:d[f],{schemaId:E}=this.
|
|
421
|
+
opts;w&&($=new a({schema:w,schemaId:E,root:p,baseId:h}))}if($!==void 0)return p.refs[f]=c.call(this,$)}ke.resolveRef=u;function c(p){return(0,n.inlineRef)(p.schema,this.opts.inlineRefs)?p.schema:p.validate?p:s.call(this,p)}function l(p){for(const h of this._compilations)if(m(h,p))return h}ke.getCompilingSchema=l;function m(p,h){return p.schema===h.schema&&p.root===h.root&&p.baseId===h.baseId}function y(p,h){let f;for(;typeof(f=this.refs[h])=="string";)h=f;return f||this.schemas[h]||_.call(this,p,
|
|
422
|
+
h)}function _(p,h){const f=this.opts.uriResolver.parse(h),d=(0,n._getFullPath)(this.opts.uriResolver,f);let v=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&d===v)return g.call(this,f,p);const $=(0,n.normalizeId)(d),w=this.refs[$]||this.schemas[$];if(typeof w=="string"){const E=_.call(this,p,w);return typeof E?.schema!="object"?void 0:g.call(this,f,E)}if(typeof w?.schema=="object"){if(w.validate||s.call(this,w),$===(0,n.normalizeId)(h)){const{schema:E}=w,
|
|
423
|
+
{schemaId:P}=this.opts,O=E[P];return O&&(v=(0,n.resolveUrl)(this.opts.uriResolver,v,O)),new a({schema:E,schemaId:P,root:p,baseId:v})}return g.call(this,f,w)}}ke.resolveSchema=_;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(p,{baseId:h,schema:f,root:d}){var v;if(((v=p.fragment)===null||v===void 0?void 0:v[0])!=="/")return;for(const E of p.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const P=f[(0,i.unescapeFragment)(E)];if(P===void 0)
|
|
424
|
+
return;f=P;const O=typeof f=="object"&&f[this.opts.schemaId];!S.has(E)&&O&&(h=(0,n.resolveUrl)(this.opts.uriResolver,h,O))}let $;if(typeof f!="boolean"&&f.$ref&&!(0,i.schemaHasRulesButRef)(f,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,h,f.$ref);$=_.call(this,d,E)}const{schemaId:w}=this.opts;if($=$||new a({schema:f,schemaId:w,root:d,baseId:h}),$.schema!==$.root.schema)return $}return ke}const wi="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",bi="M\
|
|
425
|
+
eta-schema for $data reference (JSON AnySchema extension proposal)",Ei="object",Si=["$data"],Ri={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ai=!1,oh={$id:wi,description:bi,type:Ei,required:Si,properties:Ri,additionalProperties:Ai},ah={__proto__:null,$id:wi,additionalProperties:Ai,default:oh,description:bi,properties:Ri,required:Si,type:Ei},ih=De(ah);var ur={},It={exports:{}},ys,Pi;function ch(){return Pi||(Pi=1,ys={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,
|
|
426
|
+
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}}),ys}var gs,Ci;function uh(){if(Ci)return gs;Ci=1;const{HEX:e}=ch(),t=/^(?:(?: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(g){if(s(g,".")<3)return{host:g,isIPV4:!1};const p=g.match(t)||[],[h]=p;return h?{host:a(h,"."),isIPV4:!0}:{host:g,isIPV4:!1}}function n(g,p=!1){let h="",f=!0;for(const d of g){if(e[d]===void 0)return;d!=="0"&&f===!0&&(f=!1),f||(h+=d)}return p&&h.length===0&&(h=
|
|
427
|
+
"0"),h}function i(g){let p=0;const h={error:!1,address:"",zone:""},f=[],d=[];let v=!1,$=!1,w=!1;function E(){if(d.length){if(v===!1){const P=n(d);if(P!==void 0)f.push(P);else return h.error=!0,!1}d.length=0}return!0}for(let P=0;P<g.length;P++){const O=g[P];if(!(O==="["||O==="]"))if(O===":"){if($===!0&&(w=!0),!E())break;if(p++,f.push(":"),p>7){h.error=!0;break}P-1>=0&&g[P-1]===":"&&($=!0);continue}else if(O==="%"){if(!E())break;v=!0}else{d.push(O);continue}}return d.length&&(v?h.zone=d.join(""):w?
|
|
428
|
+
f.push(d.join("")):f.push(n(d))),h.address=f.join(""),h}function o(g){if(s(g,":")<2)return{host:g,isIPV6:!1};const p=i(g);if(p.error)return{host:g,isIPV6:!1};{let h=p.address,f=p.address;return p.zone&&(h+="%"+p.zone,f+="%25"+p.zone),{host:h,escapedHost:f,isIPV6:!0}}}function a(g,p){let h="",f=!0;const d=g.length;for(let v=0;v<d;v++){const $=g[v];$==="0"&&f?(v+1<=d&&g[v+1]===p||v+1===d)&&(h+=$,f=!1):($===p?f=!0:f=!1,h+=$)}return h}function s(g,p){let h=0;for(let f=0;f<g.length;f++)g[f]===p&&h++;
|
|
429
|
+
return h}const u=/^\.\.?\//u,c=/^\/\.(?:\/|$)/u,l=/^\/\.\.(?:\/|$)/u,m=/^\/?(?:.|\n)*?(?=\/|$)/u;function y(g){const p=[];for(;g.length;)if(g.match(u))g=g.replace(u,"");else if(g.match(c))g=g.replace(c,"/");else if(g.match(l))g=g.replace(l,"/"),p.pop();else if(g==="."||g==="..")g="";else{const h=g.match(m);if(h){const f=h[0];g=g.slice(f.length),p.push(f)}else throw new Error("Unexpected dot segment condition")}return p.join("")}function _(g,p){const h=p!==!0?escape:unescape;return g.scheme!==void 0&&
|
|
430
|
+
(g.scheme=h(g.scheme)),g.userinfo!==void 0&&(g.userinfo=h(g.userinfo)),g.host!==void 0&&(g.host=h(g.host)),g.path!==void 0&&(g.path=h(g.path)),g.query!==void 0&&(g.query=h(g.query)),g.fragment!==void 0&&(g.fragment=h(g.fragment)),g}function S(g){const p=[];if(g.userinfo!==void 0&&(p.push(g.userinfo),p.push("@")),g.host!==void 0){let h=unescape(g.host);const f=r(h);if(f.isIPV4)h=f.host;else{const d=o(f.host);d.isIPV6===!0?h=`[${d.escapedHost}]`:h=g.host}p.push(h)}return(typeof g.port=="number"||typeof g.
|
|
431
|
+
port=="string")&&(p.push(":"),p.push(String(g.port))),p.length?p.join(""):void 0}return gs={recomposeAuthority:S,normalizeComponentEncoding:_,removeDotSegments:y,normalizeIPv4:r,normalizeIPv6:o,stringArrayToHexStripped:n},gs}var vs,ki;function lh(){if(ki)return vs;ki=1;const e=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(f){return typeof f.secure=="boolean"?f.secure:String(f.scheme).toLowerCase()===
|
|
432
|
+
"wss"}function n(f){return f.host||(f.error=f.error||"HTTP URIs must have a host."),f}function i(f){const d=String(f.scheme).toLowerCase()==="https";return(f.port===(d?443:80)||f.port==="")&&(f.port=void 0),f.path||(f.path="/"),f}function o(f){return f.secure=r(f),f.resourceName=(f.path||"/")+(f.query?"?"+f.query:""),f.path=void 0,f.query=void 0,f}function a(f){if((f.port===(r(f)?443:80)||f.port==="")&&(f.port=void 0),typeof f.secure=="boolean"&&(f.scheme=f.secure?"wss":"ws",f.secure=void 0),f.resourceName){
|
|
433
|
+
const[d,v]=f.resourceName.split("?");f.path=d&&d!=="/"?d:void 0,f.query=v,f.resourceName=void 0}return f.fragment=void 0,f}function s(f,d){if(!f.path)return f.error="URN can not be parsed",f;const v=f.path.match(t);if(v){const $=d.scheme||f.scheme||"urn";f.nid=v[1].toLowerCase(),f.nss=v[2];const w=`${$}:${d.nid||f.nid}`,E=h[w];f.path=void 0,E&&(f=E.parse(f,d))}else f.error=f.error||"URN can not be parsed.";return f}function u(f,d){const v=d.scheme||f.scheme||"urn",$=f.nid.toLowerCase(),w=`${v}:${d.
|
|
434
|
+
nid||$}`,E=h[w];E&&(f=E.serialize(f,d));const P=f,O=f.nss;return P.path=`${$||d.nid}:${O}`,d.skipEscape=!0,P}function c(f,d){const v=f;return v.uuid=v.nss,v.nss=void 0,!d.tolerant&&(!v.uuid||!e.test(v.uuid))&&(v.error=v.error||"UUID is not valid."),v}function l(f){const d=f;return d.nss=(f.uuid||"").toLowerCase(),d}const m={scheme:"http",domainHost:!0,parse:n,serialize:i},y={scheme:"https",domainHost:m.domainHost,parse:n,serialize:i},_={scheme:"ws",domainHost:!0,parse:o,serialize:a},S={scheme:"w\
|
|
435
|
+
ss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},h={http:m,https:y,ws:_,wss:S,urn:{scheme:"urn",parse:s,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:c,serialize:l,skipNormalize:!0}};return vs=h,vs}var Ti;function fh(){if(Ti)return It.exports;Ti=1;const{normalizeIPv6:e,normalizeIPv4:t,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:i}=uh(),o=lh();function a(p,h){return typeof p=="string"?p=l(S(p,h),h):typeof p=="object"&&(p=S(l(p,h),h)),p}function s(p,h,f){
|
|
436
|
+
const d=Object.assign({scheme:"null"},f),v=u(S(p,d),S(h,d),d,!0);return l(v,{...d,skipEscape:!0})}function u(p,h,f,d){const v={};return d||(p=S(l(p,f),f),h=S(l(h,f),f)),f=f||{},!f.tolerant&&h.scheme?(v.scheme=h.scheme,v.userinfo=h.userinfo,v.host=h.host,v.port=h.port,v.path=r(h.path||""),v.query=h.query):(h.userinfo!==void 0||h.host!==void 0||h.port!==void 0?(v.userinfo=h.userinfo,v.host=h.host,v.port=h.port,v.path=r(h.path||""),v.query=h.query):(h.path?(h.path.charAt(0)==="/"?v.path=r(h.path):((p.
|
|
437
|
+
userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?v.path="/"+h.path:p.path?v.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+h.path:v.path=h.path,v.path=r(v.path)),v.query=h.query):(v.path=p.path,h.query!==void 0?v.query=h.query:v.query=p.query),v.userinfo=p.userinfo,v.host=p.host,v.port=p.port),v.scheme=p.scheme),v.fragment=h.fragment,v}function c(p,h,f){return typeof p=="string"?(p=unescape(p),p=l(i(S(p,f),!0),{...f,skipEscape:!0})):typeof p=="object"&&(p=l(i(p,!0),{...f,skipEscape:!0})),
|
|
438
|
+
typeof h=="string"?(h=unescape(h),h=l(i(S(h,f),!0),{...f,skipEscape:!0})):typeof h=="object"&&(h=l(i(h,!0),{...f,skipEscape:!0})),p.toLowerCase()===h.toLowerCase()}function l(p,h){const f={host:p.host,scheme:p.scheme,userinfo:p.userinfo,port:p.port,path:p.path,query:p.query,nid:p.nid,nss:p.nss,uuid:p.uuid,fragment:p.fragment,reference:p.reference,resourceName:p.resourceName,secure:p.secure,error:""},d=Object.assign({},h),v=[],$=o[(d.scheme||f.scheme||"").toLowerCase()];$&&$.serialize&&$.serialize(
|
|
439
|
+
f,d),f.path!==void 0&&(d.skipEscape?f.path=unescape(f.path):(f.path=escape(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),d.reference!=="suffix"&&f.scheme&&v.push(f.scheme,":");const w=n(f);if(w!==void 0&&(d.reference!=="suffix"&&v.push("//"),v.push(w),f.path&&f.path.charAt(0)!=="/"&&v.push("/")),f.path!==void 0){let E=f.path;!d.absolutePath&&(!$||!$.absolutePath)&&(E=r(E)),w===void 0&&(E=E.replace(/^\/\//u,"/%2F")),v.push(E)}return f.query!==void 0&&v.push("?",f.query),f.fragment!==
|
|
440
|
+
void 0&&v.push("#",f.fragment),v.join("")}const m=Array.from({length:127},(p,h)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(h)));function y(p){let h=0;for(let f=0,d=p.length;f<d;++f)if(h=p.charCodeAt(f),h>126||m[h])return!0;return!1}const _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(p,h){const f=Object.assign({},h),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},
|
|
441
|
+
v=p.indexOf("%")!==-1;let $=!1;f.reference==="suffix"&&(p=(f.scheme?f.scheme+":":"")+"//"+p);const w=p.match(_);if(w){if(d.scheme=w[1],d.userinfo=w[3],d.host=w[4],d.port=parseInt(w[5],10),d.path=w[6]||"",d.query=w[7],d.fragment=w[8],isNaN(d.port)&&(d.port=w[5]),d.host){const P=t(d.host);if(P.isIPV4===!1){const O=e(P.host);d.host=O.host.toLowerCase(),$=O.isIPV6}else d.host=P.host,$=!0}d.scheme===void 0&&d.userinfo===void 0&&d.host===void 0&&d.port===void 0&&d.query===void 0&&!d.path?d.reference="\
|
|
442
|
+
same-document":d.scheme===void 0?d.reference="relative":d.fragment===void 0?d.reference="absolute":d.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==d.reference&&(d.error=d.error||"URI is not a "+f.reference+" reference.");const E=o[(f.scheme||d.scheme||"").toLowerCase()];if(!f.unicodeSupport&&(!E||!E.unicodeSupport)&&d.host&&(f.domainHost||E&&E.domainHost)&&$===!1&&y(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(P){d.error=d.error||"Host's domain name can n\
|
|
443
|
+
ot be converted to ASCII: "+P}(!E||E&&!E.skipNormalize)&&(v&&d.scheme!==void 0&&(d.scheme=unescape(d.scheme)),v&&d.host!==void 0&&(d.host=unescape(d.host)),d.path&&(d.path=escape(unescape(d.path))),d.fragment&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),E&&E.parse&&E.parse(d,f)}else d.error=d.error||"URI can not be parsed.";return d}const g={SCHEMES:o,normalize:a,resolve:s,resolveComponents:u,equal:c,serialize:l,parse:S};return It.exports=g,It.exports.default=g,It.exports.fastUri=g,It.
|
|
444
|
+
exports}var Ni;function dh(){if(Ni)return ur;Ni=1,Object.defineProperty(ur,"__esModule",{value:!0});const e=fh();return e.code='require("ajv/dist/runtime/uri").default',ur.default=e,ur}var Oi;function Ii(){return Oi||(Oi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Nt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ae();Object.defineProperty(e,"_",{enumerable:!0,
|
|
445
|
+
get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ar(),i=Ot(),o=ii(),a=cr(),s=ae(),u=sr(),c=nr(),l=fe(),m=ih,y=dh(),
|
|
446
|
+
_=(q,A)=>new RegExp(q,A);_.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),p={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.",
|
|
447
447
|
missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cach\
|
|
448
|
-
e, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},
|
|
449
|
-
|
|
448
|
+
e, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},h={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function d(q){var A,L,T,R,b,C,B,K,ee,re,k,N,V,X,Z,J,ue,we,Y,ne,W,te,le,ye,he;const Me=q.strict,Ke=(A=q.code)===null||A===void 0?void 0:A.optimize,ko=Ke===!0||Ke===void 0?1:Ke||0,To=(T=(L=q.code)===null||L===void 0?void 0:L.regExp)!==null&&T!==void 0?T:_,
|
|
449
|
+
kf=(R=q.uriResolver)!==null&&R!==void 0?R:y.default;return{strictSchema:(C=(b=q.strictSchema)!==null&&b!==void 0?b:Me)!==null&&C!==void 0?C:!0,strictNumbers:(K=(B=q.strictNumbers)!==null&&B!==void 0?B:Me)!==null&&K!==void 0?K:!0,strictTypes:(re=(ee=q.strictTypes)!==null&&ee!==void 0?ee:Me)!==null&&re!==void 0?re:"log",strictTuples:(N=(k=q.strictTuples)!==null&&k!==void 0?k:Me)!==null&&N!==void 0?N:"log",strictRequired:(X=(V=q.strictRequired)!==null&&V!==void 0?V:Me)!==null&&X!==void 0?X:!1,code:q.
|
|
450
450
|
code?{...q.code,optimize:ko,regExp:To}:{optimize:ko,regExp:To},loopRequired:(Z=q.loopRequired)!==null&&Z!==void 0?Z:f,loopEnum:(J=q.loopEnum)!==null&&J!==void 0?J:f,meta:(ue=q.meta)!==null&&ue!==void 0?ue:!0,messages:(we=q.messages)!==null&&we!==void 0?we:!0,inlineRefs:(Y=q.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(ne=q.schemaId)!==null&&ne!==void 0?ne:"$id",addUsedSchema:(W=q.addUsedSchema)!==null&&W!==void 0?W:!0,validateSchema:(te=q.validateSchema)!==null&&te!==void 0?te:!0,validateFormats:(le=
|
|
451
|
-
q.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(ye=q.unicodeRegExp)!==null&&ye!==void 0?ye:!0,int32range:(he=q.int32range)!==null&&he!==void 0?he:!0,uriResolver:
|
|
452
|
-
!1,this.RULES=(0,
|
|
451
|
+
q.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(ye=q.unicodeRegExp)!==null&&ye!==void 0?ye:!0,int32range:(he=q.int32range)!==null&&he!==void 0?he:!0,uriResolver:kf}}class v{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,...d(A)};const{es5:L,lines:T}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:g,es5:L,lines:T}),this.logger=H(A.logger);const R=A.validateFormats;A.validateFormats=
|
|
452
|
+
!1,this.RULES=(0,o.getRules)(),$.call(this,p,A,"NOT SUPPORTED"),$.call(this,h,A,"DEPRECATED","warn"),this._metaOpts=U.call(this),A.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&O.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),E.call(this),A.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:A,meta:L,schemaId:T}=this.opts;let R=m;T==="id"&&(R={...m},R.id=R.$id,delete R.$id),L&&A&&this.
|
|
453
453
|
addMetaSchema(R,R[T],!1)}defaultMeta(){const{meta:A,schemaId:L}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[L]||A:void 0}validate(A,L){let T;if(typeof A=="string"){if(T=this.getSchema(A),!T)throw new Error(`no schema with key or ref "${A}"`)}else T=this.compile(A);const R=T(L);return"$async"in T||(this.errors=T.errors),R}compile(A,L){const T=this._addSchema(A,L);return T.validate||this._compileSchemaEnv(T)}compileAsync(A,L){if(typeof this.opts.loadSchema!="function")throw new Error(
|
|
454
454
|
"options.loadSchema should be a function");const{loadSchema:T}=this.opts;return R.call(this,A,L);async function R(re,k){await b.call(this,re.$schema);const N=this._addSchema(re,k);return N.validate||C.call(this,N)}async function b(re){re&&!this.getSchema(re)&&await R.call(this,{$ref:re},!0)}async function C(re){try{return this._compileSchemaEnv(re)}catch(k){if(!(k instanceof i.default))throw k;return B.call(this,k),await K.call(this,k.missingSchema),C.call(this,re)}}function B({missingSchema:re,
|
|
455
455
|
missingRef:k}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${k} cannot be resolved`)}async function K(re){const k=await ee.call(this,re);this.refs[re]||await b.call(this,k.$schema),this.refs[re]||this.addSchema(k,re,L)}async function ee(re){const k=this._loading[re];if(k)return k;try{return await(this._loading[re]=T(re))}finally{delete this._loading[re]}}}addSchema(A,L,T,R=this.opts.validateSchema){if(Array.isArray(A)){for(const C of A)this.addSchema(C,void 0,T,R);return this}
|
|
456
456
|
let b;if(typeof A=="object"){const{schemaId:C}=this.opts;if(b=A[C],b!==void 0&&typeof b!="string")throw new Error(`schema ${C} must be string`)}return L=(0,u.normalizeId)(L||b),this._checkUnique(L),this.schemas[L]=this._addSchema(A,T,L,R,!0),this}addMetaSchema(A,L,T=this.opts.validateSchema){return this.addSchema(A,L,!0,T),this}validateSchema(A,L){if(typeof A=="boolean")return!0;let T;if(T=A.$schema,T!==void 0&&typeof T!="string")throw new Error("$schema must be a string");if(T=T||this.opts.defaultMeta||
|
|
457
|
-
this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const R=this.validate(T,A);if(!R&&L){const b="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(b);else throw new Error(b)}return R}getSchema(A){let L;for(;typeof(L=w.call(this,A))=="string";)A=L;if(L===void 0){const{schemaId:T}=this.opts,R=new
|
|
457
|
+
this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const R=this.validate(T,A);if(!R&&L){const b="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(b);else throw new Error(b)}return R}getSchema(A){let L;for(;typeof(L=w.call(this,A))=="string";)A=L;if(L===void 0){const{schemaId:T}=this.opts,R=new a.SchemaEnv({schema:{},schemaId:T});if(L=a.resolveSchema.call(this,R,A),!L)return;this.refs[A]=L}return L.validate||this.
|
|
458
458
|
_compileSchemaEnv(L)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(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 L=w.call(this,A);return typeof L=="object"&&this._cache.delete(L.schema),delete this.schemas[A],delete this.refs[A],this}case"object":{const L=A;this._cache.delete(L);let T=A[this.opts.schemaId];return T&&
|
|
459
459
|
(T=(0,u.normalizeId)(T),delete this.schemas[T],delete this.refs[T]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const L of A)this.addKeyword(L);return this}addKeyword(A,L){let T;if(typeof A=="string")T=A,typeof L=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),L.keyword=T);else if(typeof A=="object"&&L===void 0){if(L=A,T=L.keyword,Array.isArray(T)&&!T.length)throw new Error("addKeywords: keyword must be string\
|
|
460
460
|
or non-empty array")}else throw new Error("invalid addKeywords parameters");if(I.call(this,T,L),!L)return(0,l.eachItem)(T,b=>M.call(this,b)),this;F.call(this,L);const R={...L,type:(0,c.getJSONTypes)(L.type),schemaType:(0,c.getJSONTypes)(L.schemaType)};return(0,l.eachItem)(T,R.type.length===0?b=>M.call(this,b,R):b=>R.type.forEach(C=>M.call(this,b,R,C))),this}getKeyword(A){const L=this.RULES.all[A];return typeof L=="object"?L.definition:!!L}removeKeyword(A){const{RULES:L}=this;delete L.keywords[A],
|
|
461
461
|
delete L.all[A];for(const T of L.rules){const R=T.rules.findIndex(b=>b.keyword===A);R>=0&&T.rules.splice(R,1)}return this}addFormat(A,L){return typeof L=="string"&&(L=new RegExp(L)),this.formats[A]=L,this}errorsText(A=this.errors,{separator:L=", ",dataVar:T="data"}={}){return!A||A.length===0?"No errors":A.map(R=>`${T}${R.instancePath} ${R.message}`).reduce((R,b)=>R+L+b)}$dataMetaSchema(A,L){const T=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const R of L){const b=R.split("/").slice(1);let C=A;
|
|
462
462
|
for(const B of b)C=C[B];for(const B in T){const K=T[B];if(typeof K!="object")continue;const{$data:ee}=K.definition,re=C[B];ee&&re&&(C[B]=Q(re))}}return A}_removeAllSchemas(A,L){for(const T in A){const R=A[T];(!L||L.test(T))&&(typeof R=="string"?delete A[T]:R&&!R.meta&&(this._cache.delete(R.schema),delete A[T]))}}_addSchema(A,L,T,R=this.opts.validateSchema,b=this.opts.addUsedSchema){let C;const{schemaId:B}=this.opts;if(typeof A=="object")C=A[B];else{if(this.opts.jtd)throw new Error("schema must b\
|
|
463
|
-
e object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let K=this._cache.get(A);if(K!==void 0)return K;T=(0,u.normalizeId)(C||T);const ee=u.getSchemaRefs.call(this,A,T);return K=new
|
|
464
|
-
dy exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):
|
|
463
|
+
e object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let K=this._cache.get(A);if(K!==void 0)return K;T=(0,u.normalizeId)(C||T);const ee=u.getSchemaRefs.call(this,A,T);return K=new a.SchemaEnv({schema:A,schemaId:B,meta:L,baseId:T,localRefs:ee}),this._cache.set(K.schema,K),b&&!T.startsWith("#")&&(T&&this._checkUnique(T),this.refs[T]=K),R&&this.validateSchema(A,!0),K}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" alrea\
|
|
464
|
+
dy exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):a.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const L=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,A)}finally{this.opts=L}}}v.ValidationError=n.default,v.MissingRefError=i.default,e.default=v;function $(q,A,L,T="error"){for(const R in q){const b=R;b in A&&this.logger[T](`${L}: option ${R}. ${q[b]}`)}}function w(q){return q=(0,u.normalizeId)(
|
|
465
465
|
q),this.schemas[q]||this.refs[q]}function E(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const A in q)this.addSchema(q[A],A)}function P(){for(const q in this.opts.formats){const A=this.opts.formats[q];A&&this.addFormat(q,A)}}function O(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in q){const L=q[A];L.keyword||(L.keyword=A),this.addKeyword(L)}}function U(){const q={...this.opts};
|
|
466
466
|
for(const A of S)delete q[A];return q}const x={log(){},warn(){},error(){}};function H(q){if(q===!1)return x;if(q===void 0)return console;if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const D=/^[a-z_$][a-z0-9_$:-]*$/i;function I(q,A){const{RULES:L}=this;if((0,l.eachItem)(q,T=>{if(L.keywords[T])throw new Error(`Keyword ${T} is already defined`);if(!D.test(T))throw new Error(`Keyword ${T} has invalid name`)}),!!A&&A.$data&&!("code"in A||"val\
|
|
467
467
|
idate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function M(q,A,L){var T;const R=A?.post;if(L&&R)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:b}=this;let C=R?b.post:b.rules.find(({type:K})=>K===L);if(C||(C={type:L,rules:[]},b.rules.push(C)),b.keywords[q]=!0,!A)return;const B={keyword:q,definition:{...A,type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)}};A.before?z.call(this,C,B,A.before):C.rules.push(B),b.
|
|
468
468
|
all[q]=B,(T=A.implements)===null||T===void 0||T.forEach(K=>this.addKeyword(K))}function z(q,A,L){const T=q.rules.findIndex(R=>R.keyword===L);T>=0?q.rules.splice(T,0,A):(q.rules.push(A),this.logger.warn(`rule ${L} is not defined`))}function F(q){let{metaSchema:A}=q;A!==void 0&&(q.$data&&this.opts.$data&&(A=Q(A)),q.validateSchema=this.compile(A,!0))}const G={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Q(q){return{anyOf:[q,G]}}})(ls)),ls}var lr={},
|
|
469
|
-
fr={},dr={},
|
|
470
|
-
validateName
|
|
471
|
-
E)}:{ref:E}),O=l.name("valid"),U=c.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:P,errSchemaPath:
|
|
472
|
-
by sync schema");const E=_.let("valid");_.try(()=>{_.code((0,r._)`await ${(0,t.callValidateCode)(c,l,f)}`),w(l)
|
|
473
|
-
default.vErrors}.length`)}function w(E){var P;if(!S.opts.unevaluated)return;const O=(P=
|
|
474
|
-
S.items=
|
|
475
|
-
okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:
|
|
476
|
-
var mr={},
|
|
477
|
-
_)`(${
|
|
478
|
-
const e=ae(),t=fe(),r=
|
|
479
|
-
_)`${
|
|
480
|
-
(0,t._)`!${
|
|
481
|
-
roperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${
|
|
482
|
-
schemaCode:u,data:c,$data:l,it:
|
|
483
|
-
|
|
484
|
-
return _r.default=i,_r}var wr={},
|
|
485
|
-
_)`${
|
|
486
|
-
params:({params:{i:
|
|
487
|
-
const w=
|
|
488
|
-
label(E).for((0,t._)`;${
|
|
489
|
-
l&&typeof l=="object"?
|
|
490
|
-
c.length===0)throw new Error("enum must have non-empty array");const y=c.length>=
|
|
491
|
-
ect"&&
|
|
492
|
-
function
|
|
493
|
-
ms" is not an array of schemas');return}i(
|
|
494
|
-
|
|
495
|
-
schema){const{gen:u,parentSchema:c,data:l,keyword:
|
|
496
|
-
"${
|
|
497
|
-
Cr,"__esModule",{value:!0});const e=ae(),t=fe(),r=Ie(),n=
|
|
498
|
-
if(
|
|
499
|
-
const{gen:
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
erties";return(0,t.str)`must have ${
|
|
503
|
-
missingProperty: ${
|
|
469
|
+
fr={},dr={},ji;function ph(){if(ji)return dr;ji=1,Object.defineProperty(dr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return dr.default=e,dr}var et={},Li;function $s(){if(Li)return et;Li=1,Object.defineProperty(et,"__esModule",{value:!0}),et.callRef=et.getValidate=void 0;const e=Ot(),t=Ie(),r=ae(),n=Ne(),i=cr(),o=fe(),a={keyword:"$ref",schemaType:"string",code(c){const{gen:l,schema:m,it:y}=c,{baseId:_,schemaEnv:S,
|
|
470
|
+
validateName:g,opts:p,self:h}=y,{root:f}=S;if((m==="#"||m==="#/")&&_===f.baseId)return v();const d=i.resolveRef.call(h,f,_,m);if(d===void 0)throw new e.default(y.opts.uriResolver,_,m);if(d instanceof i.SchemaEnv)return $(d);return w(d);function v(){if(S===f)return u(c,g,S,S.$async);const E=l.scopeValue("root",{ref:f});return u(c,(0,r._)`${E}.validate`,f,f.$async)}function $(E){const P=s(c,E);u(c,P,E,E.$async)}function w(E){const P=l.scopeValue("schema",p.code.source===!0?{ref:E,code:(0,r.stringify)(
|
|
471
|
+
E)}:{ref:E}),O=l.name("valid"),U=c.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:P,errSchemaPath:m},O);c.mergeEvaluated(U),c.ok(O)}}};function s(c,l){const{gen:m}=c;return l.validate?m.scopeValue("validate",{ref:l.validate}):(0,r._)`${m.scopeValue("wrapper",{ref:l})}.validate`}et.getValidate=s;function u(c,l,m,y){const{gen:_,it:S}=c,{allErrors:g,schemaEnv:p,opts:h}=S,f=h.passContext?n.default.this:r.nil;y?d():v();function d(){if(!p.$async)throw new Error("async schema referenced\
|
|
472
|
+
by sync schema");const E=_.let("valid");_.try(()=>{_.code((0,r._)`await ${(0,t.callValidateCode)(c,l,f)}`),w(l),g||_.assign(E,!0)},P=>{_.if((0,r._)`!(${P} instanceof ${S.ValidationError})`,()=>_.throw(P)),$(P),g||_.assign(E,!1)}),c.ok(E)}function v(){c.result((0,t.callValidateCode)(c,l,f),()=>w(l),()=>$(l))}function $(E){const P=(0,r._)`${E}.errors`;_.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${P} : ${n.default.vErrors}.concat(${P})`),_.assign(n.default.errors,(0,r._)`${n.
|
|
473
|
+
default.vErrors}.length`)}function w(E){var P;if(!S.opts.unevaluated)return;const O=(P=m?.validate)===null||P===void 0?void 0:P.evaluated;if(S.props!==!0)if(O&&!O.dynamicProps)O.props!==void 0&&(S.props=o.mergeEvaluated.props(_,O.props,S.props));else{const U=_.var("props",(0,r._)`${E}.evaluated.props`);S.props=o.mergeEvaluated.props(_,U,S.props,r.Name)}if(S.items!==!0)if(O&&!O.dynamicItems)O.items!==void 0&&(S.items=o.mergeEvaluated.items(_,O.items,S.items));else{const U=_.var("items",(0,r._)`${E}.evaluated.items`);
|
|
474
|
+
S.items=o.mergeEvaluated.items(_,U,S.items,r.Name)}}}return et.callRef=u,et.default=a,et}var Di;function qi(){if(Di)return fr;Di=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=ph(),t=$s(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return fr.default=r,fr}var pr={},hr={},xi;function hh(){if(xi)return hr;xi=1,Object.defineProperty(hr,"__esModule",{value:!0});const e=ae(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{
|
|
475
|
+
okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:o,schemaCode:a})=>(0,e.str)`must be ${r[o].okStr} ${a}`,params:({keyword:o,schemaCode:a})=>(0,e._)`{comparison: ${r[o].okStr}, limit: ${a}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(o){const{keyword:a,data:s,schemaCode:u}=o;o.fail$data((0,e._)`${s} ${r[a].fail} ${u} || isNaN(${s})`)}};return hr.default=i,hr}
|
|
476
|
+
var mr={},Mi;function mh(){if(Mi)return mr;Mi=1,Object.defineProperty(mr,"__esModule",{value:!0});const e=ae(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:o,schemaCode:a,it:s}=n,u=s.opts.multipleOfPrecision,c=i.let("res"),l=u?(0,e._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${u}`:(0,e._)`${c} !== parseInt(${c})`;n.fail$data((0,e.
|
|
477
|
+
_)`(${a} === 0 || (${c} = ${o}/${a}, ${l}))`)}};return mr.default=r,mr}var yr={},gr={},Hi;function yh(){if(Hi)return gr;Hi=1,Object.defineProperty(gr,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,i=0,o;for(;i<r;)n++,o=t.charCodeAt(i++),o>=55296&&o<=56319&&i<r&&(o=t.charCodeAt(i),(o&64512)===56320&&i++);return n}return gr.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',gr}var Ui;function gh(){if(Ui)return yr;Ui=1,Object.defineProperty(yr,"__esModule",{value:!0});
|
|
478
|
+
const e=ae(),t=fe(),r=yh(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:a}){const s=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:a,data:s,schemaCode:u,it:c}=o,l=a==="maxLength"?e.operators.GT:e.operators.LT,m=c.opts.unicode===!1?(0,e._)`${s}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${s})`;o.fail$data((0,e.
|
|
479
|
+
_)`${m} ${l} ${u}`)}};return yr.default=i,yr}var vr={},Fi;function vh(){if(Fi)return vr;Fi=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=Ie(),t=ae(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:o,$data:a,schema:s,schemaCode:u,it:c}=i,l=c.opts.unicodeRegExp?"u":"",m=a?(0,t._)`(new RegExp(${u}, ${l}))`:(0,e.usePattern)(i,s);i.fail$data(
|
|
480
|
+
(0,t._)`!${m}.test(${o})`)}};return vr.default=n,vr}var $r={},Vi;function $h(){if(Vi)return $r;Vi=1,Object.defineProperty($r,"__esModule",{value:!0});const e=ae(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const o=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${i} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:o,schemaCode:a}=n,s=i==="maxP\
|
|
481
|
+
roperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${o}).length ${s} ${a}`)}};return $r.default=r,$r}var _r={},zi;function _h(){if(zi)return _r;zi=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=Ie(),t=ae(),r=fe(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:a,schema:s,
|
|
482
|
+
schemaCode:u,data:c,$data:l,it:m}=o,{opts:y}=m;if(!l&&s.length===0)return;const _=s.length>=y.loopRequired;if(m.allErrors?S():g(),y.strictRequired){const f=o.parentSchema.properties,{definedProperties:d}=o.it;for(const v of s)if(f?.[v]===void 0&&!d.has(v)){const $=m.schemaEnv.baseId+m.errSchemaPath,w=`required property "${v}" is not defined at "${$}" (strictRequired)`;(0,r.checkStrictMode)(m,w,m.opts.strictRequired)}}function S(){if(_||l)o.block$data(t.nil,p);else for(const f of s)(0,e.checkReportMissingProp)(
|
|
483
|
+
o,f)}function g(){const f=a.let("missing");if(_||l){const d=a.let("valid",!0);o.block$data(d,()=>h(f,d)),o.ok(d)}else a.if((0,e.checkMissingProp)(o,s,f)),(0,e.reportMissingProp)(o,f),a.else()}function p(){a.forOf("prop",u,f=>{o.setParams({missingProperty:f}),a.if((0,e.noPropertyInData)(a,c,f,y.ownProperties),()=>o.error())})}function h(f,d){o.setParams({missingProperty:f}),a.forOf(f,u,()=>{a.assign(d,(0,e.propertyInData)(a,c,f,y.ownProperties)),a.if((0,t.not)(d),()=>{o.error(),a.break()})},t.nil)}}};
|
|
484
|
+
return _r.default=i,_r}var wr={},Gi;function wh(){if(Gi)return wr;Gi=1,Object.defineProperty(wr,"__esModule",{value:!0});const e=ae(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const o=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${i} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:o,schemaCode:a}=n,s=i==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e.
|
|
485
|
+
_)`${o}.length ${s} ${a}`)}};return wr.default=r,wr}var br={},Er={},Bi;function _s(){if(Bi)return Er;Bi=1,Object.defineProperty(Er,"__esModule",{value:!0});const e=Do();return e.code='require("ajv/dist/runtime/equal").default',Er.default=e,Er}var Ki;function bh(){if(Ki)return br;Ki=1,Object.defineProperty(br,"__esModule",{value:!0});const e=nr(),t=ae(),r=fe(),n=_s(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:s}})=>(0,t.str)`must NOT have duplicate items (items ## ${s} and ${a} are identical)`,
|
|
486
|
+
params:({params:{i:a,j:s}})=>(0,t._)`{i: ${a}, j: ${s}}`},code(a){const{gen:s,data:u,$data:c,schema:l,parentSchema:m,schemaCode:y,it:_}=a;if(!c&&!l)return;const S=s.let("valid"),g=m.items?(0,e.getSchemaTypes)(m.items):[];a.block$data(S,p,(0,t._)`${y} === false`),a.ok(S);function p(){const v=s.let("i",(0,t._)`${u}.length`),$=s.let("j");a.setParams({i:v,j:$}),s.assign(S,!0),s.if((0,t._)`${v} > 1`,()=>(h()?f:d)(v,$))}function h(){return g.length>0&&!g.some(v=>v==="object"||v==="array")}function f(v,$){
|
|
487
|
+
const w=s.name("item"),E=(0,e.checkDataTypes)(g,w,_.opts.strictNumbers,e.DataType.Wrong),P=s.const("indices",(0,t._)`{}`);s.for((0,t._)`;${v}--;`,()=>{s.let(w,(0,t._)`${u}[${v}]`),s.if(E,(0,t._)`continue`),g.length>1&&s.if((0,t._)`typeof ${w} == "string"`,(0,t._)`${w} += "_"`),s.if((0,t._)`typeof ${P}[${w}] == "number"`,()=>{s.assign($,(0,t._)`${P}[${w}]`),a.error(),s.assign(S,!1).break()}).code((0,t._)`${P}[${w}] = ${v}`)})}function d(v,$){const w=(0,r.useFunc)(s,n.default),E=s.name("outer");s.
|
|
488
|
+
label(E).for((0,t._)`;${v}--;`,()=>s.for((0,t._)`${$} = ${v}; ${$}--;`,()=>s.if((0,t._)`${w}(${u}[${v}], ${u}[${$}])`,()=>{a.error(),s.assign(S,!1).break(E)})))}}};return br.default=o,br}var Sr={},Wi;function Eh(){if(Wi)return Sr;Wi=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=ae(),t=fe(),r=_s(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:a,data:s,$data:u,schemaCode:c,schema:l}=o;u||
|
|
489
|
+
l&&typeof l=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(a,r.default)}(${s}, ${c})`):o.fail((0,e._)`${l} !== ${s}`)}};return Sr.default=i,Sr}var Rr={},Xi;function Sh(){if(Xi)return Rr;Xi=1,Object.defineProperty(Rr,"__esModule",{value:!0});const e=ae(),t=fe(),r=_s(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:a,data:s,$data:u,schema:c,schemaCode:l,it:m}=o;if(!u&&
|
|
490
|
+
c.length===0)throw new Error("enum must have non-empty array");const y=c.length>=m.opts.loopEnum;let _;const S=()=>_??(_=(0,t.useFunc)(a,r.default));let g;if(y||u)g=a.let("valid"),o.block$data(g,p);else{if(!Array.isArray(c))throw new Error("ajv implementation error");const f=a.const("vSchema",l);g=(0,e.or)(...c.map((d,v)=>h(f,v)))}o.pass(g);function p(){a.assign(g,!1),a.forOf("v",l,f=>a.if((0,e._)`${S()}(${s}, ${f})`,()=>a.assign(g,!0).break()))}function h(f,d){const v=c[d];return typeof v=="obj\
|
|
491
|
+
ect"&&v!==null?(0,e._)`${S()}(${s}, ${f}[${d}])`:(0,e._)`${s} === ${v}`}}};return Rr.default=i,Rr}var Ji;function Yi(){if(Ji)return pr;Ji=1,Object.defineProperty(pr,"__esModule",{value:!0});const e=hh(),t=mh(),r=gh(),n=vh(),i=$h(),o=_h(),a=wh(),s=bh(),u=Eh(),c=Sh(),l=[e.default,t.default,r.default,n.default,i.default,o.default,a.default,s.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,c.default];return pr.default=l,pr}var Ar={},ht={},Qi;
|
|
492
|
+
function Zi(){if(Qi)return ht;Qi=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.validateAdditionalItems=void 0;const e=ae(),t=fe(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:a,it:s}=o,{items:u}=a;if(!Array.isArray(u)){(0,t.checkStrictMode)(s,'"additionalItems" is ignored when "ite\
|
|
493
|
+
ms" is not an array of schemas');return}i(o,u)}};function i(o,a){const{gen:s,schema:u,data:c,keyword:l,it:m}=o;m.items=!0;const y=s.const("len",(0,e._)`${c}.length`);if(u===!1)o.setParams({len:a.length}),o.pass((0,e._)`${y} <= ${a.length}`);else if(typeof u=="object"&&!(0,t.alwaysValidSchema)(m,u)){const S=s.var("valid",(0,e._)`${y} <= ${a.length}`);s.if((0,e.not)(S),()=>_(S)),o.ok(S)}function _(S){s.forRange("i",a.length,y,g=>{o.subschema({keyword:l,dataProp:g,dataPropType:t.Type.Num},S),m.allErrors||
|
|
494
|
+
s.if((0,e.not)(S),()=>s.break())})}}return ht.validateAdditionalItems=i,ht.default=n,ht}var Pr={},mt={},ec;function tc(){if(ec)return mt;ec=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.validateTuple=void 0;const e=ae(),t=fe(),r=Ie(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:a,it:s}=o;if(Array.isArray(a))return i(o,"additionalItems",a);s.items=!0,!(0,t.alwaysValidSchema)(s,a)&&o.ok((0,r.validateArray)(o))}};function i(o,a,s=o.
|
|
495
|
+
schema){const{gen:u,parentSchema:c,data:l,keyword:m,it:y}=o;g(c),y.opts.unevaluated&&s.length&&y.items!==!0&&(y.items=t.mergeEvaluated.items(u,s.length,y.items));const _=u.name("valid"),S=u.const("len",(0,e._)`${l}.length`);s.forEach((p,h)=>{(0,t.alwaysValidSchema)(y,p)||(u.if((0,e._)`${S} > ${h}`,()=>o.subschema({keyword:m,schemaProp:h,dataProp:h},_)),o.ok(_))});function g(p){const{opts:h,errSchemaPath:f}=y,d=s.length,v=d===p.minItems&&(d===p.maxItems||p[a]===!1);if(h.strictTuples&&!v){const $=`\
|
|
496
|
+
"${m}" is ${d}-tuple, but minItems or maxItems/${a} are not specified or different at path "${f}"`;(0,t.checkStrictMode)(y,$,h.strictTuples)}}}return mt.validateTuple=i,mt.default=n,mt}var rc;function Rh(){if(rc)return Pr;rc=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=tc(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Pr.default=t,Pr}var Cr={},nc;function Ah(){if(nc)return Cr;nc=1,Object.defineProperty(
|
|
497
|
+
Cr,"__esModule",{value:!0});const e=ae(),t=fe(),r=Ie(),n=Zi(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{schema:s,parentSchema:u,it:c}=a,{prefixItems:l}=u;c.items=!0,!(0,t.alwaysValidSchema)(c,s)&&(l?(0,n.validateAdditionalItems)(a,l):a.ok((0,r.validateArray)(a)))}};return Cr.default=o,Cr}var kr={},sc;function Ph(){
|
|
498
|
+
if(sc)return kr;sc=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:o}})=>o===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${o} valid item(s)`,params:({params:{min:i,max:o}})=>o===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${o}}`},code(i){
|
|
499
|
+
const{gen:o,schema:a,parentSchema:s,data:u,it:c}=i;let l,m;const{minContains:y,maxContains:_}=s;c.opts.next?(l=y===void 0?1:y,m=_):l=1;const S=o.const("len",(0,e._)`${u}.length`);if(i.setParams({min:l,max:m}),m===void 0&&l===0){(0,t.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&l>m){(0,t.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(c,a)){let d=(0,e._)`${S} >= ${l}`;
|
|
500
|
+
m!==void 0&&(d=(0,e._)`${d} && ${S} <= ${m}`),i.pass(d);return}c.items=!0;const g=o.name("valid");m===void 0&&l===1?h(g,()=>o.if(g,()=>o.break())):l===0?(o.let(g,!0),m!==void 0&&o.if((0,e._)`${u}.length > 0`,p)):(o.let(g,!1),p()),i.result(g,()=>i.reset());function p(){const d=o.name("_valid"),v=o.let("count",0);h(d,()=>o.if(d,()=>f(v)))}function h(d,v){o.forRange("i",0,S,$=>{i.subschema({keyword:"contains",dataProp:$,dataPropType:t.Type.Num,compositeRule:!0},d),v()})}function f(d){o.code((0,e._)`${d}++`),
|
|
501
|
+
m===void 0?o.if((0,e._)`${d} >= ${l}`,()=>o.assign(g,!0).break()):(o.if((0,e._)`${d} > ${m}`,()=>o.assign(g,!1).break()),l===1?o.assign(g,!0):o.if((0,e._)`${d} >= ${l}`,()=>o.assign(g,!0)))}}};return kr.default=n,kr}var ws={},oc;function bs(){return oc||(oc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ae(),r=fe(),n=Ie();e.error={message:({params:{property:u,depsCount:c,deps:l}})=>{const m=c===1?"property":"prop\
|
|
502
|
+
erties";return(0,t.str)`must have ${m} ${l} when property ${u} is present`},params:({params:{property:u,depsCount:c,deps:l,missingProperty:m}})=>(0,t._)`{property: ${u},
|
|
503
|
+
missingProperty: ${m},
|
|
504
504
|
depsCount: ${c},
|
|
505
|
-
deps: ${l}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[c,l]=
|
|
506
|
-
u.setParams({property:S,depsCount
|
|
507
|
-
u.mergeValidEvaluated(p,S)},()=>l.var(S,!0)),u.ok(S))}e.validateSchemaDeps=
|
|
508
|
-
alid");
|
|
509
|
-
error:{message:"must NOT have additional properties",params:({params:
|
|
510
|
-
function
|
|
511
|
-
w);return}if(u===!1){
|
|
512
|
-
Nr}var Or={},
|
|
513
|
-
props!==!0&&(l.props=r.mergeEvaluated.props(
|
|
514
|
-
return Or.default=i,Or}var Ir={},
|
|
515
|
-
c.properties
|
|
516
|
-
patternProperties",schemaProp:
|
|
517
|
-
{keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},
|
|
518
|
-
Module",{value:!0});const e=ae(),t=fe(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:
|
|
519
|
-
reset(),()=>i.error(!0));function _(){c.forEach((S
|
|
520
|
-
y",code(r){const{gen:n,schema:i,it:
|
|
521
|
-
str)`must match "${
|
|
522
|
-
se"));
|
|
523
|
-
le",{value:!0});const e=fe(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return Mr.default=t,Mr}var
|
|
524
|
-
S.default
|
|
525
|
-
default.dynamicAnchors}${(0,e.getProperty)(u)}`,y=l.errSchemaPath==="#"?l.validateName:
|
|
526
|
-
sModule",{value:!0}),gt.dynamicRef=void 0;const e=ae(),t=Ne(),r
|
|
527
|
-
_))}else y(c.validateName,_)()}function y(_,S){return S?()=>
|
|
528
|
-
return Fr;
|
|
529
|
-
dependentRequired",type:"object",schemaType:"object",error:e.error,code:r=>(0,e.validatePropertyDeps)(r)};return zr.default=t,zr}var Gr={},
|
|
530
|
-
"minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:i}){n.contains===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "contains" is ignored`)}};return Br.default=t,Br}var
|
|
531
|
-
i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:
|
|
532
|
-
|
|
533
|
-
...f)}}};return Wr.default=i,Wr}var Xr={},
|
|
534
|
-
i.fail((0,e._)`${l} > ${c}`);else if(typeof
|
|
535
|
-
default];return Kr.default=r,Kr}var Jr={},Yr={},
|
|
536
|
-
const
|
|
537
|
-
(0,e._)`${
|
|
538
|
-
code.formats}${(0,e.getProperty)(u)}`:void 0,U=
|
|
539
|
-
|
|
540
|
-
Module",{value:!0});const e=
|
|
541
|
-
Qr,"__esModule",{value:!0});const e=ae(),t=
|
|
542
|
-
equires discriminator option");const S=l.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const
|
|
543
|
-
u.elseIf((0,e._)`${p} === ${
|
|
544
|
-
H.schema),H===void 0)throw new n.default(y.opts.uriResolver,y.baseId,I)}const D=(
|
|
545
|
-
throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function U(x,H){if(typeof x!="string"||x in
|
|
546
|
-
-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},
|
|
547
|
-
ontent"}],
|
|
548
|
-
s.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},
|
|
549
|
-
properties:
|
|
505
|
+
deps: ${l}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[c,l]=o(u);a(u,c),s(u,l)}};function o({schema:u}){const c={},l={};for(const m in u){if(m==="__proto__")continue;const y=Array.isArray(u[m])?c:l;y[m]=u[m]}return[c,l]}function a(u,c=u.schema){const{gen:l,data:m,it:y}=u;if(Object.keys(c).length===0)return;const _=l.let("missing");for(const S in c){const g=c[S];if(g.length===0)continue;const p=(0,n.propertyInData)(l,m,S,y.opts.ownProperties);
|
|
506
|
+
u.setParams({property:S,depsCount:g.length,deps:g.join(", ")}),y.allErrors?l.if(p,()=>{for(const h of g)(0,n.checkReportMissingProp)(u,h)}):(l.if((0,t._)`${p} && (${(0,n.checkMissingProp)(u,g,_)})`),(0,n.reportMissingProp)(u,_),l.else())}}e.validatePropertyDeps=a;function s(u,c=u.schema){const{gen:l,data:m,keyword:y,it:_}=u,S=l.name("valid");for(const g in c)(0,r.alwaysValidSchema)(_,c[g])||(l.if((0,n.propertyInData)(l,m,g,_.opts.ownProperties),()=>{const p=u.subschema({keyword:y,schemaProp:g},S);
|
|
507
|
+
u.mergeValidEvaluated(p,S)},()=>l.var(S,!0)),u.ok(S))}e.validateSchemaDeps=s,e.default=i})(ws)),ws}var Tr={},ac;function Ch(){if(ac)return Tr;ac=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:o,schema:a,data:s,it:u}=i;if((0,t.alwaysValidSchema)(u,a))return;const c=o.name("v\
|
|
508
|
+
alid");o.forIn("key",s,l=>{i.setParams({propertyName:l}),i.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},c),o.if((0,e.not)(c),()=>{i.error(!0),u.allErrors||o.break()})}),i.ok(c)}};return Tr.default=n,Tr}var Nr={},ic;function cc(){if(ic)return Nr;ic=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=Ie(),t=ae(),r=Ne(),n=fe(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,
|
|
509
|
+
error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:s,schema:u,parentSchema:c,data:l,errsCount:m,it:y}=a;if(!m)throw new Error("ajv implementation error");const{allErrors:_,opts:S}=y;if(y.props=!0,S.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(y,u))return;const g=(0,e.allSchemaProperties)(c.properties),p=(0,e.allSchemaProperties)(c.patternProperties);h(),a.ok((0,t._)`${m} === ${r.default.errors}`);
|
|
510
|
+
function h(){s.forIn("key",l,w=>{!g.length&&!p.length?v(w):s.if(f(w),()=>v(w))})}function f(w){let E;if(g.length>8){const P=(0,n.schemaRefOrVal)(y,c.properties,"properties");E=(0,e.isOwnProperty)(s,P,w)}else g.length?E=(0,t.or)(...g.map(P=>(0,t._)`${w} === ${P}`)):E=t.nil;return p.length&&(E=(0,t.or)(E,...p.map(P=>(0,t._)`${(0,e.usePattern)(a,P)}.test(${w})`))),(0,t.not)(E)}function d(w){s.code((0,t._)`delete ${l}[${w}]`)}function v(w){if(S.removeAdditional==="all"||S.removeAdditional&&u===!1){d(
|
|
511
|
+
w);return}if(u===!1){a.setParams({additionalProperty:w}),a.error(),_||s.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(y,u)){const E=s.name("valid");S.removeAdditional==="failing"?($(w,E,!1),s.if((0,t.not)(E),()=>{a.reset(),d(w)})):($(w,E),_||s.if((0,t.not)(E),()=>s.break()))}}function $(w,E,P){const O={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};P===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(O,E)}}};return Nr.default=o,
|
|
512
|
+
Nr}var Or={},uc;function kh(){if(uc)return Or;uc=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=Nt(),t=Ie(),r=fe(),n=cc(),i={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:a,schema:s,parentSchema:u,data:c,it:l}=o;l.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(l,n.default,"additionalProperties"));const m=(0,t.allSchemaProperties)(s);for(const p of m)l.definedProperties.add(p);l.opts.unevaluated&&m.length&&l.
|
|
513
|
+
props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(m),l.props));const y=m.filter(p=>!(0,r.alwaysValidSchema)(l,s[p]));if(y.length===0)return;const _=a.name("valid");for(const p of y)S(p)?g(p):(a.if((0,t.propertyInData)(a,c,p,l.opts.ownProperties)),g(p),l.allErrors||a.else().var(_,!0),a.endIf()),o.it.definedProperties.add(p),o.ok(_);function S(p){return l.opts.useDefaults&&!l.compositeRule&&s[p].default!==void 0}function g(p){o.subschema({keyword:"properties",schemaProp:p,dataProp:p},_)}}};
|
|
514
|
+
return Or.default=i,Or}var Ir={},lc;function Th(){if(lc)return Ir;lc=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=Ie(),t=ae(),r=fe(),n=fe(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:a,schema:s,data:u,parentSchema:c,it:l}=o,{opts:m}=l,y=(0,e.allSchemaProperties)(s),_=y.filter(v=>(0,r.alwaysValidSchema)(l,s[v]));if(y.length===0||_.length===y.length&&(!l.opts.unevaluated||l.props===!0))return;const S=m.strictSchema&&!m.allowMatchingProperties&&
|
|
515
|
+
c.properties,g=a.name("valid");l.props!==!0&&!(l.props instanceof t.Name)&&(l.props=(0,n.evaluatedPropsToName)(a,l.props));const{props:p}=l;h();function h(){for(const v of y)S&&f(v),l.allErrors?d(v):(a.var(g,!0),d(v),a.if(g))}function f(v){for(const $ in S)new RegExp(v).test($)&&(0,r.checkStrictMode)(l,`property ${$} matches pattern ${v} (use allowMatchingProperties)`)}function d(v){a.forIn("key",u,$=>{a.if((0,t._)`${(0,e.usePattern)(o,v)}.test(${$})`,()=>{const w=_.includes(v);w||o.subschema({keyword:"\
|
|
516
|
+
patternProperties",schemaProp:v,dataProp:$,dataPropType:n.Type.Str},g),l.opts.unevaluated&&p!==!0?a.assign((0,t._)`${p}[${$}]`,!0):!w&&!l.allErrors&&a.if((0,t.not)(g),()=>a.break())})})}}};return Ir.default=i,Ir}var jr={},fc;function Nh(){if(fc)return jr;fc=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=fe(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:o}=r;if((0,e.alwaysValidSchema)(o,i)){r.fail();return}const a=n.name("valid");r.subschema(
|
|
517
|
+
{keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),r.failResult(a,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return jr.default=t,jr}var Lr={},dc;function Oh(){if(dc)return Lr;dc=1,Object.defineProperty(Lr,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ie().validateUnion,error:{message:"must match a schema in anyOf"}};return Lr.default=t,Lr}var Dr={},pc;function Ih(){if(pc)return Dr;pc=1,Object.defineProperty(Dr,"__es\
|
|
518
|
+
Module",{value:!0});const e=ae(),t=fe(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:o,schema:a,parentSchema:s,it:u}=i;if(!Array.isArray(a))throw new Error("ajv implementation error");if(u.opts.discriminator&&s.discriminator)return;const c=a,l=o.let("valid",!1),m=o.let("passing",null),y=o.name("_valid");i.setParams({passing:m}),o.block(_),i.result(l,()=>i.
|
|
519
|
+
reset(),()=>i.error(!0));function _(){c.forEach((S,g)=>{let p;(0,t.alwaysValidSchema)(u,S)?o.var(y,!0):p=i.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},y),g>0&&o.if((0,e._)`${y} && ${l}`).assign(l,!1).assign(m,(0,e._)`[${m}, ${g}]`).else(),o.if(y,()=>{o.assign(l,!0),o.assign(m,g),p&&i.mergeEvaluated(p,e.Name)})})}}};return Dr.default=n,Dr}var qr={},hc;function jh(){if(hc)return qr;hc=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=fe(),t={keyword:"allOf",schemaType:"arra\
|
|
520
|
+
y",code(r){const{gen:n,schema:i,it:o}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const a=n.name("valid");i.forEach((s,u)=>{if((0,e.alwaysValidSchema)(o,s))return;const c=r.subschema({keyword:"allOf",schemaProp:u},a);r.ok(a),r.mergeEvaluated(c)})}};return qr.default=t,qr}var xr={},mc;function Lh(){if(mc)return xr;mc=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.
|
|
521
|
+
str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:a,parentSchema:s,it:u}=o;s.then===void 0&&s.else===void 0&&(0,t.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const c=i(u,"then"),l=i(u,"else");if(!c&&!l)return;const m=a.let("valid",!0),y=a.name("_valid");if(_(),o.reset(),c&&l){const g=a.let("ifClause");o.setParams({ifClause:g}),a.if(y,S("then",g),S("else",g))}else c?a.if(y,S("then")):a.if((0,e.not)(y),S("el\
|
|
522
|
+
se"));o.pass(m,()=>o.error(!0));function _(){const g=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},y);o.mergeEvaluated(g)}function S(g,p){return()=>{const h=o.subschema({keyword:g},y);a.assign(m,y),o.mergeValidEvaluated(h,m),p?a.assign(p,(0,e._)`${g}`):o.setParams({ifClause:g})}}}};function i(o,a){const s=o.schema[a];return s!==void 0&&!(0,t.alwaysValidSchema)(o,s)}return xr.default=n,xr}var Mr={},yc;function Dh(){if(yc)return Mr;yc=1,Object.defineProperty(Mr,"__esModu\
|
|
523
|
+
le",{value:!0});const e=fe(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return Mr.default=t,Mr}var gc;function vc(){if(gc)return Ar;gc=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=Zi(),t=Rh(),r=tc(),n=Ah(),i=Ph(),o=bs(),a=Ch(),s=cc(),u=kh(),c=Th(),l=Nh(),m=Oh(),y=Ih(),_=jh(),S=Lh(),g=Dh();function p(h=!1){const f=[l.default,m.default,y.default,_.default,
|
|
524
|
+
S.default,g.default,a.default,s.default,o.default,u.default,c.default];return h?f.push(t.default,n.default):f.push(e.default,r.default),f.push(i.default),f}return Ar.default=p,Ar}var Hr={},yt={},$c;function _c(){if($c)return yt;$c=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.dynamicAnchor=void 0;const e=ae(),t=Ne(),r=cr(),n=$s(),i={keyword:"$dynamicAnchor",schemaType:"string",code:s=>o(s,s.schema)};function o(s,u){const{gen:c,it:l}=s;l.schemaEnv.root.dynamicAnchors[u]=!0;const m=(0,e._)`${t.
|
|
525
|
+
default.dynamicAnchors}${(0,e.getProperty)(u)}`,y=l.errSchemaPath==="#"?l.validateName:a(s);c.if((0,e._)`!${m}`,()=>c.assign(m,y))}yt.dynamicAnchor=o;function a(s){const{schemaEnv:u,schema:c,self:l}=s.it,{root:m,baseId:y,localRefs:_,meta:S}=u.root,{schemaId:g}=l.opts,p=new r.SchemaEnv({schema:c,schemaId:g,root:m,baseId:y,localRefs:_,meta:S});return r.compileSchema.call(l,p),(0,n.getValidate)(s,p)}return yt.default=i,yt}var gt={},wc;function bc(){if(wc)return gt;wc=1,Object.defineProperty(gt,"__e\
|
|
526
|
+
sModule",{value:!0}),gt.dynamicRef=void 0;const e=ae(),t=Ne(),r=$s(),n={keyword:"$dynamicRef",schemaType:"string",code:o=>i(o,o.schema)};function i(o,a){const{gen:s,keyword:u,it:c}=o;if(a[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);const l=a.slice(1);if(c.allErrors)m();else{const _=s.let("valid",!1);m(_),o.ok(_)}function m(_){if(c.schemaEnv.root.dynamicAnchors[l]){const S=s.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(l)}`);s.if(S,y(S,_),y(c.validateName,
|
|
527
|
+
_))}else y(c.validateName,_)()}function y(_,S){return S?()=>s.block(()=>{(0,r.callRef)(o,_),s.let(S,!0)}):()=>(0,r.callRef)(o,_)}}return gt.dynamicRef=i,gt.default=n,gt}var Ur={},Ec;function qh(){if(Ec)return Ur;Ec=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=_c(),t=fe(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,e.dynamicAnchor)(n,""):(0,t.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return Ur.default=r,Ur}var Fr={},Sc;function xh(){if(Sc)
|
|
528
|
+
return Fr;Sc=1,Object.defineProperty(Fr,"__esModule",{value:!0});const e=bc(),t={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,e.dynamicRef)(r,r.schema)};return Fr.default=t,Fr}var Rc;function Mh(){if(Rc)return Hr;Rc=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=_c(),t=bc(),r=qh(),n=xh(),i=[e.default,t.default,r.default,n.default];return Hr.default=i,Hr}var Vr={},zr={},Ac;function Hh(){if(Ac)return zr;Ac=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=bs(),t={keyword:"\
|
|
529
|
+
dependentRequired",type:"object",schemaType:"object",error:e.error,code:r=>(0,e.validatePropertyDeps)(r)};return zr.default=t,zr}var Gr={},Pc;function Uh(){if(Pc)return Gr;Pc=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=bs(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,e.validateSchemaDeps)(r)};return Gr.default=t,Gr}var Br={},Cc;function Fh(){if(Cc)return Br;Cc=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=fe(),t={keyword:["maxContains",
|
|
530
|
+
"minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:i}){n.contains===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "contains" is ignored`)}};return Br.default=t,Br}var kc;function Vh(){if(kc)return Vr;kc=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=Hh(),t=Uh(),r=Fh(),n=[e.default,t.default,r.default];return Vr.default=n,Vr}var Kr={},Wr={},Tc;function zh(){if(Tc)return Wr;Tc=1,Object.defineProperty(Wr,"__esModule",{value:!0});const e=ae(),t=fe(),r=Ne(),
|
|
531
|
+
i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:o})=>(0,e._)`{unevaluatedProperty: ${o.unevaluatedProperty}}`},code(o){const{gen:a,schema:s,data:u,errsCount:c,it:l}=o;if(!c)throw new Error("ajv implementation error");const{allErrors:m,props:y}=l;y instanceof e.Name?a.if((0,e._)`${y} !== true`,()=>a.forIn("key",u,p=>a.if(S(y,p),()=>_(p)))):y!==!0&&a.forIn("key",u,p=>y===void 0?_(p):
|
|
532
|
+
a.if(g(y,p),()=>_(p))),l.props=!0,o.ok((0,e._)`${c} === ${r.default.errors}`);function _(p){if(s===!1){o.setParams({unevaluatedProperty:p}),o.error(),m||a.break();return}if(!(0,t.alwaysValidSchema)(l,s)){const h=a.name("valid");o.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:t.Type.Str},h),m||a.if((0,e.not)(h),()=>a.break())}}function S(p,h){return(0,e._)`!${p} || !${p}[${h}]`}function g(p,h){const f=[];for(const d in p)p[d]===!0&&f.push((0,e._)`${h} !== ${d}`);return(0,e.and)(
|
|
533
|
+
...f)}}};return Wr.default=i,Wr}var Xr={},Nc;function Gh(){if(Nc)return Xr;Nc=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{gen:o,schema:a,data:s,it:u}=i,c=u.items||0;if(c===!0)return;const l=o.const("len",(0,e._)`${s}.length`);if(a===!1)i.setParams({len:c}),
|
|
534
|
+
i.fail((0,e._)`${l} > ${c}`);else if(typeof a=="object"&&!(0,t.alwaysValidSchema)(u,a)){const y=o.var("valid",(0,e._)`${l} <= ${c}`);o.if((0,e.not)(y),()=>m(y,c)),i.ok(y)}u.items=!0;function m(y,_){o.forRange("i",_,l,S=>{i.subschema({keyword:"unevaluatedItems",dataProp:S,dataPropType:t.Type.Num},y),u.allErrors||o.if((0,e.not)(y),()=>o.break())})}}};return Xr.default=n,Xr}var Oc;function Bh(){if(Oc)return Kr;Oc=1,Object.defineProperty(Kr,"__esModule",{value:!0});const e=zh(),t=Gh(),r=[e.default,t.
|
|
535
|
+
default];return Kr.default=r,Kr}var Jr={},Yr={},Ic;function Kh(){if(Ic)return Yr;Ic=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=ae(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,i){const{gen:o,data:a,$data:s,schema:u,schemaCode:c,it:l}=n,{opts:m,errSchemaPath:y,schemaEnv:_,self:S}=l;if(!m.validateFormats)return;s?g():p();function g(){
|
|
536
|
+
const h=o.scopeValue("formats",{ref:S.formats,code:m.code.formats}),f=o.const("fDef",(0,e._)`${h}[${c}]`),d=o.let("fType"),v=o.let("format");o.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>o.assign(d,(0,e._)`${f}.type || "string"`).assign(v,(0,e._)`${f}.validate`),()=>o.assign(d,(0,e._)`"string"`).assign(v,f)),n.fail$data((0,e.or)($(),w()));function $(){return m.strictSchema===!1?e.nil:(0,e._)`${c} && !${v}`}function w(){const E=_.$async?(0,e._)`(${f}.async ? await ${v}(${a}) : ${v}(${a}))`:
|
|
537
|
+
(0,e._)`${v}(${a})`,P=(0,e._)`(typeof ${v} == "function" ? ${E} : ${v}.test(${a}))`;return(0,e._)`${v} && ${v} !== true && ${d} === ${i} && !${P}`}}function p(){const h=S.formats[u];if(!h){$();return}if(h===!0)return;const[f,d,v]=w(h);f===i&&n.pass(E());function $(){if(m.strictSchema===!1){S.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${u}" ignored in schema at path "${y}"`}}function w(P){const O=P instanceof RegExp?(0,e.regexpCode)(P):m.code.formats?(0,e._)`${m.
|
|
538
|
+
code.formats}${(0,e.getProperty)(u)}`:void 0,U=o.scopeValue("formats",{key:u,ref:P,code:O});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,e._)`${U}.validate`]:["string",P,U]}function E(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!_.$async)throw new Error("async format in sync schema");return(0,e._)`await ${v}(${a})`}return typeof d=="function"?(0,e._)`${v}(${a})`:(0,e._)`${v}.test(${a})`}}}};return Yr.default=r,Yr}var jc;function Lc(){if(jc)return Jr;
|
|
539
|
+
jc=1,Object.defineProperty(Jr,"__esModule",{value:!0});const t=[Kh().default];return Jr.default=t,Jr}var ot={},Dc;function qc(){return Dc||(Dc=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.contentVocabulary=ot.metadataVocabulary=void 0,ot.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],ot.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),ot}var xc;function Wh(){if(xc)return lr;xc=1,Object.defineProperty(lr,"__es\
|
|
540
|
+
Module",{value:!0});const e=qi(),t=Yi(),r=vc(),n=Mh(),i=Vh(),o=Bh(),a=Lc(),s=qc(),u=[n.default,e.default,t.default,(0,r.default)(!0),a.default,s.metadataVocabulary,s.contentVocabulary,i.default,o.default];return lr.default=u,lr}var Qr={},jt={},Mc;function Xh(){if(Mc)return jt;Mc=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(jt.DiscrError=e={})),jt}var Hc;function Uc(){if(Hc)return Qr;Hc=1,Object.defineProperty(
|
|
541
|
+
Qr,"__esModule",{value:!0});const e=ae(),t=Xh(),r=cr(),n=Ot(),i=fe(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:s,tagName:u}})=>s===t.DiscrError.Tag?`tag "${u}" must be string`:`value of tag "${u}" must be in oneOf`,params:({params:{discrError:s,tag:u,tagName:c}})=>(0,e._)`{error: ${s}, tag: ${c}, tagValue: ${u}}`},code(s){const{gen:u,data:c,schema:l,parentSchema:m,it:y}=s,{oneOf:_}=m;if(!y.opts.discriminator)throw new Error("discriminator: r\
|
|
542
|
+
equires discriminator option");const S=l.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const g=u.let("valid",!1),p=u.const("tag",(0,e._)`${c}${(0,e.getProperty)(S)}`);u.if((0,e._)`typeof ${p} == "string"`,()=>h(),()=>s.error(!1,{discrError:t.DiscrError.Tag,tag:p,tagName:S})),s.ok(g);function h(){const v=d();u.if(!1);for(const $ in v)
|
|
543
|
+
u.elseIf((0,e._)`${p} === ${$}`),u.assign(g,f(v[$]));u.else(),s.error(!1,{discrError:t.DiscrError.Mapping,tag:p,tagName:S}),u.endIf()}function f(v){const $=u.name("valid"),w=s.subschema({keyword:"oneOf",schemaProp:v},$);return s.mergeEvaluated(w,e.Name),$}function d(){var v;const $={},w=P(m);let E=!0;for(let x=0;x<_.length;x++){let H=_[x];if(H?.$ref&&!(0,i.schemaHasRulesButRef)(H,y.self.RULES)){const I=H.$ref;if(H=r.resolveRef.call(y.self,y.schemaEnv.root,y.baseId,I),H instanceof r.SchemaEnv&&(H=
|
|
544
|
+
H.schema),H===void 0)throw new n.default(y.opts.uriResolver,y.baseId,I)}const D=(v=H?.properties)===null||v===void 0?void 0:v[S];if(typeof D!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);E=E&&(w||P(H)),O(D,x)}if(!E)throw new Error(`discriminator: "${S}" must be required`);return $;function P({required:x}){return Array.isArray(x)&&x.includes(S)}function O(x,H){if(x.const)U(x.const,H);else if(x.enum)for(const D of x.enum)U(D,H);else
|
|
545
|
+
throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function U(x,H){if(typeof x!="string"||x in $)throw new Error(`discriminator: "${S}" values must be unique strings`);$[x]=H}}}};return Qr.default=a,Qr}var Zr={};const Fc="https://json-schema.org/draft/2020-12/schema",Vc="https://json-schema.org/draft/2020-12/schema",zc={"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\
|
|
546
|
+
-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},Gc="meta",Bc="Core and Validation specifications meta-schema",Kc=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/c\
|
|
547
|
+
ontent"}],Wc=["object","boolean"],Xc="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",Jc={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 semantic\
|
|
548
|
+
s.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},Jh={$schema:Fc,$id:Vc,$vocabulary:zc,$dynamicAnchor:Gc,title:Bc,allOf:Kc,type:Wc,$comment:Xc,
|
|
549
|
+
properties:Jc},Yh={__proto__:null,$comment:Xc,$dynamicAnchor:Gc,$id:Vc,$schema:Fc,$vocabulary:zc,allOf:Kc,default:Jh,properties:Jc,title:Bc,type:Wc},Qh=De(Yh),Yc="https://json-schema.org/draft/2020-12/schema",Qc="https://json-schema.org/draft/2020-12/meta/applicator",Zc={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},eu="meta",tu="Applicator vocabulary meta-schema",ru=["object","boolean"],nu={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"\
|
|
550
550
|
#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"\
|
|
551
|
-
#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},
|
|
552
|
-
tps://json-schema.org/draft/2020-12/vocab/unevaluated":!0},
|
|
553
|
-
s://json-schema.org/draft/2020-12/meta/content",
|
|
554
|
-
https://json-schema.org/draft/2020-12/schema",
|
|
555
|
-
$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},
|
|
556
|
-
$defs:
|
|
557
|
-
|
|
558
|
-
writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},
|
|
559
|
-
ema",
|
|
560
|
-
$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},
|
|
561
|
-
er",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},
|
|
562
|
-
return Zr;
|
|
563
|
-
t.Ajv2020=void 0;const r=
|
|
564
|
-
return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(
|
|
565
|
-
return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var l=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var
|
|
566
|
-
en={exports:{}},Es={},
|
|
551
|
+
#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},su={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},Zh={$schema:Yc,$id:Qc,$vocabulary:Zc,$dynamicAnchor:eu,title:tu,type:ru,properties:nu,$defs:su},em={__proto__:null,$defs:su,$dynamicAnchor:eu,$id:Qc,$schema:Yc,$vocabulary:Zc,default:Zh,properties:nu,title:tu,type:ru},tm=De(em),ou="https://json-schema.org/draft/2020-12/schema",au="https://json-schema.org/draft/2020-12/meta/unevaluated",iu={"ht\
|
|
552
|
+
tps://json-schema.org/draft/2020-12/vocab/unevaluated":!0},cu="meta",uu="Unevaluated applicator vocabulary meta-schema",lu=["object","boolean"],fu={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},rm={$schema:ou,$id:au,$vocabulary:iu,$dynamicAnchor:cu,title:uu,type:lu,properties:fu},nm={__proto__:null,$dynamicAnchor:cu,$id:au,$schema:ou,$vocabulary:iu,default:rm,properties:fu,title:uu,type:lu},sm=De(nm),du="https://json-schema.org/draft/2020-12/schema",pu="http\
|
|
553
|
+
s://json-schema.org/draft/2020-12/meta/content",hu={"https://json-schema.org/draft/2020-12/vocab/content":!0},mu="meta",yu="Content vocabulary meta-schema",gu=["object","boolean"],vu={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},om={$schema:du,$id:pu,$vocabulary:hu,$dynamicAnchor:mu,title:yu,type:gu,properties:vu},am={__proto__:null,$dynamicAnchor:mu,$id:pu,$schema:du,$vocabulary:hu,default:om,properties:vu,title:yu,type:gu},im=De(am),$u="\
|
|
554
|
+
https://json-schema.org/draft/2020-12/schema",_u="https://json-schema.org/draft/2020-12/meta/core",wu={"https://json-schema.org/draft/2020-12/vocab/core":!0},bu="meta",Eu="Core vocabulary meta-schema",Su=["object","boolean"],Ru={$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:{
|
|
555
|
+
$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},Au={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},cm={$schema:$u,$id:_u,$vocabulary:wu,$dynamicAnchor:bu,title:Eu,type:Su,properties:Ru,$defs:Au},um={__proto__:null,
|
|
556
|
+
$defs:Au,$dynamicAnchor:bu,$id:_u,$schema:$u,$vocabulary:wu,default:cm,properties:Ru,title:Eu,type:Su},lm=De(um),Pu="https://json-schema.org/draft/2020-12/schema",Cu="https://json-schema.org/draft/2020-12/meta/format-annotation",ku={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Tu="meta",Nu="Format vocabulary meta-schema for annotation results",Ou=["object","boolean"],Iu={format:{type:"string"}},fm={$schema:Pu,$id:Cu,$vocabulary:ku,$dynamicAnchor:Tu,title:Nu,type:Ou,properties:Iu},
|
|
557
|
+
dm={__proto__:null,$dynamicAnchor:Tu,$id:Cu,$schema:Pu,$vocabulary:ku,default:fm,properties:Iu,title:Nu,type:Ou},pm=De(dm),ju="https://json-schema.org/draft/2020-12/schema",Lu="https://json-schema.org/draft/2020-12/meta/meta-data",Du={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},qu="meta",xu="Meta-data vocabulary meta-schema",Mu=["object","boolean"],Hu={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},
|
|
558
|
+
writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},hm={$schema:ju,$id:Lu,$vocabulary:Du,$dynamicAnchor:qu,title:xu,type:Mu,properties:Hu},mm={__proto__:null,$dynamicAnchor:qu,$id:Lu,$schema:ju,$vocabulary:Du,default:hm,properties:Hu,title:xu,type:Mu},ym=De(mm),Uu="https://json-schema.org/draft/2020-12/schema",Fu="https://json-schema.org/draft/2020-12/meta/validation",Vu={"https://json-schema.org/draft/2020-12/vocab/validation":!0},zu="meta",Gu="Validation vocabulary meta-sch\
|
|
559
|
+
ema",Bu=["object","boolean"],Ku={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{
|
|
560
|
+
$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},Wu={nonNegativeInteger:{type:"integ\
|
|
561
|
+
er",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},gm={$schema:Uu,$id:Fu,$vocabulary:Vu,$dynamicAnchor:zu,title:Gu,type:Bu,properties:Ku,$defs:Wu},vm={__proto__:null,$defs:Wu,$dynamicAnchor:zu,$id:Fu,$schema:Uu,$vocabulary:Vu,default:gm,properties:Ku,title:Gu,type:Bu},$m=De(vm);var Xu;function _m(){if(Xu)
|
|
562
|
+
return Zr;Xu=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=Qh,t=tm,r=sm,n=im,i=lm,o=pm,a=ym,s=$m,u=["/properties"];function c(l){return[e,t,r,n,i,m(this,o),a,m(this,s)].forEach(y=>this.addMetaSchema(y,void 0,!1)),this;function m(y,_){return l?y.$dataMetaSchema(_,u):_}}return Zr.default=c,Zr}var Ju;function wm(){return Ju||(Ju=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=
|
|
563
|
+
t.Ajv2020=void 0;const r=Ii(),n=Wh(),i=Uc(),o=_m(),a="https://json-schema.org/draft/2020-12/schema";class s extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:_,meta:S}=this.opts;S&&(o.default.call(this,_),this.refs["http://json-schema.org/schema"]=a)}defaultMeta(){
|
|
564
|
+
return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv2020=s,e.exports=t=s,e.exports.Ajv2020=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var u=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=ae();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){
|
|
565
|
+
return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var l=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var m=Ot();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(Zt,Zt.exports)),Zt.exports}var bm=wm(),
|
|
566
|
+
en={exports:{}},Es={},Yu;function Em(){return Yu||(Yu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(x,H){return{validate:x,compare:H}}e.fullFormats={date:t(o,a),time:t(u(!0),c),"date-time":t(y(!0),_),"iso-time":t(u(),l),"iso-date-time":t(y(),S),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:h,"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,
|
|
567
567
|
"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,
|
|
568
568
|
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,
|
|
569
569
|
regex:U,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:d,int32:{type:"number",validate:w},int64:{type:"number",validate:E},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
570
|
-
|
|
571
|
-
email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(x){return x%4===0&&(x%100!==0||x%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function
|
|
572
|
-
function u(x){return function(D){const I=
|
|
573
|
-
D[1]+D[2]+D[3],H=I[1]+I[2]+I[3],x>H?1:x<H?-1:0}const
|
|
574
|
-
function
|
|
575
|
-
rn,"__esModule",{value:!0});const e=
|
|
576
|
-
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},
|
|
570
|
+
a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,S),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
571
|
+
email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(x){return x%4===0&&(x%100!==0||x%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(x){const H=n.exec(x);if(!H)return!1;const D=+H[1],I=+H[2],M=+H[3];return I>=1&&I<=12&&M>=1&&M<=(I===2&&r(D)?29:i[I])}function a(x,H){if(x&&H)return x>H?1:x<H?-1:0}const s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
572
|
+
function u(x){return function(D){const I=s.exec(D);if(!I)return!1;const M=+I[1],z=+I[2],F=+I[3],G=I[4],Q=I[5]==="-"?-1:1,q=+(I[6]||0),A=+(I[7]||0);if(q>23||A>59||x&&!G)return!1;if(M<=23&&z<=59&&F<60)return!0;const L=z-A*Q,T=M-q*Q-(L<0?1:0);return(T===23||T===-1)&&(L===59||L===-1)&&F<61}}function c(x,H){if(!(x&&H))return;const D=new Date("2020-01-01T"+x).valueOf(),I=new Date("2020-01-01T"+H).valueOf();if(D&&I)return D-I}function l(x,H){if(!(x&&H))return;const D=s.exec(x),I=s.exec(H);if(D&&I)return x=
|
|
573
|
+
D[1]+D[2]+D[3],H=I[1]+I[2]+I[3],x>H?1:x<H?-1:0}const m=/t|\s/i;function y(x){const H=u(x);return function(I){const M=I.split(m);return M.length===2&&o(M[0])&&H(M[1])}}function _(x,H){if(!(x&&H))return;const D=new Date(x).valueOf(),I=new Date(H).valueOf();if(D&&I)return D-I}function S(x,H){if(!(x&&H))return;const[D,I]=x.split(m),[M,z]=H.split(m),F=a(D,M);if(F!==void 0)return F||c(I,z)}const g=/\/|:/,p=/^(?:[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;
|
|
574
|
+
function h(x){return g.test(x)&&p.test(x)}const f=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function d(x){return f.lastIndex=0,f.test(x)}const v=-2147483648,$=2**31-1;function w(x){return Number.isInteger(x)&&x<=$&&x>=v}function E(x){return Number.isInteger(x)}function P(){return!0}const O=/[^\\]\\Z/;function U(x){if(O.test(x))return!1;try{return new RegExp(x),!0}catch{return!1}}})(Es)),Es}var Ss={},tn={exports:{}},rn={},Qu;function Sm(){if(Qu)return rn;Qu=1,Object.defineProperty(
|
|
575
|
+
rn,"__esModule",{value:!0});const e=qi(),t=Yi(),r=vc(),n=Lc(),i=qc(),o=[e.default,t.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return rn.default=o,rn}const Zu="http://json-schema.org/draft-07/schema#",el="http://json-schema.org/draft-07/schema#",tl="Core schema meta-schema",rl={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},
|
|
576
|
+
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},nl=["object","boolean"],sl={$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},
|
|
577
577
|
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\
|
|
578
578
|
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:"\
|
|
579
579
|
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\
|
|
580
|
-
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},
|
|
581
|
-
|
|
582
|
-
(this.getSchema(
|
|
583
|
-
"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var
|
|
584
|
-
Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=
|
|
585
|
-
{keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:
|
|
586
|
-
f(
|
|
587
|
-
|
|
588
|
-
throw new Error(`Unknown format "${c}"`);return y};function u(c,l,
|
|
589
|
-
t,r);!
|
|
590
|
-
${t}`,
|
|
591
|
-
t,i,r);return
|
|
592
|
-
void 0),
|
|
593
|
-
MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Rs}var As,
|
|
594
|
-
MAX_LENGTH:i}=sn(),
|
|
595
|
-
`\\d*[a-zA-Z-]${y}*`)
|
|
596
|
-
PRERELEASEIDENTIFIER]})*))`)
|
|
597
|
-
GEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
|
|
598
|
-
$`)
|
|
599
|
-
$`)
|
|
600
|
-
"$1$2$3"
|
|
601
|
-
|
|
602
|
-
"string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const
|
|
603
|
-
|
|
604
|
-
return this.version}compare(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof
|
|
605
|
-
prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let l=0;do{const
|
|
606
|
-
if(
|
|
607
|
-
minor++,this.inc("pre",l,
|
|
608
|
-
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(
|
|
609
|
-
push(y)}}if(l){let _=[l,y];
|
|
610
|
-
if(
|
|
611
|
-
return Ls=(r,n)=>{const i=e(r,null,!0),
|
|
612
|
-
wl;function
|
|
613
|
-
(r,n,i)=>e(n,r,i),Us}var Fs,
|
|
614
|
-
Tl=1;const e=
|
|
615
|
-
n,i)<=0,eo}var ro,
|
|
616
|
-
`Invalid operator: ${u}`)}},ro}var no,
|
|
617
|
-
S),_.lastIndex=S.index+S[1].length+S[2].length;_.lastIndex=-1}if(
|
|
618
|
-
n!==void 0){if(this.map.size>=this.max){const
|
|
619
|
-
this.raw=M.trim().replace(e," "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(G
|
|
620
|
-
set.length;M++){M>0&&(this.formatted+="||");const z=this.set[M];for(let F=0;F<z.length;F++)F>0&&(this.formatted+=" "),this.formatted+=z[F].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const F=((this.options.includePrerelease&&_)|(this.options.loose&&S))+":"+M,G=n.get(F);if(G)return G;const Q=this.options.loose,q=Q?u[c.HYPHENRANGELOOSE]:
|
|
621
|
-
u[c.COMPARATORTRIM],l),
|
|
622
|
-
values()];return n.set(F,R),R}intersects(M,z){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(F=>
|
|
623
|
-
{FLAG_INCLUDE_PRERELEASE:_,FLAG_LOOSE:S}=sn()
|
|
624
|
-
|
|
625
|
-
.0.0${F} <${+Q+1}.0.0-0`:d(A)?Q==="0"?T=`>=${Q}.${q}.0${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.0${F} <${+Q+1}.0.0-0`:L?(
|
|
626
|
-
M),I.split(/\s+/).map(z=>O(z,M)).join(" ")),O=(I,M)=>{I=I.trim();const z=M.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return I.replace(z,(F,G,Q,q,A,L)=>{
|
|
627
|
-
.0${L} <${Q}.${+q+1}.0-0`),
|
|
628
|
-
D=(I,M,z)=>{for(let F=0;F<I.length;F++)if(!I[F].test(M))return!1;if(M.prerelease.length&&!z.includePrerelease){for(let F=0;F<I.length;F++)if(
|
|
629
|
-
return l;l=l.value}l=l.trim().split(/\s+/).join(" "),
|
|
630
|
-
return this.value}test(l){if(
|
|
631
|
-
-0"||l.value==="<0.0.0-0")||!
|
|
632
|
-
">")))}}ao=t;const r=Cs(),{safeRe:n,t:i}=Lt(),
|
|
633
|
-
|
|
634
|
-
i.set.length;++
|
|
635
|
-
po}var ho,
|
|
636
|
-
v.semver,_)
|
|
637
|
-
var vo,ef;function
|
|
638
|
-
return _o;
|
|
639
|
-
let
|
|
640
|
-
|
|
641
|
-
P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===w.major&&P.semver.minor===w.minor&&P.semver.patch===w.patch&&(w=!1),P.operator==="<"||P.operator==="<="){if(d=l(p,P,_),d===P&&d!==p)return!1}else if(p.operator==="<="&&!n(p.semver,String(P),_))return!1}if(!P.operator&&(p
|
|
642
|
-
const S=i(
|
|
643
|
-
patch:
|
|
644
|
-
const
|
|
645
|
-
if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,
|
|
646
|
-
(e,t)=>t.toString(16).padStart(2,"0"));const
|
|
647
|
-
accessPropertiesByDotNotation:!0,configFileMode:438,...t};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=
|
|
648
|
-
|
|
649
|
-
"Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(
|
|
650
|
-
"Use `delete()` to clear values");if(this._containsReservedKey(t))throw new TypeError(`Please don't use the ${ln} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(
|
|
651
|
-
this.set(r,this.#r[r])}delete(t){const{store:r}=this;this.#e.accessPropertiesByDotNotation?
|
|
652
|
-
"function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.store,t)}get size(){return Object.keys(this.store).length}get store(){try{const t=se.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(t),n=this._deserialize(r);return this.
|
|
653
|
-
this._ensureDirectory(),this._validate(t),this._write(t),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[t,r]of Object.entries(this.store))yield[t,r]}_encryptData(t){if(!this.#t)return typeof t=="string"?t:
|
|
654
|
-
|
|
655
|
-
let r=this._serialize(t);if(this.#t){const n=Pt.randomBytes(16),i=Pt.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),
|
|
656
|
-
me.platform==="win32"?se.watch(this.path,{persistent:!1},
|
|
657
|
-
{...this.store}}catch(u){throw this.store=
|
|
658
|
-
_isVersionInRangeFormat(t)?r!=="0.0.0"
|
|
659
|
-
options=n}}class
|
|
660
|
-
BodyInit type")return!1;throw i}return e&&!t})(),
|
|
661
|
-
|
|
662
|
-
encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).
|
|
663
|
-
t).length}catch{return 0}return 0},
|
|
664
|
-
u.byteLength;const c=r===0?0:n/r;t({percent:c,transferredBytes:n,totalBytes:r},u)}i.enqueue(u),await
|
|
665
|
-
max(r,n)},new Uint8Array),i.close();return}n+=u.byteLength;let c=r===0?0:n/r;(r<n||c===1)&&(c=.99),t&&t({percent:Number(c.toFixed(2)),transferredBytes:n,totalBytes:r},u),i.enqueue(u),await
|
|
666
|
-
Headers(t);for(const[
|
|
667
|
-
|
|
668
|
-
limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...
|
|
669
|
-
|
|
670
|
-
hooks.afterResponse){const c=await u(n.request,n._options,n._decorateResponse(
|
|
671
|
-
|
|
672
|
-
parseJson)return r.parseJson(await c.text())}return c[
|
|
673
|
-
globalThis)},typeof this._input!="string"&&!(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.
|
|
674
|
-
this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(
|
|
675
|
-
_options),this._options.searchParams){const i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),
|
|
676
|
-
Request(
|
|
677
|
-
limit||t instanceof
|
|
678
|
-
retry.maxRetryAfter??i;return i<
|
|
679
|
-
if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===
|
|
680
|
-
const t=(r,n)=>hn.create(r,fn(e,n));for(const r of
|
|
681
|
-
ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:$f}}).catch(()=>{})}catch{}t&&bo.gt(t,at)&&We(["Update available: ",j.dim(at),j.reset(" \u2192 "),j.green(t)].join(""))}async function
|
|
682
|
-
|
|
683
|
-
const n=yn.file(r.endsWith(
|
|
684
|
-
Symbol[e])?t:Symbol.for("Symbol."+e),
|
|
685
|
-
SuppressedError",c.error=
|
|
686
|
-
c,n);n&&qt.info(`${j.dim("project")} ${j.green(l)}`);const y=
|
|
687
|
-
|
|
688
|
-
An(u)}if(!c)throw n.error(`Cannot locate ${u.id}`,{target:u}),new Error(`Cannot locate ${u.id}`);const l=yn.parse(c.uri);return{range:c.range,document:l,relativePath:gn.relative(
|
|
689
|
-
await Xe(l,c)},abort:u=>{throw n.error(u||"Generator aborted"),new Error(u||"Generator aborted")}}}))}async function
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
`error while generating ${l.id}`,{error:
|
|
693
|
-
d2":case"mermaid":case"plantuml":{await
|
|
694
|
-
|
|
695
|
-
c),
|
|
696
|
-
n),He(n)&&(await wn(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const p=Ut(
|
|
580
|
+
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Rm={$schema:Zu,$id:el,title:tl,definitions:rl,type:nl,properties:sl,default:!0},Am={__proto__:null,$id:el,$schema:Zu,default:Rm,definitions:rl,properties:sl,title:tl,type:nl},Pm=De(Am);var ol;function Cm(){return ol||(ol=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=Ii(),n=Sm(),i=Uc(),
|
|
581
|
+
o=Pm,a=["/properties"],s="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(S=>this.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(S,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
582
|
+
(this.getSchema(s)?s:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var c=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=ae();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(t,
|
|
583
|
+
"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var m=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var y=Ot();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return y.default}})})(tn,tn.exports)),tn.exports}var al;function km(){return al||(al=1,(function(e){
|
|
584
|
+
Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Cm(),r=ae(),n=r.operators,i={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}},o={message:({keyword:s,schemaCode:u})=>(0,r.str)`should be ${i[s].okStr} ${u}`,params:({keyword:s,schemaCode:u})=>(0,r._)`{comparison: ${i[s].okStr}, limit: ${u}}`};e.formatLimitDefinition=
|
|
585
|
+
{keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(s){const{gen:u,data:c,schemaCode:l,keyword:m,it:y}=s,{opts:_,self:S}=y;if(!_.validateFormats)return;const g=new t.KeywordCxt(y,S.RULES.all.format.definition,"format");g.$data?p():h();function p(){const d=u.scopeValue("formats",{ref:S.formats,code:_.code.formats}),v=u.const("fmt",(0,r._)`${d}[${g.schemaCode}]`);s.fail$data((0,r.or)((0,r._)`typeof ${v} != "object"`,(0,r._)`${v} instanceof RegExp`,(0,r._)`typeof ${v}.compare != "function"`,
|
|
586
|
+
f(v)))}function h(){const d=g.schema,v=S.formats[d];if(!v||v===!0)return;if(typeof v!="object"||v instanceof RegExp||typeof v.compare!="function")throw new Error(`"${m}": format "${d}" does not define "compare" function`);const $=u.scopeValue("formats",{key:d,ref:v,code:_.code.formats?(0,r._)`${_.code.formats}${(0,r.getProperty)(d)}`:void 0});s.fail$data(f($))}function f(d){return(0,r._)`${d}.compare(${c}, ${l}) ${i[m].fail} 0`}},dependencies:["format"]};const a=s=>(s.addKeyword(e.formatLimitDefinition),
|
|
587
|
+
s);e.default=a})(Ss)),Ss}var il;function Tm(){return il||(il=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Em(),n=km(),i=ae(),o=new i.Name("fullFormats"),a=new i.Name("fastFormats"),s=(c,l={keywords:!0})=>{if(Array.isArray(l))return u(c,l,r.fullFormats,o),c;const[m,y]=l.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,o],_=l.formats||r.formatNames;return u(c,_,m,y),l.keywords&&(0,n.default)(c),c};s.get=(c,l="full")=>{const y=(l==="fast"?r.fastFormats:r.fullFormats)[c];if(!y)
|
|
588
|
+
throw new Error(`Unknown format "${c}"`);return y};function u(c,l,m,y){var _,S;(_=(S=c.opts.code).formats)!==null&&_!==void 0||(S.formats=(0,i._)`require("ajv-formats/dist/formats").${y}`);for(const g of l)c.addFormat(g,m[g])}e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s})(en,en.exports)),en.exports}var Nm=Tm();const Om=mn(Nm),Im=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const i=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(
|
|
589
|
+
t,r);!jm(i,o)&&n||Object.defineProperty(e,r,o)},jm=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Lm=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Dm=(e,t)=>`/* Wrapped ${e}*/
|
|
590
|
+
${t}`,qm=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xm=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Mm=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=Dm.bind(null,n,t.toString());Object.defineProperty(i,"name",xm);const{writable:o,enumerable:a,configurable:s}=qm;Object.defineProperty(e,"toString",{value:i,writable:o,enumerable:a,configurable:s})};function Hm(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const i of Reflect.ownKeys(t))Im(e,
|
|
591
|
+
t,i,r);return Lm(e,t),Mm(e,t,n),e}const cl=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:o=!0}=t;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!o)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let a,s,u;const c=function(...l){const m=this,y=()=>{a=void 0,s&&(clearTimeout(s),s=
|
|
592
|
+
void 0),o&&(u=e.apply(m,l))},_=()=>{s=void 0,a&&(clearTimeout(a),a=void 0),o&&(u=e.apply(m,l))},S=i&&!a;return clearTimeout(a),a=setTimeout(y,r),n>0&&n!==Number.POSITIVE_INFINITY&&!s&&(s=setTimeout(_,n)),S&&(u=e.apply(m,l)),u};return Hm(c,e),c.cancel=()=>{a&&(clearTimeout(a),a=void 0),s&&(clearTimeout(s),s=void 0)},c};var nn={exports:{}},Rs,ul;function sn(){if(ul)return Rs;ul=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=t-6;return Rs={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,
|
|
593
|
+
MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Rs}var As,ll;function on(){return ll||(ll=1,As=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),As}var fl;function Lt(){return fl||(fl=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,
|
|
594
|
+
MAX_LENGTH:i}=sn(),o=on();t=e.exports={};const a=t.re=[],s=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],l=t.t={};let m=0;const y="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",i],[y,n]],S=p=>{for(const[h,f]of _)p=p.split(`${h}*`).join(`${h}{0,${f}}`).split(`${h}+`).join(`${h}{1,${f}}`);return p},g=(p,h,f)=>{const d=S(h),v=m++;o(p,v,h),l[p]=v,u[v]=h,c[v]=d,a[v]=new RegExp(h,f?"g":void 0),s[v]=new RegExp(d,f?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",
|
|
595
|
+
`\\d*[a-zA-Z-]${y}*`),g("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.
|
|
596
|
+
PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${y}+`),g("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),g("FULL",`^${u[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),g("LOOSE",`^${u[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRAN\
|
|
597
|
+
GEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),g("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}\
|
|
598
|
+
$`),g("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),g("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[l.COERCE],!0),g("COERCERTLFULL",u[l.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}\
|
|
599
|
+
$`),g("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace=
|
|
600
|
+
"$1$2$3",g("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(nn,nn.exports)),nn.exports}var Ps,dl;function Cs(){if(dl)return Ps;dl=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ps=n=>n?typeof n!="object"?e:n:t,Ps}var ks,pl;function hl(){if(pl)return ks;
|
|
601
|
+
pl=1;const e=/^[0-9]+$/,t=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const o=e.test(n),a=e.test(i);return o&&a&&(n=+n,i=+i),n===i?0:o&&!a?-1:a&&!o?1:n<i?-1:1};return ks={compareIdentifiers:t,rcompareIdentifiers:(n,i)=>t(i,n)},ks}var Ts,ml;function Se(){if(ml)return Ts;ml=1;const e=on(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=sn(),{safeRe:n,t:i}=Lt(),o=Cs(),{compareIdentifiers:a}=hl();class s{constructor(c,l){if(l=o(l),c instanceof s){if(c.loose===!!l.loose&&c.includePrerelease===
|
|
602
|
+
!!l.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const m=c.trim().match(l.loose?n[i.LOOSE]:n[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>
|
|
603
|
+
r||this.major<0)throw new TypeError("Invalid major version");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");m[4]?this.prerelease=m[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const _=+y;if(_>=0&&_<r)return _}return y}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=
|
|
604
|
+
`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof s)){if(typeof c=="string"&&c===this.version)return 0;c=new s(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof s||(c=new s(c,this.options)),this.major<c.major?-1:this.major>c.major?1:this.minor<c.minor?-1:this.minor>c.minor?1:this.patch<c.patch?-1:this.patch>c.patch?1:0}comparePre(c){
|
|
605
|
+
if(c instanceof s||(c=new s(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let l=0;do{const m=this.prerelease[l],y=c.prerelease[l];if(e("prerelease compare",l,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return a(m,y)}while(++l)}compareBuild(c){c instanceof s||(c=new s(c,this.options));let l=0;do{const m=this.
|
|
606
|
+
build[l],y=c.build[l];if(e("build compare",l,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return a(m,y)}while(++l)}inc(c,l,m){if(c.startsWith("pre")){if(!l&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const y=`-${l}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!y||y[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.
|
|
607
|
+
minor=0,this.major++,this.inc("pre",l,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,m),this.inc("pre",l,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,m),this.inc("pre",l,m);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.
|
|
608
|
+
prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];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(m)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let _=this.prerelease.length;for(;--_>=0;)typeof this.prerelease[_]=="number"&&(this.prerelease[_]++,_=-2);if(_===-1){if(l===this.prerelease.
|
|
609
|
+
join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(l){let _=[l,y];m===!1&&(_=[l]),a(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=_):this.prerelease=_}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ts=s,Ts}var Ns,yl;function vt(){if(yl)return Ns;yl=1;const e=Se();return Ns=(r,n,i=!1)=>{if(r instanceof
|
|
610
|
+
e)return r;try{return new e(r,n)}catch(o){if(!i)return null;throw o}},Ns}var Os,gl;function Um(){if(gl)return Os;gl=1;const e=vt();return Os=(r,n)=>{const i=e(r,n);return i?i.version:null},Os}var Is,vl;function Fm(){if(vl)return Is;vl=1;const e=vt();return Is=(r,n)=>{const i=e(r.trim().replace(/^[=v]+/,""),n);return i?i.version:null},Is}var js,$l;function Vm(){if($l)return js;$l=1;const e=Se();return js=(r,n,i,o,a)=>{typeof i=="string"&&(a=o,o=i,i=void 0);try{return new e(r instanceof e?r.version:
|
|
611
|
+
r,i).inc(n,o,a).version}catch{return null}},js}var Ls,_l;function zm(){if(_l)return Ls;_l=1;const e=vt();return Ls=(r,n)=>{const i=e(r,null,!0),o=e(n,null,!0),a=i.compare(o);if(a===0)return null;const s=a>0,u=s?i:o,c=s?o:i,l=!!u.prerelease.length;if(!!c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(c.compareMain(u)===0)return c.minor&&!c.patch?"minor":"patch"}const y=l?"pre":"";return i.major!==o.major?y+"major":i.minor!==o.minor?y+"minor":i.patch!==o.patch?y+"patch":"prerelease"},
|
|
612
|
+
Ls}var Ds,wl;function Gm(){if(wl)return Ds;wl=1;const e=Se();return Ds=(r,n)=>new e(r,n).major,Ds}var qs,bl;function Bm(){if(bl)return qs;bl=1;const e=Se();return qs=(r,n)=>new e(r,n).minor,qs}var xs,El;function Km(){if(El)return xs;El=1;const e=Se();return xs=(r,n)=>new e(r,n).patch,xs}var Ms,Sl;function Wm(){if(Sl)return Ms;Sl=1;const e=vt();return Ms=(r,n)=>{const i=e(r,n);return i&&i.prerelease.length?i.prerelease:null},Ms}var Hs,Rl;function je(){if(Rl)return Hs;Rl=1;const e=Se();return Hs=(r,n,i)=>new e(
|
|
613
|
+
r,i).compare(new e(n,i)),Hs}var Us,Al;function Xm(){if(Al)return Us;Al=1;const e=je();return Us=(r,n,i)=>e(n,r,i),Us}var Fs,Pl;function Jm(){if(Pl)return Fs;Pl=1;const e=je();return Fs=(r,n)=>e(r,n,!0),Fs}var Vs,Cl;function zs(){if(Cl)return Vs;Cl=1;const e=Se();return Vs=(r,n,i)=>{const o=new e(r,i),a=new e(n,i);return o.compare(a)||o.compareBuild(a)},Vs}var Gs,kl;function Ym(){if(kl)return Gs;kl=1;const e=zs();return Gs=(r,n)=>r.sort((i,o)=>e(i,o,n)),Gs}var Bs,Tl;function Qm(){if(Tl)return Bs;
|
|
614
|
+
Tl=1;const e=zs();return Bs=(r,n)=>r.sort((i,o)=>e(o,i,n)),Bs}var Ks,Nl;function an(){if(Nl)return Ks;Nl=1;const e=je();return Ks=(r,n,i)=>e(r,n,i)>0,Ks}var Ws,Ol;function Xs(){if(Ol)return Ws;Ol=1;const e=je();return Ws=(r,n,i)=>e(r,n,i)<0,Ws}var Js,Il;function jl(){if(Il)return Js;Il=1;const e=je();return Js=(r,n,i)=>e(r,n,i)===0,Js}var Ys,Ll;function Dl(){if(Ll)return Ys;Ll=1;const e=je();return Ys=(r,n,i)=>e(r,n,i)!==0,Ys}var Qs,ql;function Zs(){if(ql)return Qs;ql=1;const e=je();return Qs=(r,n,i)=>e(
|
|
615
|
+
r,n,i)>=0,Qs}var eo,xl;function to(){if(xl)return eo;xl=1;const e=je();return eo=(r,n,i)=>e(r,n,i)<=0,eo}var ro,Ml;function Hl(){if(Ml)return ro;Ml=1;const e=jl(),t=Dl(),r=an(),n=Zs(),i=Xs(),o=to();return ro=(s,u,c,l)=>{switch(u){case"===":return typeof s=="object"&&(s=s.version),typeof c=="object"&&(c=c.version),s===c;case"!==":return typeof s=="object"&&(s=s.version),typeof c=="object"&&(c=c.version),s!==c;case"":case"=":case"==":return e(s,c,l);case"!=":return t(s,c,l);case">":return r(s,c,l);case"\
|
|
616
|
+
>=":return n(s,c,l);case"<":return i(s,c,l);case"<=":return o(s,c,l);default:throw new TypeError(`Invalid operator: ${u}`)}},ro}var no,Ul;function Zm(){if(Ul)return no;Ul=1;const e=Se(),t=vt(),{safeRe:r,t:n}=Lt();return no=(o,a)=>{if(o instanceof e)return o;if(typeof o=="number"&&(o=String(o)),typeof o!="string")return null;a=a||{};let s=null;if(!a.rtl)s=o.match(a.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const _=a.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let S;for(;(S=_.exec(
|
|
617
|
+
o))&&(!s||s.index+s[0].length!==o.length);)(!s||S.index+S[0].length!==s.index+s[0].length)&&(s=S),_.lastIndex=S.index+S[1].length+S[2].length;_.lastIndex=-1}if(s===null)return null;const u=s[2],c=s[3]||"0",l=s[4]||"0",m=a.includePrerelease&&s[5]?`-${s[5]}`:"",y=a.includePrerelease&&s[6]?`+${s[6]}`:"";return t(`${u}.${c}.${l}${m}${y}`,a)},no}var so,Fl;function ey(){if(Fl)return so;Fl=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.
|
|
618
|
+
delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(r,n)}return this}}return so=e,so}var oo,Vl;function Le(){if(Vl)return oo;Vl=1;const e=/\s+/g;class t{constructor(M,z){if(z=i(z),M instanceof t)return M.loose===!!z.loose&&M.includePrerelease===!!z.includePrerelease?M:new t(M.raw,z);if(M instanceof o)return this.raw=M.value,this.set=[[M]],this.formatted=
|
|
619
|
+
void 0,this;if(this.options=z,this.loose=!!z.loose,this.includePrerelease=!!z.includePrerelease,this.raw=M.trim().replace(e," "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(G=>!g(G[0])),this.set.length===0)this.set=[F];else if(this.set.length>1){for(const G of this.set)if(G.length===1&&p(G[0])){this.set=[G];break}}}
|
|
620
|
+
this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const z=this.set[M];for(let F=0;F<z.length;F++)F>0&&(this.formatted+=" "),this.formatted+=z[F].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const F=((this.options.includePrerelease&&_)|(this.options.loose&&S))+":"+M,G=n.get(F);if(G)return G;const Q=this.options.loose,q=Q?u[c.HYPHENRANGELOOSE]:
|
|
621
|
+
u[c.HYPHENRANGE];M=M.replace(q,H(this.options.includePrerelease)),a("hyphen replace",M),M=M.replace(u[c.COMPARATORTRIM],l),a("comparator trim",M),M=M.replace(u[c.TILDETRIM],m),a("tilde trim",M),M=M.replace(u[c.CARETTRIM],y),a("caret trim",M);let A=M.split(" ").map(b=>f(b,this.options)).join(" ").split(/\s+/).map(b=>x(b,this.options));Q&&(A=A.filter(b=>(a("loose invalid filter",b,this.options),!!b.match(u[c.COMPARATORLOOSE])))),a("range list",A);const L=new Map,T=A.map(b=>new o(b,this.options));for(const b of T){
|
|
622
|
+
if(g(b))return[b];L.set(b.value,b)}L.size>1&&L.has("")&&L.delete("");const R=[...L.values()];return n.set(F,R),R}intersects(M,z){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(F=>h(F,z)&&M.set.some(G=>h(G,z)&&F.every(Q=>G.every(q=>Q.intersects(q,z)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new s(M,this.options)}catch{return!1}for(let z=0;z<this.set.length;z++)if(D(this.set[z],M,this.options))return!0;return!1}}oo=t;const r=ey(),n=new r,i=Cs(),o=cn(),
|
|
623
|
+
a=on(),s=Se(),{safeRe:u,t:c,comparatorTrimReplace:l,tildeTrimReplace:m,caretTrimReplace:y}=Lt(),{FLAG_INCLUDE_PRERELEASE:_,FLAG_LOOSE:S}=sn(),g=I=>I.value==="<0.0.0-0",p=I=>I.value==="",h=(I,M)=>{let z=!0;const F=I.slice();let G=F.pop();for(;z&&F.length;)z=F.every(Q=>G.intersects(Q,M)),G=F.pop();return z},f=(I,M)=>(I=I.replace(u[c.BUILD],""),a("comp",I,M),I=w(I,M),a("caret",I),I=v(I,M),a("tildes",I),I=P(I,M),a("xrange",I),I=U(I,M),a("stars",I),I),d=I=>!I||I.toLowerCase()==="x"||I==="*",v=(I,M)=>I.
|
|
624
|
+
trim().split(/\s+/).map(z=>$(z,M)).join(" "),$=(I,M)=>{const z=M.loose?u[c.TILDELOOSE]:u[c.TILDE];return I.replace(z,(F,G,Q,q,A)=>{a("tilde",I,F,G,Q,q,A);let L;return d(G)?L="":d(Q)?L=`>=${G}.0.0 <${+G+1}.0.0-0`:d(q)?L=`>=${G}.${Q}.0 <${G}.${+Q+1}.0-0`:A?(a("replaceTilde pr",A),L=`>=${G}.${Q}.${q}-${A} <${G}.${+Q+1}.0-0`):L=`>=${G}.${Q}.${q} <${G}.${+Q+1}.0-0`,a("tilde return",L),L})},w=(I,M)=>I.trim().split(/\s+/).map(z=>E(z,M)).join(" "),E=(I,M)=>{a("caret",I,M);const z=M.loose?u[c.CARETLOOSE]:
|
|
625
|
+
u[c.CARET],F=M.includePrerelease?"-0":"";return I.replace(z,(G,Q,q,A,L)=>{a("caret",I,G,Q,q,A,L);let T;return d(Q)?T="":d(q)?T=`>=${Q}.0.0${F} <${+Q+1}.0.0-0`:d(A)?Q==="0"?T=`>=${Q}.${q}.0${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.0${F} <${+Q+1}.0.0-0`:L?(a("replaceCaret pr",L),Q==="0"?q==="0"?T=`>=${Q}.${q}.${A}-${L} <${Q}.${q}.${+A+1}-0`:T=`>=${Q}.${q}.${A}-${L} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.${A}-${L} <${+Q+1}.0.0-0`):(a("no pr"),Q==="0"?q==="0"?T=`>=${Q}.${q}.${A}${F} <${Q}.${q}.${+A+1}-0`:T=
|
|
626
|
+
`>=${Q}.${q}.${A}${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.${A} <${+Q+1}.0.0-0`),a("caret return",T),T})},P=(I,M)=>(a("replaceXRanges",I,M),I.split(/\s+/).map(z=>O(z,M)).join(" ")),O=(I,M)=>{I=I.trim();const z=M.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return I.replace(z,(F,G,Q,q,A,L)=>{a("xRange",I,F,G,Q,q,A,L);const T=d(Q),R=T||d(q),b=R||d(A),C=b;return G==="="&&C&&(G=""),L=M.includePrerelease?"-0":"",T?G===">"||G==="<"?F="<0.0.0-0":F="*":G&&C?(R&&(q=0),A=0,G===">"?(G=">=",R?(Q=+Q+1,q=0,A=0):(q=+q+1,A=
|
|
627
|
+
0)):G==="<="&&(G="<",R?Q=+Q+1:q=+q+1),G==="<"&&(L="-0"),F=`${G+Q}.${q}.${A}${L}`):R?F=`>=${Q}.0.0${L} <${+Q+1}.0.0-0`:b&&(F=`>=${Q}.${q}.0${L} <${Q}.${+q+1}.0-0`),a("xRange return",F),F})},U=(I,M)=>(a("replaceStars",I,M),I.trim().replace(u[c.STAR],"")),x=(I,M)=>(a("replaceGTE0",I,M),I.trim().replace(u[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),H=I=>(M,z,F,G,Q,q,A,L,T,R,b,C)=>(d(F)?z="":d(G)?z=`>=${F}.0.0${I?"-0":""}`:d(Q)?z=`>=${F}.${G}.0${I?"-0":""}`:q?z=`>=${z}`:z=`>=${z}${I?"-0":""}`,d(T)?L="":
|
|
628
|
+
d(R)?L=`<${+T+1}.0.0-0`:d(b)?L=`<${T}.${+R+1}.0-0`:C?L=`<=${T}.${R}.${b}-${C}`:I?L=`<${T}.${R}.${+b+1}-0`:L=`<=${L}`,`${z} ${L}`.trim()),D=(I,M,z)=>{for(let F=0;F<I.length;F++)if(!I[F].test(M))return!1;if(M.prerelease.length&&!z.includePrerelease){for(let F=0;F<I.length;F++)if(a(I[F].semver),I[F].semver!==o.ANY&&I[F].semver.prerelease.length>0){const G=I[F].semver;if(G.major===M.major&&G.minor===M.minor&&G.patch===M.patch)return!0}return!1}return!0};return oo}var ao,zl;function cn(){if(zl)return ao;
|
|
629
|
+
zl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,m){if(m=r(m),l instanceof t){if(l.loose===!!m.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),a("comparator",l,m),this.options=m,this.loose=!!m.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(l){const m=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],y=l.match(m);if(!y)throw new TypeError(`Invalid comparator: ${l}`);this.operator=
|
|
630
|
+
y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new s(y[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(a("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new s(l,this.options)}catch{return!1}return o(l,this.operator,this.semver,this.options)}intersects(l,m){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(l.value,m).
|
|
631
|
+
test(this.value):l.operator===""?l.value===""?!0:new u(this.value,m).test(l.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||o(this.semver,"<",l.semver,m)&&this.
|
|
632
|
+
operator.startsWith(">")&&l.operator.startsWith("<")||o(this.semver,">",l.semver,m)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ao=t;const r=Cs(),{safeRe:n,t:i}=Lt(),o=Hl(),a=on(),s=Se(),u=Le();return ao}var io,Gl;function un(){if(Gl)return io;Gl=1;const e=Le();return io=(r,n,i)=>{try{n=new e(n,i)}catch{return!1}return n.test(r)},io}var co,Bl;function ty(){if(Bl)return co;Bl=1;const e=Le();return co=(r,n)=>new e(r,n).set.map(i=>i.map(o=>o.value).join(" ").trim().split(" ")),co}
|
|
633
|
+
var uo,Kl;function ry(){if(Kl)return uo;Kl=1;const e=Se(),t=Le();return uo=(n,i,o)=>{let a=null,s=null,u=null;try{u=new t(i,o)}catch{return null}return n.forEach(c=>{u.test(c)&&(!a||s.compare(c)===-1)&&(a=c,s=new e(a,o))}),a},uo}var lo,Wl;function ny(){if(Wl)return lo;Wl=1;const e=Se(),t=Le();return lo=(n,i,o)=>{let a=null,s=null,u=null;try{u=new t(i,o)}catch{return null}return n.forEach(c=>{u.test(c)&&(!a||s.compare(c)===1)&&(a=c,s=new e(a,o))}),a},lo}var fo,Xl;function sy(){if(Xl)return fo;Xl=
|
|
634
|
+
1;const e=Se(),t=Le(),r=an();return fo=(i,o)=>{i=new t(i,o);let a=new e("0.0.0");if(i.test(a)||(a=new e("0.0.0-0"),i.test(a)))return a;a=null;for(let s=0;s<i.set.length;++s){const u=i.set[s];let c=null;u.forEach(l=>{const m=new e(l.semver.version);switch(l.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!c||r(m,c))&&(c=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),c&&(!a||r(a,c))&&(a=c)}
|
|
635
|
+
return a&&i.test(a)?a:null},fo}var po,Jl;function oy(){if(Jl)return po;Jl=1;const e=Le();return po=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},po}var ho,Yl;function mo(){if(Yl)return ho;Yl=1;const e=Se(),t=cn(),{ANY:r}=t,n=Le(),i=un(),o=an(),a=Xs(),s=to(),u=Zs();return ho=(l,m,y,_)=>{l=new e(l,_),m=new n(m,_);let S,g,p,h,f;switch(y){case">":S=o,g=s,p=a,h=">",f=">=";break;case"<":S=a,g=u,p=o,h="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(
|
|
636
|
+
l,m,_))return!1;for(let d=0;d<m.set.length;++d){const v=m.set[d];let $=null,w=null;if(v.forEach(E=>{E.semver===r&&(E=new t(">=0.0.0")),$=$||E,w=w||E,S(E.semver,$.semver,_)?$=E:p(E.semver,w.semver,_)&&(w=E)}),$.operator===h||$.operator===f||(!w.operator||w.operator===h)&&g(l,w.semver))return!1;if(w.operator===f&&p(l,w.semver))return!1}return!0},ho}var yo,Ql;function ay(){if(Ql)return yo;Ql=1;const e=mo();return yo=(r,n,i)=>e(r,n,">",i),yo}var go,Zl;function iy(){if(Zl)return go;Zl=1;const e=mo();
|
|
637
|
+
return go=(r,n,i)=>e(r,n,"<",i),go}var vo,ef;function cy(){if(ef)return vo;ef=1;const e=Le();return vo=(r,n,i)=>(r=new e(r,i),n=new e(n,i),r.intersects(n,i)),vo}var $o,tf;function uy(){if(tf)return $o;tf=1;const e=un(),t=je();return $o=(r,n,i)=>{const o=[];let a=null,s=null;const u=r.sort((y,_)=>t(y,_,i));for(const y of u)e(y,n,i)?(s=y,a||(a=y)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);const c=[];for(const[y,_]of o)y===_?c.push(y):!_&&y===u[0]?c.push("*"):_?y===u[0]?c.push(`<=${_}`):
|
|
638
|
+
c.push(`${y} - ${_}`):c.push(`>=${y}`);const l=c.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return l.length<m.length?l:n},$o}var _o,rf;function ly(){if(rf)return _o;rf=1;const e=Le(),t=cn(),{ANY:r}=t,n=un(),i=je(),o=(m,y,_={})=>{if(m===y)return!0;m=new e(m,_),y=new e(y,_);let S=!1;e:for(const g of m.set){for(const p of y.set){const h=u(g,p,_);if(S=S||h!==null,h)continue e}if(S)return!1}return!0},a=[new t(">=0.0.0-0")],s=[new t(">=0.0.0")],u=(m,y,_)=>{if(m===y)return!0;if(m.length===1&&
|
|
639
|
+
m[0].semver===r){if(y.length===1&&y[0].semver===r)return!0;_.includePrerelease?m=a:m=s}if(y.length===1&&y[0].semver===r){if(_.includePrerelease)return!0;y=s}const S=new Set;let g,p;for(const P of m)P.operator===">"||P.operator===">="?g=c(g,P,_):P.operator==="<"||P.operator==="<="?p=l(p,P,_):S.add(P.semver);if(S.size>1)return null;let h;if(g&&p){if(h=i(g.semver,p.semver,_),h>0)return null;if(h===0&&(g.operator!==">="||p.operator!=="<="))return null}for(const P of S){if(g&&!n(P,String(g),_)||p&&!n(
|
|
640
|
+
P,String(p),_))return null;for(const O of y)if(!n(P,String(O),_))return!1;return!0}let f,d,v,$,w=p&&!_.includePrerelease&&p.semver.prerelease.length?p.semver:!1,E=g&&!_.includePrerelease&&g.semver.prerelease.length?g.semver:!1;w&&w.prerelease.length===1&&p.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(const P of y){if($=$||P.operator===">"||P.operator===">=",v=v||P.operator==="<"||P.operator==="<=",g){if(E&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===E.major&&P.semver.minor===
|
|
641
|
+
E.minor&&P.semver.patch===E.patch&&(E=!1),P.operator===">"||P.operator===">="){if(f=c(g,P,_),f===P&&f!==g)return!1}else if(g.operator===">="&&!n(g.semver,String(P),_))return!1}if(p){if(w&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===w.major&&P.semver.minor===w.minor&&P.semver.patch===w.patch&&(w=!1),P.operator==="<"||P.operator==="<="){if(d=l(p,P,_),d===P&&d!==p)return!1}else if(p.operator==="<="&&!n(p.semver,String(P),_))return!1}if(!P.operator&&(p||g)&&h!==0)return!1}return!(g&&
|
|
642
|
+
v&&!p&&h!==0||p&&$&&!g&&h!==0||E||w)},c=(m,y,_)=>{if(!m)return y;const S=i(m.semver,y.semver,_);return S>0?m:S<0||y.operator===">"&&m.operator===">="?y:m},l=(m,y,_)=>{if(!m)return y;const S=i(m.semver,y.semver,_);return S<0?m:S>0||y.operator==="<"&&m.operator==="<="?y:m};return _o=o,_o}var wo,nf;function fy(){if(nf)return wo;nf=1;const e=Lt(),t=sn(),r=Se(),n=hl(),i=vt(),o=Um(),a=Fm(),s=Vm(),u=zm(),c=Gm(),l=Bm(),m=Km(),y=Wm(),_=je(),S=Xm(),g=Jm(),p=zs(),h=Ym(),f=Qm(),d=an(),v=Xs(),$=jl(),w=Dl(),E=Zs(),
|
|
643
|
+
P=to(),O=Hl(),U=Zm(),x=cn(),H=Le(),D=un(),I=ty(),M=ry(),z=ny(),F=sy(),G=oy(),Q=mo(),q=ay(),A=iy(),L=cy(),T=uy(),R=ly();return wo={parse:i,valid:o,clean:a,inc:s,diff:u,major:c,minor:l,patch:m,prerelease:y,compare:_,rcompare:S,compareLoose:g,compareBuild:p,sort:h,rsort:f,gt:d,lt:v,eq:$,neq:w,gte:E,lte:P,cmp:O,coerce:U,Comparator:x,Range:H,satisfies:D,toComparators:I,maxSatisfying:M,minSatisfying:z,minVersion:F,validRange:G,outside:Q,gtr:q,ltr:A,intersects:L,simplifyRange:T,subset:R,SemVer:r,re:e.re,
|
|
644
|
+
src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},wo}var bo=fy();const $t=mn(bo),dy=Object.prototype.toString,py="[object Uint8Array]",hy="[object ArrayBuffer]";function sf(e,t,r){return e?e.constructor===t?!0:dy.call(e)===r:!1}function of(e){return sf(e,Uint8Array,py)}function my(e){return sf(e,ArrayBuffer,hy)}function yy(e){return of(e)||my(e)}function gy(e){if(!of(e))throw new TypeError(
|
|
645
|
+
`Expected \`Uint8Array\`, got \`${typeof e}\``)}function vy(e){if(!yy(e))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function af(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,o)=>i+o.length,0);const r=new Uint8Array(t);let n=0;for(const i of e)gy(i),r.set(i,n),n+=i.length;return r}const cf={utf8:new globalThis.TextDecoder("utf8")};function uf(e,t="utf8"){return vy(e),cf[t]??=new globalThis.TextDecoder(t),cf[t].decode(e)}function $y(e){if(typeof e!=
|
|
646
|
+
"string")throw new TypeError(`Expected \`string\`, got \`${typeof e}\``)}const _y=new globalThis.TextEncoder;function Eo(e){return $y(e),_y.encode(e)}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const wy=Om.default,lf="aes-256-cbc",_t=()=>Object.create(null),by=e=>e!=null,Ey=(e,t)=>{const r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},ln="_\
|
|
647
|
+
_internal__",So=`${ln}.migrations.version`;class Sy{path;events;#n;#t;#e;#r={};constructor(t={}){const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...t};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=qp(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(
|
|
648
|
+
"The `schema` option must be an object.");const a=new bm.Ajv2020({allErrors:!0,useDefaults:!0,...r.ajvOptions});wy(a);const s={...r.rootSchema,type:"object",properties:r.schema};this.#n=a.compile(s);for(const[u,c]of Object.entries(r.schema??{}))c?.default&&(this.#r[u]=c.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.
|
|
649
|
+
fileExtension}`:"";this.path=ie.resolve(r.cwd,`${r.configName??"config"}${n}`);const i=this.store,o=Object.assign(_t(),r.defaults,i);if(r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(o);try{ld.deepEqual(i,o)}catch{this.store=o}r.watch&&this._watch()}get(t,r){if(this.#e.accessPropertiesByDotNotation)return this._get(t,r);const{store:n}=this;return t in n?n[t]:r}set(t,r){
|
|
650
|
+
if(typeof t!="string"&&typeof t!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`);if(typeof t!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(t))throw new TypeError(`Please don't use the ${ln} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(o,a)=>{Ey(o,a),this.#e.accessPropertiesByDotNotation?Ba(n,o,a):n[o]=a};if(typeof t=="object"){const o=t;for(const[
|
|
651
|
+
a,s]of Object.entries(o))i(a,s)}else i(t,r);this.store=n}has(t){return this.#e.accessPropertiesByDotNotation?Ip(this.store,t):t in this.store}reset(...t){for(const r of t)by(this.#r[r])&&this.set(r,this.#r[r])}delete(t){const{store:r}=this;this.#e.accessPropertiesByDotNotation?Op(r,t):delete r[t],this.store=r}clear(){this.store=_t();for(const t of Object.keys(this.#r))this.reset(t)}onDidChange(t,r){if(typeof t!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`);
|
|
652
|
+
if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(t),r)}onDidAnyChange(t){if(typeof t!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.store,t)}get size(){return Object.keys(this.store).length}get store(){try{const t=se.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(t),n=this._deserialize(r);return this.
|
|
653
|
+
_validate(n),Object.assign(_t(),n)}catch(t){if(t?.code==="ENOENT")return this._ensureDirectory(),_t();if(this.#e.clearInvalidConfig&&t.name==="SyntaxError")return _t();throw t}}set store(t){this._ensureDirectory(),this._validate(t),this._write(t),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[t,r]of Object.entries(this.store))yield[t,r]}_encryptData(t){if(!this.#t)return typeof t=="string"?t:uf(t);try{const r=t.slice(0,16),n=Pt.pbkdf2Sync(this.#t,r.toString(),1e4,32,
|
|
654
|
+
"sha512"),i=Pt.createDecipheriv(lf,n,r),o=t.slice(17),a=typeof o=="string"?Eo(o):o;return uf(af([i.update(a),i.final()]))}catch{}return t.toString()}_handleChange(t,r){let n=t();const i=()=>{const o=n,a=t();ud(a,o)||(n=a,r.call(this,a,o))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,void 0," ");_validate(t){if(!this.#n||this.#n(t)||!this.#n.errors)return;const n=this.#n.errors.map(({
|
|
655
|
+
instancePath:i,message:o=""})=>`\`${i.slice(1)}\` ${o}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){se.mkdirSync(ie.dirname(this.path),{recursive:!0})}_write(t){let r=this._serialize(t);if(this.#t){const n=Pt.randomBytes(16),i=Pt.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),o=Pt.createCipheriv(lf,i,n);r=af([n,Eo(":"),o.update(Eo(r)),o.final()])}if(me.env.SNAP)se.writeFileSync(this.path,r,{mode:this.#e.configFileMode});else try{Ya(this.path,r,{mode:this.#e.configFileMode})}catch(n){
|
|
656
|
+
if(n?.code==="EXDEV"){se.writeFileSync(this.path,r,{mode:this.#e.configFileMode});return}throw n}}_watch(){this._ensureDirectory(),se.existsSync(this.path)||this._write(_t()),me.platform==="win32"?se.watch(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):se.watchFile(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(t,r,n){let i=this._get(So,"0.0.0");const o=Object.keys(t).filter(s=>this._shouldPerformMigration(
|
|
657
|
+
s,i,r));let a={...this.store};for(const s of o)try{n&&n(this,{fromVersion:i,toVersion:s,finalVersion:r,versions:o});const u=t[s];u?.(this),this._set(So,s),i=s,a={...this.store}}catch(u){throw this.store=a,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${u}`)}(this._isVersionInRangeFormat(i)||!$t.eq(i,r))&&this._set(So,r)}_containsReservedKey(t){return typeof t=="object"&&Object.keys(t)[0]===ln?!0:typeof t!="string"?
|
|
658
|
+
!1:this.#e.accessPropertiesByDotNotation?!!t.startsWith(`${ln}.`):!1}_isVersionInRangeFormat(t){return $t.clean(t)===null}_shouldPerformMigration(t,r,n){return this._isVersionInRangeFormat(t)?r!=="0.0.0"&&$t.satisfies(r,t)?!1:$t.satisfies(n,t):!($t.lte(t,r)||$t.gt(t,n))}_get(t,r){return Np(this.store,t,r)}_set(t,r){const{store:n}=this;Ba(n,t,r),this.store=n}}class ff extends Error{response;request;options;constructor(t,r,n){const i=t.status||t.status===0?t.status:"",o=t.statusText||"",a=`${i} ${o}`.
|
|
659
|
+
trim(),s=a?`status code ${a}`:"an unknown error";super(`Request failed with ${s}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=n}}class df extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}const pf=(()=>{let e=!1,t=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.
|
|
660
|
+
ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return e&&!t})(),Ry=typeof globalThis.AbortController=="function",Ay=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Py=typeof globalThis.ReadableStream=="function",Cy=typeof globalThis.FormData=="function",hf=["get","post","put","patch","head","delete"],ky={json:"application/j\
|
|
661
|
+
son",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Ro=2147483647,Ty=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,mf=Symbol("stop"),Ny={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Oy={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,
|
|
662
|
+
window:!0,dispatcher:!0,duplex:!0,priority:!0},Iy=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=Ty,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).
|
|
663
|
+
length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},jy=(e,t)=>{const r=Number(e.headers.get("content-length"))||0;let n=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:n},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(i){const o=e.body.getReader();t&&t({percent:0,
|
|
664
|
+
transferredBytes:0,totalBytes:r},new Uint8Array);async function a(){const{done:s,value:u}=await o.read();if(s){i.close();return}if(t){n+=u.byteLength;const c=r===0?0:n/r;t({percent:c,transferredBytes:n,totalBytes:r},u)}i.enqueue(u),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},Ly=(e,t)=>{const r=Iy(e.body);let n=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(i){const o=e.body instanceof ReadableStream?e.body.getReader():new Response(
|
|
665
|
+
"").body.getReader();async function a(){const{done:s,value:u}=await o.read();if(s){t&&t({percent:1,transferredBytes:n,totalBytes:Math.max(r,n)},new Uint8Array),i.close();return}n+=u.byteLength;let c=r===0?0:n/r;(r<n||c===1)&&(c=.99),t&&t({percent:Number(c.toFixed(2)),transferredBytes:n,totalBytes:r},u),i.enqueue(u),await a()}await a()}})})},Dt=e=>e!==null&&typeof e=="object",fn=(...e)=>{for(const t of e)if((!Dt(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be\
|
|
666
|
+
an object");return Ao({},...e)},yf=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(const[o,a]of i.entries())n&&a==="undefined"||a===void 0?r.delete(o):r.set(o,a);return r};function dn(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:Ao(e[r]??[],t[r]??[])}const gf=(e={},t={})=>({beforeRequest:dn(e,t,"beforeRequest"),beforeRetry:dn(e,t,"beforeRetry"),afterResponse:dn(e,t,"afterResponse"),beforeError:dn(e,t,"beforeError")}),Ao=(...e)=>{
|
|
667
|
+
let t={},r={},n={};for(const i of e)if(Array.isArray(i))Array.isArray(t)||(t=[]),t=[...t,...i];else if(Dt(i)){for(let[o,a]of Object.entries(i))Dt(a)&&o in t&&(a=Ao(t[o],a)),t={...t,[o]:a};Dt(i.hooks)&&(n=gf(n,i.hooks),t.hooks=n),Dt(i.headers)&&(r=yf(r,i.headers),t.headers=r)}return t},Dy=e=>hf.includes(e)?e.toUpperCase():e,qy=["get","put","head","delete","options","trace"],xy=[408,413,429,500,502,503,504],My=[413,429,503],vf={limit:2,methods:qy,statusCodes:xy,afterStatusCodes:My,maxRetryAfter:Number.
|
|
668
|
+
POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Hy=(e={})=>{if(typeof e=="number")return{...vf,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...vf,...e}};async function Uy(e,t,r,n){return new Promise((i,o)=>{const a=setTimeout(()=>{r&&r.abort(),o(new df(e))},n.timeout);n.fetch(e,t).then(i).catch(o).then(
|
|
669
|
+
()=>{clearTimeout(a)})})}async function Fy(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(t.reason)}const o=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}const Vy=(e,t)=>{const r={};for(const n in t)!(n in Oy)&&!(n in Ny)&&!(n in e)&&(r[n]=t[n]);return r};class hn{static create(t,r){const n=new hn(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Ro)throw new RangeError(
|
|
670
|
+
`The \`timeout\` option cannot be greater than ${Ro}`);await Promise.resolve();let s=await n._fetch();for(const u of n._options.hooks.afterResponse){const c=await u(n.request,n._options,n._decorateResponse(s.clone()));c instanceof globalThis.Response&&(s=c)}if(n._decorateResponse(s),!s.ok&&n._options.throwHttpErrors){let u=new ff(s,n.request,n._options);for(const c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="fun\
|
|
671
|
+
ction")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Py)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return jy(s.clone(),n._options.onDownloadProgress)}return s},a=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{n.request.bodyUsed||await n.request.body?.cancel()});for(const[s,u]of Object.entries(ky))a[s]=async()=>{n.request.headers.set("accept",n.request.headers.
|
|
672
|
+
get("accept")||u);const c=await a;if(s==="json"){if(c.status===204||(await c.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await c.text())}return c[s]()};return a}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:yf(this._input.headers,r.headers),hooks:gf({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Dy(r.method??this._input.method??"GET"),prefixUrl:String(r.
|
|
673
|
+
prefixUrl||""),retry:Hy(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(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.
|
|
674
|
+
endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Ry&&Ay){const n=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(pf&&(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.
|
|
675
|
+
set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Cy&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.
|
|
676
|
+
headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!pf)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&
|
|
677
|
+
(this.request=Ly(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof df)throw t;if(t instanceof ff){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;const n=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(
|
|
678
|
+
t.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());const o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(t.response.status===413)throw t}const r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){const n=Math.min(
|
|
679
|
+
this._calculateRetryDelay(r),Ro);if(this._retryCount<1)throw r;await Fy(n,{signal:this._options.signal});for(const i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===mf)return;return this._retry(t)}}async _fetch(){for(const n of this._options.hooks.beforeRequest){const i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}const t=Vy(this.request,this._options),
|
|
680
|
+
r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):Uy(r,t,this.abortController,this._options)}}const Po=e=>{const t=(r,n)=>hn.create(r,fn(e,n));for(const r of hf)t[r]=(n,i)=>hn.create(n,fn(e,i,{method:r}));return t.create=r=>Po(fn(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Po(fn(e,r))),t.stop=mf,t},zy=Po(),Co=new Sy({projectName:xf,serialize:e=>lt.stringify(e,null,2),deserialize:e=>lt.parse(e)}),Gy=1e3*60*60*24,$f="check-update";function By(){
|
|
681
|
+
if(Kf||Wf===$f)return;const e=Co.get("lastUpdateCheck"),t=Co.get("latestVersion");if(Mf(t)||Hf(e)||e+Gy<Date.now())try{Oo("likec4",["check-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:$f}}).catch(()=>{})}catch{}t&&bo.gt(t,at)&&We(["Update available: ",j.dim(at),j.reset(" \u2192 "),j.green(t)].join(""))}async function Ky(){try{const e=await Wy();Rn(e,"No version found in latest npm"),Co.set({lastUpdateCheck:Date.now(),latestVersion:e}),bo.gt(e,at)?We(["Update available: ",j.dim(
|
|
682
|
+
at),j.reset(" \u2192 "),j.green(e)].join("")):We(j.dim("Up to date: ")+" "+j.green(at))}catch(e){Ae.error(Mt(e))}}async function Wy(){return(await zy("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}const Xy=e=>e.command({command:"check-update",describe:"Check for updates",handler:async()=>{await Ky()}});function Jy(e,t){if(!t)return e.languageServices.projectsManager.ensureProjectId();
|
|
683
|
+
const r=oe(t);if(r===e.workspace)return e.languageServices.projectsManager.ensureProjectId();if(He(r)&&Ff(r).isDirectory()){Ae.debug`Project path exists: ${r}`;const n=yn.file(r.endsWith(zo)?r:r+zo),i=e.languageServices.projects().find(o=>o.folder.fsPath===n.fsPath);if(i)return Ae.debug`Found project ${i.id} at path: ${r}`,i.id;Ae.debug`No project registered at path: ${r}`}return e.languageServices.projectsManager.ensureProjectId(t)}function pn(e,t){const r=Jy(e,t),n=e.languageServices.projectsManager.
|
|
684
|
+
getProject(r);return e.languageServices.projectsManager.defaultProjectId=r,{projectId:r,projectFolder:n.folderUri.fsPath,config:n.config}}var _f=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wf=e=>{throw TypeError(e)},Yy=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&wf("Object expected");var n,i;n=t[_f("asyncDispose")],n===void 0&&(n=t[_f("dispose")],i=n),typeof n!="function"&&wf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),e.
|
|
685
|
+
push([r,n,t])}else e.push([r]);return t},Qy=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=a,c.suppressed=s,c},i=a=>t=r?new n(a,t,"An error was suppressed during disposal"):(r=!0,a),o=a=>{for(;a=e.pop();)try{var s=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(s).then(o,u=>(i(u),o()))}catch(u){i(u)}if(r)throw t};return o()};const qt=Ae.getChild("generator");async function bf({name:e,path:t,useDotBin:r,
|
|
686
|
+
project:n}){var i=[];try{const u=it(qt),c=Yy(i,await Pe.fromWorkspace(t,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:l,config:m}=pn(c,n);n&&qt.info(`${j.dim("project")} ${j.green(l)}`);const y=m.generators?.[e];if(!y)throw qt.error(j.red(`generator ${e} does not exist in project config`)),new Error(`generator ${e} does not exist in project config`);qt.info(`${j.dim("generator")} ${j.green(e)}`);const _=await c.layoutedModel(l);await Zy({likec4:c,model:_,generator:y,logger:qt.
|
|
687
|
+
getChild(e)}),u.stopAndLog()}catch(u){var o=u,a=!0}finally{var s=Qy(i,o,a);s&&await s}}async function Zy({likec4:e,model:t,generator:r,logger:n}){const i=e.languageServices,o=new Set,a=i.project(t.project.id),s=t.project.id;n.debug(`${j.dim("runnig for project:")} ${j.green(a.id)}`),await Promise.resolve().then(()=>r({likec4model:t,ctx:{workspace:e.languageServices.workspaceUri,project:a,locate:u=>{let c=null;switch(!0){case md(u):c=i.locate({element:u.id,projectId:s});break;case hd(u):c=i.locate(
|
|
688
|
+
{view:u.id,projectId:s});break;case pd(u):c=i.locate({deployment:u.id,projectId:s});break;case dd(u):case fd(u):c=i.locate({relation:u.id,projectId:s});break;default:An(u)}if(!c)throw n.error(`Cannot locate ${u.id}`,{target:u}),new Error(`Cannot locate ${u.id}`);const l=yn.parse(c.uri);return{range:c.range,document:l,relativePath:gn.relative(a.folder,l),folder:gn.dirname(l).fsPath,filename:gn.basename(l)}},write:async({path:u,content:c})=>{let l;yn.isUri(u)?l=u.fsPath:l=oe(a.folder.fsPath,...Array.
|
|
689
|
+
isArray(u)?u:[u]);const m=qe(l);o.has(m)||(He(m)||(n.debug(`${j.dim("create directory")} ${m}`),await xe(m,{recursive:!0})),o.add(m)),n.debug(`${j.dim("write")} ${l}`),await Xe(l,c)},abort:u=>{throw n.error(u||"Generator aborted"),new Error(u||"Generator aborted")}}}))}async function eg(e,t,r){t=t??oe(e.workspace,"likec4.generated.ts"),St(t)!==".ts"&&(t=t+".ts"),await xe(qe(t),{recursive:!0});const n=await e.diagrams(),i=tp([...n]);await Xe(t,i),r.info(`${j.dim("generated")} ${Ue(process.cwd(),t)}`)}
|
|
690
|
+
async function tg(e,t,r){await xe(t,{recursive:!0}),r.info(`${j.dim("format")} ${j.green("dot")}`),r.info(`${j.dim("outdir")} ${t}`);const n=new Set,i=e.computedModel(),o=Uo(i.$data.views);let a=0;for(const s of o)try{const u=await e.viewsService.layouter.dot({view:s,styles:i.$styles});let c=".";s.sourcePath&&(c=qe(s.sourcePath)),c=oe(t,c),n.has(c)||(await xe(c,{recursive:!0}),n.add(c));const l=oe(c,s.id+".dot");await Xe(l,u),r.info(`${j.dim("generated")} ${Ue(process.cwd(),l)}`),a++}catch(u){Ae.
|
|
691
|
+
error(`error while generating ${s.id}`,{error:u})}a>0&&r.info(`${j.dim("total")} ${a} files`)}async function rg(e,t,r,n){await xe(r,{recursive:!0}),n.info(`${j.dim("format")} ${j.green(t)}`),n.info(`${j.dim("outdir")} ${r}`);let i,o;switch(t){case"d2":i=".d2",o=nd;break;case"mermaid":i=".mmd",o=rd;break;case"plantuml":i=".puml",o=td;break;default:An(t)}const a=new Set,s=await e.layoutedModel();let u=0;for(const c of s.views()){const l=c.$view;try{let m=".";l.sourcePath&&(m=qe(l.sourcePath)),m=oe(
|
|
692
|
+
r,m),a.has(m)||(await xe(m,{recursive:!0}),a.add(m));const y=oe(m,l.id+i),_=o(c);await Xe(y,_),n.info(`${j.dim("generated")} ${Ue(process.cwd(),y)}`),u++}catch(m){n.error(`error while generating ${l.id}`,{error:m})}}u>0&&n.info(`${j.dim("total")} ${u} files`)}async function xt({path:e,useDotBin:t,...r}){const n=Te("c4:codegen"),i=it(n),o=await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm"});if(o.ensureSingleProject(),(await o.viewsService.computedViews()).length===0)throw n.warn("\
|
|
693
|
+
no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await eg(o,r.outfile,n);break}case"dot":{await tg(o,r.outdir??e,n);break}case"d2":case"mermaid":case"plantuml":{await rg(o,r.format,r.outdir??e,n);break}default:An(r)}i.stopAndLog()}var Ef=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Sf=e=>{throw TypeError(e)},ng=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Sf("Object expected");var n,i;n=t[Ef("asyncDispose")],n===void 0&&(n=t[Ef("d\
|
|
694
|
+
ispose")],i=n),typeof n!="function"&&Sf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),e.push([r,n,t])}else e.push([r]);return t},sg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=a,c.suppressed=s,c},i=a=>t=r?new n(a,t,"An error was suppressed during disposal"):(r=!0,a),o=a=>{for(;a=e.pop();)try{var s=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(s).then(
|
|
695
|
+
o,u=>(i(u),o()))}catch(u){i(u)}if(r)throw t};return o()};async function og({path:e,useDotBin:t,useCorePackage:r,outfile:n,project:i}){var o=[];try{const c=Te("c4:codegen"),l=it(c),m=ng(o,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(m,i);i&&c.info(`${j.dim("project")} ${j.green(y)}`),c.info(`${j.dim("format")} ${j.green("model")}`);const S=await m.layoutedModel(y);for(const d of S.views())d.$view.hasLayoutDrift&&c.warn(j.yellow(
|
|
696
|
+
"drift detected, manual layout can not be applied, view:")+" "+j.red(d.id));let g=oe(m.projectsManager.hasMultipleProjects()?_:m.workspace,"likec4-model.ts");if(n&&(g=_n(n)?n:oe(n),He(n)&&(await wn(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const p=Ut(g);c.info(`${j.dim("filename")} ${p}`);const h=St(p).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(h))throw c.error(`output file ${n} has extension "${h}"`),new Error(`output file ${n} must be a .ts, .mts or .ct\
|
|
697
|
+
s file`);const f=qe(g);c.info(`${j.dim("outdir")} ${f}`),await xe(f,{recursive:!0}),await Xe(g,Zd(S,{useCorePackage:r}),{encoding:"utf-8"}),l.stopAndLog(),We(vn(`
|
|
697
698
|
${j.dim("Source generated:")}
|
|
698
|
-
${Ue(Ht()
|
|
699
|
+
${Ue(Ht(),g)}
|
|
699
700
|
|
|
700
701
|
${j.dim("How to use:")}
|
|
701
702
|
${j.underline("https://likec4.dev/tooling/code-generation/model/")}
|
|
702
|
-
`).trim(),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var
|
|
703
|
-
`+Tn.banner,footer:Tn.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:t,emptyOutDir:!1,sourcemap:!1,minify:!1,copyPublicDir:!1,chunkSizeWarningLimit:In,lib:{entry:"react/likec4.tsx",fileName(
|
|
704
|
-
l","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/,/@likec4\/core.*/],onwarn(
|
|
705
|
-
"function"&&
|
|
706
|
-
i(u)}if(r)throw t};return
|
|
707
|
-
hasLayoutDrift&&c.warn(j.yellow("drift detected, manual layout can not be applied, view:")+" "+j.red(w.id))});let
|
|
708
|
-
has extension "${f}"`),new Error(`output file ${n} must be a .js, .jsx or .mjs`);const d=await
|
|
703
|
+
`).trim(),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var a=c,s=!0}finally{var u=sg(o,a,s);u&&await u}}async function ag({languageServices:e,outDir:t,filename:r="likec4-react.mjs"}){const n=Te(["vite","react"]),i=Nn();return n.info(`${j.cyan("likec4 app root")} ${j.dim(i)}`),n.info(j.cyan("outDir")+" "+j.dim(t)),{customLogger:n,root:i,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:jn()},esbuild:{banner:`'use client'
|
|
704
|
+
`+Tn.banner,footer:Tn.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:t,emptyOutDir:!1,sourcemap:!1,minify:!1,copyPublicDir:!1,chunkSizeWarningLimit:In,lib:{entry:"react/likec4.tsx",fileName(o,a){return r},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/react","likec4/mode\
|
|
705
|
+
l","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/,/@likec4\/core.*/],onwarn(o,a){o.code!=="SOURCEMAP_ERROR"&&a(o)}}},plugins:[bn({}),Sn({languageServices:e.languageServices,useOverviewGraph:!1})]}}var Rf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Af=e=>{throw TypeError(e)},ig=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Af("Object expected");var n,i;n=t[Rf("asyncDispose")],n===void 0&&(n=t[Rf("dispose")],i=n),typeof n!=
|
|
706
|
+
"function"&&Af("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),e.push([r,n,t])}else e.push([r]);return t},cg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=a,c.suppressed=s,c},i=a=>t=r?new n(a,t,"An error was suppressed during disposal"):(r=!0,a),o=a=>{for(;a=e.pop();)try{var s=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(s).then(o,u=>(i(u),o()))}catch(u){
|
|
707
|
+
i(u)}if(r)throw t};return o()};async function ug({path:e,useDotBin:t,useCorePackage:r,outfile:n,project:i}){var o=[];try{await Ct();const c=Te("c4:codegen"),l=it(c),m=ig(o,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(m,i);i&&c.info(`${j.dim("project")} ${j.green(y)}`),c.info(`${j.dim("format")} ${j.green("react")}`);const S=await m.diagrams(y);if(S.length===0)throw process.exitCode=1,new Error("no views found");S.forEach(w=>{w.
|
|
708
|
+
hasLayoutDrift&&c.warn(j.yellow("drift detected, manual layout can not be applied, view:")+" "+j.red(w.id))});let g=oe(m.projectsManager.hasMultipleProjects()?_:m.workspace,"likec4-views.js");if(n&&(g=_n(n)?n:oe(n),He(n)&&(await wn(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const p=qe(g);c.info(`${j.dim("outdir")} ${p}`);const h=Ut(g);c.info(`${j.dim("filename")} ${h}`);const f=St(h).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(f))throw c.error(`output file ${n}\
|
|
709
|
+
has extension "${f}"`),new Error(`output file ${n} must be a .js, .jsx or .mjs`);const d=await ag({languageServices:m,outDir:p,filename:h});await At({...d,logLevel:"warn"});const v=await m.layoutedModel(y),$=oe(p,Ut(g,f)+(f===".mjs"?".d.mts":".d.ts"));await Xe($,rp(v,{useCorePackage:r})),l.stopAndLog(),We(vn(`
|
|
709
710
|
${j.dim("Sources generated:")}
|
|
711
|
+
${Ue(Ht(),g)}
|
|
710
712
|
${Ue(Ht(),$)}
|
|
711
|
-
${Ue(Ht(),v)}
|
|
712
713
|
|
|
713
714
|
${j.dim("How to use:")}
|
|
714
715
|
${j.underline("https://likec4.dev/tooling/code-generation/react/")}
|
|
715
|
-
`),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var
|
|
716
|
-
[r]);return t},
|
|
717
|
-
const c=Te("c4:codegen"),l=it(c),
|
|
718
|
-
id))});let
|
|
719
|
-
ated temp public")} ${f}`);const d=await ts({languageServices:
|
|
716
|
+
`),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var a=c,s=!0}finally{var u=cg(o,a,s);u&&await u}}var Pf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Cf=e=>{throw TypeError(e)},lg=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Cf("Object expected");var n,i;n=t[Pf("asyncDispose")],n===void 0&&(n=t[Pf("dispose")],i=n),typeof n!="function"&&Cf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),e.push([r,n,t])}else e.push(
|
|
717
|
+
[r]);return t},fg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=a,c.suppressed=s,c},i=a=>t=r?new n(a,t,"An error was suppressed during disposal"):(r=!0,a),o=a=>{for(;a=e.pop();)try{var s=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(s).then(o,u=>(i(u),o()))}catch(u){i(u)}if(r)throw t};return o()};async function dg({project:e,path:t,useDotBin:r,webcomponentPrefix:n="likec4",outfile:i}){var o=[];try{await Ct();
|
|
718
|
+
const c=Te("c4:codegen"),l=it(c),m=lg(o,await Pe.fromWorkspace(t,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(m,e);e&&c.info(`${j.dim("project")} ${j.green(y)}`),c.info(`${j.dim("format")} ${j.green("webcomponent")}`);const S=await m.diagrams(y);if(!bt(S,1))throw c.warn("no views found"),process.exitCode=1,new Error("no views found");S.forEach($=>{$.hasLayoutDrift&&c.warn(j.yellow("drift detected, manual layout can not be applied, view:")+" "+j.red($.
|
|
719
|
+
id))});let g=oe(m.projectsManager.hasMultipleProjects()?_:m.workspace,"likec4-views.js");if(i&&(g=_n(i)?i:oe(i),He(i)&&(await wn(i)).isDirectory()))throw new Error(`output file is a directory: ${i}`);tt.debug(`${j.dim("outfilepath")} ${g}`);const p=Ut(g);tt.debug(`${j.dim("filename")} ${p}`);const h=St(p).toLocaleLowerCase();if(h!==".js"&&h!==".mjs")throw tt.warn(`output file ${i} has extension "${h}"`),new Error(`output file ${i} must be a .js or .mjs`);const f=await On();tt.debug(`${j.dim("cre\
|
|
720
|
+
ated temp public")} ${f}`);const d=await ts({languageServices:m,outDir:f,filename:p,webcomponentPrefix:n,base:"/"});tt.debug(`${j.dim("vite build webcomponent")}`),await At({...d,logLevel:"warn"});const v=oe(f,p);if(!He(v))throw new Error(`output file not found: ${v}`);await xe(qe(g),{recursive:!0}),await Qf(v,g),c.info(`${j.dim("generated")} ${g}`),tt.debug(`${j.dim("remove temp public")}`),await Zf(f,{recursive:!0,force:!0}),l.stopAndLog(),We(vn(`
|
|
720
721
|
${j.dim("Webcomponents generated to:")}
|
|
721
|
-
${Ue(Ht()
|
|
722
|
+
${Ue(Ht(),g)}
|
|
722
723
|
|
|
723
724
|
${j.dim("Setup and usage instructions:")}
|
|
724
725
|
${j.blue("https://likec4.dev/tooling/code-generation/webcomponent/")}
|
|
725
|
-
`))}catch(c){var
|
|
726
|
-
Re).option("use-core-package",
|
|
727
|
-
await
|
|
726
|
+
`))}catch(c){var a=c,s=!0}finally{var u=fg(o,a,s);u&&await u}}const pg=e=>e.command({command:"gen <command> [path]",aliases:["generate","codegen"],describe:"Generate various artifacts from LikeC4 sources",builder:t=>t.positional("path",be).command("react [path]","generate react component to render likec4 view",r=>r.positional("path",be).option("project",Gt).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:ct}).option("use-dot",
|
|
727
|
+
Re).option("use-core-package",Qo),async r=>{await ug({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,useCorePackage:r.useCorePackage})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:r=>r.positional("path",be).option("project",Gt).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:ct}).option("webcomponent-prefix",kn).option("use-dot",Re),handler:async r=>{
|
|
728
|
+
await dg({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,webcomponentPrefix:r.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:r=>r.positional("path",be).option("project",Gt).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:ct}).option("use-dot",Re).option("use-core-package",Qo),handler:async r=>{await og({path:r.path,useDotBin:r.useDotBin,useCorePackage:r.
|
|
728
729
|
useCorePackage,outfile:r.outfile,project:r.project})}}).command({command:"views-data [path]",aliases:["views"],describe:"{deprecated} use codegen model",deprecated:!0,builder:r=>r.positional("path",be).option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:ct}).option("use-dot",Re),handler:async r=>{await xt({format:"views",path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:r=>r.
|
|
729
730
|
positional("path",be).option("outdir",zt).option("use-dot",Re),handler:async r=>{await xt({format:"dot",path:r.path,useDotBin:r.useDotBin,outdir:r.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:r=>r.positional("path",be).option("outdir",zt).option("use-dot",Re),handler:async r=>{await xt({format:"d2",path:r.path,useDotBin:r.useDotBin,outdir:r.outdir})}}).command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:r=>r.positional(
|
|
730
731
|
"path",be).option("outdir",zt).option("use-dot",Re),handler:async r=>{await xt({format:"mermaid",useDotBin:r.useDotBin,path:r.path,outdir:r.outdir})}}).command({command:"plantuml [path]",aliases:["puml"],describe:"generate PlantUML files (.puml)",builder:r=>r.positional("path",be).option("outdir",zt).option("use-dot",Re),handler:async r=>{await xt({format:"plantuml",useDotBin:r.useDotBin,path:r.path,outdir:r.outdir})}}).command({command:"<custom> [path]",describe:"run custom generator from likec\
|
|
731
|
-
4 config",builder:r=>r.positional("path",be).option("project",Gt).option("use-dot",Re),handler:async r=>{await
|
|
732
|
+
4 config",builder:r=>r.positional("path",be).option("project",Gt).option("use-dot",Re),handler:async r=>{await bf({name:"custom",path:r.path,project:r.project,useDotBin:r.useDotBin})}}).epilog(`${j.bold("Examples:")}
|
|
732
733
|
likec4 gen react -o dist/likec4-views.mjs ./src/likec4
|
|
733
734
|
likec4 gen model -o likec4-model.ts
|
|
734
735
|
likec4 gen ts --outfile likec4-model.ts
|
|
@@ -736,8 +737,8 @@ positional("path",be).option("outdir",zt).option("use-dot",Re),handler:async r=>
|
|
|
736
737
|
likec4 gen mmd --outdir assets/
|
|
737
738
|
likec4 gen plantuml --outdir assets/
|
|
738
739
|
likec4 gen dot -o out .
|
|
739
|
-
`),handler:async t=>{await
|
|
740
|
-
"\u2713 export in ")}const
|
|
740
|
+
`),handler:async t=>{await bf({name:t.command,path:t.path,project:t.project,useDotBin:t.useDotBin})}});async function hg({path:e,useDotBin:t,outfile:r}){const n=Te("c4:export"),i=it(n),o=await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1});o.ensureSingleProject();const a=await o.layoutedModel();St(r)!==".json"&&(r=r+".json"),await xe(qe(r),{recursive:!0});const s=JSON.stringify(a.$model,null,2);await Xe(r,s),n.info(`${j.dim("generated")} ${Ue(process.cwd(),r)}`),i.stopAndLog(
|
|
741
|
+
"\u2713 export in ")}const mg=e=>e.command({command:"export <format> [path]",describe:"Export to images or JSON",builder:t=>t.usage(`${j.bold("Usage:")} $0 export <format> [path]`).positional("path",be).command({command:"png [path]",describe:"export views to PNG",builder:r=>r.options({output:{alias:["o","outdir"],type:"string",desc:"output directory, if not specified, images are saved next to sources",normalize:!0,nargs:1,coerce:oe},theme:{choices:["light","dark"],desc:"color-scheme to use, defa\
|
|
741
742
|
ults to light",conflicts:["dark","light"],nargs:1},dark:{type:"boolean",desc:"use dark theme, shortcut for --theme=dark",conflicts:["theme","light"]},light:{type:"boolean",desc:"use light theme, shortcut for --theme=light",conflicts:["theme","dark"]},"use-dot":Re,seq:{boolean:!0,alias:["sequence"],type:"boolean",desc:"use sequence layout for dynamic views"},flat:{alias:["flatten"],boolean:!0,type:"boolean",desc:"flatten all images in output directory ignoring sources structure"},filter:{alias:"f",
|
|
742
743
|
array:!0,string:!0,desc:`include views with ids matching given patterns
|
|
743
744
|
multiple patterns are combined with OR`},ignore:{boolean:!0,alias:"i",desc:"continue if export fails for some views"},timeout:{type:"number",alias:"t",desc:"timeout for playwright (in seconds)",default:15,nargs:1},"max-attempts":{type:"number",desc:"max attempts to export failing view, 1 means no retry",default:3,nargs:1},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server",nargs:1},"chromium-sandbox":{boolean:!0,desc:"enable chromium sandbox (see Playwright docs\
|
|
@@ -753,14 +754,14 @@ multiple patterns are combined with OR`},ignore:{boolean:!0,alias:"i",desc:"cont
|
|
|
753
754
|
|
|
754
755
|
${j.green('$0 export png -f "use-case*" --sequence src/likec4')}
|
|
755
756
|
${j.gray("Export views matching use-case* using sequence layout")}
|
|
756
|
-
`),handler:async r=>{Rn(r.timeout>=1,"timeout must be >= 1"),Rn(r["max-attempts"]>=1,"max-attempts must be >= 1"),await Ct();const n=r.theme??(r.dark?"dark":"light");await
|
|
757
|
+
`),handler:async r=>{Rn(r.timeout>=1,"timeout must be >= 1"),Rn(r["max-attempts"]>=1,"max-attempts must be >= 1"),await Ct();const n=r.theme??(r.dark?"dark":"light");await Ha({path:r.path,useDotBin:r["use-dot"],output:r.output,timeoutMs:r.timeout*1e3,maxAttempts:r.maxAttempts,ignore:r.ignore===!0,outputType:r.flat?"flat":"relative",serverUrl:r.serverUrl,theme:n,filter:r.filter,sequence:r.seq,chromiumSandbox:r["chromium-sandbox"]})}}).command({command:"json [path]",describe:"export model to JSON",
|
|
757
758
|
builder:r=>r.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:oe}).option("use-dot",Re).epilog(`${j.bold("Examples:")}
|
|
758
759
|
${j.green("$0 export json")}
|
|
759
760
|
${j.gray("Search for likec4 files in current directory and output JSON to likec4.json")}
|
|
760
761
|
|
|
761
762
|
${j.green("$0 export json -o ./generated/likec4.json src/likec4 ")}
|
|
762
763
|
${j.gray("Search for likec4 files in src/likec4 and output JSON to generated/likec4.json")}
|
|
763
|
-
`),handler:async r=>{await
|
|
764
|
+
`),handler:async r=>{await hg({path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).updateStrings({"Commands:":j.bold("Formats:")}),handler:()=>{}}),yg=e=>e.command({command:"mcp [path]",aliases:[],describe:"Start MCP server",builder:t=>t.usage(`${j.bold("Usage:")} $0 mcp [path]`).positional("path",be).option("stdio",{boolean:!0,description:"use stdio transport",conflicts:["http","port"]}).option("http",{boolean:!0,description:"use streamable http transport (use 33335 port by default)",conflicts:"\
|
|
764
765
|
stdio"}).option("port",{alias:"p",number:!0,description:"enables http transport and sets the port",conflicts:"stdio"}).option("use-dot",Re).epilog(`${j.bold("Examples:")}
|
|
765
766
|
${j.green("$0 mcp")}
|
|
766
767
|
${j.gray("Start MCP with default stdio transport")}
|
|
@@ -768,7 +769,7 @@ ${j.green("$0 mcp --http ./src")}
|
|
|
768
769
|
${j.gray("Start MCP with streamable http transport on port 33335 at ./src folder")}
|
|
769
770
|
${j.green("$0 mcp -p 1234")}
|
|
770
771
|
${j.gray("Start MCP with streamable http transport on port 1234")}
|
|
771
|
-
`),handler:async t=>{t.http||t.port?await
|
|
772
|
+
`),handler:async t=>{t.http||t.port?await gg(t.path,t.useDot,t.port):await vg(t.path,t.useDot)}});async function gg(e,t,r=33335){await Pe.fromWorkspace(e,{mcp:{port:r},watch:!0,graphviz:t?"binary":"wasm"}),We([j.green("LikeC4 MCP served at:"),`
|
|
772
773
|
{
|
|
773
774
|
"mcpServers": {
|
|
774
775
|
"likec4": {
|
|
@@ -780,13 +781,14 @@ ${j.green("$0 mcp -p 1234")}
|
|
|
780
781
|
${j.dim("Documentation:")}
|
|
781
782
|
${j.underline("https://likec4.dev/tooling/mcp/#using-extension")}
|
|
782
783
|
`].join(`
|
|
783
|
-
`))}async function
|
|
784
|
-
outputDir:t,open:!Fe(),listen:n});
|
|
785
|
-
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"],ct).default("path",ct("."),".").default("listen","127.0.0.1","localhost"),handler:async t=>{await
|
|
786
|
-
title:n,useHashHistory:i,useOverview:
|
|
787
|
-
const
|
|
788
|
-
{command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:t=>t.positional("path",be).option("base",
|
|
789
|
-
{path:t.path,useDotBin:t["use-dot"],base:t.base,webcomponentPrefix:t["webcomponent-prefix"],title:t.title,useHashHistory:t["use-hash-history"],listen:t.listen,enableHMR:t["react-hmr"],enableWebcomponent:t["build-webcomponent"]})}});async function
|
|
790
|
-
for(const
|
|
791
|
-
loggers:[{category:"likec4",sinks:["console"],lowestLevel:
|
|
792
|
-
valid command").recommendCommands().showHelpOnFail(!0).updateStrings({"Options:":j.bold("Options:"),"Positionals:":j.bold("Arguments:"),"Commands:":j.bold("Commands:"),"Examples:":j.bold("Examples:")}).wrap(jo(
|
|
784
|
+
`))}async function vg(e,t){await Pe.fromWorkspace(e,{mcp:"stdio",watch:!0,graphviz:t?"binary":"wasm"})}async function $g(e){const t=await es({...e,likec4AssetsDir:"",webcomponentPrefix:void 0}),r=await ss({port:Yt(62001,62010)}),n=e?.open??!1;return await od({...t,mode:"production",preview:{host:e.listen??"127.0.0.1",allowedHosts:!0,port:r,open:n}})}async function _g({path:e,output:t,base:r,listen:n}){const i=await Pe.fromWorkspace(e,{logger:"vite",watch:!1}),o=await $g({base:r,languageServices:i,
|
|
785
|
+
outputDir:t,open:!Fe(),listen:n});Oa(o)}const wg=e=>e.command({command:"preview [path]",describe:"Start local server to preview production build",builder:t=>t.positional("path",{type:"string",desc:`Directory with LikeC4 source files
|
|
786
|
+
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"],ct).default("path",ct("."),".").default("listen","127.0.0.1","localhost"),handler:async t=>{await _g(t)}});async function bg({path:e,useDotBin:t,webcomponentPrefix:r,
|
|
787
|
+
title:n,useHashHistory:i,useOverview:o=!1,enableWebcomponent:a=!0,enableHMR:s=!0,base:u,listen:c,port:l}){s&&(process.env.NODE_ENV="development");const m=await Pe.fromWorkspace(e,{graphviz:t?"binary":"wasm",watch:s}),y=await Ft(Et(Vt(),".likec4-assets-")),_=await Da({buildWebcomponent:a,hmr:s,base:u,webcomponentPrefix:r,title:n,languageServices:m,useHashHistory:i,useOverviewGraph:o,likec4AssetsDir:y,listen:c,port:l});if(_.config.logger.clearScreen("info"),Oa(_),!o)return;const S=await m.diagrams();
|
|
788
|
+
if(bt(S,1)){const g=Te("c4:export"),p=Na(_);if(!p){g.error("no preview server url");return}g.info(j.cyan("wait 5sec before generating previews")),await Yo(5e3);try{await Ma({serverUrl:p,logger:g,views:S,theme:"light",output:y,outputType:"flat"}),await Yo(1e3),g.info(j.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(h){g.error(j.red("Failed to generate previews")),g.error(h)}}else _.config.logger.warn("no views found, no previews generated")}const Eg=e=>e.
|
|
789
|
+
command({command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:t=>t.positional("path",be).option("base",ta).option("webcomponent-prefix",kn).option("title",ea).option("use-hash-history",Zo).option("use-dot",Re).option("listen",Sd).option("port",Rd).options({"react-hmr":{type:"boolean",default:!0,describe:"Enable/Disable React HMR"},"build-webcomponent":{type:"boolean",default:!0,describe:"Enable/Disable Webcomponent build"}}),handler:async t=>{
|
|
790
|
+
await Ct(),await bg({path:t.path,useDotBin:t["use-dot"],base:t.base,webcomponentPrefix:t["webcomponent-prefix"],title:t.title,useHashHistory:t["use-hash-history"],listen:t.listen,port:t.port,enableHMR:t["react-hmr"],enableWebcomponent:t["build-webcomponent"]})}});async function Sg({path:e,ignoreLayout:t}){const r=await Pe.fromWorkspace(e,{logger:"vite",watch:!1}),n=Te("c4:views");let i=o(r);return i=i&&(t||await a(r,n)),i?0:Ho(1);function o(s){return s.getErrors().length===0}async function a(s,u){
|
|
791
|
+
const c=await s.diagrams();let l=!1;for(const m of c)m.hasLayoutDrift===!0&&(l=!0,u.error(j.red(`Layout drift detected on view '${m.id}' at ${oe(e,m.sourcePath??".")}`)));return!l}}const Rg=e=>e.command({command:"validate [path]",aliases:[],describe:"Validate model syntax and manual layout",builder:t=>t.positional("path",be).option("ignore-layout",{alias:["skip-layout"],boolean:!0,default:!1,description:"do not validate layout of views"}),handler:async t=>{await Sg({path:t.path,ignoreLayout:t["i\
|
|
792
|
+
gnore-layout"]})}});qo({sinks:{console:xo()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:Xf?"debug":"info"}]});async function Ag(){!Fe()&&By(),await Fo(Jf(Yf(zf)),Eg,kp,pg,mg,wg,Rg,yg,Xy,e=>e.command({command:"completion",describe:"Generate completion script",handler:()=>{e.showCompletionScript()}})).scriptName("likec4").usage("Usage: $0 <command>").version(at).alias("v","version").alias("h","help").help("help").option("verbose",{type:"boolean",default:!1,describe:"verbose logging",
|
|
793
|
+
global:!0}).demandCommand(1,"Please run with valid command").recommendCommands().showHelpOnFail(!0).updateStrings({"Options:":j.bold("Options:"),"Positionals:":j.bold("Arguments:"),"Commands:":j.bold("Commands:"),"Examples:":j.bold("Examples:")}).wrap(jo(Gf.columns-10,{min:80,max:150})).middleware(e=>{e.verbose&&qo({sinks:{console:xo()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:"debug"}]})}).parseAsync()}Ag().catch(()=>{Ho(1)}),process.on("unhandledRejection",e=>{console.error("U\
|
|
794
|
+
nhandled rejection",e)});
|