likec4 1.22.1 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/__app__/src/chunks/{-index-overview-Cg0Rizhy.js → -index-overview-DHMItP2E.js} +4 -4
- package/__app__/src/chunks/index-B1tnNgDX.js +491 -0
- package/__app__/src/chunks/likec4-Dc_HarGT.js +6124 -0
- package/__app__/src/chunks/{main-8uz6QKlw.js → main-CgCGub6x.js} +15222 -15030
- package/__app__/src/chunks/{mantine-pfC7caNp.js → mantine-Dy50iVbn.js} +3537 -3478
- package/__app__/src/chunks/tanstack-router-htnGPerc.js +2925 -0
- package/__app__/src/main.js +1 -1
- package/__app__/src/style.css +1 -1
- package/dist/cli/index.mjs +582 -580
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.31-Bgt9N.mjs → likec4.BguysIDg.mjs} +1405 -1403
- package/package.json +57 -54
- package/react/index.js +14635 -14443
- package/react/style.css +1 -1
- package/__app__/src/chunks/index-KI-kE60c.js +0 -465
- package/__app__/src/chunks/likec4-B-gfuLMn.js +0 -6106
- package/__app__/src/chunks/tanstack-router-CsfoXGgM.js +0 -3032
package/dist/cli/index.mjs
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as
|
|
3
|
-
resolve as Qe,dirname as ts,normalize as qp,relative as Up,extname as Hp,basename as Vp}from"path";import{statSync as
|
|
4
|
-
writeFile as Kt,mkdir as $t,stat as ss,copyFile as Jp,rm as Xp}from"node:fs/promises";import Ir,{tmpdir as
|
|
5
|
-
import{promisify as Me,isDeepStrictEqual as im}from"node:util";import Pr from"node:crypto";import sm from"node:assert";import"tty";import"os";import"crypto";import"net";import"child_process";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"boxen";import"node:child_process";import"node:events";import"node:stream/promises";import"fs/promises";import"@likec4/core/model";const
|
|
6
|
-
env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?
|
|
2
|
+
import{c as pt,f as yp,m as mt,g as Ji,a as Ep,b as xa,T as Dp,N as Ma,i as vp,n as Xi,C as $p,d as _p,e as qa,h as Ua,t as wp,p as bp,u as K,l as Ap,w as Cp,j as Sp,k as Rp,o as zt,q as Ha,r as Va,L as gt,s as Op,v as yt,x as Ip,y as Fp,z as Pp,A as dr,B as za,D as Np,E as Sr,F as Qi,G as Ga,H as Tp,Q as Lp}from"../shared/likec4.BguysIDg.mjs";import Te,{hrtime as jp,cwd as Zi,exit as Wa,stdout as kp,argv as Bp}from"node:process";import{strictEqual as xp,notStrictEqual as Mp}from"assert";import es,{
|
|
3
|
+
resolve as Qe,dirname as ts,normalize as qp,relative as Up,extname as Hp,basename as Vp}from"path";import{statSync as Ka,readdirSync as zp,readFileSync as rs,writeFile as Gp}from"fs";import Ya,{format as Ja,inspect as Wp}from"util";import{fileURLToPath as Kp}from"url";import be,{resolve as De,dirname as Gt,join as Rr,relative as Wt,extname as Or,isAbsolute as ns,basename as on}from"node:path";import ge,{existsSync as Pt,copyFileSync as Xa,readdirSync as Yp,rmSync as is}from"node:fs";import{mkdtemp as an,
|
|
4
|
+
writeFile as Kt,mkdir as $t,stat as ss,copyFile as Jp,rm as Xp}from"node:fs/promises";import Ir,{tmpdir as un}from"node:os";import{fileURLToPath as Qa}from"node:url";import Za from"@vitejs/plugin-react";import{sortNaturalByFqn as eu,compareNatural as Qp,hasAtLeast as Zp,invariant as os,nonexhaustive as tu,delay as ru}from"@likec4/core";import{build as Fr,createServer as em,preview as tm}from"vite";import{chromium as nu}from"playwright";import rm from"node:net";import{setTimeout as nm}from"node:timers/promises";
|
|
5
|
+
import{promisify as Me,isDeepStrictEqual as im}from"node:util";import Pr from"node:crypto";import sm from"node:assert";import"tty";import"os";import"crypto";import"net";import"child_process";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"boxen";import"node:child_process";import"node:events";import"node:stream/promises";import"fs/promises";import"@likec4/core/model";const cn=Object.create(null),Nr=t=>globalThis.process?.
|
|
6
|
+
env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?cn:globalThis),Nt=new Proxy(cn,{get(t,e){return Nr()[e]??cn[e]},has(t,e){const r=Nr();return e in r||e in cn},set(t,e,r){const n=Nr(!0);return n[e]=r,!0},deleteProperty(t,e){if(!e)return!1;const r=Nr(!0);return delete r[e],!0},ownKeys(){const t=Nr(!0);return Object.keys(t)}}),as=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",om=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEA\
|
|
7
7
|
MFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_M\
|
|
8
8
|
ERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKB\
|
|
9
9
|
LITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function am(){if(globalThis.process?.env)for(const t of om){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stac\
|
|
10
|
-
kblitz",ci:!1}:{name:"",ci:!1}}const
|
|
11
|
-
process||Object.create(null),
|
|
12
|
-
de"]];function _m(){const t=$m.find(e=>e[0]);if(t)return{name:t[1]}}const wm=_m();wm?.name;const bm={right:Im,center:Fm},Am=0,
|
|
10
|
+
kblitz",ci:!1}:{name:"",ci:!1}}const iu=am();iu.name;function Yt(t){return t?t!=="false":!1}const um=globalThis.process?.platform||"",su=Yt(Nt.CI)||iu.ci!==!1,ou=Yt(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);Yt(Nt.DEBUG);const cm=as==="test"||Yt(Nt.TEST),lm=Yt(Nt.MINIMAL)||su||cm||!ou,fm=/^win/i.test(um);!Yt(Nt.NO_COLOR)&&(Yt(Nt.FORCE_COLOR)||(ou||fm)&&Nt.TERM);const dm=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(dm?.split(".")[0]);const hm=globalThis.
|
|
11
|
+
process||Object.create(null),au={versions:{}};new Proxy(hm,{get(t,e){if(e==="env")return Nt;if(e in t)return t[e];if(e in au)return au[e]}});const pm=globalThis.process?.release?.name==="node",mm=!!globalThis.Bun||!!globalThis.process?.versions?.bun,gm=!!globalThis.Deno,ym=!!globalThis.fastly,Em=!!globalThis.Netlify,Dm=!!globalThis.EdgeRuntime,vm=globalThis.navigator?.userAgent==="Cloudflare-Workers",$m=[[Em,"netlify"],[Dm,"edge-light"],[vm,"workerd"],[ym,"fastly"],[gm,"deno"],[mm,"bun"],[pm,"no\
|
|
12
|
+
de"]];function _m(){const t=$m.find(e=>e[0]);if(t)return{name:t[1]}}const wm=_m();wm?.name;const bm={right:Im,center:Fm},Am=0,ln=1,Cm=2,fn=3;class Sm{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){const r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);const r=e.map(n=>typeof n=="string"?this.colFromString(
|
|
13
13
|
n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){const r=e.split(`
|
|
14
14
|
`).map(i=>i.split(" "));let n=0;return r.forEach(i=>{i.length>1&&Ge.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Ge.stringWidth(i[0])))}),r.forEach(i=>{this.div(...i.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const r=Ge.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){const e=[];return this.
|
|
15
15
|
rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
|
|
16
|
-
`)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let s="";n.forEach((o,a)=>{const{width:c}=e[a],l=this.negatePadding(e[a]);let u=o;if(l>Ge.stringWidth(o)&&(u+=" ".repeat(l-Ge.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){const h=bm[e[a].align];u=h(u,l),Ge.stringWidth(u)<l&&(u+=" ".repeat((c||0)-Ge.stringWidth(u)-1))}const d=e[a].padding||[0,0,0,0];d[
|
|
16
|
+
`)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let s="";n.forEach((o,a)=>{const{width:c}=e[a],l=this.negatePadding(e[a]);let u=o;if(l>Ge.stringWidth(o)&&(u+=" ".repeat(l-Ge.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){const h=bm[e[a].align];u=h(u,l),Ge.stringWidth(u)<l&&(u+=" ".repeat((c||0)-Ge.stringWidth(u)-1))}const d=e[a].padding||[0,0,0,0];d[fn]&&(s+=" ".repeat(d[fn])),s+=uu(e[a],u,"| "),s+=u,s+=uu(e[a],u," |"),d[ln]&&(s+=" ".repeat(d[ln])),i===0&&r.length>0&&(s=
|
|
17
17
|
this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){const n=e.match(/^ */),i=n?n[0].length:0,s=r.text,o=Ge.stringWidth(s.trimRight());return r.span?this.wrap?i<o?e:(r.hidden=!0,s.trimRight()+" ".repeat(i-o)+e.trimLeft()):(r.hidden=!0,s+e):e}rasterize(e){const r=[],n=this.columnWidths(e);let i;return e.forEach((s,o)=>{s.width=n[o],this.wrap?i=Ge.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
|
|
18
18
|
`):i=s.text.split(`
|
|
19
|
-
`),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[Am]||0).fill("")),i.push(...new Array(s.padding[Cm]||0).fill(""))),i.forEach((a,c)=>{r[c]||r.push([]);const l=r[c];for(let u=0;u<o;u++)l[u]===void 0&&l.push("");l.push(a)})}),r}negatePadding(e){let r=e.width||0;return e.padding&&(r-=(e.padding[
|
|
20
|
-
o=>o.width||Ge.stringWidth(o.text));let r=e.length,n=this.width;const i=e.map(o=>{if(o.width)return r--,n-=o.width,o.width}),s=r?Math.floor(n/r):0;return i.map((o,a)=>o===void 0?Math.max(s,Rm(e[a])):o)}}function
|
|
21
|
-
t=t.trim();const r=Ge.stringWidth(t);return r<e?" ".repeat(e-r)+t:t}function Fm(t,e){t=t.trim();const r=Ge.stringWidth(t);return r>=e?t:" ".repeat(e-r>>1)+t}let Ge;function Pm(t,e){return Ge=e,new Sm({width:t?.width||Om(),wrap:t?.wrap})}const
|
|
19
|
+
`),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[Am]||0).fill("")),i.push(...new Array(s.padding[Cm]||0).fill(""))),i.forEach((a,c)=>{r[c]||r.push([]);const l=r[c];for(let u=0;u<o;u++)l[u]===void 0&&l.push("");l.push(a)})}),r}negatePadding(e){let r=e.width||0;return e.padding&&(r-=(e.padding[fn]||0)+(e.padding[ln]||0)),e.border&&(r-=4),r}columnWidths(e){if(!this.wrap)return e.map(
|
|
20
|
+
o=>o.width||Ge.stringWidth(o.text));let r=e.length,n=this.width;const i=e.map(o=>{if(o.width)return r--,n-=o.width,o.width}),s=r?Math.floor(n/r):0;return i.map((o,a)=>o===void 0?Math.max(s,Rm(e[a])):o)}}function uu(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}function Rm(t){const e=t.padding||[],r=1+(e[fn]||0)+(e[ln]||0);return t.border?r+4:r}function Om(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Im(t,e){
|
|
21
|
+
t=t.trim();const r=Ge.stringWidth(t);return r<e?" ".repeat(e-r)+t:t}function Fm(t,e){t=t.trim();const r=Ge.stringWidth(t);return r>=e?t:" ".repeat(e-r>>1)+t}let Ge;function Pm(t,e){return Ge=e,new Sm({width:t?.width||Om(),wrap:t?.wrap})}const cu=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function lu(t){return t.replace(cu,"")}function Nm(t,e){const[r,n]=t.match(cu)||["",""];t=lu(t);let i="";for(let s=0;s<t.length;s++)s!==0&&s%e===0&&(i+=
|
|
22
22
|
`
|
|
23
|
-
`),i+=t.charAt(s);return r&&n&&(i=`${r}${i}${n}`),i}function Tm(t){return Pm(t,{stringWidth:e=>[...e].length,stripAnsi:
|
|
24
|
-
o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(r+=o)}return r}}function
|
|
23
|
+
`),i+=t.charAt(s);return r&&n&&(i=`${r}${i}${n}`),i}function Tm(t){return Pm(t,{stringWidth:e=>[...e].length,stripAnsi:lu,wrap:Nm})}function Lm(t,e){let r=Qe(".",t),n;for(Ka(r).isDirectory()||(r=ts(r));;){if(n=e(r,zp(r)),n)return Qe(r,n);if(r=ts(n=r),n===r)break}}function Tr(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1;const i=t.match(/^-+/);for(let s=i?i[0].length:0;s<t.length;s++){let o=t.charAt(s);n&&(n=!1,
|
|
24
|
+
o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(r+=o)}return r}}function fu(t,e){const r=t.toLowerCase();e=e||"-";let n="";for(let i=0;i<t.length;i++){const s=r.charAt(i),o=t.charAt(i);s!==o&&i>0?n+=`${e}${r.charAt(i)}`:n+=o}return n}function du(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function jm(t){if(Array.isArray(t))return t.map(o=>typeof o!="string"?o+"":o);t=t.trim();let e=0,
|
|
25
25
|
r=null,n=null,i=null;const s=[];for(let o=0;o<t.length;o++){if(r=n,n=t.charAt(o),n===" "&&!i){r!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[e]||(s[e]=""),s[e]+=n}return s}var it;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(it||(it={}));let _t;class km{constructor(e){_t=e}parse(e,r){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,
|
|
26
26
|
envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=jm(e),s=typeof e=="string",o=Bm(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"se\
|
|
27
|
-
t-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),l=n.configObjects||[],u=n.envPrefix,d=a["populate--"],h=d?"--":"_",E=Object.create(null)
|
|
27
|
+
t-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),l=n.configObjects||[],u=n.envPrefix,d=a["populate--"],h=d?"--":"_",E=Object.create(null),$=Object.create(null),y=n.__||_t.format,f={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),
|
|
28
28
|
configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,p=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(O){const P=typeof O=="object"?O.key:O,ee=Object.keys(O).map(function(W){return{boolean:"bools",string:"strings",number:"numbers"}[W]}).filter(Boolean).pop();ee&&(f[ee][P]=!0),f.arrays[P]=!0,f.keys.push(P)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(O){
|
|
29
29
|
f.bools[O]=!0,f.keys.push(O)}),[].concat(n.string||[]).filter(Boolean).forEach(function(O){f.strings[O]=!0,f.keys.push(O)}),[].concat(n.number||[]).filter(Boolean).forEach(function(O){f.numbers[O]=!0,f.keys.push(O)}),[].concat(n.count||[]).filter(Boolean).forEach(function(O){f.counts[O]=!0,f.keys.push(O)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(O){f.normalize[O]=!0,f.keys.push(O)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([O,P])=>{typeof P=="number"&&(f.nargs[O]=
|
|
30
30
|
P,f.keys.push(O))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([O,P])=>{typeof P=="function"&&(f.coercions[O]=P,f.keys.push(O))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(O){f.configs[O]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([O,P])=>{(typeof P=="boolean"||typeof P=="function")&&(f.configs[O]=P)})),k(n.key,o,n.default,f.arrays),Object.keys(c).forEach(function(O){(f.aliases[O]||
|
|
31
|
-
[]).forEach(function(P){c[P]=c[O]})});let m=null;ie();let
|
|
32
|
-
O,
|
|
33
|
-
match(/^-.\..+=/))
|
|
34
|
-
O=
|
|
35
|
-
(G(F,ne),O++):G(F,ae(F))))}else if(P.match(/^-[0-9]$/)&&P.match(g)&&w(P.slice(1),f.bools))F=P.slice(1),G(F,ae(F));else if(P==="--"){
|
|
36
|
-
"--"&&O.includes("-")).forEach(O=>{delete
|
|
37
|
-
rgs-eats-options"])ee.length-(O+1)+
|
|
38
|
-
test(re)&&!Z(re)){if(c[P]!==void 0){const ne=c[P];F=Array.isArray(ne)?ne:[ne]}}else{Q(W)||F.push(B(P,W,!0));for(let ne=O+1;ne<ee.length&&!(!a["greedy-arrays"]&&F.length>0||
|
|
39
|
-
map(function(
|
|
31
|
+
[]).forEach(function(P){c[P]=c[O]})});let m=null;ie();let D=[];const v=Object.assign(Object.create(null),{_:[]}),_={};for(let O=0;O<i.length;O++){const P=i[O],ee=P.replace(/^-{3,}/,"---");let W,F,re,V,ne,fe;if(P!=="--"&&/^-/.test(P)&&Z(P))b(P);else if(ee.match(/^---+(=|$)/)){b(P);continue}else if(P.match(/^--.+=/)||!a["short-option-groups"]&&P.match(/^-.+=/))V=P.match(/^--?([^=]+)=([\s\S]*)$/),V!==null&&Array.isArray(V)&&V.length>=3&&(w(V[1],f.arrays)?O=U(O,V[1],i,V[2]):w(V[1],f.nargs)!==!1?O=I(
|
|
32
|
+
O,V[1],i,V[2]):G(V[1],V[2],!0));else if(P.match(p)&&a["boolean-negation"])V=P.match(p),V!==null&&Array.isArray(V)&&V.length>=2&&(F=V[1],G(F,w(F,f.arrays)?[!1]:!1));else if(P.match(/^--.+/)||!a["short-option-groups"]&&P.match(/^-[^-]+/))V=P.match(/^--?(.+)/),V!==null&&Array.isArray(V)&&V.length>=2&&(F=V[1],w(F,f.arrays)?O=U(O,F,i):w(F,f.nargs)!==!1?O=I(O,F,i):(ne=i[O+1],ne!==void 0&&(!ne.match(/^-/)||ne.match(g))&&!w(F,f.bools)&&!w(F,f.counts)||/^(true|false)$/.test(ne)?(G(F,ne),O++):G(F,ae(F))));else if(P.
|
|
33
|
+
match(/^-.\..+=/))V=P.match(/^-([^=]+)=([\s\S]*)$/),V!==null&&Array.isArray(V)&&V.length>=3&&G(V[1],V[2]);else if(P.match(/^-.\..+/)&&!P.match(g))ne=i[O+1],V=P.match(/^-(.\..+)/),V!==null&&Array.isArray(V)&&V.length>=2&&(F=V[1],ne!==void 0&&!ne.match(/^-/)&&!w(F,f.bools)&&!w(F,f.counts)?(G(F,ne),O++):G(F,ae(F)));else if(P.match(/^-[^-]+/)&&!P.match(g)){re=P.slice(1,-1).split(""),W=!1;for(let we=0;we<re.length;we++){if(ne=P.slice(we+2),re[we+1]&&re[we+1]==="="){fe=P.slice(we+3),F=re[we],w(F,f.arrays)?
|
|
34
|
+
O=U(O,F,i,fe):w(F,f.nargs)!==!1?O=I(O,F,i,fe):G(F,fe),W=!0;break}if(ne==="-"){G(re[we],ne);continue}if(/[A-Za-z]/.test(re[we])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(ne)&&w(ne,f.bools)===!1){G(re[we],ne),W=!0;break}if(re[we+1]&&re[we+1].match(/\W/)){G(re[we],ne),W=!0;break}else G(re[we],ae(re[we]))}F=P.slice(-1)[0],!W&&F!=="-"&&(w(F,f.arrays)?O=U(O,F,i):w(F,f.nargs)!==!1?O=I(O,F,i):(ne=i[O+1],ne!==void 0&&(!/^(-|--)[^-]/.test(ne)||ne.match(g))&&!w(F,f.bools)&&!w(F,f.counts)||/^(true|false)$/.test(ne)?
|
|
35
|
+
(G(F,ne),O++):G(F,ae(F))))}else if(P.match(/^-[0-9]$/)&&P.match(g)&&w(P.slice(1),f.bools))F=P.slice(1),G(F,ae(F));else if(P==="--"){D=i.slice(O+1);break}else if(a["halt-at-non-option"]){D=i.slice(O);break}else b(P)}z(v,!0),z(v,!1),j(v),Y(),q(v,f.aliases,c,!0),X(v),a["set-placeholder-key"]&&se(v),Object.keys(f.counts).forEach(function(O){C(v,O.split("."))||G(O,0)}),d&&D.length&&(v[h]=[]),D.forEach(function(O){v[h].push(O)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(v).filter(O=>O!==
|
|
36
|
+
"--"&&O.includes("-")).forEach(O=>{delete v[O]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(O=>o[O])).forEach(O=>{a["camel-case-expansion"]&&O.includes("-")&&delete v[O.split(".").map(P=>Tr(P)).join(".")],delete v[O]});function b(O){const P=N("_",O);(typeof P=="string"||typeof P=="number")&&v._.push(P)}function I(O,P,ee,W){let F,re=w(P,f.nargs);if(re=typeof re!="number"||isNaN(re)?1:re,re===0)return Q(W)||(m=Error(y("Argument unexpected for: %s",P))),G(P,ae(P)),O;let V=Q(W)?0:1;if(a["na\
|
|
37
|
+
rgs-eats-options"])ee.length-(O+1)+V<re&&(m=Error(y("Not enough arguments following: %s",P))),V=re;else{for(F=O+1;F<ee.length&&(!ee[F].match(/^-[^0-9]/)||ee[F].match(g)||Z(ee[F]));F++)V++;V<re&&(m=Error(y("Not enough arguments following: %s",P)))}let ne=Math.min(V,re);for(!Q(W)&&ne>0&&(G(P,W),ne--),F=O+1;F<ne+O+1;F++)G(P,ee[F]);return O+ne}function U(O,P,ee,W){let F=[],re=W||ee[O+1];const V=w(P,f.nargs);if(w(P,f.bools)&&!/^(true|false)$/.test(re))F.push(!0);else if(Q(re)||Q(W)&&/^-/.test(re)&&!g.
|
|
38
|
+
test(re)&&!Z(re)){if(c[P]!==void 0){const ne=c[P];F=Array.isArray(ne)?ne:[ne]}}else{Q(W)||F.push(B(P,W,!0));for(let ne=O+1;ne<ee.length&&!(!a["greedy-arrays"]&&F.length>0||V&&typeof V=="number"&&F.length>=V||(re=ee[ne],/^-/.test(re)&&!g.test(re)&&!Z(re)));ne++)O=ne,F.push(B(P,re,s))}return typeof V=="number"&&(V&&F.length<V||isNaN(V)&&F.length===0)&&(m=Error(y("Not enough arguments following: %s",P))),G(P,F),O}function G(O,P,ee=s){if(/-/.test(O)&&a["camel-case-expansion"]){const re=O.split(".").
|
|
39
|
+
map(function(V){return Tr(V)}).join(".");L(O,re)}const W=B(O,P,ee),F=O.split(".");H(v,F,W),f.aliases[O]&&f.aliases[O].forEach(function(re){const V=re.split(".");H(v,V,W)}),F.length>1&&a["dot-notation"]&&(f.aliases[F[0]]||[]).forEach(function(re){let V=re.split(".");const ne=[].concat(F);ne.shift(),V=V.concat(ne),(f.aliases[O]||[]).includes(V.join("."))||H(v,V,W)}),w(O,f.normalize)&&!w(O,f.arrays)&&[O].concat(f.aliases[O]||[]).forEach(function(V){Object.defineProperty(_,V,{enumerable:!0,get(){return P},
|
|
40
40
|
set(ne){P=typeof ne=="string"?_t.normalize(ne):ne}})})}function L(O,P){f.aliases[O]&&f.aliases[O].length||(f.aliases[O]=[P],E[P]=!0),f.aliases[P]&&f.aliases[P].length||L(P,O)}function B(O,P,ee){ee&&(P=xm(P)),(w(O,f.bools)||w(O,f.counts))&&typeof P=="string"&&(P=P==="true");let W=Array.isArray(P)?P.map(function(F){return N(O,F)}):N(O,P);return w(O,f.counts)&&(Q(W)||typeof W=="boolean")&&(W=us()),w(O,f.normalize)&&w(O,f.arrays)&&(Array.isArray(P)?W=P.map(F=>_t.normalize(F)):W=_t.normalize(P)),W}function N(O,P){
|
|
41
|
-
return!a["parse-positional-numbers"]&&O==="_"||!w(O,f.strings)&&!w(O,f.bools)&&!Array.isArray(P)&&(
|
|
42
|
-
F=_t.require(re);M(F)}catch(F){F.name==="PermissionDenied"?m=F:O[ee]&&(m=Error(
|
|
43
|
-
function(F){if(ee===""||F.lastIndexOf(ee,0)===0){const re=F.split("__").map(function(
|
|
44
|
-
typeof O[P]>"u"&&(O[P]=void 0)}),O}function q(O,P,ee,W=!1){Object.keys(ee).forEach(function(F){C(O,F.split("."))||(
|
|
45
|
-
fe=
|
|
46
|
-
rays"]?W[F].concat(ee):(Array.isArray(W[F][0])?W[F]:[W[F]]).concat([ee]):!ne&&!!re==!!
|
|
47
|
-
push(F),E[F]=!0)}}),f.aliases[ee].concat(ee).forEach(function(W){if(W.length>1&&/[A-Z]/.test(W)&&a["camel-case-expansion"]){const F=
|
|
41
|
+
return!a["parse-positional-numbers"]&&O==="_"||!w(O,f.strings)&&!w(O,f.bools)&&!Array.isArray(P)&&(du(P)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${P}`)))||!Q(P)&&w(O,f.numbers))&&(P=Number(P)),P}function j(O){const P=Object.create(null);q(P,f.aliases,c),Object.keys(f.configs).forEach(function(ee){const W=O[ee]||P[ee];if(W)try{let F=null;const re=_t.resolve(_t.cwd(),W),V=f.configs[ee];if(typeof V=="function"){try{F=V(re)}catch(ne){F=ne}if(F instanceof Error){m=F;return}}else
|
|
42
|
+
F=_t.require(re);M(F)}catch(F){F.name==="PermissionDenied"?m=F:O[ee]&&(m=Error(y("Invalid JSON config file: %s",W)))}})}function M(O,P){Object.keys(O).forEach(function(ee){const W=O[ee],F=P?P+"."+ee:ee;typeof W=="object"&&W!==null&&!Array.isArray(W)&&a["dot-notation"]?M(W,F):(!C(v,F.split("."))||w(F,f.arrays)&&a["combine-arrays"])&&G(F,W)})}function Y(){typeof l<"u"&&l.forEach(function(O){M(O)})}function z(O,P){if(typeof u>"u")return;const ee=typeof u=="string"?u:"",W=_t.env();Object.keys(W).forEach(
|
|
43
|
+
function(F){if(ee===""||F.lastIndexOf(ee,0)===0){const re=F.split("__").map(function(V,ne){return ne===0&&(V=V.substring(ee.length)),Tr(V)});(P&&f.configs[re.join(".")]||!P)&&!C(O,re)&&G(re.join("."),W[F])}})}function X(O){let P;const ee=new Set;Object.keys(O).forEach(function(W){if(!ee.has(W)&&(P=w(W,f.coercions),typeof P=="function"))try{const F=N(W,P(O[W]));[].concat(f.aliases[W]||[],W).forEach(re=>{ee.add(re),O[re]=F})}catch(F){m=F}})}function se(O){return f.keys.forEach(P=>{~P.indexOf(".")||
|
|
44
|
+
typeof O[P]>"u"&&(O[P]=void 0)}),O}function q(O,P,ee,W=!1){Object.keys(ee).forEach(function(F){C(O,F.split("."))||(H(O,F.split("."),ee[F]),W&&($[F]=!0),(P[F]||[]).forEach(function(re){C(O,re.split("."))||H(O,re.split("."),ee[F])}))})}function C(O,P){let ee=O;a["dot-notation"]||(P=[P.join(".")]),P.slice(0,-1).forEach(function(F){ee=ee[F]||{}});const W=P[P.length-1];return typeof ee!="object"?!1:W in ee}function H(O,P,ee){let W=O;a["dot-notation"]||(P=[P.join(".")]),P.slice(0,-1).forEach(function(fe){
|
|
45
|
+
fe=hu(fe),typeof W=="object"&&W[fe]===void 0&&(W[fe]={}),typeof W[fe]!="object"||Array.isArray(W[fe])?(Array.isArray(W[fe])?W[fe].push({}):W[fe]=[W[fe],{}],W=W[fe][W[fe].length-1]):W=W[fe]});const F=hu(P[P.length-1]),re=w(P.join("."),f.arrays),V=Array.isArray(ee);let ne=a["duplicate-arguments-array"];!ne&&w(F,f.nargs)&&(ne=!0,(!Q(W[F])&&f.nargs[F]===1||Array.isArray(W[F])&&W[F].length===f.nargs[F])&&(W[F]=void 0)),ee===us()?W[F]=us(W[F]):Array.isArray(W[F])?ne&&re&&V?W[F]=a["flatten-duplicate-ar\
|
|
46
|
+
rays"]?W[F].concat(ee):(Array.isArray(W[F][0])?W[F]:[W[F]]).concat([ee]):!ne&&!!re==!!V?W[F]=ee:W[F]=W[F].concat([ee]):W[F]===void 0&&re?W[F]=V?ee:[ee]:ne&&!(W[F]===void 0||w(F,f.counts)||w(F,f.bools))?W[F]=[W[F],ee]:W[F]=ee}function k(...O){O.forEach(function(P){Object.keys(P||{}).forEach(function(ee){f.aliases[ee]||(f.aliases[ee]=[].concat(o[ee]||[]),f.aliases[ee].concat(ee).forEach(function(W){if(/-/.test(W)&&a["camel-case-expansion"]){const F=Tr(W);F!==ee&&f.aliases[ee].indexOf(F)===-1&&(f.aliases[ee].
|
|
47
|
+
push(F),E[F]=!0)}}),f.aliases[ee].concat(ee).forEach(function(W){if(W.length>1&&/[A-Z]/.test(W)&&a["camel-case-expansion"]){const F=fu(W,"-");F!==ee&&f.aliases[ee].indexOf(F)===-1&&(f.aliases[ee].push(F),E[F]=!0)}}),f.aliases[ee].forEach(function(W){f.aliases[W]=[ee].concat(f.aliases[ee].filter(function(F){return W!==F}))}))})})}function w(O,P){const ee=[].concat(f.aliases[O]||[],O),W=Object.keys(P),F=ee.find(re=>W.includes(re));return F?P[F]:!1}function A(O){const P=Object.keys(f);return[].concat(
|
|
48
48
|
P.map(W=>f[W])).some(function(W){return Array.isArray(W)?W.includes(O):W[O]})}function R(O,...P){return[].concat(...P).some(function(W){const F=O.match(W);return F&&A(F[1])})}function J(O){if(O.match(g)||!O.match(/^-[^-]+/))return!1;let P=!0,ee;const W=O.slice(1).split("");for(let F=0;F<W.length;F++){if(ee=O.slice(F+2),!A(W[F])){P=!1;break}if(W[F+1]&&W[F+1]==="="||ee==="-"||/[A-Za-z]/.test(W[F])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(ee)||W[F+1]&&W[F+1].match(/\W/))break}return P}function Z(O){return a["\
|
|
49
49
|
unknown-options-as-args"]&&oe(O)}function oe(O){return O=O.replace(/^-{3,}/,"--"),O.match(g)||J(O)?!1:!R(O,/^-+([^=]+?)=[\s\S]*$/,p,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ae(O){return!w(O,f.bools)&&!w(O,f.counts)&&`${O}`in c?c[O]:T(x(O))}function T(O){return{[it.BOOLEAN]:!0,[it.STRING]:"",[it.NUMBER]:void 0,[it.ARRAY]:[]}[O]}function x(O){let P=it.BOOLEAN;return w(O,f.strings)?P=it.STRING:w(O,f.numbers)?P=it.NUMBER:w(O,f.bools)?P=it.BOOLEAN:w(O,f.arrays)&&
|
|
50
|
-
(P=it.ARRAY),P}function Q(O){return O===void 0}function ie(){Object.keys(f.counts).find(O=>w(O,f.arrays)?(m=Error(
|
|
51
|
-
keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(a){return e[s].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(o,a,c){return c.indexOf(o)===a});const s=i.pop();s!==void 0&&typeof s=="string"&&(r[s]=i)}),r}function us(t){return t!==void 0?t+1:1}function
|
|
52
|
-
"string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var cs,ls,fs;const
|
|
53
|
-
on of ${
|
|
54
|
-
Tr,Lr.decamelize=
|
|
50
|
+
(P=it.ARRAY),P}function Q(O){return O===void 0}function ie(){Object.keys(f.counts).find(O=>w(O,f.arrays)?(m=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",O)),!0):w(O,f.nargs)?(m=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",O)),!0):!1)}return{aliases:Object.assign({},f.aliases),argv:Object.assign(_,v),configuration:a,defaulted:Object.assign({},$),error:m,newAliases:Object.assign({},E)}}}function Bm(t){const e=[],r=Object.create(null);let n=!0;for(Object.
|
|
51
|
+
keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(a){return e[s].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(o,a,c){return c.indexOf(o)===a});const s=i.pop();s!==void 0&&typeof s=="string"&&(r[s]=i)}),r}function us(t){return t!==void 0?t+1:1}function hu(t){return t==="__proto__"?"___proto___":t}function xm(t){return typeof t==
|
|
52
|
+
"string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var cs,ls,fs;const pu=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,mu=(ls=(cs=process==null?void 0:process.versions)===null||cs===void 0?void 0:cs.node)!==null&&ls!==void 0?ls:(fs=process==null?void 0:process.version)===null||fs===void 0?void 0:fs.slice(1);if(mu&&Number(mu.match(/^([^.]+)/)[1])<pu)throw Error(`yargs parser supports a minimum Node.js versi\
|
|
53
|
+
on of ${pu}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const Mm=process?process.env:{},gu=new km({cwd:process.cwd,env:()=>Mm,format:Ja,normalize:qp,resolve:Qe,require:t=>{if(typeof require<"u")return require(t);if(t.match(/\.json$/))return JSON.parse(rs(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Lr=function(e,r){return gu.parse(e.slice(),r).argv};Lr.detailed=function(t,e){return gu.parse(t.slice(),e)},Lr.camelCase=
|
|
54
|
+
Tr,Lr.decamelize=fu,Lr.looksLikeNumber=du;function yu(){return qm()?0:1}function qm(){return Um()&&!process.defaultApp}function Um(){return!!process.versions.electron}function Hm(t){return t.slice(yu()+1)}function Vm(){return process.argv[yu()]}class je extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,je)}}const zm={fs:{readFileSync:rs,writeFile:Gp},format:Ja,resolve:Qe,exists:t=>{try{return Ka(t).isFile()}catch{return!1}}};
|
|
55
55
|
let st;class Gm{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const r=e.shift();let n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||
|
|
56
56
|
function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),st.format.apply(st.format,[this.cache[this.locale][r]||r].concat(e))}__n(){const e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),i=e.shift();let s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?r:n;this.
|
|
57
57
|
cache[this.locale][r]&&(o=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();const a=[o];return~o.indexOf("%d")&&a.push(i),st.format.apply(st.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(const r in e)Object.prototype.hasOwnProperty.call(
|
|
58
58
|
e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(i,s){const o=r[s+1];n+=i,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const e=this,r=this.writeQueue[0],n=r.directory,i=r.locale,s=r.cb,o=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);st.fs.writeFile(o,a,"utf-8",function(c){e.writeQueue.
|
|
59
59
|
shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(c)})}_readLocaleFile(){let e={};const r=this._resolveLocaleFile(this.directory,this.locale);try{st.fs.readFileSync&&(e=JSON.parse(st.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=st.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){const i=st.resolve(
|
|
60
|
-
e,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return st.exists(e)}}function Wm(t,e){st=e;const r=new Gm(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}const Km=t=>Wm(t,zm),Ym="require is not supported by ESM",
|
|
61
|
-
0,jr.lastIndexOf("node_modules")),Xm={assert:{notStrictEqual:Mp,strictEqual:xp},cliui:Tm,findUp:Lm,getEnv:t=>process.env[t],inspect:Wp,getCallerFile:()=>{throw new je(
|
|
62
|
-
"u"?process.stdout.columns:null},readFileSync:rs,require:()=>{throw new je(Ym)},requireDirectory:()=>{throw new je(
|
|
60
|
+
e,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return st.exists(e)}}function Wm(t,e){st=e;const r=new Gm(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}const Km=t=>Wm(t,zm),Ym="require is not supported by ESM",Eu="loading a directory of commands is not supported yet for ESM";let jr;try{jr=Kp(import.meta.url)}catch{jr=process.cwd()}const Jm=jr.substring(
|
|
61
|
+
0,jr.lastIndexOf("node_modules")),Xm={assert:{notStrictEqual:Mp,strictEqual:xp},cliui:Tm,findUp:Lm,getEnv:t=>process.env[t],inspect:Wp,getCallerFile:()=>{throw new je(Eu)},getProcessArgvBin:Vm,mainFilename:Jm||process.cwd(),Parser:Lr,path:{basename:Vp,dirname:ts,extname:Hp,relative:Up,resolve:Qe},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<
|
|
62
|
+
"u"?process.stdout.columns:null},readFileSync:rs,require:()=>{throw new je(Ym)},requireDirectory:()=>{throw new je(Eu)},stringWidth:t=>[...t].length,y18n:Km({directory:Qe(jr,"../../../locales"),updateFiles:!1})};function ot(t,e,r,n){r.assert.notStrictEqual(t,e,n)}function Du(t,e){e.assert.strictEqual(typeof t,"string")}function dn(t){return Object.keys(t)}function Le(t){return!!t&&!!t.then&&typeof t.then=="function"}function kr(t){const r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,
|
|
63
63
|
i=r.shift();if(!i)throw new Error(`No command found in: ${t}`);const s={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((o,a)=>{let c=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===r.length-1&&(c=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:c}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:c})}),s}const Qm=["first","second","third","fourth","fifth","sixth"];function ce(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},
|
|
64
|
-
t,e]:[kr(`cmd ${t}`),e,r]}try{let i=0;const[s,o,a]=n(),c=[].slice.call(o);for(;c.length&&c[c.length-1]===void 0;)c.pop();const l=a||c.length;if(l<s.demanded.length)throw new je(`Not enough arguments provided. Expected ${s.demanded.length} but received ${c.length}.`);const u=s.demanded.length+s.optional.length;if(l>u)throw new je(`Too many arguments provided. Expected max ${u} but received ${l}.`);s.demanded.forEach(d=>{const h=c.shift(),E=
|
|
65
|
-
cmd,i),i+=1}),s.optional.forEach(d=>{if(c.length===0)return;const h=c.shift(),E=
|
|
64
|
+
t,e]:[kr(`cmd ${t}`),e,r]}try{let i=0;const[s,o,a]=n(),c=[].slice.call(o);for(;c.length&&c[c.length-1]===void 0;)c.pop();const l=a||c.length;if(l<s.demanded.length)throw new je(`Not enough arguments provided. Expected ${s.demanded.length} but received ${c.length}.`);const u=s.demanded.length+s.optional.length;if(l>u)throw new je(`Too many arguments provided. Expected max ${u} but received ${l}.`);s.demanded.forEach(d=>{const h=c.shift(),E=vu(h);d.cmd.filter(y=>y===E||y==="*").length===0&&$u(E,d.
|
|
65
|
+
cmd,i),i+=1}),s.optional.forEach(d=>{if(c.length===0)return;const h=c.shift(),E=vu(h);d.cmd.filter(y=>y===E||y==="*").length===0&&$u(E,d.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function vu(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function $u(t,e,r){throw new je(`Invalid ${Qm[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}class Zm{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,i=!1){if(ce("<array|funct\
|
|
66
66
|
ion> [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let s=0;s<e.length;s++){if(typeof e[s]!="function")throw Error("middleware must be a function");const o=e[s];o.applyBeforeValidation=r,o.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){const s=e;s.applyBeforeValidation=r,s.global=n,s.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,r){const n=this.yargs.getAliases();return this.globalMiddleware=
|
|
67
67
|
this.globalMiddleware.filter(i=>{const s=[...n[r]||[],r];return i.option?!s.includes(i.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}}function e0(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Br(t,e,r,n){return r.reduce((i,s)=>{
|
|
68
68
|
if(s.applyBeforeValidation!==n)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Le(i))return i.then(o=>Promise.all([o,s(o,e)])).then(([o,a])=>Object.assign(o,a));{const o=s(i,e);return Le(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},t)}function xr(t,e,r=n=>{throw n}){try{const n=t0(t)?t():t;return Le(n)?n.then(i=>e(i)):e(n)}catch(n){return r(n)}}function t0(t){return typeof t=="function"}function r0(t){if(typeof require>"u")return null;for(let e=0,r=Object.keys(require.cache),
|
|
69
69
|
n;e<r.length;e++)if(n=require.cache[r[e]],n.exports===t)return n;return null}const hr=/(^\*)|(^\$0)/;class n0{constructor(e,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,a,c)=>{const l=s(o,a,c);if(l){if(this.requireCache.
|
|
70
70
|
has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},e,i)}addHandler(e,r,n,i,s,o){let a=[];const c=e0(s);if(i=i||(()=>{}),Array.isArray(e))if(s0(e))[e,...a]=e;else for(const l of e)this.addHandler(l);else if(a0(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);
|
|
71
|
-
return}else if(
|
|
71
|
+
return}else if(_u(n)){this.addHandler([e].concat(a),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){const l=kr(e);a=a.map(h=>kr(h).cmd);let u=!1;const d=[l.cmd].concat(a).filter(h=>hr.test(h)?(u=!0,!1):!0);d.length===0&&u&&d.push("$0"),u&&(l.cmd=d[0],a=d.slice(1),e=e.replace(hr,l.cmd)),a.forEach(h=>{this.aliasMap[h]=l.cmd}),r!==!1&&this.usage.command(e,r,u,a,o),this.handlers[l.cmd]={original:e,description:r,handler:i,builder:n||{},middlewares:c,deprecated:o,demanded:l.
|
|
72
72
|
demanded,optional:l.optional},u&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,i,s,o){const a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,c=r.getInternalMethods().getContext(),l=c.commands.slice(),u=!e;e&&(c.commands.push(e),c.fullCommands.push(a.original));const d=this.applyBuilderUpdateUsageAndParse(
|
|
73
73
|
u,a,r,n.aliases,l,i,s,o);return Le(d)?d.then(h=>this.applyMiddlewareAndGetResult(u,a,h.innerArgv,c,s,h.aliases,r)):this.applyMiddlewareAndGetResult(u,a,d.innerArgv,c,s,d.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,i,s,o,a,c){const l=r.builder;let u=n;if(ds(l)){n.getInternalMethods().getUsageInstance().freeze();const d=l(n.getInternalMethods().reset(i),c);if(Le(d))return d.then(h=>(u=w0(h)?h:n,this.parseAndUpdateUsage(e,r,u,s,o,a)))}else o0(l)&&(n.getInternalMethods().getUsageInstance().freeze(),
|
|
74
74
|
u=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(d=>{u.option(d,l[d])}));return this.parseAndUpdateUsage(e,r,u,s,o,a)}parseAndUpdateUsage(e,r,n,i,s,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);const a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return Le(a)?a.then(c=>({aliases:n.parsed.aliases,innerArgv:c})):
|
|
@@ -79,29 +79,29 @@ return e||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(
|
|
|
79
79
|
alias:{},demand:{}},n=kr(e);return n.demanded.forEach(i=>{const[s,...o]=i.cmd;i.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=o,r.demand[s]=!0}),n.optional.forEach(i=>{const[s,...o]=i.cmd;i.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=o}),r}postProcessPositionals(e,r,n,i){const s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(const l of Object.keys(n.alias))s.alias[l]=(s.alias[l]||[]).concat(n.alias[l]);s.array=s.array.concat(n.array),s.config=
|
|
80
80
|
{};const o=[];if(Object.keys(r).forEach(l=>{r[l].map(u=>{s.configuration["unknown-options-as-args"]&&(s.key[l]=!0),o.push(`--${l}`),o.push(u)})}),!o.length)return;const a=Object.assign({},s.configuration,{"populate--":!1}),c=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(c.error)i.getInternalMethods().getUsageInstance().fail(c.error.message,c.error);else{const l=Object.keys(r);Object.keys(r).forEach(u=>{l.push(...c.aliases[u])}),Object.keys(c.argv).forEach(u=>{l.includes(u)&&
|
|
81
81
|
(r[u]||(r[u]=c.argv[u]),!this.isInConfigs(i,u)&&!this.isDefaulted(i,u)&&Object.prototype.hasOwnProperty.call(e,u)&&Object.prototype.hasOwnProperty.call(c.argv,u)&&(Array.isArray(e[u])||Array.isArray(c.argv[u]))?e[u]=[].concat(e[u],c.argv[u]):e[u]=c.argv[u])})}}isDefaulted(e,r){const{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){const{configObjects:n}=e.getOptions();return n.some(i=>Object.
|
|
82
|
-
prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const n=hr.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const r=this.defaultCommand.builder;if(ds(r))return r(e,!0)
|
|
82
|
+
prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const n=hr.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const r=this.defaultCommand.builder;if(ds(r))return r(e,!0);_u(r)||Object.keys(r).forEach(
|
|
83
83
|
n=>{e.option(n,r[n])})}moduleName(e){const r=r0(e);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(r.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:r,desc:n}){for(const i of[e,r,n]){if(typeof i=="string"||i===!1)return i;ot(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){
|
|
84
|
-
const e=this.frozens.pop();ot(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function i0(t,e,r,n){return new n0(t,e,r,n)}function
|
|
85
|
-
object"}function a0(t){return typeof t=="object"&&!Array.isArray(t)}function Mr(t={},e=()=>!0){const r={};return
|
|
84
|
+
const e=this.frozens.pop();ot(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function i0(t,e,r,n){return new n0(t,e,r,n)}function _u(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}function s0(t){return t.every(e=>typeof e=="string")}function ds(t){return typeof t=="function"}function o0(t){return typeof t=="\
|
|
85
|
+
object"}function a0(t){return typeof t=="object"&&!Array.isArray(t)}function Mr(t={},e=()=>!0){const r={};return dn(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function qr(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{const r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function u0(t){return typeof t=="boolean"}function c0(t,e){const r=e.y18n.__,n={},i=[];n.failFn=function(B){i.push(B)};let s=null,o=null,a=!0;n.showHelpOnFail=function(B=!0,N){
|
|
86
86
|
const[j,M]=typeof B=="string"?[!0,B]:[B,N];return t.getInternalMethods().isGlobalContext()&&(o=M),s=M,a=j,n};let c=!1;n.fail=function(B,N){const j=t.getInternalMethods().getLoggerInstance();if(i.length)for(let M=i.length-1;M>=0;--M){const Y=i[M];if(u0(Y)){if(N)throw N;if(B)throw Error(B)}else Y(B,N,n)}else{if(t.getExitProcess()&&qr(!0),!c){c=!0,a&&(t.showHelp("error"),j.error()),(B||N)&&j.error(B||N);const M=s||o;M&&((B||N)&&j.error(""),j.error(M))}if(N=N||new je(B),t.getExitProcess())return t.exit(
|
|
87
87
|
1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,N);throw N}};let l=[],u=!1;n.usage=(L,B)=>L===null?(u=!0,l=[],n):(u=!1,l.push([L,B||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>u,n.getPositionalGroupName=()=>r("Positionals:");let d=[];n.example=(L,B)=>{d.push([L,B||""])};let h=[];n.command=function(B,N,j,M,Y=!1){j&&(h=h.map(z=>(z[2]=!1,z))),h.push([B,N||"",j,M,Y])},n.getCommands=()=>h;let E={};n.describe=function(B,N){Array.isArray(B)?B.forEach(j=>{n.describe(j,N)}):typeof B==
|
|
88
|
-
"object"?Object.keys(B).forEach(j=>{n.describe(j,B[j])}):E[B]=N},n.getDescriptions=()=>E;let
|
|
88
|
+
"object"?Object.keys(B).forEach(j=>{n.describe(j,B[j])}):E[B]=N},n.getDescriptions=()=>E;let $=[];n.epilog=L=>{$.push(L)};let y=!1,f;n.wrap=L=>{y=!0,f=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(f=I(),y=!0),f);const g="__yargsString__:";n.deferY18nLookup=L=>g+L,n.help=function(){if(D)return D;m();const B=t.customScriptName?t.$0:e.path.basename(t.$0),N=t.getDemandedOptions(),j=t.getDemandedCommands(),M=t.getDeprecatedOptions(),Y=t.getGroups(),z=t.getOptions();let X=[];X=X.concat(Object.
|
|
89
89
|
keys(E)),X=X.concat(Object.keys(N)),X=X.concat(Object.keys(j)),X=X.concat(Object.keys(z.default)),X=X.filter(_),X=Object.keys(X.reduce((R,J)=>(J!=="_"&&(R[J]=!0),R),{}));const se=n.getWrap(),q=e.cliui({width:se,wrap:!!se});if(!u){if(l.length)l.forEach(R=>{q.div({text:`${R[0].replace(/\$0/g,B)}`}),R[1]&&q.div({text:`${R[1]}`,padding:[1,0,0,0]})}),q.div();else if(h.length){let R=null;j._?R=`${B} <${r("command")}>
|
|
90
90
|
`:R=`${B} [${r("command")}]
|
|
91
91
|
`,q.div(`${R}`)}}if(h.length>1||h.length===1&&!h[0][2]){q.div(r("Commands:"));const R=t.getInternalMethods().getContext(),J=R.commands.length?`${R.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(h=h.sort((oe,ae)=>oe[0].localeCompare(ae[0])));const Z=B?`${B} `:"";h.forEach(oe=>{const ae=`${Z}${J}${oe[0].replace(/^\$0 ?/,"")}`;q.span({text:ae,padding:[0,2,0,2],width:p(h,se,`${B}${J}`)+4},{text:oe[1]});const T=[];oe[2]&&T.push(`[${r("default")}]`),oe[3]&&
|
|
92
|
-
oe[3].length&&T.push(`[${r("aliases:")} ${oe[3].join(", ")}]`),oe[4]&&(typeof oe[4]=="string"?T.push(`[${r("deprecated: %s",oe[4])}]`):T.push(`[${r("deprecated")}]`)),T.length?q.div({text:T.join(" "),padding:[0,0,0,2],align:"right"}):q.div()}),q.div()}const C=(Object.keys(z.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);X=X.filter(R=>!t.parsed.newAliases[R]&&C.every(J=>(z.alias[J]||[]).indexOf(R)===-1));const
|
|
92
|
+
oe[3].length&&T.push(`[${r("aliases:")} ${oe[3].join(", ")}]`),oe[4]&&(typeof oe[4]=="string"?T.push(`[${r("deprecated: %s",oe[4])}]`):T.push(`[${r("deprecated")}]`)),T.length?q.div({text:T.join(" "),padding:[0,0,0,2],align:"right"}):q.div()}),q.div()}const C=(Object.keys(z.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);X=X.filter(R=>!t.parsed.newAliases[R]&&C.every(J=>(z.alias[J]||[]).indexOf(R)===-1));const H=r("Options:");Y[H]||(Y[H]=[]),v(X,z.alias,Y,H);const k=R=>/^--/.test(hn(R)),
|
|
93
93
|
w=Object.keys(Y).filter(R=>Y[R].length>0).map(R=>{const J=Y[R].filter(_).map(Z=>{if(C.includes(Z))return Z;for(let oe=0,ae;(ae=C[oe])!==void 0;oe++)if((z.alias[ae]||[]).includes(Z))return ae;return Z});return{groupName:R,normalizedKeys:J}}).filter(({normalizedKeys:R})=>R.length>0).map(({groupName:R,normalizedKeys:J})=>{const Z=J.reduce((oe,ae)=>(oe[ae]=[ae].concat(z.alias[ae]||[]).map(T=>R===n.getPositionalGroupName()?T:(/^[0-9]$/.test(T)?z.boolean.includes(ae)?"-":"--":T.length>1?"--":"-")+T).sort(
|
|
94
94
|
(T,x)=>k(T)===k(x)?0:k(T)?1:-1).join(", "),oe),{});return{groupName:R,normalizedKeys:J,switches:Z}});if(w.filter(({groupName:R})=>R!==n.getPositionalGroupName()).some(({normalizedKeys:R,switches:J})=>!R.every(Z=>k(J[Z])))&&w.filter(({groupName:R})=>R!==n.getPositionalGroupName()).forEach(({normalizedKeys:R,switches:J})=>{R.forEach(Z=>{k(J[Z])&&(J[Z]=l0(J[Z],4))})}),w.forEach(({groupName:R,normalizedKeys:J,switches:Z})=>{q.div(R),J.forEach(oe=>{const ae=Z[oe];let T=E[oe]||"",x=null;T.includes(g)&&
|
|
95
95
|
(T=r(T.substring(g.length))),z.boolean.includes(oe)&&(x=`[${r("boolean")}]`),z.count.includes(oe)&&(x=`[${r("count")}]`),z.string.includes(oe)&&(x=`[${r("string")}]`),z.normalize.includes(oe)&&(x=`[${r("string")}]`),z.array.includes(oe)&&(x=`[${r("array")}]`),z.number.includes(oe)&&(x=`[${r("number")}]`);const Q=P=>typeof P=="string"?`[${r("deprecated: %s",P)}]`:`[${r("deprecated")}]`,ie=[oe in M?Q(M[oe]):null,x,oe in N?`[${r("required")}]`:null,z.choices&&z.choices[oe]?`[${r("choices:")} ${n.stringifiedValues(
|
|
96
|
-
z.choices[oe])}]`:null,b(z.default[oe],z.defaultDescription[oe])].filter(Boolean).join(" ");q.span({text:
|
|
97
|
-
q.div())
|
|
96
|
+
z.choices[oe])}]`:null,b(z.default[oe],z.defaultDescription[oe])].filter(Boolean).join(" ");q.span({text:hn(ae),padding:[0,2,0,2+wu(ae)],width:p(Z,se)+4},T);const O=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;ie&&!O?q.div({text:ie,padding:[0,0,0,2],align:"right"}):q.div()}),q.div()}),d.length&&(q.div(r("Examples:")),d.forEach(R=>{R[0]=R[0].replace(/\$0/g,B)}),d.forEach(R=>{R[1]===""?q.div({text:R[0],padding:[0,2,0,2]}):q.div({text:R[0],padding:[0,2,0,2],width:p(d,se)+4},{text:R[1]})}),
|
|
97
|
+
q.div()),$.length>0){const R=$.map(J=>J.replace(/\$0/g,B)).join(`
|
|
98
98
|
`);q.div(`${R}
|
|
99
|
-
`)}return q.toString().replace(/\s*$/,"")};function p(L,B,N){let j=0;return Array.isArray(L)||(L=Object.values(L).map(M=>[M])),L.forEach(M=>{j=Math.max(e.stringWidth(N?`${N} ${
|
|
100
|
-
count(N),B.string.includes(j)&&t.string(N),B.normalize.includes(j)&&t.normalize(N),B.array.includes(j)&&t.array(N),B.number.includes(j)&&t.number(N)})})}let
|
|
99
|
+
`)}return q.toString().replace(/\s*$/,"")};function p(L,B,N){let j=0;return Array.isArray(L)||(L=Object.values(L).map(M=>[M])),L.forEach(M=>{j=Math.max(e.stringWidth(N?`${N} ${hn(M[0])}`:hn(M[0]))+wu(M[0]),j)}),B&&(j=Math.min(j,parseInt((B*.5).toString(),10))),j}function m(){const L=t.getDemandedOptions(),B=t.getOptions();(Object.keys(B.alias)||[]).forEach(N=>{B.alias[N].forEach(j=>{E[j]&&n.describe(N,E[j]),j in L&&t.demandOption(N,L[j]),B.boolean.includes(j)&&t.boolean(N),B.count.includes(j)&&t.
|
|
100
|
+
count(N),B.string.includes(j)&&t.string(N),B.normalize.includes(j)&&t.normalize(N),B.array.includes(j)&&t.array(N),B.number.includes(j)&&t.number(N)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function v(L,B,N,j){let M=[],Y=null;return Object.keys(N).forEach(z=>{M=M.concat(N[z])}),L.forEach(z=>{Y=[z].concat(B[z]),Y.some(X=>M.indexOf(X)!==-1)||N[j].push(z)}),M}function _(L){return t.getOptions().
|
|
101
101
|
hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=L=>{const B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(B,N){let j="";const M=N||", ",Y=[].concat(B);return!B||!Y.length||Y.forEach(z=>{j.length&&(j+=M),j+=JSON.stringify(z)}),j};function b(L,B){let N=`[${r("default:")} `;if(L===
|
|
102
|
-
void 0&&!B)return null;if(B)N+=B;else switch(typeof L){case"string":N+=`"${L}"`;break;case"object":N+=JSON.stringify(L);break;default:N+=L}return`${N}]`}function I(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let
|
|
103
|
-
G.push({failMessage:s,failureOutput:c,usages:l,usageDisabled:u,epilogs
|
|
104
|
-
{text:t,indentation:e}}function
|
|
102
|
+
void 0&&!B)return null;if(B)N+=B;else switch(typeof L){case"string":N+=`"${L}"`;break;case"object":N+=JSON.stringify(L);break;default:N+=L}return`${N}]`}function I(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let U=null;n.version=L=>{U=L},n.showVersion=L=>{const B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(U)},n.reset=function(B){return s=null,c=!1,l=[],u=!1,$=[],d=[],h=[],E=Mr(E,N=>!B[N]),n};const G=[];return n.freeze=function(){
|
|
103
|
+
G.push({failMessage:s,failureOutput:c,usages:l,usageDisabled:u,epilogs:$,examples:d,commands:h,descriptions:E})},n.unfreeze=function(B=!1){const N=G.pop();N&&(B?(E={...N.descriptions,...E},h=[...N.commands,...h],l=[...N.usages,...l],d=[...N.examples,...d],$=[...N.epilogs,...$]):{failMessage:s,failureOutput:c,usages:l,usageDisabled:u,epilogs:$,examples:d,commands:h,descriptions:E}=N)},n}function hs(t){return typeof t=="object"}function l0(t,e){return hs(t)?{text:t.text,indentation:t.indentation+e}:
|
|
104
|
+
{text:t,indentation:e}}function wu(t){return hs(t)?t.indentation:0}function hn(t){return hs(t)?t.text:t}const f0=`###-begin-{{app_name}}-completions-###
|
|
105
105
|
#
|
|
106
106
|
# yargs command completion script
|
|
107
107
|
#
|
|
@@ -153,87 +153,87 @@ length;a<c;++a)if(s[e[a]]&&s[e[a]].builder){const l=s[e[a]].builder;if(ds(l)){th
|
|
|
153
153
|
r)&&this.usage.getCommands().forEach(s=>{const o=kr(s[0]).cmd;if(r.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{const a=s[1]||"";e.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,r,n,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(r)){const s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{const c=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!s.hiddenOptions.
|
|
154
154
|
includes(a)&&!this.argsContainKey(r,a,c)&&this.completeOptionKey(a,e,i,c&&!!s.default[a])})}}choicesFromOptionsCompletions(e,r,n,i){if(this.previousArgHasChoices(r)){const s=this.getPreviousArgChoices(r);s&&s.length>0&&e.push(...s.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,i){if(i===""&&e.length>0&&this.previousArgHasChoices(r))return;const s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().
|
|
155
155
|
getContext().commands.length+1),a=s[n._.length-o-1];if(!a)return;const c=this.yargs.getOptions().choices[a]||[];for(const l of c)l.startsWith(i)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;const i=r.replace(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]];let a;for(const c of o)if(Object.prototype.hasOwnProperty.call(s.key,c)&&Array.
|
|
156
|
-
isArray(s.choices[c])){a=s.choices[c];break}if(a)return a.filter(c=>!n||c.startsWith(n))}previousArgHasChoices(e){const r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){const i=s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(r)||n&&i(`no-${r}`))return!0;if(this.aliases){for(const s of this.aliases[r])if(i(s))return!0}return!1}completeOptionKey(e,r,n,i){var s,o,a,c;let l=e;if(this.zshShell){const E=this.usage.getDescriptions()
|
|
157
|
-
void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||o===void 0?void 0:o.find(g=>{const p=E[g];return typeof p=="string"&&p.length>0}),
|
|
156
|
+
isArray(s.choices[c])){a=s.choices[c];break}if(a)return a.filter(c=>!n||c.startsWith(n))}previousArgHasChoices(e){const r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){const i=s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(r)||n&&i(`no-${r}`))return!0;if(this.aliases){for(const s of this.aliases[r])if(i(s))return!0}return!1}completeOptionKey(e,r,n,i){var s,o,a,c;let l=e;if(this.zshShell){const E=this.usage.getDescriptions(),$=(o=(s=this===null||this===
|
|
157
|
+
void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||o===void 0?void 0:o.find(g=>{const p=E[g];return typeof p=="string"&&p.length>0}),y=$?E[$]:void 0,f=(c=(a=E[e])!==null&&a!==void 0?a:y)!==null&&c!==void 0?c:"";l=`${e.replace(/:/g,"\\:")}:${f.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const u=E=>/^--/.test(E),d=E=>/^[^0-9]$/.test(E),h=!u(n)&&d(e)?"-":"--";r.push(h+l),i&&r.push(h+"no-"+l)}customCompletion(e,r,n,i){if(ot(this.customCompletionFunction,null,this.
|
|
158
158
|
shim),m0(this.customCompletionFunction)){const s=this.customCompletionFunction(n,r);return Le(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return g0(this.customCompletionFunction)?this.customCompletionFunction(n,r,(s=i)=>this.defaultCompletion(e,r,n,s),s=>{i(null,s)}):this.customCompletionFunction(n,r,s=>{i(null,s)})}getCompletion(e,r){const n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?
|
|
159
159
|
o=>this.customCompletion(e,o,n,r):o=>this.defaultCompletion(e,o,n,r);return Le(i)?i.then(s):s(i)}generateCompletionScript(e,r){let n=this.zshShell?d0:f0;const i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function p0(t,e,r,n){return new h0(t,e,r,n)}function m0(t){return t.length<3}function g0(t){
|
|
160
|
-
return t.length>3}function y0(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;const r=[];let n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:n>1&&i>1&&e.charAt(n-2)===t.charAt(i-1)&&e.charAt(n-1)===t.charAt(i-2)?r[n][i]=r[n-2][i-2]+1:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}const
|
|
161
|
-
function E0(t,e,r){const n=r.y18n.__,i=r.y18n.__n,s={};s.nonOptionCount=function(d){const h=t.getDemandedCommands()
|
|
162
|
-
h._.min.toString()))
|
|
163
|
-
function(d,h){let E=null;for(const
|
|
164
|
-
${
|
|
165
|
-
`)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(E).length,Object.keys(E).join(", ")+
|
|
166
|
-
h)&&p.push(
|
|
167
|
-
getCommandInstance().getCommands(),E=[]
|
|
168
|
-
function(d){const h=t.getOptions(),E={};if(!Object.keys(h.choices).length)return;Object.keys(d).forEach(f=>{
|
|
169
|
-
${n("Argument: %s, Given: %s, Choices: %s",f,e.stringifiedValues(E[f]),e.stringifiedValues(h.choices[f]))}`}),e.fail(
|
|
170
|
-
ber"?d=u._.length>=d:d.match(/^--no-.+/)?(d=d.match(/^--no-(.+)/)[1],d=!Object.prototype.hasOwnProperty.call(u,d)):d=Object.prototype.hasOwnProperty.call(u,d),d}s.implications=function(d){const h=[];if(Object.keys(o).forEach(E=>{const
|
|
171
|
-
`;h.forEach(
|
|
172
|
-
getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach(h=>{c[h].forEach(E=>{E&&d[r.Parser.camelCase(h)]!==void 0&&d[r.Parser.camelCase(E)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",h,E))})})},s.recommendCommands=function(d,h){h=h.sort((f,g)=>g.length-f.length);let
|
|
160
|
+
return t.length>3}function y0(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;const r=[];let n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:n>1&&i>1&&e.charAt(n-2)===t.charAt(i-1)&&e.charAt(n-1)===t.charAt(i-2)?r[n][i]=r[n-2][i-2]+1:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}const bu=["$0","--","_"];
|
|
161
|
+
function E0(t,e,r){const n=r.y18n.__,i=r.y18n.__n,s={};s.nonOptionCount=function(d){const h=t.getDemandedCommands(),$=d._.length+(d["--"]?d["--"].length:0)-t.getInternalMethods().getContext().commands.length;h._&&($<h._.min||$>h._.max)&&($<h._.min?h._.minMsg!==void 0?e.fail(h._.minMsg?h._.minMsg.replace(/\$0/g,$.toString()).replace(/\$1/,h._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",$,$.toString(),
|
|
162
|
+
h._.min.toString())):$>h._.max&&(h._.maxMsg!==void 0?e.fail(h._.maxMsg?h._.maxMsg.replace(/\$0/g,$.toString()).replace(/\$1/,h._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",$,$.toString(),h._.max.toString()))))},s.positionalCount=function(d,h){h<d&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",h,h+"",d+""))},s.requiredArguments=
|
|
163
|
+
function(d,h){let E=null;for(const $ of Object.keys(h))(!Object.prototype.hasOwnProperty.call(d,$)||typeof d[$]>"u")&&(E=E||{},E[$]=h[$]);if(E){const $=[];for(const f of Object.keys(E)){const g=E[f];g&&$.indexOf(g)<0&&$.push(g)}const y=$.length?`
|
|
164
|
+
${$.join(`
|
|
165
|
+
`)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(E).length,Object.keys(E).join(", ")+y))}},s.unknownArguments=function(d,h,E,$,y=!0){var f;const g=t.getInternalMethods().getCommandInstance().getCommands(),p=[],m=t.getInternalMethods().getContext();if(Object.keys(d).forEach(D=>{!bu.includes(D)&&!Object.prototype.hasOwnProperty.call(E,D)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),D)&&!s.isValidAndSomeAliasIsNotNew(D,
|
|
166
|
+
h)&&p.push(D)}),y&&(m.commands.length>0||g.length>0||$)&&d._.slice(m.commands.length).forEach(D=>{g.includes(""+D)||p.push(""+D)}),y){const v=((f=t.getDemandedCommands()._)===null||f===void 0?void 0:f.max)||0,_=m.commands.length+v;_<d._.length&&d._.slice(_).forEach(b=>{b=String(b),!m.commands.includes(b)&&!p.includes(b)&&p.push(b)})}p.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",p.length,p.map(D=>D.trim()?D:`"${D}"`).join(", ")))},s.unknownCommands=function(d){const h=t.getInternalMethods().
|
|
167
|
+
getCommandInstance().getCommands(),E=[],$=t.getInternalMethods().getContext();return($.commands.length>0||h.length>0)&&d._.slice($.commands.length).forEach(y=>{h.includes(""+y)||E.push(""+y)}),E.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",E.length,E.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(d,h){if(!Object.prototype.hasOwnProperty.call(h,d))return!1;const E=t.parsed.newAliases;return[d,...h[d]].some($=>!Object.prototype.hasOwnProperty.call(E,$)||!E[d])},s.limitedChoices=
|
|
168
|
+
function(d){const h=t.getOptions(),E={};if(!Object.keys(h.choices).length)return;Object.keys(d).forEach(f=>{bu.indexOf(f)===-1&&Object.prototype.hasOwnProperty.call(h.choices,f)&&[].concat(d[f]).forEach(g=>{h.choices[f].indexOf(g)===-1&&g!==void 0&&(E[f]=(E[f]||[]).concat(g))})});const $=Object.keys(E);if(!$.length)return;let y=n("Invalid values:");$.forEach(f=>{y+=`
|
|
169
|
+
${n("Argument: %s, Given: %s, Choices: %s",f,e.stringifiedValues(E[f]),e.stringifiedValues(h.choices[f]))}`}),e.fail(y)};let o={};s.implies=function(d,h){ce("<string|object> [array|number|string]",[d,h],arguments.length),typeof d=="object"?Object.keys(d).forEach(E=>{s.implies(E,d[E])}):(t.global(d),o[d]||(o[d]=[]),Array.isArray(h)?h.forEach(E=>s.implies(d,E)):(ot(h,void 0,r),o[d].push(h)))},s.getImplied=function(){return o};function a(u,d){const h=Number(d);return d=isNaN(h)?d:h,typeof d=="num\
|
|
170
|
+
ber"?d=u._.length>=d:d.match(/^--no-.+/)?(d=d.match(/^--no-(.+)/)[1],d=!Object.prototype.hasOwnProperty.call(u,d)):d=Object.prototype.hasOwnProperty.call(u,d),d}s.implications=function(d){const h=[];if(Object.keys(o).forEach(E=>{const $=E;(o[E]||[]).forEach(y=>{let f=$;const g=y;f=a(d,f),y=a(d,y),f&&!y&&h.push(` ${$} -> ${g}`)})}),h.length){let E=`${n("Implications failed:")}
|
|
171
|
+
`;h.forEach($=>{E+=$}),e.fail(E)}};let c={};s.conflicts=function(d,h){ce("<string|object> [array|string]",[d,h],arguments.length),typeof d=="object"?Object.keys(d).forEach(E=>{s.conflicts(E,d[E])}):(t.global(d),c[d]||(c[d]=[]),Array.isArray(h)?h.forEach(E=>s.conflicts(d,E)):c[d].push(h))},s.getConflicting=()=>c,s.conflicting=function(d){Object.keys(d).forEach(h=>{c[h]&&c[h].forEach(E=>{E&&d[h]!==void 0&&d[E]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",h,E))})}),t.getInternalMethods().
|
|
172
|
+
getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach(h=>{c[h].forEach(E=>{E&&d[r.Parser.camelCase(h)]!==void 0&&d[r.Parser.camelCase(E)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",h,E))})})},s.recommendCommands=function(d,h){h=h.sort((f,g)=>g.length-f.length);let $=null,y=1/0;for(let f=0,g;(g=h[f])!==void 0;f++){const p=y0(d,g);p<=3&&p<y&&(y=p,$=g)}$&&e.fail(n("Did you mean %s?",$))},s.reset=function(d){return o=Mr(o,h=>!d[h]),c=Mr(c,h=>!d[h]),s};const l=[];return s.
|
|
173
173
|
freeze=function(){l.push({implied:o,conflicting:c})},s.unfreeze=function(){const d=l.pop();ot(d,void 0,r),{implied:o,conflicting:c}=d},s}let ps=[],Ur;function ms(t,e,r,n){Ur=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;const s=/\.json|\..*rc$/.test(t.extends);let o=null;if(s)o=v0(e,t.extends);else try{o=require.resolve(t.extends)}catch{return t}D0(o),ps.push(o),i=s?JSON.parse(Ur.readFileSync(o,"utf8")):require(t.extends),delete t.extends,
|
|
174
|
-
i=ms(i,Ur.path.dirname(o),r,Ur)}return ps=[],r?
|
|
174
|
+
i=ms(i,Ur.path.dirname(o),r,Ur)}return ps=[],r?Au(i,t):Object.assign({},i,t)}function D0(t){if(ps.indexOf(t)>-1)throw new je(`Circular extended configurations: '${t}'.`)}function v0(t,e){return Ur.path.resolve(t,e)}function Au(t,e){const r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(const i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=Au(t[i],e[i]):r[i]=e[i];return r}var ue=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");
|
|
175
175
|
if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},S=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class d\
|
|
176
|
-
id not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fe,Jt,Hr,Ze,We,
|
|
177
|
-
"getDollarZero"),nr=Symbol("getParserConfiguration"),
|
|
178
|
-
"getContext"),
|
|
179
|
-
this,void 0),Jt.set(this,void 0),Hr.set(this,{commands:[],fullCommands:[]}),Ze.set(this,null),We.set(this,null),
|
|
180
|
-
de.set(this,void 0),er.set(this,!1),tr.set(this,!1),rr.set(this,!1),he.set(this,void 0)
|
|
181
|
-
"[string|boolean] [string]",[e,r],arguments.length),S(this,rt,"f")&&(this[gs](S(this,rt,"f")),ue(this,rt,null,"f")),e===!1&&r===void 0?this:(ue(this,rt,typeof e=="string"?e:n,"f"),this.boolean(S(this,rt,"f")),this.describe(S(this,rt,"f"),r||S(this,he,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(ce("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;const n=typeof e=="string"?e:S(this,
|
|
176
|
+
id not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fe,Jt,Hr,Ze,We,pn,Tt,Xt,mn,et,gn,tt,Et,Ke,rt,yn,pr,ke,le,En,Dn,Ye,Qt,mr,Zt,Lt,vn,de,er,tr,rr,he,$n,Dt,Ie;function $0(t){return(e=[],r=t.process.cwd(),n)=>{const i=new _0(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}const Cu=Symbol("copyDoubleDash"),Su=Symbol("copyDoubleDash"),gs=Symbol("deleteFromParserHintObject"),Ru=Symbol("emitWarning"),Ou=Symbol("freeze"),Iu=Symbol(
|
|
177
|
+
"getDollarZero"),nr=Symbol("getParserConfiguration"),Fu=Symbol("getUsageConfiguration"),ys=Symbol("guessLocale"),Pu=Symbol("guessVersion"),Nu=Symbol("parsePositionalNumbers"),Es=Symbol("pkgUp"),jt=Symbol("populateParserHintArray"),gr=Symbol("populateParserHintSingleValueDictionary"),Ds=Symbol("populateParserHintArrayDictionary"),vs=Symbol("populateParserHintDictionary"),$s=Symbol("sanitizeKey"),_s=Symbol("setKey"),ws=Symbol("unfreeze"),Tu=Symbol("validateAsync"),Lu=Symbol("getCommandInstance"),ju=Symbol(
|
|
178
|
+
"getContext"),ku=Symbol("getHasOutput"),Bu=Symbol("getLoggerInstance"),xu=Symbol("getParseContext"),Mu=Symbol("getUsageInstance"),qu=Symbol("getValidationInstance"),_n=Symbol("hasParseCallback"),Uu=Symbol("isGlobalContext"),ir=Symbol("postProcess"),Hu=Symbol("rebase"),bs=Symbol("reset"),Vr=Symbol("runYargsParserAndExecuteCommands"),As=Symbol("runValidation"),Vu=Symbol("setHasOutput"),sr=Symbol("kTrackManuallySetKeys");class _0{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,Fe.set(
|
|
179
|
+
this,void 0),Jt.set(this,void 0),Hr.set(this,{commands:[],fullCommands:[]}),Ze.set(this,null),We.set(this,null),pn.set(this,"show-hidden"),Tt.set(this,null),Xt.set(this,!0),mn.set(this,{}),et.set(this,!0),gn.set(this,[]),tt.set(this,void 0),Et.set(this,{}),Ke.set(this,!1),rt.set(this,null),yn.set(this,!0),pr.set(this,void 0),ke.set(this,""),le.set(this,void 0),En.set(this,void 0),Dn.set(this,{}),Ye.set(this,null),Qt.set(this,null),mr.set(this,{}),Zt.set(this,{}),Lt.set(this,void 0),vn.set(this,!1),
|
|
180
|
+
de.set(this,void 0),er.set(this,!1),tr.set(this,!1),rr.set(this,!1),he.set(this,void 0),$n.set(this,{}),Dt.set(this,null),Ie.set(this,void 0),ue(this,de,i,"f"),ue(this,Lt,e,"f"),ue(this,Jt,r,"f"),ue(this,En,n,"f"),ue(this,tt,new Zm(this),"f"),this.$0=this[Iu](),this[bs](),ue(this,Fe,S(this,Fe,"f"),"f"),ue(this,he,S(this,he,"f"),"f"),ue(this,Ie,S(this,Ie,"f"),"f"),ue(this,le,S(this,le,"f"),"f"),S(this,le,"f").showHiddenOpt=S(this,pn,"f"),ue(this,pr,this[Su](),"f")}addHelpOpt(e,r){const n="help";return ce(
|
|
181
|
+
"[string|boolean] [string]",[e,r],arguments.length),S(this,rt,"f")&&(this[gs](S(this,rt,"f")),ue(this,rt,null,"f")),e===!1&&r===void 0?this:(ue(this,rt,typeof e=="string"?e:n,"f"),this.boolean(S(this,rt,"f")),this.describe(S(this,rt,"f"),r||S(this,he,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(ce("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;const n=typeof e=="string"?e:S(this,pn,"f");return this.boolean(
|
|
182
182
|
n),this.describe(n,r||S(this,he,"f").deferY18nLookup("Show hidden options")),S(this,le,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return ce("<object|string|array> [string|array]",[e,r],arguments.length),this[Ds](this.alias.bind(this),"alias",e,r),this}array(e){return ce("<array|string>",[e],arguments.length),this[jt]("array",e),this[sr](e),this}boolean(e){return ce("<array|string>",[e],arguments.length),this[jt]("boolean",e),this[sr](e),this}check(e,r){
|
|
183
183
|
return ce("<function> [boolean]",[e,r],arguments.length),this.middleware((n,i)=>xr(()=>e(n,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&S(this,he,"f").fail(s.toString(),s):S(this,he,"f").fail(S(this,de,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(S(this,he,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return ce("<object|string|array> [string|array]",[e,r],arguments.length),this[Ds](this.choices.bind(this),"choices",e,r),this}coerce(e,r){
|
|
184
184
|
if(ce("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new je("coerce callback must be provided");for(const n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(const n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new je("coerce callback must be provided");return S(this,le,"f").key[e]=!0,S(this,tt,"f").addCoerceMiddleware((n,i)=>{let s;return Object.prototype.hasOwnProperty.call(n,e)?xr(()=>(s=i.getAliases(),r(n[e])),a=>{n[e]=
|
|
185
185
|
a;const c=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[e]&&c!==!0)for(const l of s[e])n[l]=a;return n},a=>{throw new je(a.message)}):n},e),this}conflicts(e,r){return ce("<string|object> [string|array]",[e,r],arguments.length),S(this,Ie,"f").conflicts(e,r),this}config(e="config",r,n){return ce("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=ms(e,S(this,Jt,"f"),this[nr]()["deep-merge-config"]||!1,S(this,de,"\
|
|
186
186
|
f")),S(this,le,"f").configObjects=(S(this,le,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||S(this,he,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{S(this,le,"f").config[i]=n||!0}),this)}completion(e,r,n){return ce("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),ue(this,We,e||S(this,We,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion\
|
|
187
|
-
script"),this.command(S(this,We,"f"),r),n&&S(this,Ze,"f").registerFunction(n),this}command(e,r,n,i,s,o){return ce("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,s,o],arguments.length),S(this,Fe,"f").addHandler(e,r,n,i,s,o),this}commands(e,r,n,i,s,o){return this.command(e,r,n,i,s,o)}commandDir(e,r){ce("<string> [object]",[e,r],arguments.length);const n=S(this,
|
|
188
|
-
"f").getCallerFile(),r),this}count(e){return ce("<array|string>",[e],arguments.length),this[jt]("count",e),this[sr](e),this}default(e,r,n){return ce("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(
|
|
187
|
+
script"),this.command(S(this,We,"f"),r),n&&S(this,Ze,"f").registerFunction(n),this}command(e,r,n,i,s,o){return ce("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,s,o],arguments.length),S(this,Fe,"f").addHandler(e,r,n,i,s,o),this}commands(e,r,n,i,s,o){return this.command(e,r,n,i,s,o)}commandDir(e,r){ce("<string> [object]",[e,r],arguments.length);const n=S(this,En,"f")||S(this,de,"f").require;return S(this,Fe,"f").addDirectory(e,n,S(this,de,
|
|
188
|
+
"f").getCallerFile(),r),this}count(e){return ce("<array|string>",[e],arguments.length),this[jt]("count",e),this[sr](e),this}default(e,r,n){return ce("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(Du(e,S(this,de,"f")),S(this,le,"f").defaultDescription[e]=n),typeof r=="function"&&(Du(e,S(this,de,"f")),S(this,le,"f").defaultDescription[e]||(S(this,le,"f").defaultDescription[e]=S(this,he,"f").functionDescription(r)),r=r.call()),this[gr](this.default.bind(this),"default",e,r),this}defaults(e,r,n){
|
|
189
189
|
return this.default(e,r,n)}demandCommand(e=1,r,n,i){return ce("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),S(this,le,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{ot(n,!0,S(this,de,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(ot(n,!0,S(this,de,"f")),this.demandCommand(e,r,n,n)):
|
|
190
190
|
Array.isArray(e)?e.forEach(i=>{ot(n,!0,S(this,de,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return ce("<object|string|array> [string]",[e,r],arguments.length),this[gr](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return ce("<string> [string|boolean]",[e,r],arguments.length),S(this,le,"f").deprecatedOptions[e]=r,this}describe(e,r){return ce("<object|string|array> [str\
|
|
191
191
|
ing]",[e,r],arguments.length),this[_s](e,!0),S(this,he,"f").describe(e,r),this}detectLocale(e){return ce("<boolean>",[e],arguments.length),ue(this,Xt,e,"f"),this}env(e){return ce("[string|boolean]",[e],arguments.length),e===!1?delete S(this,le,"f").envPrefix:S(this,le,"f").envPrefix=e||"",this}epilogue(e){return ce("<string>",[e],arguments.length),S(this,he,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return ce("<string|array> [string]",[e,r],arguments.length),Array.isArray(
|
|
192
192
|
e)?e.forEach(n=>this.example(...n)):S(this,he,"f").example(e,r),this}exit(e,r){ue(this,Ke,!0,"f"),ue(this,Tt,r,"f"),S(this,et,"f")&&S(this,de,"f").process.exit(e)}exitProcess(e=!0){return ce("[boolean]",[e],arguments.length),ue(this,et,e,"f"),this}fail(e){if(ce("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new je("Invalid first argument. Expected function or boolean 'false'");return S(this,he,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){
|
|
193
|
-
return ce("<array> [function]",[e,r],arguments.length),r?S(this,Ze,"f").getCompletion(e,r):new Promise((n,i)=>{S(this,Ze,"f").getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return ce([],0),S(this,le,"f").demandedOptions}getDemandedCommands(){return ce([],0),S(this,le,"f").demandedCommands}getDeprecatedOptions(){return ce([],0),S(this,le,"f").deprecatedOptions}getDetectLocale(){return S(this,Xt,"f")}getExitProcess(){return S(this,et,"f")}getGroups(){return Object.assign({},S(this,
|
|
193
|
+
return ce("<array> [function]",[e,r],arguments.length),r?S(this,Ze,"f").getCompletion(e,r):new Promise((n,i)=>{S(this,Ze,"f").getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return ce([],0),S(this,le,"f").demandedOptions}getDemandedCommands(){return ce([],0),S(this,le,"f").demandedCommands}getDeprecatedOptions(){return ce([],0),S(this,le,"f").deprecatedOptions}getDetectLocale(){return S(this,Xt,"f")}getExitProcess(){return S(this,et,"f")}getGroups(){return Object.assign({},S(this,Et,
|
|
194
194
|
"f"),S(this,Zt,"f"))}getHelp(){if(ue(this,Ke,!0,"f"),!S(this,he,"f").hasCachedHelpMessage()){if(!this.parsed){const r=this[Vr](S(this,Lt,"f"),void 0,void 0,0,!0);if(Le(r))return r.then(()=>S(this,he,"f").help())}const e=S(this,Fe,"f").runDefaultBuilderOn(this);if(Le(e))return e.then(()=>S(this,he,"f").help())}return Promise.resolve(S(this,he,"f").help())}getOptions(){return S(this,le,"f")}getStrict(){return S(this,er,"f")}getStrictCommands(){return S(this,tr,"f")}getStrictOptions(){return S(this,
|
|
195
|
-
rr,"f")}global(e,r){return ce("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?S(this,le,"f").local=S(this,le,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{S(this,le,"f").local.includes(n)||S(this,le,"f").local.push(n)}),this}group(e,r){ce("<string|array> <string>",[e,r],arguments.length);const n=S(this,Zt,"f")[r]||S(this,
|
|
195
|
+
rr,"f")}global(e,r){return ce("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?S(this,le,"f").local=S(this,le,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{S(this,le,"f").local.includes(n)||S(this,le,"f").local.push(n)}),this}group(e,r){ce("<string|array> <string>",[e,r],arguments.length);const n=S(this,Zt,"f")[r]||S(this,Et,"f")[r];S(this,Zt,"f")[r]&&delete S(this,Zt,"f")[r];const i={};return S(this,Et,"f")[r]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){
|
|
196
196
|
return ce("<string>",[e],arguments.length),S(this,le,"f").hiddenOptions.push(e),this}implies(e,r){return ce("<string|object> [number|string|array]",[e,r],arguments.length),S(this,Ie,"f").implies(e,r),this}locale(e){return ce("[string]",[e],arguments.length),e===void 0?(this[ys](),S(this,de,"f").y18n.getLocale()):(ue(this,Xt,!1,"f"),S(this,de,"f").y18n.setLocale(e),this)}middleware(e,r,n){return S(this,tt,"f").addMiddleware(e,!!r,n)}nargs(e,r){return ce("<string|object|array> [number]",[e,r],arguments.
|
|
197
|
-
length),this[gr](this.nargs.bind(this),"narg",e,r),this}normalize(e){return ce("<array|string>",[e],arguments.length),this[jt]("normalize",e),this}number(e){return ce("<array|string>",[e],arguments.length),this[jt]("number",e),this[sr](e),this}option(e,r){if(ce("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[sr](e),S(this,
|
|
197
|
+
length),this[gr](this.nargs.bind(this),"narg",e,r),this}normalize(e){return ce("<array|string>",[e],arguments.length),this[jt]("normalize",e),this}number(e){return ce("<array|string>",[e],arguments.length),this[jt]("number",e),this[sr](e),this}option(e,r){if(ce("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[sr](e),S(this,Dt,"f")&&(e==="version"||r?.alias==="version")&&this[Ru](['"version\
|
|
198
198
|
" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
199
199
|
`),void 0,"versionWarning"),S(this,le,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);const n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);const i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),
|
|
200
200
|
r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global==
|
|
201
201
|
"boolean"&&this.global(e,r.global),r.defaultDescription&&(S(this,le,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);const s=r.describe||r.description||r.desc,o=S(this,he,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,e)||typeof s=="string")&&this.describe(e,s),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){ce("[string|array] [function|boolean|object] [function]",[e,
|
|
202
|
-
r,n],arguments.length),this[
|
|
203
|
-
this.parsed=s}):(S(this,Ye,"f")&&S(this,Ye,"f").call(this,S(this,Tt,"f"),i,S(this,ke,"f")),this[ws](),this.parsed=s,i)}parseAsync(e,r,n){const i=this.parse(e,r,n);return Le(i)?i:Promise.resolve(i)}parseSync(e,r,n){const i=this.parse(e,r,n);if(Le(i))throw new je(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return ce("<object>",[e],arguments.length),ue(this,
|
|
202
|
+
r,n],arguments.length),this[Ou](),typeof e>"u"&&(e=S(this,Lt,"f")),typeof r=="object"&&(ue(this,Qt,r,"f"),r=n),typeof r=="function"&&(ue(this,Ye,r,"f"),r=!1),r||ue(this,Lt,e,"f"),S(this,Ye,"f")&&ue(this,et,!1,"f");const i=this[Vr](e,!!r),s=this.parsed;return S(this,Ze,"f").setParsed(this.parsed),Le(i)?i.then(o=>(S(this,Ye,"f")&&S(this,Ye,"f").call(this,S(this,Tt,"f"),o,S(this,ke,"f")),o)).catch(o=>{throw S(this,Ye,"f")&&S(this,Ye,"f")(o,this.parsed.argv,S(this,ke,"f")),o}).finally(()=>{this[ws](),
|
|
203
|
+
this.parsed=s}):(S(this,Ye,"f")&&S(this,Ye,"f").call(this,S(this,Tt,"f"),i,S(this,ke,"f")),this[ws](),this.parsed=s,i)}parseAsync(e,r,n){const i=this.parse(e,r,n);return Le(i)?i:Promise.resolve(i)}parseSync(e,r,n){const i=this.parse(e,r,n);if(Le(i))throw new je(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return ce("<object>",[e],arguments.length),ue(this,Dn,e,"f"),this}pkgConf(e,r){ce("<string> [string]",[e,r],arguments.length);
|
|
204
204
|
let n=null;const i=this[Es](r||S(this,Jt,"f"));return i[e]&&typeof i[e]=="object"&&(n=ms(i[e],r||S(this,Jt,"f"),this[nr]()["deep-merge-config"]||!1,S(this,de,"f")),S(this,le,"f").configObjects=(S(this,le,"f").configObjects||[]).concat(n)),this}positional(e,r){ce("<string> <object>",[e,r],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=Mr(r,(o,a)=>o==="type"&&!["string","number","boole\
|
|
205
|
-
an"].includes(a)?!1:n.includes(o));const i=S(this,Hr,"f").fullCommands[S(this,Hr,"f").fullCommands.length-1],s=i?S(this,Fe,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return
|
|
205
|
+
an"].includes(a)?!1:n.includes(o));const i=S(this,Hr,"f").fullCommands[S(this,Hr,"f").fullCommands.length-1],s=i?S(this,Fe,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return dn(s).forEach(o=>{const a=s[o];Array.isArray(a)?a.indexOf(e)!==-1&&(r[o]=!0):a[e]&&!(o in r)&&(r[o]=a[e])}),this.group(e,S(this,he,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return ce("[boolean]",[e],arguments.length),ue(this,vn,e,"f"),this}required(e,r,n){return this.demand(
|
|
206
206
|
e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return ce("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&S(this,le,"f").narg[e]?this:(this[gr](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return ce("[string] [string]",[e,r],arguments.length),e=e||this.$0,S(this,pr,"f").log(S(this,Ze,"f").generateCompletionScript(e,r||S(this,We,"f")||"completion")),this}showHelp(e){if(ce("[string|function]",[e],arguments.length),ue(this,Ke,!0,
|
|
207
207
|
"f"),!S(this,he,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[Vr](S(this,Lt,"f"),void 0,void 0,0,!0);if(Le(n))return n.then(()=>{S(this,he,"f").showHelp(e)}),this}const r=S(this,Fe,"f").runDefaultBuilderOn(this);if(Le(r))return r.then(()=>{S(this,he,"f").showHelp(e)}),this}return S(this,he,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return ce("[boolean|string] [string]",[e,r],arguments.length),S(this,he,"f").showHelpOnFail(e,
|
|
208
208
|
r),this}showVersion(e){return ce("[string|function]",[e],arguments.length),S(this,he,"f").showVersion(e),this}skipValidation(e){return ce("<array|string>",[e],arguments.length),this[jt]("skipValidation",e),this}strict(e){return ce("[boolean]",[e],arguments.length),ue(this,er,e!==!1,"f"),this}strictCommands(e){return ce("[boolean]",[e],arguments.length),ue(this,tr,e!==!1,"f"),this}strictOptions(e){return ce("[boolean]",[e],arguments.length),ue(this,rr,e!==!1,"f"),this}string(e){return ce("<array|\
|
|
209
209
|
string>",[e],arguments.length),this[jt]("string",e),this[sr](e),this}terminalWidth(){return ce([],0),S(this,de,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return ce("<object>",[e],arguments.length),ue(this,Xt,!1,"f"),S(this,de,"f").y18n.updateLocale(e),this}usage(e,r,n,i){if(ce("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,i],arguments.length),r!==void 0){if(ot(e,null,S(this,de,"f")),(e||"").match(/^\$0( |$)/))return this.
|
|
210
|
-
command(e,r,n,i);throw new je(".usage() description must start with $0 if being used as alias for .command()")}else return S(this,he,"f").usage(e),this}usageConfiguration(e){return ce("<object>",[e],arguments.length),ue(this,
|
|
211
|
-
1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return ue(this,
|
|
212
|
-
et=new WeakMap,
|
|
213
|
-
log:(...e)=>{this[
|
|
214
|
-
`,"f"),ue(this,ke,S(this,ke,"f")+e.join(" "),"f")},error:(...e)=>{this[
|
|
215
|
-
`,"f"),ue(this,ke,S(this,ke,"f")+e.join(" "),"f")}}}[gs](e){
|
|
216
|
-
this,et,"f"),groups:S(this,
|
|
217
|
-
process.argv().slice(1,2):r=S(this,de,"f").process.argv().slice(0,1),e=r.map(n=>{const i=this[
|
|
218
|
-
this,de,"f").getEnv("LC_ALL")||S(this,de,"f").getEnv("LC_MESSAGES")||S(this,de,"f").getEnv("LANG")||S(this,de,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[
|
|
210
|
+
command(e,r,n,i);throw new je(".usage() description must start with $0 if being used as alias for .command()")}else return S(this,he,"f").usage(e),this}usageConfiguration(e){return ce("<object>",[e],arguments.length),ue(this,$n,e,"f"),this}version(e,r,n){const i="version";if(ce("[boolean|string] [string] [string]",[e,r,n],arguments.length),S(this,Dt,"f")&&(this[gs](S(this,Dt,"f")),S(this,he,"f").version(void 0),ue(this,Dt,null,"f")),arguments.length===0)n=this[Pu](),e=i;else if(arguments.length===
|
|
211
|
+
1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return ue(this,Dt,typeof e=="string"?e:i,"f"),r=r||S(this,he,"f").deferY18nLookup("Show version number"),S(this,he,"f").version(n||void 0),this.boolean(S(this,Dt,"f")),this.describe(S(this,Dt,"f"),r),this}wrap(e){return ce("<number|null|undefined>",[e],arguments.length),S(this,he,"f").wrap(e),this}[(Fe=new WeakMap,Jt=new WeakMap,Hr=new WeakMap,Ze=new WeakMap,We=new WeakMap,pn=new WeakMap,Tt=new WeakMap,Xt=new WeakMap,mn=new WeakMap,
|
|
212
|
+
et=new WeakMap,gn=new WeakMap,tt=new WeakMap,Et=new WeakMap,Ke=new WeakMap,rt=new WeakMap,yn=new WeakMap,pr=new WeakMap,ke=new WeakMap,le=new WeakMap,En=new WeakMap,Dn=new WeakMap,Ye=new WeakMap,Qt=new WeakMap,mr=new WeakMap,Zt=new WeakMap,Lt=new WeakMap,vn=new WeakMap,de=new WeakMap,er=new WeakMap,tr=new WeakMap,rr=new WeakMap,he=new WeakMap,$n=new WeakMap,Dt=new WeakMap,Ie=new WeakMap,Cu)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Su](){return{
|
|
213
|
+
log:(...e)=>{this[_n]()||console.log(...e),ue(this,Ke,!0,"f"),S(this,ke,"f").length&&ue(this,ke,S(this,ke,"f")+`
|
|
214
|
+
`,"f"),ue(this,ke,S(this,ke,"f")+e.join(" "),"f")},error:(...e)=>{this[_n]()||console.error(...e),ue(this,Ke,!0,"f"),S(this,ke,"f").length&&ue(this,ke,S(this,ke,"f")+`
|
|
215
|
+
`,"f"),ue(this,ke,S(this,ke,"f")+e.join(" "),"f")}}}[gs](e){dn(S(this,le,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;const n=S(this,le,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete S(this,he,"f").getDescriptions()[e]}[Ru](e,r,n){S(this,mn,"f")[n]||(S(this,de,"f").process.emitWarning(e,r),S(this,mn,"f")[n]=!0)}[Ou](){S(this,gn,"f").push({options:S(this,le,"f"),configObjects:S(this,le,"f").configObjects.slice(0),exitProcess:S(
|
|
216
|
+
this,et,"f"),groups:S(this,Et,"f"),strict:S(this,er,"f"),strictCommands:S(this,tr,"f"),strictOptions:S(this,rr,"f"),completionCommand:S(this,We,"f"),output:S(this,ke,"f"),exitError:S(this,Tt,"f"),hasOutput:S(this,Ke,"f"),parsed:this.parsed,parseFn:S(this,Ye,"f"),parseContext:S(this,Qt,"f")}),S(this,he,"f").freeze(),S(this,Ie,"f").freeze(),S(this,Fe,"f").freeze(),S(this,tt,"f").freeze()}[Iu](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(S(this,de,"f").process.argv()[0])?r=S(this,de,"f").
|
|
217
|
+
process.argv().slice(1,2):r=S(this,de,"f").process.argv().slice(0,1),e=r.map(n=>{const i=this[Hu](S(this,Jt,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),S(this,de,"f").getEnv("_")&&S(this,de,"f").getProcessArgvBin()===S(this,de,"f").getEnv("_")&&(e=S(this,de,"f").getEnv("_").replace(`${S(this,de,"f").path.dirname(S(this,de,"f").process.execPath())}/`,"")),e}[nr](){return S(this,Dn,"f")}[Fu](){return S(this,$n,"f")}[ys](){if(!S(this,Xt,"f"))return;const e=S(
|
|
218
|
+
this,de,"f").getEnv("LC_ALL")||S(this,de,"f").getEnv("LC_MESSAGES")||S(this,de,"f").getEnv("LANG")||S(this,de,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Pu](){return this[Es]().version||"unknown"}[Nu](e){const r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)S(this,de,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[Es](e){const r=e||"*";if(S(this,mr,"f")[r])return S(this,mr,"f")[r];let n={};try{let i=e||
|
|
219
219
|
S(this,de,"f").mainFilename;!e&&S(this,de,"f").path.extname(i)&&(i=S(this,de,"f").path.dirname(i));const s=S(this,de,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});ot(s,void 0,S(this,de,"f")),n=JSON.parse(S(this,de,"f").readFileSync(s,"utf8"))}catch{}return S(this,mr,"f")[r]=n||{},S(this,mr,"f")[r]}[jt](e,r){r=[].concat(r),r.forEach(n=>{n=this[$s](n),S(this,le,"f")[e].push(n)})}[gr](e,r,n,i){this[vs](e,r,n,i,(s,o,a)=>{S(this,le,"f")[s][o]=a})}[Ds](e,r,n,i){this[vs](e,
|
|
220
|
-
r,n,i,(s,o,a)=>{S(this,le,"f")[s][o]=(S(this,le,"f")[s][o]||[]).concat(a)})}[vs](e,r,n,i,s){if(Array.isArray(n))n.forEach(o=>{e(o,i)});else if((o=>typeof o=="object")(n))for(const o of
|
|
221
|
-
d=this,h=this,{options:{set value(
|
|
222
|
-
ue(u,We,
|
|
223
|
-
bind(this),getUsageConfiguration:this[
|
|
224
|
-
return S(this,Qt,"f")||{}}[
|
|
225
|
-
r.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(a=>{n[a]=!0})}),Object.assign(S(this,Zt,"f"),Object.keys(S(this,
|
|
220
|
+
r,n,i,(s,o,a)=>{S(this,le,"f")[s][o]=(S(this,le,"f")[s][o]||[]).concat(a)})}[vs](e,r,n,i,s){if(Array.isArray(n))n.forEach(o=>{e(o,i)});else if((o=>typeof o=="object")(n))for(const o of dn(n))e(o,n[o]);else s(r,this[$s](n),i)}[$s](e){return e==="__proto__"?"___proto___":e}[_s](e,r){return this[gr](this[_s].bind(this),"key",e,r),this}[ws](){var e,r,n,i,s,o,a,c,l,u,d,h;const E=S(this,gn,"f").pop();ot(E,void 0,S(this,de,"f"));let $;e=this,r=this,n=this,i=this,s=this,o=this,a=this,c=this,l=this,u=this,
|
|
221
|
+
d=this,h=this,{options:{set value(y){ue(e,le,y,"f")}}.value,configObjects:$,exitProcess:{set value(y){ue(r,et,y,"f")}}.value,groups:{set value(y){ue(n,Et,y,"f")}}.value,output:{set value(y){ue(i,ke,y,"f")}}.value,exitError:{set value(y){ue(s,Tt,y,"f")}}.value,hasOutput:{set value(y){ue(o,Ke,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){ue(a,er,y,"f")}}.value,strictCommands:{set value(y){ue(c,tr,y,"f")}}.value,strictOptions:{set value(y){ue(l,rr,y,"f")}}.value,completionCommand:{set value(y){
|
|
222
|
+
ue(u,We,y,"f")}}.value,parseFn:{set value(y){ue(d,Ye,y,"f")}}.value,parseContext:{set value(y){ue(h,Qt,y,"f")}}.value}=E,S(this,le,"f").configObjects=$,S(this,he,"f").unfreeze(),S(this,Ie,"f").unfreeze(),S(this,Fe,"f").unfreeze(),S(this,tt,"f").unfreeze()}[Tu](e,r){return xr(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Lu].bind(this),getContext:this[ju].bind(this),getHasOutput:this[ku].bind(this),getLoggerInstance:this[Bu].bind(this),getParseContext:this[xu].bind(this),getParserConfiguration:this[nr].
|
|
223
|
+
bind(this),getUsageConfiguration:this[Fu].bind(this),getUsageInstance:this[Mu].bind(this),getValidationInstance:this[qu].bind(this),hasParseCallback:this[_n].bind(this),isGlobalContext:this[Uu].bind(this),postProcess:this[ir].bind(this),reset:this[bs].bind(this),runValidation:this[As].bind(this),runYargsParserAndExecuteCommands:this[Vr].bind(this),setHasOutput:this[Vu].bind(this)}}[Lu](){return S(this,Fe,"f")}[ju](){return S(this,Hr,"f")}[ku](){return S(this,Ke,"f")}[Bu](){return S(this,pr,"f")}[xu](){
|
|
224
|
+
return S(this,Qt,"f")||{}}[Mu](){return S(this,he,"f")}[qu](){return S(this,Ie,"f")}[_n](){return!!S(this,Ye,"f")}[Uu](){return S(this,yn,"f")}[ir](e,r,n,i){return n||Le(e)||(r||(e=this[Cu](e)),(this[nr]()["parse-positional-numbers"]||this[nr]()["parse-positional-numbers"]===void 0)&&(e=this[Nu](e)),i&&(e=Br(e,this,S(this,tt,"f").getMiddleware(),!1))),e}[bs](e={}){ue(this,le,S(this,le,"f")||{},"f");const r={};r.local=S(this,le,"f").local||[],r.configObjects=S(this,le,"f").configObjects||[];const n={};
|
|
225
|
+
r.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(a=>{n[a]=!0})}),Object.assign(S(this,Zt,"f"),Object.keys(S(this,Et,"f")).reduce((o,a)=>{const c=S(this,Et,"f")[a].filter(l=>!(l in n));return c.length>0&&(o[a]=c),o},{})),ue(this,Et,{},"f");const i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{r[o]=(S(this,
|
|
226
226
|
le,"f")[o]||[]).filter(a=>!n[a])}),s.forEach(o=>{r[o]=Mr(S(this,le,"f")[o],a=>!n[a])}),r.envPrefix=S(this,le,"f").envPrefix,ue(this,le,r,"f"),ue(this,he,S(this,he,"f")?S(this,he,"f").reset(n):c0(this,S(this,de,"f")),"f"),ue(this,Ie,S(this,Ie,"f")?S(this,Ie,"f").reset(n):E0(this,S(this,he,"f"),S(this,de,"f")),"f"),ue(this,Fe,S(this,Fe,"f")?S(this,Fe,"f").reset():i0(S(this,he,"f"),S(this,Ie,"f"),S(this,tt,"f"),S(this,de,"f")),"f"),S(this,Ze,"f")||ue(this,Ze,p0(this,S(this,he,"f"),S(this,Fe,"f"),S(
|
|
227
|
-
this,de,"f")),"f"),S(this,tt,"f").reset(),ue(this,We,null,"f"),ue(this,ke,"","f"),ue(this,Tt,null,"f"),ue(this,Ke,!1,"f"),this.parsed=!1,this}[
|
|
228
|
-
S(this,le,"f"),{configuration:{"parse-positional-numbers":!1,...c}})),u=Object.assign(l.argv,S(this,Qt,"f"));let d;const h=l.aliases;let E=!1
|
|
229
|
-
|
|
230
|
-
et,"f")&&qr(!0),this.showCompletionScript(),this.exit(0))}if(S(this,Fe,"f").hasDefaultCommand()&&!g){const p=S(this,Fe,"f").runCommand(null,this,l,0,s,E
|
|
231
|
-
o=!0,this.showHelp("log"),this.exit(0))
|
|
232
|
-
je)S(this,he,"f").fail(
|
|
233
|
-
Ie,"f").conflicting(o)}}[
|
|
234
|
-
lean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},wn={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:De},Cs={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},
|
|
235
|
-
boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},C0={alias:"l",type:"string",desc:"ip address of the network interface to listen on",default:"127.0.0.1"},
|
|
236
|
-
r==="directory"&&a?.isDirectory())return o}catch{}i=be.dirname(i)}}function R0({cwd:t=Te.cwd()}={}){return S0("package.json",{cwd:t})}const Ss=
|
|
227
|
+
this,de,"f")),"f"),S(this,tt,"f").reset(),ue(this,We,null,"f"),ue(this,ke,"","f"),ue(this,Tt,null,"f"),ue(this,Ke,!1,"f"),this.parsed=!1,this}[Hu](e,r){return S(this,de,"f").path.relative(e,r)}[Vr](e,r,n,i=0,s=!1){let o=!!n||s;e=e||S(this,Lt,"f"),S(this,le,"f").__=S(this,de,"f").y18n.__,S(this,le,"f").configuration=this[nr]();const a=!!S(this,le,"f").configuration["populate--"],c=Object.assign({},S(this,le,"f").configuration,{"populate--":!0}),l=S(this,de,"f").Parser.detailed(e,Object.assign({},
|
|
228
|
+
S(this,le,"f"),{configuration:{"parse-positional-numbers":!1,...c}})),u=Object.assign(l.argv,S(this,Qt,"f"));let d;const h=l.aliases;let E=!1,$=!1;Object.keys(u).forEach(y=>{y===S(this,rt,"f")&&u[y]?E=!0:y===S(this,Dt,"f")&&u[y]&&($=!0)}),u.$0=this.$0,this.parsed=l,i===0&&S(this,he,"f").clearCachedHelpMessage();try{if(this[ys](),r)return this[ir](u,a,!!n,!1);S(this,rt,"f")&&[S(this,rt,"f")].concat(h[S(this,rt,"f")]||[]).filter(m=>m.length>1).includes(""+u._[u._.length-1])&&(u._.pop(),E=!0),ue(this,
|
|
229
|
+
yn,!1,"f");const y=S(this,Fe,"f").getCommands(),f=S(this,Ze,"f").completionKey in u,g=E||f||s;if(u._.length){if(y.length){let p;for(let m=i||0,D;u._[m]!==void 0;m++)if(D=String(u._[m]),y.includes(D)&&D!==S(this,We,"f")){const v=S(this,Fe,"f").runCommand(D,this,l,m+1,s,E||$||s);return this[ir](v,a,!!n,!1)}else if(!p&&D!==S(this,We,"f")){p=D;break}!S(this,Fe,"f").hasDefaultCommand()&&S(this,vn,"f")&&p&&!g&&S(this,Ie,"f").recommendCommands(p,y)}S(this,We,"f")&&u._.includes(S(this,We,"f"))&&!f&&(S(this,
|
|
230
|
+
et,"f")&&qr(!0),this.showCompletionScript(),this.exit(0))}if(S(this,Fe,"f").hasDefaultCommand()&&!g){const p=S(this,Fe,"f").runCommand(null,this,l,0,s,E||$||s);return this[ir](p,a,!!n,!1)}if(f){S(this,et,"f")&&qr(!0),e=[].concat(e);const p=e.slice(e.indexOf(`--${S(this,Ze,"f").completionKey}`)+1);return S(this,Ze,"f").getCompletion(p,(m,D)=>{if(m)throw new je(m.message);(D||[]).forEach(v=>{S(this,pr,"f").log(v)}),this.exit(0)}),this[ir](u,!a,!!n,!1)}if(S(this,Ke,"f")||(E?(S(this,et,"f")&&qr(!0),
|
|
231
|
+
o=!0,this.showHelp("log"),this.exit(0)):$&&(S(this,et,"f")&&qr(!0),o=!0,S(this,he,"f").showVersion("log"),this.exit(0))),!o&&S(this,le,"f").skipValidation.length>0&&(o=Object.keys(u).some(p=>S(this,le,"f").skipValidation.indexOf(p)>=0&&u[p]===!0)),!o){if(l.error)throw new je(l.error.message);if(!f){const p=this[As](h,{},l.error);n||(d=Br(u,this,S(this,tt,"f").getMiddleware(),!0)),d=this[Tu](p,d??u),Le(d)&&!n&&(d=d.then(()=>Br(u,this,S(this,tt,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof
|
|
232
|
+
je)S(this,he,"f").fail(y.message,y);else throw y}return this[ir](d??u,a,!!n,!0)}[As](e,r,n,i){const s={...this.getDemandedOptions()};return o=>{if(n)throw new je(n.message);S(this,Ie,"f").nonOptionCount(o),S(this,Ie,"f").requiredArguments(o,s);let a=!1;S(this,tr,"f")&&(a=S(this,Ie,"f").unknownCommands(o)),S(this,er,"f")&&!a?S(this,Ie,"f").unknownArguments(o,e,r,!!i):S(this,rr,"f")&&S(this,Ie,"f").unknownArguments(o,e,{},!1,!1),S(this,Ie,"f").limitedChoices(o),S(this,Ie,"f").implications(o),S(this,
|
|
233
|
+
Ie,"f").conflicting(o)}}[Vu](){ue(this,Ke,!0,"f")}[sr](e){if(typeof e=="string")S(this,le,"f").key[e]=!0;else for(const r of e)S(this,le,"f").key[r]=!0}}function w0(t){return!!t&&typeof t.getInternalMethods=="function"}const b0=$0(Xm),zr={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:De},at={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:'use graphviz binaries ("dot" should be on PATH)',default:!1},zu={boolean:!0,type:"boo\
|
|
234
|
+
lean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},wn={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:De},Cs={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},Gu={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"'},Wu={boolean:!0,type:"boolean",desc:"overview all diagrams as graph [experimental]",default:!1},A0={boolean:!0,type:"\
|
|
235
|
+
boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},C0={alias:"l",type:"string",desc:"ip address of the network interface to listen on",default:"127.0.0.1"},Ku=t=>t instanceof URL?Qa(t):t;function S0(t,{cwd:e=Te.cwd(),type:r="file",stopAt:n}={}){let i=be.resolve(Ku(e)??"");const{root:s}=be.parse(i);for(n=be.resolve(i,Ku(n)??s);i&&i!==n&&i!==s;){const o=be.isAbsolute(t)?t:be.join(i,t);try{const a=ge.statSync(o,{throwIfNoEntry:!1});if(r==="file"&&a?.isFile()||
|
|
236
|
+
r==="directory"&&a?.isDirectory())return o}catch{}i=be.dirname(i)}}function R0({cwd:t=Te.cwd()}={}){return S0("package.json",{cwd:t})}const Ss=pt("vite"),bn=Gt(Qa(import.meta.url)),O0=`
|
|
237
237
|
/* prettier-ignore-start */
|
|
238
238
|
/* eslint-disable */
|
|
239
239
|
|
|
@@ -245,153 +245,153 @@ r==="directory"&&a?.isDirectory())return o}catch{}i=be.dirname(i)}}function R0({
|
|
|
245
245
|
`.trimStart(),I0=`
|
|
246
246
|
|
|
247
247
|
/* prettier-ignore-end */
|
|
248
|
-
`,Rs={banner:O0,footer:I0};function
|
|
248
|
+
`,Rs={banner:O0,footer:I0};function Yu(){const t=R0({cwd:bn});if(!t)throw new Error("likec4 package folder not found");return Gt(t)}function Os(){const t=Yu(),e=[De(t,"__app__"),De(bn,"../__app__"),De(bn,"../../__app__"),De(bn,"../../dist/__app__")],r=yp(e,Pt);if(!r)throw mt.error(`likec4 app root does not exist, tried:
|
|
249
249
|
${e.join(`
|
|
250
|
-
`)}`),new Error("likec4 app root does not exist");return r}async function Is(){const t=await
|
|
251
|
-
`),t}const Fs=1e4;function Ps(){const t=
|
|
250
|
+
`)}`),new Error("likec4 app root does not exist");return r}async function Is(){const t=await an(Rr(un(),".likec4-public-"));return await Kt(Rr(t,"likec4-views.js"),`// generated by likec4
|
|
251
|
+
`),t}const Fs=1e4;function Ps(){const t=Yu();return{"likec4/icons":De(t,"icons"),"likec4/react":De(t,"react"),"likec4/model":De(t,"dist/model")}}var Ns={},Ju;function Ts(){return Ju||(Ju=1,function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,r)=>e.nodes.find(n=>n.type===r),t.exceedsLimit=(e,r,n=1,i)=>i===!1||!t.isInteger(e)||!t.isInteger(r)?!1:(Number(r)-Number(e))/Number(n)>=i,t.escapeNode=(e,r=0,n)=>{const i=e.
|
|
252
252
|
nodes[r];i&&(n&&i.type===n||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&
|
|
253
|
-
(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=i=>{for(let s=0;s<i.length;s++){const o=i[s];if(Array.isArray(o)){n(o);continue}o!==void 0&&r.push(o)}return r};return n(e),r}}(Ns)),Ns}var Ls,
|
|
254
|
-
nodes)c+=n(l);return c};return n(e)},Ls}var ks,
|
|
255
|
-
o be a number.");let m={relaxZeros:!0,...p};typeof m.strictZeros=="boolean"&&(m.relaxZeros=m.strictZeros===!1);let
|
|
256
|
-
0){let M=G<0?Math.abs(G):1;j=s(M,Math.abs(
|
|
257
|
-
|
|
258
|
-
G.count[0]),b.string=b.pattern+h(b.count),_=
|
|
259
|
-
repeat(g))}function d(f,g){return f-f%Math.pow(10,g)}function h(f){let[g=0,p=""]=f;return p||g>1?`{${g+(p?","+p:"")}}`:""}function E(f,g,p){return`[${f}${g-f===1?"":"-"}${g}]`}function
|
|
260
|
-
|
|
261
|
-
m):m},l=(m,
|
|
262
|
-
m);if(m===
|
|
263
|
-
b)||!Number.isInteger(I)){if(_.strictRanges===!0)throw E([m,
|
|
264
|
-
|
|
265
|
-
m,
|
|
266
|
-
!0)return d+o.value;if(o.isClose===!0)return console.log("node.isClose",d,o.value),d+o.value;if(o.type==="open")return u?d+o.value:"(";if(o.type==="close")return u?d+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":u?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const E=e.reduce(o.nodes)
|
|
267
|
-
|
|
253
|
+
(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=i=>{for(let s=0;s<i.length;s++){const o=i[s];if(Array.isArray(o)){n(o);continue}o!==void 0&&r.push(o)}return r};return n(e),r}}(Ns)),Ns}var Ls,Xu;function js(){if(Xu)return Ls;Xu=1;const t=Ts();return Ls=(e,r={})=>{const n=(i,s={})=>{const o=r.escapeInvalid&&t.isInvalidBrace(s),a=i.invalid===!0&&r.escapeInvalid===!0;let c="";if(i.value)return(o||a)&&t.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const l of i.
|
|
254
|
+
nodes)c+=n(l);return c};return n(e)},Ls}var ks,Qu;function F0(){return Qu||(Qu=1,ks=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}),ks}var Bs,Zu;function P0(){if(Zu)return Bs;Zu=1;const t=F0(),e=(f,g,p)=>{if(t(f)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(g===void 0||f===g)return String(f);if(t(g)===!1)throw new TypeError("toRegexRange: expected the second argument t\
|
|
255
|
+
o be a number.");let m={relaxZeros:!0,...p};typeof m.strictZeros=="boolean"&&(m.relaxZeros=m.strictZeros===!1);let D=String(m.relaxZeros),v=String(m.shorthand),_=String(m.capture),b=String(m.wrap),I=f+":"+g+"="+D+v+_+b;if(e.cache.hasOwnProperty(I))return e.cache[I].result;let U=Math.min(f,g),G=Math.max(f,g);if(Math.abs(U-G)===1){let M=f+"|"+g;return m.capture?`(${M})`:m.wrap===!1?M:`(?:${M})`}let L=$(f)||$(g),B={min:f,max:g,a:U,b:G},N=[],j=[];if(L&&(B.isPadded=L,B.maxLen=String(B.max).length),U<
|
|
256
|
+
0){let M=G<0?Math.abs(G):1;j=s(M,Math.abs(U),B,m),U=B.a=0}return G>=0&&(N=s(U,G,B,m)),B.negatives=j,B.positives=N,B.result=r(j,N),m.capture===!0?B.result=`(${B.result})`:m.wrap!==!1&&N.length+j.length>1&&(B.result=`(?:${B.result})`),e.cache[I]=B,B.result};function r(f,g,p){let m=o(f,g,"-",!1)||[],D=o(g,f,"",!1)||[],v=o(f,g,"-?",!0)||[];return m.concat(v).concat(D).join("|")}function n(f,g){let p=1,m=1,D=u(f,p),v=new Set([g]);for(;f<=D&&D<=g;)v.add(D),p+=1,D=u(f,p);for(D=d(g+1,m)-1;f<D&&D<=g;)v.add(
|
|
257
|
+
D),m+=1,D=d(g+1,m)-1;return v=[...v],v.sort(c),v}function i(f,g,p){if(f===g)return{pattern:f,count:[],digits:0};let m=a(f,g),D=m.length,v="",_=0;for(let b=0;b<D;b++){let[I,U]=m[b];I===U?v+=I:I!=="0"||U!=="9"?v+=E(I,U):_++}return _&&(v+=p.shorthand===!0?"\\d":"[0-9]"),{pattern:v,count:[_],digits:D}}function s(f,g,p,m){let D=n(f,g),v=[],_=f,b;for(let I=0;I<D.length;I++){let U=D[I],G=i(String(_),String(U),m),L="";if(!p.isPadded&&b&&b.pattern===G.pattern){b.count.length>1&&b.count.pop(),b.count.push(
|
|
258
|
+
G.count[0]),b.string=b.pattern+h(b.count),_=U+1;continue}p.isPadded&&(L=y(U,p,m)),G.string=L+G.pattern+h(G.count),v.push(G),_=U+1,b=G}return v}function o(f,g,p,m,D){let v=[];for(let _ of f){let{string:b}=_;!m&&!l(g,"string",b)&&v.push(p+b),m&&l(g,"string",b)&&v.push(p+b)}return v}function a(f,g){let p=[];for(let m=0;m<f.length;m++)p.push([f[m],g[m]]);return p}function c(f,g){return f>g?1:g>f?-1:0}function l(f,g,p){return f.some(m=>m[g]===p)}function u(f,g){return Number(String(f).slice(0,-g)+"9".
|
|
259
|
+
repeat(g))}function d(f,g){return f-f%Math.pow(10,g)}function h(f){let[g=0,p=""]=f;return p||g>1?`{${g+(p?","+p:"")}}`:""}function E(f,g,p){return`[${f}${g-f===1?"":"-"}${g}]`}function $(f){return/^-?(0+)\d/.test(f)}function y(f,g,p){if(!g.isPadded)return f;let m=Math.abs(g.maxLen-String(f).length),D=p.relaxZeros!==!1;switch(m){case 0:return"";case 1:return D?"0?":"0";case 2:return D?"0{0,2}":"00";default:return D?`0{0,${m}}`:`0{${m}}`}}return e.cache={},e.clearCache=()=>e.cache={},Bs=e,Bs}var xs,
|
|
260
|
+
ec;function tc(){if(ec)return xs;ec=1;const t=Ya,e=P0(),r=m=>m!==null&&typeof m=="object"&&!Array.isArray(m),n=m=>D=>m===!0?Number(D):String(D),i=m=>typeof m=="number"||typeof m=="string"&&m!=="",s=m=>Number.isInteger(+m),o=m=>{let D=`${m}`,v=-1;if(D[0]==="-"&&(D=D.slice(1)),D==="0")return!1;for(;D[++v]==="0";);return v>0},a=(m,D,v)=>typeof m=="string"||typeof D=="string"?!0:v.stringify===!0,c=(m,D,v)=>{if(D>0){let _=m[0]==="-"?"-":"";_&&(m=m.slice(1)),m=_+m.padStart(_?D-1:D,"0")}return v===!1?String(
|
|
261
|
+
m):m},l=(m,D)=>{let v=m[0]==="-"?"-":"";for(v&&(m=m.slice(1),D--);m.length<D;)m="0"+m;return v?"-"+m:m},u=(m,D,v)=>{m.negatives.sort((G,L)=>G<L?-1:G>L?1:0),m.positives.sort((G,L)=>G<L?-1:G>L?1:0);let _=D.capture?"":"?:",b="",I="",U;return m.positives.length&&(b=m.positives.map(G=>l(String(G),v)).join("|")),m.negatives.length&&(I=`-(${_}${m.negatives.map(G=>l(String(G),v)).join("|")})`),b&&I?U=`${b}|${I}`:U=b||I,D.wrap?`(${_}${U})`:U},d=(m,D,v,_)=>{if(v)return e(m,D,{wrap:!1,..._});let b=String.fromCharCode(
|
|
262
|
+
m);if(m===D)return b;let I=String.fromCharCode(D);return`[${b}-${I}]`},h=(m,D,v)=>{if(Array.isArray(m)){let _=v.wrap===!0,b=v.capture?"":"?:";return _?`(${b}${m.join("|")})`:m.join("|")}return e(m,D,v)},E=(...m)=>new RangeError("Invalid range arguments: "+t.inspect(...m)),$=(m,D,v)=>{if(v.strictRanges===!0)throw E([m,D]);return[]},y=(m,D)=>{if(D.strictRanges===!0)throw new TypeError(`Expected step "${m}" to be a number`);return[]},f=(m,D,v=1,_={})=>{let b=Number(m),I=Number(D);if(!Number.isInteger(
|
|
263
|
+
b)||!Number.isInteger(I)){if(_.strictRanges===!0)throw E([m,D]);return[]}b===0&&(b=0),I===0&&(I=0);let U=b>I,G=String(m),L=String(D),B=String(v);v=Math.max(Math.abs(v),1);let N=o(G)||o(L)||o(B),j=N?Math.max(G.length,L.length,B.length):0,M=N===!1&&a(m,D,_)===!1,Y=_.transform||n(M);if(_.toRegex&&v===1)return d(l(m,j),l(D,j),!0,_);let z={negatives:[],positives:[]},X=C=>z[C<0?"negatives":"positives"].push(Math.abs(C)),se=[],q=0;for(;U?b>=I:b<=I;)_.toRegex===!0&&v>1?X(b):se.push(c(Y(b,q),j,M)),b=U?b-
|
|
264
|
+
v:b+v,q++;return _.toRegex===!0?v>1?u(z,_,j):h(se,null,{wrap:!1,..._}):se},g=(m,D,v=1,_={})=>{if(!s(m)&&m.length>1||!s(D)&&D.length>1)return $(m,D,_);let b=_.transform||(M=>String.fromCharCode(M)),I=`${m}`.charCodeAt(0),U=`${D}`.charCodeAt(0),G=I>U,L=Math.min(I,U),B=Math.max(I,U);if(_.toRegex&&v===1)return d(L,B,!1,_);let N=[],j=0;for(;G?I>=U:I<=U;)N.push(b(I,j)),I=G?I-v:I+v,j++;return _.toRegex===!0?h(N,null,{wrap:!1,options:_}):N},p=(m,D,v,_={})=>{if(D==null&&i(m))return[m];if(!i(m)||!i(D))return $(
|
|
265
|
+
m,D,_);if(typeof v=="function")return p(m,D,1,{transform:v});if(r(v))return p(m,D,0,v);let b={..._};return b.capture===!0&&(b.wrap=!0),v=v||b.step||1,s(v)?s(m)&&s(D)?f(m,D,v,b):g(m,D,Math.max(Math.abs(v),1),b):v!=null&&!r(v)?y(v,b):p(m,D,1,v)};return xs=p,xs}var Ms,rc;function N0(){if(rc)return Ms;rc=1;const t=tc(),e=Ts();return Ms=(n,i={})=>{const s=(o,a={})=>{const c=e.isInvalidBrace(a),l=o.invalid===!0&&i.escapeInvalid===!0,u=c===!0||l===!0,d=i.escapeInvalid===!0?"\\":"";let h="";if(o.isOpen===
|
|
266
|
+
!0)return d+o.value;if(o.isClose===!0)return console.log("node.isClose",d,o.value),d+o.value;if(o.type==="open")return u?d+o.value:"(";if(o.type==="close")return u?d+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":u?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const E=e.reduce(o.nodes),$=t(...E,{...i,wrap:!1,toRegex:!0,strictZeros:!0});if($.length!==0)return E.length>1&&$.length>1?`(${$})`:$}if(o.nodes)for(const E of o.nodes)h+=s(E,o);return h};return s(n)},Ms}var qs,
|
|
267
|
+
nc;function T0(){if(nc)return qs;nc=1;const t=tc(),e=js(),r=Ts(),n=(s="",o="",a=!1)=>{const c=[];if(s=[].concat(s),o=[].concat(o),!o.length)return s;if(!s.length)return a?r.flatten(o).map(l=>`{${l}}`):o;for(const l of s)if(Array.isArray(l))for(const u of l)c.push(n(u,o,a));else for(let u of o)a===!0&&typeof u=="string"&&(u=`{${u}}`),c.push(Array.isArray(u)?n(l,u,a):l+u);return r.flatten(c)};return qs=(s,o={})=>{const a=o.rangeLimit===void 0?1e3:o.rangeLimit,c=(l,u={})=>{l.queue=[];let d=u,h=u.queue;
|
|
268
268
|
for(;d.type!=="brace"&&d.type!=="root"&&d.parent;)d=d.parent,h=d.queue;if(l.invalid||l.dollar){h.push(n(h.pop(),e(l,o)));return}if(l.type==="brace"&&l.invalid!==!0&&l.nodes.length===2){h.push(n(h.pop(),["{}"]));return}if(l.nodes&&l.ranges>0){const f=r.reduce(l.nodes);if(r.exceedsLimit(...f,o.step,a))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let g=t(...f,o);g.length===0&&(g=e(l,o)),h.push(n(h.pop(),g)),l.nodes=[];return}
|
|
269
|
-
const E=r.encloseBrace(l);let
|
|
269
|
+
const E=r.encloseBrace(l);let $=l.queue,y=l;for(;y.type!=="brace"&&y.type!=="root"&&y.parent;)y=y.parent,$=y.queue;for(let f=0;f<l.nodes.length;f++){const g=l.nodes[f];if(g.type==="comma"&&l.type==="brace"){f===1&&$.push(""),$.push("");continue}if(g.type==="close"){h.push(n(h.pop(),$,E));continue}if(g.value&&g.type!=="open"){$.push(n($.pop(),g.value));continue}g.nodes&&c(g,l)}return $};return r.flatten(c(s))},qs}var Us,ic;function L0(){return ic||(ic=1,Us={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"\
|
|
270
270
|
A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"\
|
|
271
271
|
{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
272
|
-
`,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"}),Us}var Hs,
|
|
273
|
-
CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:l,CHAR_LEFT_SQUARE_BRACKET:u,CHAR_RIGHT_SQUARE_BRACKET:d,CHAR_DOUBLE_QUOTE:h,CHAR_SINGLE_QUOTE:E,CHAR_NO_BREAK_SPACE:y
|
|
274
|
-
let b
|
|
275
|
-
j();continue}if(Y===d&&(
|
|
272
|
+
`,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"}),Us}var Hs,sc;function j0(){if(sc)return Hs;sc=1;const t=js(),{MAX_LENGTH:e,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:i,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,
|
|
273
|
+
CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:l,CHAR_LEFT_SQUARE_BRACKET:u,CHAR_RIGHT_SQUARE_BRACKET:d,CHAR_DOUBLE_QUOTE:h,CHAR_SINGLE_QUOTE:E,CHAR_NO_BREAK_SPACE:$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:y}=L0();return Hs=(g,p={})=>{if(typeof g!="string")throw new TypeError("Expected a string");const m=p||{},D=typeof m.maxLength=="number"?Math.min(e,m.maxLength):e;if(g.length>D)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${D})`);const v={type:"root",input:g,nodes:[]},_=[v];
|
|
274
|
+
let b=v,I=v,U=0;const G=g.length;let L=0,B=0,N;const j=()=>g[L++],M=Y=>{if(Y.type==="text"&&I.type==="dot"&&(I.type="text"),I&&I.type==="text"&&Y.type==="text"){I.value+=Y.value;return}return b.nodes.push(Y),Y.parent=b,Y.prev=I,I=Y,Y};for(M({type:"bos"});L<G;)if(b=_[_.length-1],N=j(),!(N===y||N===$)){if(N===r){M({type:"text",value:(p.keepEscaping?N:"")+j()});continue}if(N===d){M({type:"text",value:"\\"+N});continue}if(N===u){U++;let Y;for(;L<G&&(Y=j());){if(N+=Y,Y===u){U++;continue}if(Y===r){N+=
|
|
275
|
+
j();continue}if(Y===d&&(U--,U===0))break}M({type:"text",value:N});continue}if(N===o){b=M({type:"paren",nodes:[]}),_.push(b),M({type:"text",value:N});continue}if(N===a){if(b.type!=="paren"){M({type:"text",value:N});continue}b=_.pop(),M({type:"text",value:N}),b=_[_.length-1];continue}if(N===h||N===E||N===n){const Y=N;let z;for(p.keepQuotes!==!0&&(N="");L<G&&(z=j());){if(z===r){N+=z+j();continue}if(z===Y){p.keepQuotes===!0&&(N+=z);break}N+=z}M({type:"text",value:N});continue}if(N===c){B++;const z={
|
|
276
276
|
type:"brace",open:!0,close:!1,dollar:I.value&&I.value.slice(-1)==="$"||b.dollar===!0,depth:B,commas:0,ranges:0,nodes:[]};b=M(z),_.push(b),M({type:"open",value:N});continue}if(N===l){if(b.type!=="brace"){M({type:"text",value:N});continue}const Y="close";b=_.pop(),b.close=!0,M({type:Y,value:N}),B--,b=_[_.length-1];continue}if(N===i&&B>0){if(b.ranges>0){b.ranges=0;const Y=b.nodes.shift();b.nodes=[Y,{type:"text",value:t(b)}]}M({type:"comma",value:N}),b.commas++;continue}if(N===s&&B>0&&b.commas===0){
|
|
277
277
|
const Y=b.nodes;if(B===0||Y.length===0){M({type:"text",value:N});continue}if(I.type==="dot"){if(b.range=[],I.value+=N,I.type="range",b.nodes.length!==3&&b.nodes.length!==5){b.invalid=!0,b.ranges=0,I.type="text";continue}b.ranges++,b.args=[];continue}if(I.type==="range"){Y.pop();const z=Y[Y.length-1];z.value+=I.value+N,I=z,b.ranges--;continue}M({type:"dot",value:N});continue}M({type:"text",value:N})}do if(b=_.pop(),b.type!=="root"){b.nodes.forEach(X=>{X.nodes||(X.type==="open"&&(X.isOpen=!0),X.type===
|
|
278
|
-
"close"&&(X.isClose=!0),X.nodes||(X.type="text"),X.invalid=!0)});const Y=_[_.length-1],z=Y.nodes.indexOf(b);Y.nodes.splice(z,1,...b.nodes)}while(_.length>0);return M({type:"eos"})
|
|
279
|
-
s,o),i.stringify=(s,o={})=>t(typeof s=="string"?i.parse(s,o):s,o),i.compile=(s,o={})=>(typeof s=="string"&&(s=i.parse(s,o)),e(s,o)),i.expand=(s,o={})=>{typeof s=="string"&&(s=i.parse(s,o));let a=r(s,o);return o.noempty===!0&&(a=a.filter(Boolean)),o.nodupes===!0&&(a=[...new Set(a)]),a},i.create=(s,o={})=>s===""||s.length<3?[s]:o.expand!==!0?i.compile(s,o):i.expand(s,o),Vs=i,Vs}var zs={},Gs,
|
|
280
|
-
=.)",c="[^/]",l=`(?:${o}|$)`,u=`(?:^|${o})`,d=`${n}{1,2}${l}`,h=`(?!${n})`,E=`(?!${u}${d})
|
|
281
|
-
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},
|
|
278
|
+
"close"&&(X.isClose=!0),X.nodes||(X.type="text"),X.invalid=!0)});const Y=_[_.length-1],z=Y.nodes.indexOf(b);Y.nodes.splice(z,1,...b.nodes)}while(_.length>0);return M({type:"eos"}),v},Hs}var Vs,oc;function k0(){if(oc)return Vs;oc=1;const t=js(),e=N0(),r=T0(),n=j0(),i=(s,o={})=>{let a=[];if(Array.isArray(s))for(const c of s){const l=i.create(c,o);Array.isArray(l)?a.push(...l):a.push(l)}else a=[].concat(i.create(s,o));return o&&o.expand===!0&&o.nodupes===!0&&(a=[...new Set(a)]),a};return i.parse=(s,o={})=>n(
|
|
279
|
+
s,o),i.stringify=(s,o={})=>t(typeof s=="string"?i.parse(s,o):s,o),i.compile=(s,o={})=>(typeof s=="string"&&(s=i.parse(s,o)),e(s,o)),i.expand=(s,o={})=>{typeof s=="string"&&(s=i.parse(s,o));let a=r(s,o);return o.noempty===!0&&(a=a.filter(Boolean)),o.nodupes===!0&&(a=[...new Set(a)]),a},i.create=(s,o={})=>s===""||s.length<3?[s]:o.expand!==!0?i.compile(s,o):i.expand(s,o),Vs=i,Vs}var zs={},Gs,ac;function An(){if(ac)return Gs;ac=1;const t=es,e="\\\\/",r=`[^${e}]`,n="\\.",i="\\+",s="\\?",o="\\/",a="(?\
|
|
280
|
+
=.)",c="[^/]",l=`(?:${o}|$)`,u=`(?:^|${o})`,d=`${n}{1,2}${l}`,h=`(?!${n})`,E=`(?!${u}${d})`,$=`(?!${n}{0,1}${l})`,y=`(?!${d})`,f=`[^.${o}]`,g=`${c}*?`,p={DOT_LITERAL:n,PLUS_LITERAL:i,QMARK_LITERAL:s,SLASH_LITERAL:o,ONE_CHAR:a,QMARK:c,END_ANCHOR:l,DOTS_SLASH:d,NO_DOT:h,NO_DOTS:E,NO_DOT_SLASH:$,NO_DOTS_SLASH:y,QMARK_NO_DOT:f,STAR:g,START_ANCHOR:u},m={...p,SLASH_LITERAL:`[${e}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,
|
|
281
|
+
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},D={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 Gs={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:D,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
|
|
282
282
|
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,
|
|
283
283
|
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,
|
|
284
|
-
CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars(
|
|
284
|
+
CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars(v){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${v.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(v){return v===!0?m:p}},Gs}var uc;function Cn(){return uc||(uc=1,function(t){const e=es,r=process.
|
|
285
285
|
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:o}=An();t.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),t.hasRegexChars=a=>s.test(a),t.isRegexChar=a=>a.length===1&&t.hasRegexChars(a),t.escapeRegex=a=>a.replace(o,"\\$1"),t.toPosixSlashes=a=>a.replace(n,"/"),t.removeBackslashes=a=>a.replace(i,c=>c==="\\"?"":c),t.supportsLookbehinds=()=>{const a=process.version.slice(1).split(".").map(Number);return a.length===3&&a[0]>=9||
|
|
286
|
-
a[0]===8&&a[1]>=10},t.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:r===!0||e.sep==="\\",t.escapeLast=(a,c,l)=>{const u=a.lastIndexOf(c,l);return u===-1?a:a[u-1]==="\\"?t.escapeLast(a,c,u-1):`${a.slice(0,u)}\\${a.slice(u)}`},t.removePrefix=(a,c={})=>{let l=a;return l.startsWith("./")&&(l=l.slice(2),c.prefix="./"),l},t.wrapOutput=(a,c={},l={})=>{const u=l.contains?"":"^",d=l.contains?"":"$";let h=`${u}(?:${a})${d}`;return c.negated===!0&&(h=`(?:^(?!${h}).*$)`),h}}(zs)),zs}var Ws,
|
|
287
|
-
if(
|
|
288
|
-
G=[];let L=m,B=-1,N=0,j=0,M=!1,Y=!1,z=!1,X=!1,se=!1,q=!1,C=!1,
|
|
289
|
-
!0,z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(J===E&&(A--,A===0)){q=!1,M=Z.isBrace=!0,w=!0;break}}if(b===!0)continue;break}if(J===a){if(I.push(B),
|
|
290
|
-
break}if(J===e){if(R===e&&(se=Z.isGlobstar=!0),z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(J===h){if(z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(J===u){for(;oe()!==!0&&(P=T());){if(P===n){C=Z.backslashes=!0,T();continue}if(P===
|
|
291
|
-
continue}break}if(z===!0){if(w=!0,b===!0)continue;break}}
|
|
292
|
-
if(
|
|
293
|
-
if(
|
|
294
|
-
const h={...d},E=typeof h.maxLength=="number"?Math.min(r,h.maxLength):r;let
|
|
295
|
-
)*?)`,X=h.dot?"":G,se=h.dot?N:j;let q=h.bash===!0?z(h):M;h.capture&&(q=`(${q})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const C={input:u,index:-1,start:0,dot:h.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};u=e.removePrefix(u,C)
|
|
296
|
-
F,C.index+=re},x=F=>{C.output+=F.output!=null?F.output:F.value,T(F.value)},Q=()=>{let F=1;for(;Z()==="!"&&(Z(2)!=="("||Z(3)==="?");)oe(),C.start++,F++;return F%2===0?!1:(C.negated=!0,C.start++,!0)},ie=F=>{C[F]++,w.push(F)},O=F=>{C[F]--,w.pop()},P=F=>{if(A.type==="globstar"){const re=C.braces>0&&(F.type==="comma"||F.type==="brace"),
|
|
297
|
-
A.value="*",A.output=q,C.output+=A.output)}if(
|
|
298
|
-
let re=F.close+(h.capture?")":""),
|
|
299
|
-
"\\"?(F=!0,
|
|
300
|
-
R+="\\",P({type:"text",value:R});continue}const ne=/^\\+/.exec(ae());let fe=0;if(ne&&ne[0].length>2&&(fe=ne[0].length,C.index+=fe,fe%2!==0&&(R+="\\")),h.unescape===!0?R=oe():R+=oe(),C.brackets===0){P({type:"text",value:R});continue}}if(C.brackets>0&&(R!=="]"||A.value==="["||A.value==="[^")){if(h.posix!==!1&&R===":"){const
|
|
301
|
-
Oe,C.backtrack=!0,oe(),!
|
|
302
|
-
")"){if(C.parens===0&&h.strictBrackets===!0)throw new SyntaxError(c("opening","("));const H
|
|
303
|
-
1){P({type:"text",value:R,output:`\\${R}`});continue}if(C.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(c("opening","["));P({type:"text",value:R,output:`\\${R}`});continue}O("brackets");const
|
|
304
|
-
`(${g}${ne}|${A.value})`,C.output+=A.value;continue}if(R==="{"&&h.nobrace!==!0){ie("braces");const
|
|
305
|
-
!0}if(
|
|
306
|
-
if(A.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",f.pop(),A=
|
|
286
|
+
a[0]===8&&a[1]>=10},t.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:r===!0||e.sep==="\\",t.escapeLast=(a,c,l)=>{const u=a.lastIndexOf(c,l);return u===-1?a:a[u-1]==="\\"?t.escapeLast(a,c,u-1):`${a.slice(0,u)}\\${a.slice(u)}`},t.removePrefix=(a,c={})=>{let l=a;return l.startsWith("./")&&(l=l.slice(2),c.prefix="./"),l},t.wrapOutput=(a,c={},l={})=>{const u=l.contains?"":"^",d=l.contains?"":"$";let h=`${u}(?:${a})${d}`;return c.negated===!0&&(h=`(?:^(?!${h}).*$)`),h}}(zs)),zs}var Ws,cc;function B0(){
|
|
287
|
+
if(cc)return Ws;cc=1;const t=Cn(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:u,CHAR_PLUS:d,CHAR_QUESTION_MARK:h,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:$,CHAR_RIGHT_SQUARE_BRACKET:y}=An(),f=m=>m===a||m===n,g=m=>{m.isPrefix!==!0&&(m.depth=m.isGlobstar?1/0:1)};return Ws=(m,D)=>{const v=D||{},_=m.length-1,b=v.parts===!0||v.scanToEnd===!0,I=[],U=[],
|
|
288
|
+
G=[];let L=m,B=-1,N=0,j=0,M=!1,Y=!1,z=!1,X=!1,se=!1,q=!1,C=!1,H=!1,k=!1,w=!1,A=0,R,J,Z={value:"",depth:0,isGlob:!1};const oe=()=>B>=_,ae=()=>L.charCodeAt(B+1),T=()=>(R=J,L.charCodeAt(++B));for(;B<_;){J=T();let P;if(J===n){C=Z.backslashes=!0,J=T(),J===c&&(q=!0);continue}if(q===!0||J===c){for(A++;oe()!==!0&&(J=T());){if(J===n){C=Z.backslashes=!0,T();continue}if(J===c){A++;continue}if(q!==!0&&J===s&&(J=T())===s){if(M=Z.isBrace=!0,z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(q!==!0&&J===i){if(M=Z.isBrace=
|
|
289
|
+
!0,z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(J===E&&(A--,A===0)){q=!1,M=Z.isBrace=!0,w=!0;break}}if(b===!0)continue;break}if(J===a){if(I.push(B),U.push(Z),Z={value:"",depth:0,isGlob:!1},w===!0)continue;if(R===s&&B===N+1){N+=2;continue}j=B+1;continue}if(v.noext!==!0&&(J===d||J===r||J===e||J===h||J===o)===!0&&ae()===l){if(z=Z.isGlob=!0,X=Z.isExtglob=!0,w=!0,J===o&&B===N&&(k=!0),b===!0){for(;oe()!==!0&&(J=T());){if(J===n){C=Z.backslashes=!0,J=T();continue}if(J===$){z=Z.isGlob=!0,w=!0;break}}continue}
|
|
290
|
+
break}if(J===e){if(R===e&&(se=Z.isGlobstar=!0),z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(J===h){if(z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(J===u){for(;oe()!==!0&&(P=T());){if(P===n){C=Z.backslashes=!0,T();continue}if(P===y){Y=Z.isBracket=!0,z=Z.isGlob=!0,w=!0;break}}if(b===!0)continue;break}if(v.nonegate!==!0&&J===o&&B===N){H=Z.negated=!0,N++;continue}if(v.noparen!==!0&&J===l){if(z=Z.isGlob=!0,b===!0){for(;oe()!==!0&&(J=T());){if(J===l){C=Z.backslashes=!0,J=T();continue}if(J===$){w=!0;break}}
|
|
291
|
+
continue}break}if(z===!0){if(w=!0,b===!0)continue;break}}v.noext===!0&&(X=!1,z=!1);let x=L,Q="",ie="";N>0&&(Q=L.slice(0,N),L=L.slice(N),j-=N),x&&z===!0&&j>0?(x=L.slice(0,j),ie=L.slice(j)):z===!0?(x="",ie=L):x=L,x&&x!==""&&x!=="/"&&x!==L&&f(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),v.unescape===!0&&(ie&&(ie=t.removeBackslashes(ie)),x&&C===!0&&(x=t.removeBackslashes(x)));const O={prefix:Q,input:m,start:N,base:x,glob:ie,isBrace:M,isBracket:Y,isGlob:z,isExtglob:X,isGlobstar:se,negated:H,negatedExtglob:k};
|
|
292
|
+
if(v.tokens===!0&&(O.maxDepth=0,f(J)||U.push(Z),O.tokens=U),v.parts===!0||v.tokens===!0){let P;for(let ee=0;ee<I.length;ee++){const W=P?P+1:N,F=I[ee],re=m.slice(W,F);v.tokens&&(ee===0&&N!==0?(U[ee].isPrefix=!0,U[ee].value=Q):U[ee].value=re,g(U[ee]),O.maxDepth+=U[ee].depth),(ee!==0||re!=="")&&G.push(re),P=F}if(P&&P+1<m.length){const ee=m.slice(P+1);G.push(ee),v.tokens&&(U[U.length-1].value=ee,g(U[U.length-1]),O.maxDepth+=U[U.length-1].depth)}O.slashes=I,O.parts=G}return O},Ws}var Ks,lc;function x0(){
|
|
293
|
+
if(lc)return Ks;lc=1;const t=An(),e=Cn(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,a=(u,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...u,d);u.sort();const h=`[${u.join("-")}]`;try{new RegExp(h)}catch{return u.map($=>e.escapeRegex($)).join("..")}return h},c=(u,d)=>`Missing ${u}: "${d}" - use "\\\\${d}" to match literal characters`,l=(u,d)=>{if(typeof u!="string")throw new TypeError("Expected a string");u=o[u]||u;
|
|
294
|
+
const h={...d},E=typeof h.maxLength=="number"?Math.min(r,h.maxLength):r;let $=u.length;if($>E)throw new SyntaxError(`Input length: ${$}, exceeds maximum allowed length: ${E}`);const y={type:"bos",value:"",output:h.prepend||""},f=[y],g=h.capture?"":"?:",p=e.isWindows(d),m=t.globChars(p),D=t.extglobChars(m),{DOT_LITERAL:v,PLUS_LITERAL:_,SLASH_LITERAL:b,ONE_CHAR:I,DOTS_SLASH:U,NO_DOT:G,NO_DOT_SLASH:L,NO_DOTS_SLASH:B,QMARK:N,QMARK_NO_DOT:j,STAR:M,START_ANCHOR:Y}=m,z=F=>`(${g}(?:(?!${Y}${F.dot?U:v}).\
|
|
295
|
+
)*?)`,X=h.dot?"":G,se=h.dot?N:j;let q=h.bash===!0?z(h):M;h.capture&&(q=`(${q})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const C={input:u,index:-1,start:0,dot:h.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};u=e.removePrefix(u,C),$=u.length;const H=[],k=[],w=[];let A=y,R;const J=()=>C.index===$-1,Z=C.peek=(F=1)=>u[C.index+F],oe=C.advance=()=>u[++C.index]||"",ae=()=>u.slice(C.index+1),T=(F="",re=0)=>{C.consumed+=
|
|
296
|
+
F,C.index+=re},x=F=>{C.output+=F.output!=null?F.output:F.value,T(F.value)},Q=()=>{let F=1;for(;Z()==="!"&&(Z(2)!=="("||Z(3)==="?");)oe(),C.start++,F++;return F%2===0?!1:(C.negated=!0,C.start++,!0)},ie=F=>{C[F]++,w.push(F)},O=F=>{C[F]--,w.pop()},P=F=>{if(A.type==="globstar"){const re=C.braces>0&&(F.type==="comma"||F.type==="brace"),V=F.extglob===!0||H.length&&(F.type==="pipe"||F.type==="paren");F.type!=="slash"&&F.type!=="paren"&&!re&&!V&&(C.output=C.output.slice(0,-A.output.length),A.type="star",
|
|
297
|
+
A.value="*",A.output=q,C.output+=A.output)}if(H.length&&F.type!=="paren"&&(H[H.length-1].inner+=F.value),(F.value||F.output)&&x(F),A&&A.type==="text"&&F.type==="text"){A.value+=F.value,A.output=(A.output||"")+F.value;return}F.prev=A,f.push(F),A=F},ee=(F,re)=>{const V={...D[re],conditions:1,inner:""};V.prev=A,V.parens=C.parens,V.output=C.output;const ne=(h.capture?"(":"")+V.open;ie("parens"),P({type:F,value:re,output:C.output?"":I}),P({type:"paren",extglob:!0,value:oe(),output:ne}),H.push(V)},W=F=>{
|
|
298
|
+
let re=F.close+(h.capture?")":""),V;if(F.type==="negate"){let ne=q;if(F.inner&&F.inner.length>1&&F.inner.includes("/")&&(ne=z(h)),(ne!==q||J()||/^\)+$/.test(ae()))&&(re=F.close=`)$))${ne}`),F.inner.includes("*")&&(V=ae())&&/^\.[^\\/.]+$/.test(V)){const fe=l(V,{...d,fastpaths:!1}).output;re=F.close=`)${fe})${ne})`}F.prev.type==="bos"&&(C.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:R,output:re}),O("parens")};if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(u)){let F=!1,re=u.replace(s,(V,ne,fe,we,Oe,vt)=>we===
|
|
299
|
+
"\\"?(F=!0,V):we==="?"?ne?ne+we+(Oe?N.repeat(Oe.length):""):vt===0?se+(Oe?N.repeat(Oe.length):""):N.repeat(fe.length):we==="."?v.repeat(fe.length):we==="*"?ne?ne+we+(Oe?q:""):q:ne?V:`\\${V}`);return F===!0&&(h.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,V=>V.length%2===0?"\\\\":V?"\\":"")),re===u&&h.contains===!0?(C.output=u,C):(C.output=e.wrapOutput(re,C,d),C)}for(;!J();){if(R=oe(),R==="\0")continue;if(R==="\\"){const V=Z();if(V==="/"&&h.bash!==!0||V==="."||V===";")continue;if(!V){
|
|
300
|
+
R+="\\",P({type:"text",value:R});continue}const ne=/^\\+/.exec(ae());let fe=0;if(ne&&ne[0].length>2&&(fe=ne[0].length,C.index+=fe,fe%2!==0&&(R+="\\")),h.unescape===!0?R=oe():R+=oe(),C.brackets===0){P({type:"text",value:R});continue}}if(C.brackets>0&&(R!=="]"||A.value==="["||A.value==="[^")){if(h.posix!==!1&&R===":"){const V=A.value.slice(1);if(V.includes("[")&&(A.posix=!0,V.includes(":"))){const ne=A.value.lastIndexOf("["),fe=A.value.slice(0,ne),we=A.value.slice(ne+2),Oe=n[we];if(Oe){A.value=fe+
|
|
301
|
+
Oe,C.backtrack=!0,oe(),!y.output&&f.indexOf(A)===1&&(y.output=I);continue}}}(R==="["&&Z()!==":"||R==="-"&&Z()==="]")&&(R=`\\${R}`),R==="]"&&(A.value==="["||A.value==="[^")&&(R=`\\${R}`),h.posix===!0&&R==="!"&&A.value==="["&&(R="^"),A.value+=R,x({value:R});continue}if(C.quotes===1&&R!=='"'){R=e.escapeRegex(R),A.value+=R,x({value:R});continue}if(R==='"'){C.quotes=C.quotes===1?0:1,h.keepQuotes===!0&&P({type:"text",value:R});continue}if(R==="("){ie("parens"),P({type:"paren",value:R});continue}if(R===
|
|
302
|
+
")"){if(C.parens===0&&h.strictBrackets===!0)throw new SyntaxError(c("opening","("));const V=H[H.length-1];if(V&&C.parens===V.parens+1){W(H.pop());continue}P({type:"paren",value:R,output:C.parens?")":"\\)"}),O("parens");continue}if(R==="["){if(h.nobracket===!0||!ae().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(c("closing","]"));R=`\\${R}`}else ie("brackets");P({type:"bracket",value:R});continue}if(R==="]"){if(h.nobracket===!0||A&&A.type==="bracket"&&A.value.length===
|
|
303
|
+
1){P({type:"text",value:R,output:`\\${R}`});continue}if(C.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(c("opening","["));P({type:"text",value:R,output:`\\${R}`});continue}O("brackets");const V=A.value.slice(1);if(A.posix!==!0&&V[0]==="^"&&!V.includes("/")&&(R=`/${R}`),A.value+=R,x({value:R}),h.literalBrackets===!1||e.hasRegexChars(V))continue;const ne=e.escapeRegex(A.value);if(C.output=C.output.slice(0,-A.value.length),h.literalBrackets===!0){C.output+=ne,A.value=ne;continue}A.value=
|
|
304
|
+
`(${g}${ne}|${A.value})`,C.output+=A.value;continue}if(R==="{"&&h.nobrace!==!0){ie("braces");const V={type:"brace",value:R,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};k.push(V),P(V);continue}if(R==="}"){const V=k[k.length-1];if(h.nobrace===!0||!V){P({type:"text",value:R,output:R});continue}let ne=")";if(V.dots===!0){const fe=f.slice(),we=[];for(let Oe=fe.length-1;Oe>=0&&(f.pop(),fe[Oe].type!=="brace");Oe--)fe[Oe].type!=="dots"&&we.unshift(fe[Oe].value);ne=a(we,h),C.backtrack=
|
|
305
|
+
!0}if(V.comma!==!0&&V.dots!==!0){const fe=C.output.slice(0,V.outputIndex),we=C.tokens.slice(V.tokensIndex);V.value=V.output="\\{",R=ne="\\}",C.output=fe;for(const Oe of we)C.output+=Oe.output||Oe.value}P({type:"brace",value:R,output:ne}),O("braces"),k.pop();continue}if(R==="|"){H.length>0&&H[H.length-1].conditions++,P({type:"text",value:R});continue}if(R===","){let V=R;const ne=k[k.length-1];ne&&w[w.length-1]==="braces"&&(ne.comma=!0,V="|"),P({type:"comma",value:R,output:V});continue}if(R==="/"){
|
|
306
|
+
if(A.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",f.pop(),A=y;continue}P({type:"slash",value:R,output:b});continue}if(R==="."){if(C.braces>0&&A.type==="dot"){A.value==="."&&(A.output=v);const V=k[k.length-1];A.type="dots",A.output+=R,A.value+=R,V.dots=!0;continue}if(C.braces+C.parens===0&&A.type!=="bos"&&A.type!=="slash"){P({type:"text",value:R,output:v});continue}P({type:"dot",value:R,output:v});continue}if(R==="?"){if(!(A&&A.value==="(")&&h.noextglob!==!0&&Z()===
|
|
307
307
|
"("&&Z(2)!=="?"){ee("qmark",R);continue}if(A&&A.type==="paren"){const ne=Z();let fe=R;if(ne==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(A.value==="("&&!/[!=<:]/.test(ne)||ne==="<"&&!/<([!=]|\w+>)/.test(ae()))&&(fe=`\\${R}`),P({type:"text",value:R,output:fe});continue}if(h.dot!==!0&&(A.type==="slash"||A.type==="bos")){P({type:"qmark",value:R,output:j});continue}P({type:"qmark",value:R,output:N});continue}if(R==="!"){if(h.noextglob!==
|
|
308
308
|
!0&&Z()==="("&&(Z(2)!=="?"||!/[!=<:]/.test(Z(3)))){ee("negate",R);continue}if(h.nonegate!==!0&&C.index===0){Q();continue}}if(R==="+"){if(h.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){ee("plus",R);continue}if(A&&A.value==="("||h.regex===!1){P({type:"plus",value:R,output:_});continue}if(A&&(A.type==="bracket"||A.type==="paren"||A.type==="brace")||C.parens>0){P({type:"plus",value:R});continue}P({type:"plus",value:_});continue}if(R==="@"){if(h.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){P({type:"at",extglob:!0,
|
|
309
|
-
value:R,output:""});continue}P({type:"text",value:R});continue}if(R!=="*"){(R==="$"||R==="^")&&(R=`\\${R}`);const
|
|
310
|
-
|
|
311
|
-
output=A.output,C.globstar=!0,T(R);continue}if(
|
|
312
|
-
h)}${b}|${b}${Ft})`,A.value+=R,C.output+=
|
|
309
|
+
value:R,output:""});continue}P({type:"text",value:R});continue}if(R!=="*"){(R==="$"||R==="^")&&(R=`\\${R}`);const V=i.exec(ae());V&&(R+=V[0],C.index+=V[0].length),P({type:"text",value:R});continue}if(A&&(A.type==="globstar"||A.star===!0)){A.type="star",A.star=!0,A.value+=R,A.output=q,C.backtrack=!0,C.globstar=!0,T(R);continue}let F=ae();if(h.noextglob!==!0&&/^\([^?]/.test(F)){ee("star",R);continue}if(A.type==="star"){if(h.noglobstar===!0){T(R);continue}const V=A.prev,ne=V.prev,fe=V.type==="slash"||
|
|
310
|
+
V.type==="bos",we=ne&&(ne.type==="star"||ne.type==="globstar");if(h.bash===!0&&(!fe||F[0]&&F[0]!=="/")){P({type:"star",value:R,output:""});continue}const Oe=C.braces>0&&(V.type==="comma"||V.type==="brace"),vt=H.length&&(V.type==="pipe"||V.type==="paren");if(!fe&&V.type!=="paren"&&!Oe&&!vt){P({type:"star",value:R,output:""});continue}for(;F.slice(0,3)==="/**";){const Ft=u[C.index+4];if(Ft&&Ft!=="/")break;F=F.slice(3),T("/**",3)}if(V.type==="bos"&&J()){A.type="globstar",A.value+=R,A.output=z(h),C.
|
|
311
|
+
output=A.output,C.globstar=!0,T(R);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&!we&&J()){C.output=C.output.slice(0,-(V.output+A.output).length),V.output=`(?:${V.output}`,A.type="globstar",A.output=z(h)+(h.strictSlashes?")":"|$)"),A.value+=R,C.globstar=!0,C.output+=V.output+A.output,T(R);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&F[0]==="/"){const Ft=F[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(V.output+A.output).length),V.output=`(?:${V.output}`,A.type="globstar",A.output=`${z(
|
|
312
|
+
h)}${b}|${b}${Ft})`,A.value+=R,C.output+=V.output+A.output,C.globstar=!0,T(R+oe()),P({type:"slash",value:"/",output:""});continue}if(V.type==="bos"&&F[0]==="/"){A.type="globstar",A.value+=R,A.output=`(?:^|${b}|${z(h)}${b})`,C.output=A.output,C.globstar=!0,T(R+oe()),P({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-A.output.length),A.type="globstar",A.output=z(h),A.value+=R,C.output+=A.output,C.globstar=!0,T(R);continue}const re={type:"star",value:R,output:q};if(h.bash===!0){
|
|
313
313
|
re.output=".*?",(A.type==="bos"||A.type==="slash")&&(re.output=X+re.output),P(re);continue}if(A&&(A.type==="bracket"||A.type==="paren")&&h.regex===!0){re.output=R,P(re);continue}(C.index===C.start||A.type==="slash"||A.type==="dot")&&(A.type==="dot"?(C.output+=L,A.output+=L):h.dot===!0?(C.output+=B,A.output+=B):(C.output+=X,A.output+=X),Z()!=="*"&&(C.output+=I,A.output+=I)),P(re)}for(;C.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(c("closing","]"));C.output=e.escapeLast(C.output,"["),
|
|
314
314
|
O("brackets")}for(;C.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(c("closing",")"));C.output=e.escapeLast(C.output,"("),O("parens")}for(;C.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(c("closing","}"));C.output=e.escapeLast(C.output,"{"),O("braces")}if(h.strictSlashes!==!0&&(A.type==="star"||A.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${b}?`}),C.backtrack===!0){C.output="";for(const F of C.tokens)C.output+=F.output!=null?F.output:F.value,F.suffix&&(C.output+=
|
|
315
|
-
F.suffix)}return C};return l.fastpaths=(u,d)=>{const h={...d},E=typeof h.maxLength=="number"?Math.min(r,h.maxLength):r
|
|
316
|
-
noglobstar===!0?N:`(${L}(?:(?!${I}${X.dot?m:f}).)*?)`,M=X=>{switch(X){case"*":return`${
|
|
317
|
-
Y=e.removePrefix(u,B);let z=M(Y);return z&&h.strictSlashes!==!0&&(z+=`${g}?`),z},Ks=l,Ks}var Ys,
|
|
318
|
-
c),E=u?o.compileRe(a,c):o.makeRe(a,c,!1,!0)
|
|
319
|
-
on"&&d.onMatch(_),p?_:!0)};return l&&(f.state
|
|
320
|
-
RegExp?c:o.makeRe(c,l)).test(t.basename(a)),o.isMatch=(a,c,l)=>o(c,l)(a),o.parse=(a,c)=>Array.isArray(a)?a.map(l=>o.parse(l,c)):r(a,{...c,fastpaths:!1}),o.scan=(a,c)=>e(a,c),o.compileRe=(a,c,l=!1,u=!1)=>{if(l===!0)return a.output;const d=c||{},h=d.contains?"":"^",E=d.contains?"":"$";let
|
|
321
|
-
mpty string");let d={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(d.output=r.fastpaths(a,c)),d.output||(d=r(a,c)),o.compileRe(d,c,l,u)},o.toRegex=(a,c)=>{try{const l=c||{};return new RegExp(a,l.flags||(l.nocase?"i":""))}catch(l){if(c&&c.debug===!0)throw l;return/$^/}},o.constants=i,Ys=o,Ys}var Js,
|
|
322
|
-
{");return c>-1&&a.indexOf("}",c)>-1},o=(a,c,l)=>{c=[].concat(c),a=[].concat(a);let u=new Set,d=new Set,h=new Set,E=0
|
|
323
|
-
`No matches found for "${c.join(", ")}"`);if(l.nonull===!0||l.nullglob===!0)return l.unescape?c.map(g=>g.replace(/\\/g,"")):c}return f};return o.match=o,o.matcher=(a,c)=>r(a,c),o.isMatch=(a,c,l)=>r(c,l)(a),o.any=o.isMatch,o.not=(a,c,l={})=>{c=[].concat(c).map(String);let u=new Set,d=[],h
|
|
315
|
+
F.suffix)}return C};return l.fastpaths=(u,d)=>{const h={...d},E=typeof h.maxLength=="number"?Math.min(r,h.maxLength):r,$=u.length;if($>E)throw new SyntaxError(`Input length: ${$}, exceeds maximum allowed length: ${E}`);u=o[u]||u;const y=e.isWindows(d),{DOT_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:D,NO_DOTS:v,NO_DOTS_SLASH:_,STAR:b,START_ANCHOR:I}=t.globChars(y),U=h.dot?v:D,G=h.dot?_:D,L=h.capture?"":"?:",B={negated:!1,prefix:""};let N=h.bash===!0?".*?":b;h.capture&&(N=`(${N})`);const j=X=>X.
|
|
316
|
+
noglobstar===!0?N:`(${L}(?:(?!${I}${X.dot?m:f}).)*?)`,M=X=>{switch(X){case"*":return`${U}${p}${N}`;case".*":return`${f}${p}${N}`;case"*.*":return`${U}${N}${f}${p}${N}`;case"*/*":return`${U}${N}${g}${p}${G}${N}`;case"**":return U+j(h);case"**/*":return`(?:${U}${j(h)}${g})?${G}${p}${N}`;case"**/*.*":return`(?:${U}${j(h)}${g})?${G}${N}${f}${p}${N}`;case"**/.*":return`(?:${U}${j(h)}${g})?${f}${p}${N}`;default:{const se=/^(.*?)\.(\w+)$/.exec(X);if(!se)return;const q=M(se[1]);return q?q+f+se[2]:void 0}}},
|
|
317
|
+
Y=e.removePrefix(u,B);let z=M(Y);return z&&h.strictSlashes!==!0&&(z+=`${g}?`),z},Ks=l,Ks}var Ys,fc;function M0(){if(fc)return Ys;fc=1;const t=es,e=B0(),r=x0(),n=Cn(),i=An(),s=a=>a&&typeof a=="object"&&!Array.isArray(a),o=(a,c,l=!1)=>{if(Array.isArray(a)){const g=a.map(m=>o(m,c,l));return m=>{for(const D of g){const v=D(m);if(v)return v}return!1}}const u=s(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");const d=c||{},h=n.isWindows(
|
|
318
|
+
c),E=u?o.compileRe(a,c):o.makeRe(a,c,!1,!0),$=E.state;delete E.state;let y=()=>!1;if(d.ignore){const g={...c,ignore:null,onMatch:null,onResult:null};y=o(d.ignore,g,l)}const f=(g,p=!1)=>{const{isMatch:m,match:D,output:v}=o.test(g,E,c,{glob:a,posix:h}),_={glob:a,state:$,regex:E,posix:h,input:g,output:v,match:D,isMatch:m};return typeof d.onResult=="function"&&d.onResult(_),m===!1?(_.isMatch=!1,p?_:!1):y(g)?(typeof d.onIgnore=="function"&&d.onIgnore(_),_.isMatch=!1,p?_:!1):(typeof d.onMatch=="functi\
|
|
319
|
+
on"&&d.onMatch(_),p?_:!0)};return l&&(f.state=$),f};return o.test=(a,c,l,{glob:u,posix:d}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const h=l||{},E=h.format||(d?n.toPosixSlashes:null);let $=a===u,y=$&&E?E(a):a;return $===!1&&(y=E?E(a):a,$=y===u),($===!1||h.capture===!0)&&(h.matchBase===!0||h.basename===!0?$=o.matchBase(a,c,l,d):$=c.exec(y)),{isMatch:!!$,match:$,output:y}},o.matchBase=(a,c,l,u=n.isWindows(l))=>(c instanceof
|
|
320
|
+
RegExp?c:o.makeRe(c,l)).test(t.basename(a)),o.isMatch=(a,c,l)=>o(c,l)(a),o.parse=(a,c)=>Array.isArray(a)?a.map(l=>o.parse(l,c)):r(a,{...c,fastpaths:!1}),o.scan=(a,c)=>e(a,c),o.compileRe=(a,c,l=!1,u=!1)=>{if(l===!0)return a.output;const d=c||{},h=d.contains?"":"^",E=d.contains?"":"$";let $=`${h}(?:${a.output})${E}`;a&&a.negated===!0&&($=`^(?!${$}).*$`);const y=o.toRegex($,c);return u===!0&&(y.state=a),y},o.makeRe=(a,c={},l=!1,u=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-e\
|
|
321
|
+
mpty string");let d={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(d.output=r.fastpaths(a,c)),d.output||(d=r(a,c)),o.compileRe(d,c,l,u)},o.toRegex=(a,c)=>{try{const l=c||{};return new RegExp(a,l.flags||(l.nocase?"i":""))}catch(l){if(c&&c.debug===!0)throw l;return/$^/}},o.constants=i,Ys=o,Ys}var Js,dc;function q0(){return dc||(dc=1,Js=M0()),Js}var Xs,hc;function U0(){if(hc)return Xs;hc=1;const t=Ya,e=k0(),r=q0(),n=Cn(),i=a=>a===""||a==="./",s=a=>{const c=a.indexOf("\
|
|
322
|
+
{");return c>-1&&a.indexOf("}",c)>-1},o=(a,c,l)=>{c=[].concat(c),a=[].concat(a);let u=new Set,d=new Set,h=new Set,E=0,$=g=>{h.add(g.output),l&&l.onResult&&l.onResult(g)};for(let g=0;g<c.length;g++){let p=r(String(c[g]),{...l,onResult:$},!0),m=p.state.negated||p.state.negatedExtglob;m&&E++;for(let D of a){let v=p(D,!0);(m?!v.isMatch:v.isMatch)&&(m?u.add(v.output):(u.delete(v.output),d.add(v.output)))}}let f=(E===c.length?[...h]:[...d]).filter(g=>!u.has(g));if(l&&f.length===0){if(l.failglob===!0)throw new Error(
|
|
323
|
+
`No matches found for "${c.join(", ")}"`);if(l.nonull===!0||l.nullglob===!0)return l.unescape?c.map(g=>g.replace(/\\/g,"")):c}return f};return o.match=o,o.matcher=(a,c)=>r(a,c),o.isMatch=(a,c,l)=>r(c,l)(a),o.any=o.isMatch,o.not=(a,c,l={})=>{c=[].concat(c).map(String);let u=new Set,d=[],h=$=>{l.onResult&&l.onResult($),d.push($.output)},E=new Set(o(a,c,{...l,onResult:h}));for(let $ of d)E.has($)||u.add($);return[...u]},o.contains=(a,c,l)=>{if(typeof a!="string")throw new TypeError(`Expected a stri\
|
|
324
324
|
ng: "${t.inspect(a)}"`);if(Array.isArray(c))return c.some(u=>o.contains(a,u,l));if(typeof c=="string"){if(i(a)||i(c))return!1;if(a.includes(c)||a.startsWith("./")&&a.slice(2).includes(c))return!0}return o.isMatch(a,c,{...l,contains:!0})},o.matchKeys=(a,c,l)=>{if(!n.isObject(a))throw new TypeError("Expected the first argument to be an object");let u=o(Object.keys(a),c,l),d={};for(let h of u)d[h]=a[h];return d},o.some=(a,c,l)=>{let u=[].concat(a);for(let d of[].concat(c)){let h=r(String(d),l);if(u.
|
|
325
325
|
some(E=>h(E)))return!0}return!1},o.every=(a,c,l)=>{let u=[].concat(a);for(let d of[].concat(c)){let h=r(String(d),l);if(!u.every(E=>h(E)))return!1}return!0},o.all=(a,c,l)=>{if(typeof a!="string")throw new TypeError(`Expected a string: "${t.inspect(a)}"`);return[].concat(c).every(u=>r(u,l)(a))},o.capture=(a,c,l)=>{let u=n.isWindows(l),h=r.makeRe(String(a),{...l,capture:!0}).exec(u?n.toPosixSlashes(c):c);if(h)return h.slice(1).map(E=>E===void 0?"":E)},o.makeRe=(...a)=>r.makeRe(...a),o.scan=(...a)=>r.
|
|
326
|
-
scan(...a),o.parse=(a,c)=>{let l=[];for(let u of[].concat(a||[]))for(let d of e(String(u),c))l.push(r.parse(d,c));return l},o.braces=(a,c)=>{if(typeof a!="string")throw new TypeError("Expected a string");return c&&c.nobrace===!0||!s(a)?[a]:e(a,c)},o.braceExpand=(a,c)=>{if(typeof a!="string")throw new TypeError("Expected a string");return o.braces(a,{...c,expand:!0})},o.hasBraces=s,Xs=o,Xs}var H0=U0();const
|
|
326
|
+
scan(...a),o.parse=(a,c)=>{let l=[];for(let u of[].concat(a||[]))for(let d of e(String(u),c))l.push(r.parse(d,c));return l},o.braces=(a,c)=>{if(typeof a!="string")throw new TypeError("Expected a string");return c&&c.nobrace===!0||!s(a)?[a]:e(a,c)},o.braceExpand=(a,c)=>{if(typeof a!="string")throw new TypeError("Expected a string");return o.braces(a,{...c,expand:!0})},o.hasBraces=s,Xs=o,Xs}var H0=U0();const pc=Ji(H0),V0={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};
|
|
327
327
|
function z0(t,e,r,n=!1){const i=new RegExp(`<script([^>]*?) src="[./]*${e}"([^>]*)></script>`),s=/"?__VITE_PRELOAD__"?/g,o=r.replace(s,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),a=t.replace(i,(c,l,u)=>`<script${l}${u}>${o.trim()}</script>`);return n?X0(a):a}function G0(t,e,r){const n=new RegExp(`<link([^>]*?) href="[./]*${e}"([^>]*?)>`),i=r.replace('@charset "UTF-8";',"");return t.replace(n,(o,a,c)=>`<style${a}${c}>${i.trim()}</style>`)}const W0=/\.[mc]?js$/,K0=/\.css$/,Y0=/\.html?$/;function J0({
|
|
328
328
|
useRecommendedBuildConfig:t=!0,removeViteModuleLoader:e=!1,inlinePattern:r=[],deleteInlinedFiles:n=!0}=V0){function i(s){console.debug(`NOTE: asset not inlined: ${s}`)}return{name:"vite:singlefile",config:t?Q0:void 0,enforce:"post",generateBundle:(s,o)=>{console.debug(`
|
|
329
|
-
`);const a={html:[],css:[],js:[],other:[]};for(const l of Object.keys(o))Y0.test(l)?a.html.push(l):K0.test(l)?a.css.push(l):W0.test(l)?a.js.push(l):a.other.push(l);const c=[];for(const l of a.html){const u=o[l];let d=u.source;for(const h of a.js){if(r.length&&!
|
|
329
|
+
`);const a={html:[],css:[],js:[],other:[]};for(const l of Object.keys(o))Y0.test(l)?a.html.push(l):K0.test(l)?a.css.push(l):W0.test(l)?a.js.push(l):a.other.push(l);const c=[];for(const l of a.html){const u=o[l];let d=u.source;for(const h of a.js){if(r.length&&!pc.isMatch(h,r)){i(h);continue}const E=o[h];E.code!=null&&(console.debug(`Inlining: ${h}`),c.push(h),d=z0(d,E.fileName,E.code,e))}for(const h of a.css){if(r.length&&!pc.isMatch(h,r)){i(h);continue}const E=o[h];console.debug(`Inlining: ${h}`),
|
|
330
330
|
c.push(h),d=G0(d,E.fileName,E.source)}u.source=d}if(n)for(const l of c)delete o[l];for(const l of a.other)i(l)}}}const X0=t=>t.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">'),Q0=t=>{t.build||(t.build={}),t.build.assetsInlineLimit=()=>!0,t.build.chunkSizeWarningLimit=1e8,t.build.cssCodeSplit=!1,t.base="./",t.build.assetsDir="",t.build.rollupOptions||(t.build.rollupOptions={}),t.build.rollupOptions.output||(t.build.rollupOptions.
|
|
331
|
-
output={});const e=r=>{r.inlineDynamicImports=!0};if(Array.isArray(t.build.rollupOptions.output))for(const r of t.build.rollupOptions.output)e(r);else e(t.build.rollupOptions.output)};function Z0(t){var e,r;if(t){if("astNode"in t)return rg(t);if(Array.isArray(t))return t.reduce(
|
|
332
|
-
try{return xa(t).uri.toString()}catch{return}}function rg(t){var e,r;const{astNode:n,property:i,index:s}=t??{},o=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||o===void 0)){if(i===void 0)return yr(o,Qs(n));{const a=c=>s!==void 0&&s>-1&&Array.isArray(n[i])?s<c.length?c[s]:void 0:c.reduce(
|
|
333
|
-
function Qs(t){var e,r,n,i;return t.$cstNode?(r=(e=xa(t))===null||e===void 0?void 0:e.uri)===null||r===void 0?void 0:r.toString():t.$textRegion?t.$textRegion.documentURI||((i=(n=new
|
|
334
|
-
t.length)!==null&&n!==void 0?n:t.end-t.offset};return t.range&&(i.range=t.range),e??(e=t.fileURI),e&&(i.fileURI=e),i}function
|
|
331
|
+
output={});const e=r=>{r.inlineDynamicImports=!0};if(Array.isArray(t.build.rollupOptions.output))for(const r of t.build.rollupOptions.output)e(r);else e(t.build.rollupOptions.output)};function Z0(t){var e,r;if(t){if("astNode"in t)return rg(t);if(Array.isArray(t))return t.reduce(mc,void 0);{const n=t,i=eg(n)?tg((r=(e=n?.root)===null||e===void 0?void 0:e.astNode)!==null&&r!==void 0?r:n?.astNode):void 0;return yr(n,i)}}else return}function eg(t){return typeof t<"u"&&"element"in t&&"text"in t}function tg(t){
|
|
332
|
+
try{return xa(t).uri.toString()}catch{return}}function rg(t){var e,r;const{astNode:n,property:i,index:s}=t??{},o=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||o===void 0)){if(i===void 0)return yr(o,Qs(n));{const a=c=>s!==void 0&&s>-1&&Array.isArray(n[i])?s<c.length?c[s]:void 0:c.reduce(mc,void 0);if(!((r=o.assignments)===null||r===void 0)&&r[i]){const c=a(o.assignments[i]);return c&&yr(c,Qs(n))}else if(n.$cstNode){const c=a(Ep(n.$cstNode,i));return c&&yr(c,Qs(n))}else return}}}
|
|
333
|
+
function Qs(t){var e,r,n,i;return t.$cstNode?(r=(e=xa(t))===null||e===void 0?void 0:e.uri)===null||r===void 0?void 0:r.toString():t.$textRegion?t.$textRegion.documentURI||((i=(n=new Dp(t,s=>s.$container?[s.$container]:[]).find(s=>{var o;return(o=s.$textRegion)===null||o===void 0?void 0:o.documentURI}))===null||n===void 0?void 0:n.$textRegion)===null||i===void 0?void 0:i.documentURI):void 0}function yr(t,e){var r,n;const i={offset:t.offset,end:(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,length:(n=
|
|
334
|
+
t.length)!==null&&n!==void 0?n:t.end-t.offset};return t.range&&(i.range=t.range),e??(e=t.fileURI),e&&(i.fileURI=e),i}function mc(t,e){var r,n;if(t){if(!e)return t&&yr(t)}else return e&&yr(e);const i=(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,s=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,o=Math.min(t.offset,e.offset),a=Math.max(i,s),c=a-o,l={offset:o,end:a,length:c};if(t.range&&e.range&&(l.range={start:e.range.start.line<t.range.start.line||e.range.start.line===t.range.start.line&&e.range.
|
|
335
335
|
start.character<t.range.start.character?e.range.start:t.range.start,end:e.range.end.line>t.range.end.line||e.range.end.line===t.range.end.line&&e.range.end.character>t.range.end.character?e.range.end:t.range.end}),t.fileURI||e.fileURI){const u=t.fileURI,d=e.fileURI,h=u&&d&&u!==d?`<unmergable text regions of ${u}, ${d}>`:u??d;l.fileURI=h}return l}class ng{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],
|
|
336
336
|
this.lines=[[]],this.length=0,typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get contentLength(){return this.length}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}get currentPosition(){return{offset:this.contentLength,line:this.currentLineNumber,character:this.currentLineContent.length}}append(e,r){if(e.
|
|
337
337
|
length>0){const n=r&&this.currentPosition;this.lines[this.currentLineNumber].push(e),this.length+=e.length,n&&this.indentPendingTraceRegions(n)}}indentPendingTraceRegions(e){for(let r=this.traceData.length-1;r>=0;r--){const n=this.traceData[r];n.targetStart&&n.targetStart.offset===e.offset&&(n.targetStart=this.currentPosition)}}increaseIndent(e){this.currentIndents.push(e),e.indentImmediately||this.recentNonImmediateIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){
|
|
338
338
|
return this.currentIndents.filter(e=>!this.recentNonImmediateIndents.includes(e))}resetCurrentLine(){this.length-=this.lines[this.currentLineNumber].join("").length,this.lines[this.currentLineNumber]=[],this.pendingIndent=!0}addNewLine(){this.pendingIndent=!0,this.lines.push([]),this.recentNonImmediateIndents.length=0}pushTraceRegion(e){const r=ig(e,this.currentPosition,n=>{var i,s;return(s=(i=this.traceData[this.traceData.length-1])===null||i===void 0?void 0:i.children)===null||s===void 0?void 0:
|
|
339
339
|
s.push(n)});return this.traceData.push(r),r}popTraceRegion(e){const r=this.traceData.pop();return this.assertTrue(r===e,"Trace region mismatch!"),r}getParentTraceSourceFileURI(){var e;for(let r=this.traceData.length-1;r>-1;r--){const n=(e=this.traceData[r].sourceRegion)===null||e===void 0?void 0:e.fileURI;if(n)return n}}assertTrue(e,r){if(!e)throw new Error(r)}}function ig(t,e,r){const n={sourceRegion:t,targetRegion:void 0,children:[],targetStart:e,complete:i=>{var s,o;return n.targetRegion={offset:n.
|
|
340
|
-
targetStart.offset,end:i.offset,length:i.offset-n.targetStart.offset,range:{start:{line:n.targetStart.line,character:n.targetStart.character},end:{line:i.line,character:i.character}}},delete n.targetStart,((s=n.children)===null||s===void 0?void 0:s.length)===0&&delete n.children,!((o=n.targetRegion)===null||o===void 0)&&o.length&&r(n),delete n.complete,n}};return n}function sg(t,e){const r=new ng(e),n=r.pushTraceRegion(void 0);
|
|
341
|
-
const i=n.children&&n.children.length===1?n.children[0]:void 0,s=i?.targetRegion,o=n.targetRegion;return s&&i.sourceRegion&&s.offset===o.offset&&s.length===o.length?{text:r.content,trace:i}:{text:r.content,trace:n}}function
|
|
342
|
-
function og(t,e){t&&(e.pendingIndent&&
|
|
343
|
-
function ag(t,e){var r;if(
|
|
340
|
+
targetStart.offset,end:i.offset,length:i.offset-n.targetStart.offset,range:{start:{line:n.targetStart.line,character:n.targetStart.character},end:{line:i.line,character:i.character}}},delete n.targetStart,((s=n.children)===null||s===void 0?void 0:s.length)===0&&delete n.children,!((o=n.targetRegion)===null||o===void 0)&&o.length&&r(n),delete n.complete,n}};return n}function sg(t,e){const r=new ng(e),n=r.pushTraceRegion(void 0);gc(t,r),r.popTraceRegion(n),n.complete&&n.complete(r.currentPosition);
|
|
341
|
+
const i=n.children&&n.children.length===1?n.children[0]:void 0,s=i?.targetRegion,o=n.targetRegion;return s&&i.sourceRegion&&s.offset===o.offset&&s.length===o.length?{text:r.content,trace:i}:{text:r.content,trace:n}}function gc(t,e){typeof t=="string"?og(t,e):t instanceof eo?ag(t,e):t instanceof Ne?Dc(t,e):t instanceof Wr&&ug(t,e)}function yc(t,e){return typeof t=="string"?t.length!==0:t instanceof Ne?t.contents.some(r=>yc(r,e)):t instanceof Wr?!(t.ifNotEmpty&&e.currentLineContent.length===0):!1}
|
|
342
|
+
function og(t,e){t&&(e.pendingIndent&&Ec(e,!1),e.append(t))}function Ec(t,e){var r;let n="";for(const i of t.relevantIndents.filter(s=>s.indentEmptyLines||!e))n+=(r=i.indentation)!==null&&r!==void 0?r:t.defaultIndentation;t.append(n,!0),t.pendingIndent=!1}function Dc(t,e){let r;const n=Z0(t.tracedSource);n&&(r=e.pushTraceRegion(n));for(const i of t.contents)gc(i,e);if(r){e.popTraceRegion(r);const i=e.getParentTraceSourceFileURI();i&&n?.fileURI===i&&delete n.fileURI,r.complete&&r.complete(e.currentPosition)}}
|
|
343
|
+
function ag(t,e){var r;if(yc(t,e)){t.indentImmediately&&!e.pendingIndent&&e.append((r=t.indentation)!==null&&r!==void 0?r:e.defaultIndentation,!0);try{e.increaseIndent(t),Dc(t,e)}finally{e.decreaseIndent()}}}function ug(t,e){t.ifNotEmpty&&!cg(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&Ec(e,!0),e.append(t.lineDelimiter),e.addNewLine())}function cg(t){return t.trimStart()!==""}Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__");const lg=/\S|$/;function fg(t){const e=t.filter(n=>n.
|
|
344
344
|
length>0).map(n=>n.search(lg)),r=e.length===0?0:Math.min(...e);return Math.max(0,r)}function kt(t,...e){const r=hg(t),n=pg(t,e,r);return gg(n)}function dg(t,e,r){return(n,...i)=>Eg(t,e,r)(kt(n,...i))}function hg(t){const e=t.join("_").split(Ma),r=e.length>1&&e[0].trim().length===0,n=r&&e.length>1&&e[e.length-1].trim().length===0;if(e.length===1||e.length!==0&&e[0].trim().length!==0||e.length===2&&e[1].trim().length===0)return{indentation:0,omitFirstLine:r,omitLastLine:n,trimLastLine:e.length!==1&&
|
|
345
345
|
e[e.length-1].trim().length===0};{let i=r?e.slice(1):e;i=n?i.slice(0,i.length-1):i,i=i.filter(o=>o.length!==0);const s=fg(i);return{indentation:s,omitFirstLine:r,omitLastLine:n&&(e[e.length-1].length<s||!e[e.length-1].startsWith(i[0].substring(0,s)))}}}function pg(t,e,{indentation:r,omitFirstLine:n,omitLastLine:i,trimLastLine:s}){const o=[];t.forEach((l,u)=>{o.push(...l.split(Ma).map((d,h)=>h===0||d.length<r?d:d.substring(r)).reduce(u===0?(d,h,E)=>E===0?n?[]:[h]:E===1&&d.length===0?[h]:d.concat(
|
|
346
|
-
Sn,h):(d,h,E)=>E===0?[h]:d.concat(Sn,h),[]).filter(d=>!(typeof d=="string"&&d.length===0)).concat(
|
|
347
|
-
t[i-1]))||i>1&&typeof t[i-1]=="string"&&(Zs(t[i-2])||
|
|
346
|
+
Sn,h):(d,h,E)=>E===0?[h]:d.concat(Sn,h),[]).filter(d=>!(typeof d=="string"&&d.length===0)).concat(Gr(e[u])?e[u]:e[u]!==void 0?{content:String(e[u])}:u<e.length?vc:[]))});const a=o.length,c=a!==0?o[a-1]:void 0;return(i||s)&&typeof c=="string"&&c.trim().length===0?n&&a!==1&&o[a-2]===Sn?o.slice(0,a-2):o.slice(0,a-1):o}const Sn={isNewLine:!0},vc={isUndefinedSegment:!0},$c=t=>t===Sn,Zs=t=>t===vc,mg=t=>t.content!==void 0;function gg(t){return t.reduce((r,n,i)=>Zs(n)?r:$c(n)?{node:i!==0&&(Zs(t[i-1])||Gr(
|
|
347
|
+
t[i-1]))||i>1&&typeof t[i-1]=="string"&&(Zs(t[i-2])||Gr(t[i-2]))?r.node.appendNewLineIfNotEmpty():r.node.appendNewLine()}:(()=>{var s;const o=(i===0||$c(t[i-1]))&&typeof n=="string"&&n.length!==0?"".padStart(n.length-n.trimStart().length):"",a=mg(n)?n.content:n;let c;return{node:r.indented?r.node:o.length!==0?r.node.indent({indentation:o,indentImmediately:!1,indentedChildren:l=>c=l.append(a)}):r.node.append(a),indented:c??((s=r.indented)===null||s===void 0?void 0:s.append(a))}})(),{node:new Ne}).
|
|
348
348
|
node}const yg=typeof process>"u"?`
|
|
349
349
|
`:process.platform==="win32"?`\r
|
|
350
350
|
`:`
|
|
351
|
-
`;function
|
|
351
|
+
`;function Gr(t){return t instanceof Ne||t instanceof eo||t instanceof Wr}function Bt(t,e){return Gr(t)?sg(t,e).text:String(t)}class Ne{constructor(...e){this.contents=[],this.append(...e)}isEmpty(){return this.contents.length===0}trace(e,r,n){if(vp(e)){if(this.tracedSource={astNode:e,property:r,index:n},this.tracedSource.property===void 0&&this.tracedSource.index!==void 0&&this.tracedSource.index>-1)throw new Error("Generation support: 'property' argument must not be 'undefined' if a non-negati\
|
|
352
352
|
ve value is assigned to 'index' in 'CompositeGeneratorNode.trace(...)'.")}else this.tracedSource=e;return this}append(...e){for(const r of e)typeof r=="function"?r(this):r&&this.contents.push(r);return this}appendIf(e,...r){return e?this.append(...r):this}appendNewLine(){return this.append(ve)}appendNewLineIf(e){return e?this.append(ve):this}appendNewLineIfNotEmpty(){return this.append(Dg)}appendNewLineIfNotEmptyIf(e){return e?this.appendNewLineIfNotEmpty():this}appendTemplate(e,...r){return this.
|
|
353
353
|
append(kt(e,...r))}appendTemplateIf(e){return e?(r,...n)=>this.appendTemplate(r,...n):()=>this}indent(e){const{indentedChildren:r,indentation:n,indentEmptyLines:i,indentImmediately:s}=Array.isArray(e)||typeof e=="function"?{indentedChildren:e}:typeof e=="object"?e:{},o=new eo(n,s,i);return this.contents.push(o),Array.isArray(r)?o.append(...r):r&&o.append(r),this}appendTraced(e,r,n){return i=>this.append(new Ne().trace(e,r,n).append(i))}appendTracedIf(e,r,n,i){return e?this.appendTraced(typeof r==
|
|
354
354
|
"function"?r():r,n,i):()=>this}appendTracedTemplate(e,r,n){return(i,...s)=>this.append(dg(e,r,n)(i,...s))}appendTracedTemplateIf(e,r,n,i){return e?this.appendTracedTemplate(typeof r=="function"?r():r,n,i):()=>this}}function Eg(t,e,r){return n=>n instanceof Ne&&n.tracedSource===void 0?n.trace(t,e,r):new Ne().trace(t,e,r).append(n)}class eo extends Ne{constructor(e,r=!0,n=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof e=="string"?this.indentation=e:typeof e=="number"&&(this.
|
|
355
|
-
indentation="".padStart(e)),this.indentImmediately=r,this.indentEmptyLines=n}}class
|
|
356
|
-
return vg(t,(h,E
|
|
355
|
+
indentation="".padStart(e)),this.indentImmediately=r,this.indentEmptyLines=n}}class Wr{constructor(e,r=!1){this.ifNotEmpty=!1,this.lineDelimiter=e??yg,this.ifNotEmpty=r}}const ve=new Wr,Dg=new Wr(void 0,!0),_c=t=>t===void 0||typeof t=="string"||Gr(t)?t:String(t);function nt(t,e=_c,r={}){const n=typeof e=="function"?e:_c,{filter:i,prefix:s,suffix:o,separator:a,appendNewLineIfNotEmpty:c,skipNewLineAfterLastItem:l}=typeof e=="object"?e:r,u=typeof s=="function"?s:()=>s,d=typeof o=="function"?o:()=>o;
|
|
356
|
+
return vg(t,(h,E,$,y)=>{if(i&&!i(E,$,y))return h;const f=n(E,$,y);return f===void 0?h:(h??(h=new Ne)).append(u(E,$,y)).append(f).append(d(E,$,y)).appendIf(!y,a).appendNewLineIfNotEmptyIf(!h.isEmpty()&&!!c&&(!y||!l))})}function vg(t,e,r){const n=t[Symbol.iterator]();let i=n.next(),s=0,o=r;for(;!i.done;){const a=n.next();o=e(o,i.value,s,!!a.done),i=a,s++}return o}var $g=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,_g=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,
|
|
357
357
|
wg=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,
|
|
358
358
|
to={Space_Separator:$g,ID_Start:_g,ID_Continue:wg},Pe={isSpaceSeparator(t){return typeof t=="string"&&to.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||to.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||to.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t==
|
|
359
|
-
"string"&&/[0-9A-Fa-f]/.test(t)}};let ro,He,wt,Rn,xt,ut,Be,no,
|
|
360
|
-
for(const i in n){const s=io(n,i,r);s===void 0?delete n[i]:Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(t,e,n)}let ye,me,
|
|
361
|
-
`?(xt++,ut=0):t?ut+=t.length:ut++,t&&(Rn+=t.length),t}const
|
|
362
|
-
`:case"\r":case"\u2028":case"\u2029":te();return;case"/":te(),ye="comment";return;case void 0:return te(),Ce("eof")}if(Pe.isSpaceSeparator($e)){te();return}return
|
|
359
|
+
"string"&&/[0-9A-Fa-f]/.test(t)}};let ro,He,wt,Rn,xt,ut,Be,no,Kr;var bg=function(e,r){ro=String(e),He="start",wt=[],Rn=0,xt=1,ut=0,Be=void 0,no=void 0,Kr=void 0;do Be=Ag(),Rg[He]();while(Be.type!=="eof");return typeof r=="function"?io({"":Kr},"",r):Kr};function io(t,e,r){const n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){const s=String(i),o=io(n,s,r);o===void 0?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else
|
|
360
|
+
for(const i in n){const s=io(n,i,r);s===void 0?delete n[i]:Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(t,e,n)}let ye,me,Yr,bt,$e;function Ag(){for(ye="default",me="",Yr=!1,bt=1;;){$e=At();const t=wc[ye]();if(t)return t}}function At(){if(ro[Rn])return String.fromCodePoint(ro.codePointAt(Rn))}function te(){const t=At();return t===`
|
|
361
|
+
`?(xt++,ut=0):t?ut+=t.length:ut++,t&&(Rn+=t.length),t}const wc={default(){switch($e){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|
362
|
+
`:case"\r":case"\u2028":case"\u2029":te();return;case"/":te(),ye="comment";return;case void 0:return te(),Ce("eof")}if(Pe.isSpaceSeparator($e)){te();return}return wc[He]()},comment(){switch($e){case"*":te(),ye="multiLineComment";return;case"/":te(),ye="singleLineComment";return}throw Se(te())},multiLineComment(){switch($e){case"*":te(),ye="multiLineCommentAsterisk";return;case void 0:throw Se(te())}te()},multiLineCommentAsterisk(){switch($e){case"*":te();return;case"/":te(),ye="default";return;case void 0:
|
|
363
363
|
throw Se(te())}te(),ye="multiLineComment"},singleLineComment(){switch($e){case`
|
|
364
364
|
`:case"\r":case"\u2028":case"\u2029":te(),ye="default";return;case void 0:return te(),Ce("eof")}te()},value(){switch($e){case"{":case"[":return Ce("punctuator",te());case"n":return te(),or("ull"),Ce("null",null);case"t":return te(),or("rue"),Ce("boolean",!0);case"f":return te(),or("alse"),Ce("boolean",!1);case"-":case"+":te()==="-"&&(bt=-1),ye="sign";return;case".":me=te(),ye="decimalPointLeading";return;case"0":me=te(),ye="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"\
|
|
365
|
-
8":case"9":me=te(),ye="decimalInteger";return;case"I":return te(),or("nfinity"),Ce("numeric",1/0);case"N":return te(),or("aN"),Ce("numeric",NaN);case'"':case"'":
|
|
366
|
-
"identifierNameEscape";return}if(Pe.isIdContinueChar($e)){me+=te();return}return Ce("identifier",me)},identifierNameEscape(){if($e!=="u")throw Se(te());te();const t=so();switch(t){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!Pe.isIdContinueChar(t))throw
|
|
365
|
+
8":case"9":me=te(),ye="decimalInteger";return;case"I":return te(),or("nfinity"),Ce("numeric",1/0);case"N":return te(),or("aN"),Ce("numeric",NaN);case'"':case"'":Yr=te()==='"',me="",ye="string";return}throw Se(te())},identifierNameStartEscape(){if($e!=="u")throw Se(te());te();const t=so();switch(t){case"$":case"_":break;default:if(!Pe.isIdStartChar(t))throw bc();break}me+=t,ye="identifierName"},identifierName(){switch($e){case"$":case"_":case"\u200C":case"\u200D":me+=te();return;case"\\":te(),ye=
|
|
366
|
+
"identifierNameEscape";return}if(Pe.isIdContinueChar($e)){me+=te();return}return Ce("identifier",me)},identifierNameEscape(){if($e!=="u")throw Se(te());te();const t=so();switch(t){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!Pe.isIdContinueChar(t))throw bc();break}me+=t,ye="identifierName"},sign(){switch($e){case".":me=te(),ye="decimalPointLeading";return;case"0":me=te(),ye="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":me=te(),ye="decimalInt\
|
|
367
367
|
eger";return;case"I":return te(),or("nfinity"),Ce("numeric",bt*(1/0));case"N":return te(),or("aN"),Ce("numeric",NaN)}throw Se(te())},zero(){switch($e){case".":me+=te(),ye="decimalPoint";return;case"e":case"E":me+=te(),ye="decimalExponent";return;case"x":case"X":me+=te(),ye="hexadecimal";return}return Ce("numeric",bt*0)},decimalInteger(){switch($e){case".":me+=te(),ye="decimalPoint";return;case"e":case"E":me+=te(),ye="decimalExponent";return}if(Pe.isDigit($e)){me+=te();return}return Ce("numeric",
|
|
368
368
|
bt*Number(me))},decimalPointLeading(){if(Pe.isDigit($e)){me+=te(),ye="decimalFraction";return}throw Se(te())},decimalPoint(){switch($e){case"e":case"E":me+=te(),ye="decimalExponent";return}if(Pe.isDigit($e)){me+=te(),ye="decimalFraction";return}return Ce("numeric",bt*Number(me))},decimalFraction(){switch($e){case"e":case"E":me+=te(),ye="decimalExponent";return}if(Pe.isDigit($e)){me+=te();return}return Ce("numeric",bt*Number(me))},decimalExponent(){switch($e){case"+":case"-":me+=te(),ye="decimalE\
|
|
369
369
|
xponentSign";return}if(Pe.isDigit($e)){me+=te(),ye="decimalExponentInteger";return}throw Se(te())},decimalExponentSign(){if(Pe.isDigit($e)){me+=te(),ye="decimalExponentInteger";return}throw Se(te())},decimalExponentInteger(){if(Pe.isDigit($e)){me+=te();return}return Ce("numeric",bt*Number(me))},hexadecimal(){if(Pe.isHexDigit($e)){me+=te(),ye="hexadecimalInteger";return}throw Se(te())},hexadecimalInteger(){if(Pe.isHexDigit($e)){me+=te();return}return Ce("numeric",bt*Number(me))},string(){switch($e){case"\
|
|
370
|
-
\\":te(),me+=Cg();return;case'"':if(
|
|
371
|
-
`:case"\r":throw Se(te());case"\u2028":case"\u2029":Og($e);break;case void 0:throw Se(te())}me+=te()},start(){switch($e){case"{":case"[":return Ce("punctuator",te())}ye="value"},beforePropertyName(){switch($e){case"$":case"_":me=te(),ye="identifierName";return;case"\\":te(),ye="identifierNameStartEscape";return;case"}":return Ce("punctuator",te());case'"':case"'":
|
|
370
|
+
\\":te(),me+=Cg();return;case'"':if(Yr)return te(),Ce("string",me);me+=te();return;case"'":if(!Yr)return te(),Ce("string",me);me+=te();return;case`
|
|
371
|
+
`:case"\r":throw Se(te());case"\u2028":case"\u2029":Og($e);break;case void 0:throw Se(te())}me+=te()},start(){switch($e){case"{":case"[":return Ce("punctuator",te())}ye="value"},beforePropertyName(){switch($e){case"$":case"_":me=te(),ye="identifierName";return;case"\\":te(),ye="identifierNameStartEscape";return;case"}":return Ce("punctuator",te());case'"':case"'":Yr=te()==='"',ye="string";return}if(Pe.isIdStartChar($e)){me+=te(),ye="identifierName";return}throw Se(te())},afterPropertyName(){if($e===
|
|
372
372
|
":")return Ce("punctuator",te());throw Se(te())},beforePropertyValue(){ye="value"},afterPropertyValue(){switch($e){case",":case"}":return Ce("punctuator",te())}throw Se(te())},beforeArrayValue(){if($e==="]")return Ce("punctuator",te());ye="value"},afterArrayValue(){switch($e){case",":case"]":return Ce("punctuator",te())}throw Se(te())},end(){throw Se(te())}};function Ce(t,e){return{type:t,value:e,line:xt,column:ut}}function or(t){for(const e of t){if(At()!==e)throw Se(te());te()}}function Cg(){switch(At()){case"\
|
|
373
373
|
b":return te(),"\b";case"f":return te(),"\f";case"n":return te(),`
|
|
374
374
|
`;case"r":return te(),"\r";case"t":return te()," ";case"v":return te(),"\v";case"0":if(te(),Pe.isDigit(At()))throw Se(te());return"\0";case"x":return te(),Sg();case"u":return te(),so();case`
|
|
375
375
|
`:case"\u2028":case"\u2029":return te(),"";case"\r":return te(),At()===`
|
|
376
376
|
`&&te(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Se(te());case void 0:throw Se(te())}return te()}function Sg(){let t="",e=At();if(!Pe.isHexDigit(e)||(t+=te(),e=At(),!Pe.isHexDigit(e)))throw Se(te());return t+=te(),String.fromCodePoint(parseInt(t,16))}function so(){let t="",e=4;for(;e-- >0;){const r=At();if(!Pe.isHexDigit(r))throw Se(te());t+=te()}return String.fromCodePoint(parseInt(t,16))}const Rg={start(){if(Be.type==="eof")throw ar();oo()},beforePropertyName(){
|
|
377
377
|
switch(Be.type){case"identifier":case"string":no=Be.value,He="afterPropertyName";return;case"punctuator":On();return;case"eof":throw ar()}},afterPropertyName(){if(Be.type==="eof")throw ar();He="beforePropertyValue"},beforePropertyValue(){if(Be.type==="eof")throw ar();oo()},beforeArrayValue(){if(Be.type==="eof")throw ar();if(Be.type==="punctuator"&&Be.value==="]"){On();return}oo()},afterPropertyValue(){if(Be.type==="eof")throw ar();switch(Be.value){case",":He="beforePropertyName";return;case"}":On()}},
|
|
378
|
-
afterArrayValue(){if(Be.type==="eof")throw ar();switch(Be.value){case",":He="beforeArrayValue";return;case"]":On()}},end(){}};function oo(){let t;switch(Be.type){case"punctuator":switch(Be.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=Be.value;break}if(
|
|
379
|
-
push(t),Array.isArray(t)?He="beforeArrayValue":He="beforePropertyName";else{const e=wt[wt.length-1];e==null?He="end":Array.isArray(e)?He="afterArrayValue":He="afterPropertyValue"}}function On(){wt.pop();const t=wt[wt.length-1];t==null?He="end":Array.isArray(t)?He="afterArrayValue":He="afterPropertyValue"}function Se(t){return In(t===void 0?`JSON5: invalid end of input at ${xt}:${ut}`:`JSON5: invalid character '${
|
|
380
|
-
:${ut}`)}function
|
|
381
|
-
t);return e.lineNumber=xt,e.columnNumber=ut,e}var Ig=function(e,r,n){const i=[];let s="",o,a,c="",l;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,l=r.quote,r=r.replacer),typeof r=="function")a=r;else if(Array.isArray(r)){o=[];for(const
|
|
382
|
-
0&&(n=Math.min(10,Math.floor(n)),c=" ".substr(0,n)):typeof n=="string"&&(c=n.substr(0,10)),u("",{"":e});function u(
|
|
383
|
-
g);if(typeof g=="object")return Array.isArray(g)
|
|
384
|
-
continue}p
|
|
385
|
-
`+s;
|
|
386
|
-
`+s+
|
|
387
|
-
`+f+"}"}}return i.pop(),s=f,m}function E(
|
|
378
|
+
afterArrayValue(){if(Be.type==="eof")throw ar();switch(Be.value){case",":He="beforeArrayValue";return;case"]":On()}},end(){}};function oo(){let t;switch(Be.type){case"punctuator":switch(Be.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=Be.value;break}if(Kr===void 0)Kr=t;else{const e=wt[wt.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,no,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")wt.
|
|
379
|
+
push(t),Array.isArray(t)?He="beforeArrayValue":He="beforePropertyName";else{const e=wt[wt.length-1];e==null?He="end":Array.isArray(e)?He="afterArrayValue":He="afterPropertyValue"}}function On(){wt.pop();const t=wt[wt.length-1];t==null?He="end":Array.isArray(t)?He="afterArrayValue":He="afterPropertyValue"}function Se(t){return In(t===void 0?`JSON5: invalid end of input at ${xt}:${ut}`:`JSON5: invalid character '${Ac(t)}' at ${xt}:${ut}`)}function ar(){return In(`JSON5: invalid end of input at ${xt}\
|
|
380
|
+
:${ut}`)}function bc(){return ut-=5,In(`JSON5: invalid identifier character at ${xt}:${ut}`)}function Og(t){console.warn(`JSON5: '${Ac(t)}' in strings is not valid ECMAScript; consider escaping`)}function Ac(t){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){const r=t.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return t}function In(t){const e=new SyntaxError(
|
|
381
|
+
t);return e.lineNumber=xt,e.columnNumber=ut,e}var Ig=function(e,r,n){const i=[];let s="",o,a,c="",l;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,l=r.quote,r=r.replacer),typeof r=="function")a=r;else if(Array.isArray(r)){o=[];for(const y of r){let f;typeof y=="string"?f=y:(typeof y=="number"||y instanceof String||y instanceof Number)&&(f=String(y)),f!==void 0&&o.indexOf(f)<0&&o.push(f)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>
|
|
382
|
+
0&&(n=Math.min(10,Math.floor(n)),c=" ".substr(0,n)):typeof n=="string"&&(c=n.substr(0,10)),u("",{"":e});function u(y,f){let g=f[y];switch(g!=null&&(typeof g.toJSON5=="function"?g=g.toJSON5(y):typeof g.toJSON=="function"&&(g=g.toJSON(y))),a&&(g=a.call(f,y,g)),g instanceof Number?g=Number(g):g instanceof String?g=String(g):g instanceof Boolean&&(g=g.valueOf()),g){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof g=="string")return d(g);if(typeof g=="number")return String(
|
|
383
|
+
g);if(typeof g=="object")return Array.isArray(g)?$(g):h(g)}function d(y){const f={"'":.1,'"':.2},g={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let p="";for(let D=0;D<y.length;D++){const v=y[D];switch(v){case"'":case'"':f[v]++,p+=v;continue;case"\0":if(Pe.isDigit(y[D+1])){p+="\\x00";continue}}if(g[v]){p+=g[v];continue}if(v<" "){let _=v.charCodeAt(0).toString(16);p+="\\x"+("00"+_).substring(_.length);
|
|
384
|
+
continue}p+=v}const m=l||Object.keys(f).reduce((D,v)=>f[D]<f[v]?D:v);return p=p.replace(new RegExp(m,"g"),g[m]),m+p+m}function h(y){if(i.indexOf(y)>=0)throw TypeError("Converting circular structure to JSON5");i.push(y);let f=s;s=s+c;let g=o||Object.keys(y),p=[];for(const D of g){const v=u(D,y);if(v!==void 0){let _=E(D)+":";c!==""&&(_+=" "),_+=v,p.push(_)}}let m;if(p.length===0)m="{}";else{let D;if(c==="")D=p.join(","),m="{"+D+"}";else{let v=`,
|
|
385
|
+
`+s;D=p.join(v),m=`{
|
|
386
|
+
`+s+D+`,
|
|
387
|
+
`+f+"}"}}return i.pop(),s=f,m}function E(y){if(y.length===0)return d(y);const f=String.fromCodePoint(y.codePointAt(0));if(!Pe.isIdStartChar(f))return d(y);for(let g=f.length;g<y.length;g++)if(!Pe.isIdContinueChar(String.fromCodePoint(y.codePointAt(g))))return d(y);return y}function $(y){if(i.indexOf(y)>=0)throw TypeError("Converting circular structure to JSON5");i.push(y);let f=s;s=s+c;let g=[];for(let m=0;m<y.length;m++){const D=u(String(m),y);g.push(D!==void 0?D:"null")}let p;if(g.length===0)p=
|
|
388
388
|
"[]";else if(c==="")p="["+g.join(",")+"]";else{let m=`,
|
|
389
|
-
`+s,
|
|
390
|
-
`+s+
|
|
389
|
+
`+s,D=g.join(m);p=`[
|
|
390
|
+
`+s+D+`,
|
|
391
391
|
`+f+"]"}return i.pop(),s=f,p}};const Fg={parse:bg,stringify:Ig};var Ct=Fg;const Pg=t=>t.charAt(0).toLocaleUpperCase()+t.slice(1),Ng=t=>t.split(".").map(Pg).join(""),Tg=t=>Ng(t.parent?t.id.slice(t.parent.length+1):t.id),Lg=({autoLayout:t})=>{switch(t.direction){case"TB":return"down";case"BT":return"up";case"LR":return"right";case"RL":return"left"}},jg=({shape:t})=>{switch(t){case"queue":case"cylinder":case"rectangle":case"person":return t;case"storage":return"stored_data";case"mobile":case"browse\
|
|
392
|
-
r":return"rectangle"}};function
|
|
392
|
+
r":return"rectangle"}};function Cc(t){const{nodes:e,edges:r}=t,n=new Map,i=(o,a)=>{const c=Tg(o),l=(a?a+".":"")+c;n.set(o.id,l);const u=JSON.stringify(o.title),d=jg(o);return new Ne().append(c,": {",ve).indent({indentedChildren:h=>h.append("label: ",u,ve).appendIf(d!=="rectangle","shape: ",d,ve).appendIf(o.children.length>0,ve,nt(e.filter(E=>E.parent===o.id),E=>i(E,l))),indentation:2}).append("}",ve)},s=o=>new Ne().append(n.get(o.source)," -> ",n.get(o.target)).append(a=>o.label&&a.append(": ",JSON.
|
|
393
393
|
stringify(o.label)));return Bt(new Ne().append("direction: ",Lg(t),ve,ve).append(nt(e.filter(o=>Xi(o.parent)),o=>i(o),{appendNewLineIfNotEmpty:!0})).appendIf(r.length>0,ve,nt(r,o=>s(o),{appendNewLineIfNotEmpty:!0})))}const kg=t=>t.charAt(0).toLocaleUpperCase()+t.slice(1),Bg=t=>t.split(".").map(kg).join(""),xg=t=>Bg(t.parent?t.id.slice(t.parent.length+1):t.id),Mg=({shape:t})=>{switch(t){case"queue":case"cylinder":return["[(",")]"];case"person":return["[fa:fa-user ","]"];case"storage":return["([",
|
|
394
|
-
"])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function
|
|
394
|
+
"])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function Sc(t){const{nodes:e,edges:r}=t,n=new Map,i=(o,a)=>{const c=xg(o),l=(a?a+".":"")+c;n.set(o.id,l);const u=o.title.replaceAll(`
|
|
395
395
|
`,"\\n"),d=Mg(o),h=new Ne;return o.children.length>0?h.append("subgraph ",l,"[",JSON.stringify(o.title),"]",ve).indent({indentedChildren:[nt(e.filter(E=>E.parent===o.id),E=>i(E,l),{appendNewLineIfNotEmpty:!0})],indentation:2}).append("end",ve):h.append(l,d[0],u,d[1]),h},s=o=>new Ne().append(n.get(o.source)," -.",o.label?' "'+o.label.replaceAll(`
|
|
396
396
|
`,"\\n")+'" .-':"-","> ",n.get(o.target));return Bt(new Ne().appendIf(t.title!==null&&t.title.length>0,"---",ve,`title: ${JSON.stringify(t.title)}`,ve,"---",ve).append("graph ",t.autoLayout.direction,ve).indent({indentedChildren:o=>{o.append(nt(e.filter(a=>Xi(a.parent)),a=>i(a),{appendNewLineIfNotEmpty:!0})).appendIf(r.length>0,nt(r,a=>s(a),{appendNewLineIfNotEmpty:!0}))},indentation:2}))}function qg(t){const e=new Ne;return e.appendTemplate`
|
|
397
397
|
/* prettier-ignore-start */
|
|
@@ -438,8 +438,8 @@ stringify(o.label)));return Bt(new Ne().append("direction: ",Lg(t),ve,ve).append
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
/* prettier-ignore-end */
|
|
441
|
-
`.append(ve),Bt(r))}function
|
|
442
|
-
`)+";"}function Vg(t){const{fqns:e,tags:r,kinds:n}=
|
|
441
|
+
`.append(ve),Bt(r))}function Jr(t){t instanceof Set&&(t=[...t].sort(Qp));const e=t.map(r=>` | ${JSON.stringify(r)}`);return e.length===0&&e.push(" never"),e.join(`
|
|
442
|
+
`)+";"}function Vg(t){const{fqns:e,tags:r,kinds:n}=eu([...t.elements()]).reduce((o,a)=>(o.fqns.push(a.id),o.kinds.add(a.kind),o.tags.push(...a.tags),o),{fqns:[],kinds:new Set,tags:[]}),i=eu([...t.deployment.elements()]).map(o=>o.id),{viewIds:s}=[...t.views()].reduce((o,a)=>(o.viewIds.add(a.id),o.tags.push(...a.tags),o.tags.push(...a.includedTags),o),{viewIds:new Set,tags:r});return`
|
|
443
443
|
/* prettier-ignore-start */
|
|
444
444
|
/* eslint-disable */
|
|
445
445
|
|
|
@@ -460,19 +460,19 @@ import type {
|
|
|
460
460
|
} from 'likec4/react'
|
|
461
461
|
|
|
462
462
|
type LikeC4ElementId =
|
|
463
|
-
${
|
|
463
|
+
${Jr(e)}
|
|
464
464
|
|
|
465
465
|
type LikeC4DeploymentId =
|
|
466
|
-
${
|
|
466
|
+
${Jr(i)}
|
|
467
467
|
|
|
468
468
|
type LikeC4ViewId =
|
|
469
|
-
${
|
|
469
|
+
${Jr(s)}
|
|
470
470
|
|
|
471
471
|
type LikeC4ElementKind =
|
|
472
|
-
${
|
|
472
|
+
${Jr(n)}
|
|
473
473
|
|
|
474
474
|
type LikeC4Tag =
|
|
475
|
-
${
|
|
475
|
+
${Jr(new Set(r))}
|
|
476
476
|
|
|
477
477
|
declare function isLikeC4ViewId(value: unknown): value is LikeC4ViewId;
|
|
478
478
|
|
|
@@ -533,7 +533,7 @@ export {
|
|
|
533
533
|
switch (viewId) {
|
|
534
534
|
`.appendNewLine().indent({indentation:4,indentedChildren(r){r.append(nt(t,n=>kt`
|
|
535
535
|
case ${JSON.stringify(n.id)}: {
|
|
536
|
-
return ${JSON.stringify(
|
|
536
|
+
return ${JSON.stringify(Cc(n))}
|
|
537
537
|
}
|
|
538
538
|
`,{appendNewLineIfNotEmpty:!0})).appendTemplate`
|
|
539
539
|
default: {
|
|
@@ -571,7 +571,7 @@ export {
|
|
|
571
571
|
default: {
|
|
572
572
|
throw new Error('Unknown viewId: ' + viewId)
|
|
573
573
|
}
|
|
574
|
-
`}}).append(ve," }",ve,"}",ve,ve),Bt(e)}function Wg(t){const e
|
|
574
|
+
`}}).append(ve," }",ve,"}",ve,ve),Bt(e)}function Wg(t){const e=$p(t.flatMap(i=>i.nodes.map(s=>s.icon)),qa(wp),qa(i=>Ua(i)&&!i.toLowerCase().startsWith("http")),_p()).sort(),{imports:r,cases:n}=e.reduce((i,s,o)=>{const[a,c]=s.split(":"),l="Icon"+o.toString().padStart(2,"0");return i.imports.push(`import ${l} from 'likec4/icons/${a}/${c}'`),i.cases.push(` '${a}:${c}': ${l}`),i},{imports:[],cases:[]});return`
|
|
575
575
|
${r.join(`
|
|
576
576
|
`)}
|
|
577
577
|
|
|
@@ -635,7 +635,7 @@ if (import.meta.hot) {
|
|
|
635
635
|
switch (viewId) {
|
|
636
636
|
`.appendNewLine().indent({indentation:4,indentedChildren(r){r.append(nt(t,n=>kt`
|
|
637
637
|
case ${JSON.stringify(n.id)}: {
|
|
638
|
-
return ${JSON.stringify(
|
|
638
|
+
return ${JSON.stringify(Sc(n))}
|
|
639
639
|
}
|
|
640
640
|
`,{appendNewLineIfNotEmpty:!0})).appendTemplate`
|
|
641
641
|
default: {
|
|
@@ -644,7 +644,7 @@ if (import.meta.hot) {
|
|
|
644
644
|
`}}).append(ve," }",ve).appendTemplate`
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
`.append(ve,ve),Bt(e)}function
|
|
647
|
+
`.append(ve,ve),Bt(e)}function Rc(t){return`
|
|
648
648
|
import { nano } from 'likec4/react'
|
|
649
649
|
|
|
650
650
|
export const $graph = nano.atom(${Ct.stringify(t,null,2)})
|
|
@@ -708,45 +708,45 @@ if (import.meta.hot) {
|
|
|
708
708
|
}
|
|
709
709
|
})
|
|
710
710
|
}
|
|
711
|
-
`}const Xg={id:"virtual:likec4/dot-sources",virtualId:"\0likec4-plugin/dot-sources.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/dot-sources"));const r=await t.viewsService.viewsAsGraphvizOut(),n=
|
|
711
|
+
`}const Xg={id:"virtual:likec4/dot-sources",virtualId:"\0likec4-plugin/dot-sources.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/dot-sources"));const r=await t.viewsService.viewsAsGraphvizOut(),n=Ap(r,({id:i,svg:s,dot:o})=>[i,{dot:o,svg:s}]);return Gg(n)}},Qg={id:"virtual:likec4/d2-sources",virtualId:"\0likec4-plugin/d2-sources.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/d2-sources"));const r=await t.viewsService.computedViews();return zg(
|
|
712
712
|
r)}},Zg={id:"virtual:likec4/mmd-sources",virtualId:"\0likec4-plugin/mmd-sources.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/mmd-sources"));const r=await t.viewsService.computedViews();return Yg(r)}},ey={id:"virtual:likec4/icons",virtualId:"\0likec4-plugin/icons.js",async load({likec4:t,logger:e}){e.info(K.dim("generating virtual:likec4/icons"));const r=await t.viewsService.computedViews();return Wg(r)}},ty={id:"virtual:likec4/overview-graph",virtualId:"\0likec4-plu\
|
|
713
|
-
gin/overview-graph.js",async load({likec4:t,logger:e,useOverviewGraph:r}){if(r===!0)try{e.info(K.dim("generating virtual:likec4/overview-graph"));const n=await t.viewsService.overviewGraph();return
|
|
714
|
-
irtual:likec4/previews"));const n=await t.viewsService.computedViews();return Jg(n,r)}},ry={id:"virtual:likec4/model",virtualId:"\0likec4-plugin/model.js",async load({likec4:t,logger:e,assetsDir:r}){e.info(K.dim("generating virtual:likec4/model"));const n=await t.layoutedModel();return Kg(n)}},ao=[ey,Xg,Qg,Zg,ty,
|
|
715
|
-
return{name:"vite-plugin-likec4",configResolved(i){if(r=i.logger,t){const s=i.resolve.alias.find(o=>o.find==="likec4/previews")?.replacement;s?(n=s,r.info(K.dim("likec4/previews alias")+" "+K.dim(n))):r.warn("likec4/previews alias not found")}},resolveId(i){const s=ao.find(o=>o.id===i);return s?s.virtualId:null},async load(i){const s=ao.find(o=>o.virtualId===i);return s?await s.load({logger:r,likec4:e,assetsDir:n,useOverviewGraph:t}):null},configureServer(i){const s=
|
|
713
|
+
gin/overview-graph.js",async load({likec4:t,logger:e,useOverviewGraph:r}){if(r===!0)try{e.info(K.dim("generating virtual:likec4/overview-graph"));const n=await t.viewsService.overviewGraph();return Rc(n)}catch(n){e.error(n)}return e.info(K.dim("generating empty virtual:likec4/overview-graph")),Rc({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}})}},Oc={id:"virtual:likec4/previews",virtualId:"\0likec4-plugin/previews.js",async load({likec4:t,logger:e,assetsDir:r}){e.info(K.dim("generating v\
|
|
714
|
+
irtual:likec4/previews"));const n=await t.viewsService.computedViews();return Jg(n,r)}},ry={id:"virtual:likec4/model",virtualId:"\0likec4-plugin/model.js",async load({likec4:t,logger:e,assetsDir:r}){e.info(K.dim("generating virtual:likec4/model"));const n=await t.layoutedModel();return Kg(n)}},ao=[ey,Xg,Qg,Zg,ty,Oc,ry],ny=t=>{const e=t.toLowerCase();return e.endsWith(".c4")||e.endsWith(".likec4")||e.endsWith(".like-c4")};function uo({useOverviewGraph:t=!1,languageServices:e}){let r,n=e.workspace;
|
|
715
|
+
return{name:"vite-plugin-likec4",configResolved(i){if(r=i.logger,t){const s=i.resolve.alias.find(o=>o.find==="likec4/previews")?.replacement;s?(n=s,r.info(K.dim("likec4/previews alias")+" "+K.dim(n))):r.warn("likec4/previews alias not found")}},resolveId(i){const s=ao.find(o=>o.id===i);return s?s.virtualId:null},async load(i){const s=ao.find(o=>o.virtualId===i);return s?await s.load({logger:r,likec4:e,assetsDir:n,useOverviewGraph:t}):null},configureServer(i){const s=bp(1),o=()=>{s.clearQueue(),s(
|
|
716
716
|
async()=>{const[l]=e.getErrors();if(l){i.ws.send({type:"error",err:{name:"LikeC4ValidationError",message:"Validation error: "+l.message.slice(0,500),stack:"",plugin:"vite-plugin-likec4",loc:{file:l.sourceFsPath,line:l.range.start.line+1,column:l.range.start.character+1}}});return}for(const u of ao){const d=i.moduleGraph.getModuleById(u.virtualId);if(d&&d.importers.size>0){r.info(`${K.green("trigger hmr")} ${K.dim(d.url)}`);try{await i.reloadModule(d)}catch(h){r.error(h)}}}})},a=e.workspace;r.info(
|
|
717
|
-
`${K.dim("watch")} ${a}`);const c=l=>u=>{ny(u)&&e.notifyUpdate({[l]:u})};if(i.watcher.add(a).on("add",c("changed")).on("change",c("changed")).on("unlink",c("removed")),t&&!n.startsWith(e.workspace)){r.info(`${K.dim("watch")} ${n}`);const l=()=>{const u=i.moduleGraph.getModuleById(
|
|
718
|
-
likec4AssetsDir:e,...r})=>{const n=r.customLogger??Ss,i=Os(),s=r?.useOverviewGraph===!0;n.info(`${K.cyan("likec4 app root")} ${K.dim(i)}`);const o=r.outputDir??De(t.workspace,"dist");n.info(K.cyan("output")+" "+K.dim(o));let a="/";r.base&&(a=
|
|
717
|
+
`${K.dim("watch")} ${a}`);const c=l=>u=>{ny(u)&&e.notifyUpdate({[l]:u})};if(i.watcher.add(a).on("add",c("changed")).on("change",c("changed")).on("unlink",c("removed")),t&&!n.startsWith(e.workspace)){r.info(`${K.dim("watch")} ${n}`);const l=()=>{const u=i.moduleGraph.getModuleById(Oc.virtualId);u&&u.importers.size>0&&i.reloadModule(u)};i.watcher.add(n).on("add",l).on("change",l).on("unlink",l)}e.onModelUpdate(()=>{mt.debug("likec4 model update triggered"),o()})}}}const co=async({languageServices:t,
|
|
718
|
+
likec4AssetsDir:e,...r})=>{const n=r.customLogger??Ss,i=Os(),s=r?.useOverviewGraph===!0;n.info(`${K.cyan("likec4 app root")} ${K.dim(i)}`);const o=r.outputDir??De(t.workspace,"dist");n.info(K.cyan("output")+" "+K.dim(o));let a="/";r.base&&(a=Cp(r.base),!Sp(a)&&a!=="./"&&(a=Rp(a))),a!=="/"&&n.info(`${K.green("app base url")} ${K.dim(a)}`);const c=r.webcomponentPrefix??"likec4";return{isDev:!1,likec4AssetsDir:e,webcomponentPrefix:c,root:i,languageServices:t,clearScreen:!1,base:a,resolve:{conditions:[
|
|
719
719
|
"production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...Ps(),"likec4/previews":e}},configFile:!1,mode:"production",optimizeDeps:{force:!0,include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react/jsx-dev-runtime","react-dom/client"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(c),__USE_STYLE_BUNDLE__:"false",__USE_OVERVIEW_GRAPH__:s?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.e\
|
|
720
|
-
nv.NODE_ENV":'"production"'},build:{outDir:o,modulePreload:!1,emptyOutDir:!1,cssCodeSplit:!1,sourcemap:!1,cssMinify:!0,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:Fs,rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:n,plugins:[
|
|
720
|
+
nv.NODE_ENV":'"production"'},build:{outDir:o,modulePreload:!1,emptyOutDir:!1,cssCodeSplit:!1,sourcemap:!1,cssMinify:!0,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:Fs,rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:n,plugins:[Za(),uo({languageServices:t,useOverviewGraph:s})].concat(r.outputSingleFile?[J0()]:[])}};async function lo({languageServices:t,outDir:e,base:r,webcomponentPrefix:n="likec4",filename:i="likec4-views.js"}){const s=Ss,
|
|
721
721
|
o=Os();return s.info(K.cyan("outDir")+" "+K.dim(e)),{root:o,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:Ps()},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Rs},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:Fs,lib:{entry:"webcomponent/webcomponent.js",fileName(a,c){return i},formats:["iife"],name:"LikeC4Views"},commonjsOptions:{
|
|
722
|
-
defaultIsModuleExports:a=>a.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:s,plugins:[uo({languageServices:t,useOverviewGraph:!1})]}}const iy=["favicon.ico","robots.txt"],sy=async({buildWebcomponent:t=!0,webcomponentPrefix:e="likec4",languageServices:r,likec4AssetsDir:n,outputSingleFile:i,...s})=>{n??=await
|
|
723
|
-
{...s,languageServices:r,likec4AssetsDir:n,webcomponentPrefix:e,outputSingleFile:i}),c=await Is();for(const u of iy){const d=De(a.root,u);Pt(d)&&
|
|
724
|
-
{...a,publicDir:c,mode:"production"}),i)for(let u of Yp(De(a.build.outDir)).filter(d=>d!=="index.html"))is(De(a.build.outDir,u),{recursive:!0});else{const u=De(a.build.outDir,"index.html");Pt(u)&&
|
|
722
|
+
defaultIsModuleExports:a=>a.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:s,plugins:[uo({languageServices:t,useOverviewGraph:!1})]}}const iy=["favicon.ico","robots.txt"],sy=async({buildWebcomponent:t=!0,webcomponentPrefix:e="likec4",languageServices:r,likec4AssetsDir:n,outputSingleFile:i,...s})=>{n??=await an(Rr(un(),".likec4-assets-"));const{isDev:o,...a}=await co(
|
|
723
|
+
{...s,languageServices:r,likec4AssetsDir:n,webcomponentPrefix:e,outputSingleFile:i}),c=await Is();for(const u of iy){const d=De(a.root,u);Pt(d)&&Xa(d,De(c,u))}const l=await r.diagrams();if(l.length===0)throw process.exitCode=1,new Error("no views found");if(l.forEach(u=>{u.hasLayoutDrift&&a.customLogger.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(u.id))}),t){const u=await lo({webcomponentPrefix:e,languageServices:r,outDir:c,base:a.base});await Fr(u)}if(await Fr(
|
|
724
|
+
{...a,publicDir:c,mode:"production"}),i)for(let u of Yp(De(a.build.outDir)).filter(d=>d!=="index.html"))is(De(a.build.outDir,u),{recursive:!0});else{const u=De(a.build.outDir,"index.html");Pt(u)&&Xa(u,De(a.build.outDir,"404.html"))}};function Ic(t){if(t.resolvedUrls)return Ha(t.resolvedUrls.network)??Ha(t.resolvedUrls.local)}function Fc(t){if(!t.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");zt([K.green("LikeC4 served at:"),"",K.dim("Local: ")+t.resolvedUrls.local.join(
|
|
725
725
|
`
|
|
726
726
|
`+"".padEnd(9," ")),K.dim("Network: ")+t.resolvedUrls.network.join(`
|
|
727
727
|
`+"".padEnd(9," "))].join(`
|
|
728
|
-
`))}class
|
|
729
|
-
try{await
|
|
730
|
-
responding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}
|
|
731
|
-
if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof
|
|
732
|
-
i;s++)yield s}(t,e)}async function
|
|
733
|
-
base});E=Fr({...
|
|
734
|
-
outputType:o,theme:a}){let c;const l=e.map(h=>({view:h,attempt:1})),u=[];let d;for(;d=l.shift();){const{view:h,attempt:E}=d
|
|
735
|
-
id)),n.info(K.cyan(
|
|
736
|
-
path:g})}catch(
|
|
737
|
-
`+
|
|
738
|
-
`${K.cyan("from server")} ${K.dim(e)}`);const c=
|
|
739
|
-
lose chromium")),await u.close(),await l.close()}}async function
|
|
740
|
-
openBrowser:!1,useOverviewGraph:!1,hmr:!1}),s=
|
|
741
|
-
red(`failed ${h.length
|
|
742
|
-
e"}),u=s??De(l.workspace,"dist");let d=De(u,"assets");if(i)try{d=De(u,"assets","previews"),await $t(d,{recursive:!0}),c.info(`${
|
|
743
|
-
`),await
|
|
744
|
-
aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("path",
|
|
728
|
+
`))}class Pc extends Error{constructor(e){super(`${e} is locked`)}}const Er={old:new Set,young:new Set},oy=1e3*15,Fn=1024,Pn=65535;let Xr;const ay=()=>{const t=Ir.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(t))for(const n of r)e.add(n.address);return e},Nc=t=>new Promise((e,r)=>{const n=rm.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{const{port:i}=n.address();n.close(()=>{e(i)})})}),Tc=async(t,e)=>{if(t.host||t.port===0)return Nc(t);for(const r of e)
|
|
729
|
+
try{await Nc({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},uy=function*(t){t&&(yield*t),yield 0};async function fo(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){const i=t.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const s of i){if(typeof s!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
|
|
730
|
+
responding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}Xr===void 0&&(Xr=setTimeout(()=>{Xr=void 0,Er.old=Er.young,Er.young=new Set},oy),Xr.unref&&Xr.unref());const n=ay();for(const i of uy(e))try{if(r.has(i))continue;let s=await Tc({...t,port:i},n);for(;Er.old.has(s)||Er.young.has(s);){if(i!==0)throw new Pc(i);s=await Tc({...t,port:i},n)}return Er.young.add(s),s}catch(s){
|
|
731
|
+
if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof Pc))throw s}throw new Error("No available ports found")}function Nn(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<Fn||t>Pn)throw new RangeError(`'from' must be between ${Fn} and ${Pn}`);if(e<Fn||e>Pn)throw new RangeError(`'to' must be between ${Fn} and ${Pn}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,i){for(let s=n;s<=
|
|
732
|
+
i;s++)yield s}(t,e)}async function Lc({buildWebcomponent:t=!0,hmr:e=!0,webcomponentPrefix:r="likec4",languageServices:n,likec4AssetsDir:i,openBrowser:s,listen:o,...a}){i??=await an(Rr(un(),".likec4-assets-"));const{isDev:c,...l}=await co({...a,languageServices:n,likec4AssetsDir:i,webcomponentPrefix:r}),u=await fo({port:[5173,...Nn(61e3,61010),...Nn(62002,62010)]}),d=await fo({port:Nn(24678,24690)}),h=await Is();let E;if(t){const y=await lo({webcomponentPrefix:r,languageServices:n,outDir:h,base:l.
|
|
733
|
+
base});E=Fr({...y,logLevel:"warn"}).catch(f=>(mt.warn("webcomponent build failed",f),mt.warn("Ignoring error and continuing"),Promise.resolve()))}const $=await em({...l,define:Object.assign({},l.define,e&&{"process.env.NODE_ENV":'"development"'}),mode:e?"development":l.mode,publicDir:h,server:{host:o??"127.0.0.1",port:u,hmr:e&&{overlay:!0,port:d},fs:{strict:!1},open:s??!c}});return await $.listen(),E&&await E,$}async function cy({browserContext:t,views:e,output:r,logger:n,timeout:i,maxAttempts:s,
|
|
734
|
+
outputType:o,theme:a}){let c;const l=e.map(h=>({view:h,attempt:1})),u=[];let d;for(;d=l.shift();){const{view:h,attempt:E}=d,$=`/export/${encodeURIComponent(h.id)}`;try{if(E>1){c&&(c.close({runBeforeUnload:!0}).catch(m=>n.error(`failed to close page: ${m}`)),c=void 0);const p=Va(E*200,{min:200,max:1e3});n.info(K.cyan($)+K.dim(` attempt ${E} of ${s} after ${p}ms`)),await nm(p)}else h.hasLayoutDrift&&n.warn(K.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+K.red(h.
|
|
735
|
+
id)),n.info(K.cyan($));c??=await t.newPage(),await c.setViewportSize({width:h.bounds.width+20*2,height:h.bounds.height+20*2}),await c.goto($+`?padding=20&theme=${a}`);const y=c.getByRole("presentation");await y.waitFor(),h.nodes.some(p=>Ua(p.icon)&&p.icon.toLowerCase().startsWith("http"))&&await ly(c,i);let f=".";o==="relative"&&(f=h.relativePath??".",f.includes("/")?f=f.slice(0,f.lastIndexOf("/")):f=".");const g=De(r,f,`${h.id}.png`);await y.screenshot({path:g,omitBackground:!0}),u.push({view:h,
|
|
736
|
+
path:g})}catch(y){c?.close({runBeforeUnload:!0}).catch(f=>n.error(`failed to close page: ${f}`)),n.error(K.red("failed "+$+`
|
|
737
|
+
`+y)),E<s&&(l.push({view:h,attempt:E+1}),n.info(K.dim(`retry ${$}`))),c=void 0}}return u}async function ly(t,e){let r=await t.locator("//img").all();if(!r.length)return;const n=r.map(i=>i.evaluate(s=>s.complete||new Promise((o,a)=>{s.onload=o,s.onerror=a}),{timeout:Math.max(3e4,e)}));await Promise.allSettled(n)}async function jc({logger:t,serverUrl:e,theme:r="light",timeoutMs:n=15e3,views:i,output:s,outputType:o="relative",maxAttempts:a=3}){t.info(`${K.cyan("export output")} ${K.dim(s)}`),t.info(
|
|
738
|
+
`${K.cyan("from server")} ${K.dim(e)}`);const c=nu.executablePath();t.info(K.cyan("Start chromium")),t.info(K.dim(c));const l=await nu.launch();t.info(K.cyan("Color scheme: ")+r);const u=await l.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:e,ignoreHTTPSErrors:!0,reducedMotion:"reduce",isMobile:!1});u.setDefaultNavigationTimeout(n),u.setDefaultTimeout(n);try{return await cy({browserContext:u,views:i,output:s,outputType:o,logger:t,maxAttempts:a,timeout:n,theme:r})}finally{t.info(K.cyan("c\
|
|
739
|
+
lose chromium")),await u.close(),await l.close()}}async function kc({path:t,useDotBin:e,theme:r="light",output:n,outputType:i,serverUrl:s,ignore:o=!1,timeoutMs:a=1e4,maxAttempts:c=3}){const l=pt("c4:export"),u=jp(),d=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});n??=d.workspace;const h=await d.diagrams();if(!Zp(h,1))throw l.warn("no views found"),new Error("no views found");let E;if(!s&&(l.info(K.cyan("start preview server")),E=await Lc({languageServices:d,buildWebcomponent:!1,
|
|
740
|
+
openBrowser:!1,useOverviewGraph:!1,hmr:!1}),s=Ic(E),!s))throw l.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");try{const $=await jc({logger:l,serverUrl:s,theme:r,timeoutMs:a,views:h,output:n,outputType:i,maxAttempts:c}),{pretty:y}=Op(u);if($.length>0&&l.info(K.green(`exported ${$.length} views in ${y}`)),$.length!==h.length&&(o&&$.length>0?l.info(K.dim("ignore")+" "+K.red(`failed ${h.length-$.length} out of ${h.length} views`)):l.error(K.
|
|
741
|
+
red(`failed ${h.length-$.length} out of ${h.length} views`))),$.length!==h.length&&($.length===0||!o))throw new Error(`Failed ${h.length-$.length} out of ${h.length} views`)}finally{E&&(l.info(K.cyan("stop server")),await E.close().catch($=>{l.error($)}))}}const{cyan:Bc,dim:xc}=K;async function fy({path:t,useDotBin:e,useHashHistory:r,webcomponentPrefix:n,useOverview:i=!1,output:s,outputSingleFile:o,base:a}){const c=pt("c4:build"),l=await gt.fromWorkspace(t,{graphviz:e?"binary":"wasm",logger:"vit\
|
|
742
|
+
e"}),u=s??De(l.workspace,"dist");let d=De(u,"assets");if(i)try{d=De(u,"assets","previews"),await $t(d,{recursive:!0}),c.info(`${Bc("Generate previews")} ${xc(d)}
|
|
743
|
+
`),await kc({path:t,useDotBin:e,output:d,outputType:"flat",ignore:!0})}catch(h){c.error(K.red("Failed to generate previews")),c.error(h),c.warn(K.yellow("Ignore previews and continue build")),is(d,{recursive:!0,force:!0}),i=!1}await sy({base:a,useHashHistory:o||r,customLogger:c,useOverviewGraph:i,webcomponentPrefix:n,languageServices:l,likec4AssetsDir:d,outputDir:s,outputSingleFile:o}),i&&(c.info(`${Bc("clean previews")} ${xc(d)}`),is(d,{recursive:!0,force:!0}))}const dy={command:"build [path]",
|
|
744
|
+
aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("path",zr).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:De}).option("base",Gu).option("use-hash-history",zu).option("use-dot",at).option("webcomponent-prefix",Cs).option("use-overview",Wu).option("output-single-file",A0).example(`${K.green("$0 build -o ./build ./src")}`,K.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async t=>{
|
|
745
745
|
await fy({path:t.path,output:t.output,base:t.base,useHashHistory:t["use-hash-history"],useDotBin:t["use-dot"],useOverview:t["use-overview"]??!1,webcomponentPrefix:t["webcomponent-prefix"],outputSingleFile:t["output-single-file"]??!1})}},ur=t=>{const e=typeof t;return t!==null&&(e==="object"||e==="function")},ho=new Set(["__proto__","prototype","constructor"]),hy=new Set("0123456789");function Tn(t){const e=[];let r="",n="start",i=!1;for(const s of t)switch(s){case"\\":{if(n==="index")throw new Error(
|
|
746
746
|
"Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=s),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=s;break}if(ho.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=s;break}if(n==="property"){if(ho.has(r))return[];e.push(
|
|
747
747
|
r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!hy.has(s))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=s}}switch(i&&(r+="\\"),n){case"property":{if(ho.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not \
|
|
748
|
-
closed");case"start":{e.push("");break}}return e}function po(t,e){if(typeof e!="number"&&Array.isArray(t)){const r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function
|
|
749
|
-
void 0?r:t}function
|
|
748
|
+
closed");case"start":{e.push("");break}}return e}function po(t,e){if(typeof e!="number"&&Array.isArray(t)){const r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function Mc(t,e){if(po(t,e))throw new Error("Cannot use string index")}function py(t,e,r){if(!ur(t)||typeof e!="string")return r===void 0?t:r;const n=Tn(e);if(n.length===0)return r;for(let i=0;i<n.length;i++){const s=n[i];if(po(t,s)?t=i===n.length-1?void 0:null:t=t[s],t==null){if(i!==n.length-1)return r;break}}return t===
|
|
749
|
+
void 0?r:t}function qc(t,e,r){if(!ur(t)||typeof e!="string")return t;const n=t,i=Tn(e);for(let s=0;s<i.length;s++){const o=i[s];Mc(t,o),s===i.length-1?t[o]=r:ur(t[o])||(t[o]=typeof i[s+1]=="number"?[]:{}),t=t[o]}return n}function my(t,e){if(!ur(t)||typeof e!="string")return!1;const r=Tn(e);for(let n=0;n<r.length;n++){const i=r[n];if(Mc(t,i),n===r.length-1)return delete t[i],!0;if(t=t[i],!ur(t))return!1}}function gy(t,e){if(!ur(t)||typeof e!="string")return!1;const r=Tn(e);if(r.length===0)return!1;
|
|
750
750
|
for(const n of r){if(!ur(t)||!(n in t)||po(t,n))return!1;t=t[n]}return!0}const Mt=Ir.homedir(),mo=Ir.tmpdir(),{env:Dr}=Te,yy=t=>{const e=be.join(Mt,"Library");return{data:be.join(e,"Application Support",t),config:be.join(e,"Preferences",t),cache:be.join(e,"Caches",t),log:be.join(e,"Logs",t),temp:be.join(mo,t)}},Ey=t=>{const e=Dr.APPDATA||be.join(Mt,"AppData","Roaming"),r=Dr.LOCALAPPDATA||be.join(Mt,"AppData","Local");return{data:be.join(r,t,"Data"),config:be.join(e,t,"Config"),cache:be.join(r,t,
|
|
751
751
|
"Cache"),log:be.join(r,t,"Log"),temp:be.join(mo,t)}},Dy=t=>{const e=be.basename(Mt);return{data:be.join(Dr.XDG_DATA_HOME||be.join(Mt,".local","share"),t),config:be.join(Dr.XDG_CONFIG_HOME||be.join(Mt,".config"),t),cache:be.join(Dr.XDG_CACHE_HOME||be.join(Mt,".cache"),t),log:be.join(Dr.XDG_STATE_HOME||be.join(Mt,".local","state"),t),temp:be.join(mo,e,t)}};function vy(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),Te.
|
|
752
752
|
platform==="darwin"?yy(t):Te.platform==="win32"?Ey(t):Dy(t)}const qt=(t,e)=>function(...n){return t.apply(void 0,n).catch(e)},St=(t,e)=>function(...n){try{return t.apply(void 0,n)}catch(i){return e(i)}},$y=Te.getuid?!Te.getuid():!1,_y=1e4,Je=()=>{},Re={isChangeErrorOk:t=>{if(!Re.isNodeError(t))return!1;const{code:e}=t;return e==="ENOSYS"||!$y&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!Re.isNodeError(t))return!1;const{code:e}=t;return e==="EMFILE"||e===
|
|
@@ -755,110 +755,110 @@ queueWaiting.add(e),this.queueActive.size<this.limit/2?this.tick():this.init()},
|
|
|
755
755
|
return function i(...s){return by.schedule().then(o=>{const a=l=>(o(),l),c=l=>{if(o(),Date.now()>=n)throw l;if(e(l)){const u=Math.round(100*Math.random());return new Promise(h=>setTimeout(h,u)).then(()=>i.apply(void 0,s))}throw l};return t.apply(void 0,s).then(a,c)})}},Ht=(t,e)=>function(n){return function i(...s){try{return t.apply(void 0,s)}catch(o){if(Date.now()>n)throw o;if(e(o))return i.apply(void 0,s);throw o}}},qe={attempt:{chmod:qt(Me(ge.chmod),Re.onChangeError),chown:qt(Me(ge.chown),Re.
|
|
756
756
|
onChangeError),close:qt(Me(ge.close),Je),fsync:qt(Me(ge.fsync),Je),mkdir:qt(Me(ge.mkdir),Je),realpath:qt(Me(ge.realpath),Je),stat:qt(Me(ge.stat),Je),unlink:qt(Me(ge.unlink),Je),chmodSync:St(ge.chmodSync,Re.onChangeError),chownSync:St(ge.chownSync,Re.onChangeError),closeSync:St(ge.closeSync,Je),existsSync:St(ge.existsSync,Je),fsyncSync:St(ge.fsync,Je),mkdirSync:St(ge.mkdirSync,Je),realpathSync:St(ge.realpathSync,Je),statSync:St(ge.statSync,Je),unlinkSync:St(ge.unlinkSync,Je)},retry:{close:Ut(Me(ge.
|
|
757
757
|
close),Re.isRetriableError),fsync:Ut(Me(ge.fsync),Re.isRetriableError),open:Ut(Me(ge.open),Re.isRetriableError),readFile:Ut(Me(ge.readFile),Re.isRetriableError),rename:Ut(Me(ge.rename),Re.isRetriableError),stat:Ut(Me(ge.stat),Re.isRetriableError),write:Ut(Me(ge.write),Re.isRetriableError),writeFile:Ut(Me(ge.writeFile),Re.isRetriableError),closeSync:Ht(ge.closeSync,Re.isRetriableError),fsyncSync:Ht(ge.fsyncSync,Re.isRetriableError),openSync:Ht(ge.openSync,Re.isRetriableError),readFileSync:Ht(ge.readFileSync,
|
|
758
|
-
Re.isRetriableError),renameSync:Ht(ge.renameSync,Re.isRetriableError),statSync:Ht(ge.statSync,Re.isRetriableError),writeSync:Ht(ge.writeSync,Re.isRetriableError),writeFileSync:Ht(ge.writeFileSync,Re.isRetriableError)}},Ay="utf8",
|
|
759
|
-
"SIGHUP","SIGINT","SIGTERM"];
|
|
758
|
+
Re.isRetriableError),renameSync:Ht(ge.renameSync,Re.isRetriableError),statSync:Ht(ge.statSync,Re.isRetriableError),writeSync:Ht(ge.writeSync,Re.isRetriableError),writeFileSync:Ht(ge.writeFileSync,Re.isRetriableError)}},Ay="utf8",Uc=438,Cy=511,Sy={},Ry=Ir.userInfo().uid,Oy=Ir.userInfo().gid,Iy=1e3,Fy=!!Te.getuid;Te.getuid&&Te.getuid();const Hc=128,Py=t=>t instanceof Error&&"code"in t,Vc=t=>typeof t=="string",go=t=>t===void 0,Ny=Te.platform==="linux",zc=Te.platform==="win32",yo=["SIGABRT","SIGALRM",
|
|
759
|
+
"SIGHUP","SIGINT","SIGTERM"];zc||yo.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),Ny&&yo.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class Ty{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const r of this.callbacks)r();e&&(zc&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Te.kill(Te.pid,"SIGTERM"):Te.kill(Te.pid,e))}},this.hook=()=>{Te.once("exit",()=>this.exit());for(const e of yo)try{Te.once(
|
|
760
760
|
e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}const Ly=new Ty,jy=Ly.register,Ue={store:{},create:t=>{const e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),i=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${t}${i}`},get:(t,e,r=!0)=>{const n=Ue.truncate(e(t));return n in Ue.store?Ue.get(t,e,r):(Ue.store[n]=r,[n,()=>delete Ue.store[n]])},purge:t=>{Ue.store[t]&&(delete Ue.store[t],qe.attempt.unlink(t))},
|
|
761
|
-
purgeSync:t=>{Ue.store[t]&&(delete Ue.store[t],qe.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(const t in Ue.store)Ue.purgeSync(t)},truncate:t=>{const e=be.basename(t);if(e.length<=
|
|
762
|
-
s=null,o=null;try{const a=qe.attempt.realpathSync(t),c=!!a;t=a||t,[s,i]=Ue.get(t,r.tmpCreate||Ue.create,r.tmpPurge!==!1);const l=Fy&&go(r.chown),u=go(r.mode);if(c&&(l||u)){const d=qe.attempt.statSync(t);d&&(r={...r},l&&(r.chown={uid:d.uid,gid:d.gid}),u&&(r.mode=d.mode))}if(!c){const d=be.dirname(t);qe.attempt.mkdirSync(d,{mode:Cy,recursive:!0})}o=qe.retry.openSync(n)(s,"w",r.mode||
|
|
763
|
-
0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?qe.retry.fsyncSync(n)(o):qe.attempt.fsync(o)),qe.retry.closeSync(n)(o),o=null,r.chown&&(r.chown.uid!==Ry||r.chown.gid!==Oy)&&qe.attempt.chownSync(s,r.chown.uid,r.chown.gid),r.mode&&r.mode!==
|
|
764
|
-
vo={},$o={},
|
|
765
|
-
return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((m,
|
|
766
|
-
{})}}t._Code=n,t.nil=new n("");function i(g,...p){const m=[g[0]];let
|
|
761
|
+
purgeSync:t=>{Ue.store[t]&&(delete Ue.store[t],qe.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(const t in Ue.store)Ue.purgeSync(t)},truncate:t=>{const e=be.basename(t);if(e.length<=Hc)return t;const r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!r)return t;const n=e.length-Hc;return`${t.slice(0,-e.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};jy(Ue.purgeSyncAll);function Gc(t,e,r=Sy){if(Vc(r))return Gc(t,e,{encoding:r});const n=Date.now()+((r.timeout??Iy)||-1);let i=null,
|
|
762
|
+
s=null,o=null;try{const a=qe.attempt.realpathSync(t),c=!!a;t=a||t,[s,i]=Ue.get(t,r.tmpCreate||Ue.create,r.tmpPurge!==!1);const l=Fy&&go(r.chown),u=go(r.mode);if(c&&(l||u)){const d=qe.attempt.statSync(t);d&&(r={...r},l&&(r.chown={uid:d.uid,gid:d.gid}),u&&(r.mode=d.mode))}if(!c){const d=be.dirname(t);qe.attempt.mkdirSync(d,{mode:Cy,recursive:!0})}o=qe.retry.openSync(n)(s,"w",r.mode||Uc),r.tmpCreated&&r.tmpCreated(s),Vc(e)?qe.retry.writeSync(n)(o,e,0,r.encoding||Ay):go(e)||qe.retry.writeSync(n)(o,e,
|
|
763
|
+
0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?qe.retry.fsyncSync(n)(o):qe.attempt.fsync(o)),qe.retry.closeSync(n)(o),o=null,r.chown&&(r.chown.uid!==Ry||r.chown.gid!==Oy)&&qe.attempt.chownSync(s,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Uc&&qe.attempt.chmodSync(s,r.mode);try{qe.retry.renameSync(n)(s,t)}catch(d){if(!Py(d)||d.code!=="ENAMETOOLONG")throw d;qe.retry.renameSync(n)(s,Ue.truncate(t))}i(),s=null}finally{o&&qe.attempt.closeSync(o),s&&Ue.purge(s)}}var Ln={exports:{}},Eo={},Rt={},cr={},Do={},
|
|
764
|
+
vo={},$o={},Wc;function jn(){return Wc||(Wc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(p){if(super(),!t.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){
|
|
765
|
+
return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((m,D)=>`${m}${D}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((m,D)=>(D instanceof r&&(m[D.str]=(m[D.str]||0)+1),m),
|
|
766
|
+
{})}}t._Code=n,t.nil=new n("");function i(g,...p){const m=[g[0]];let D=0;for(;D<p.length;)a(m,p[D]),m.push(g[++D]);return new n(m)}t._=i;const s=new n("+");function o(g,...p){const m=[E(g[0])];let D=0;for(;D<p.length;)m.push(s),a(m,p[D]),m.push(s,E(g[++D]));return c(m),new n(m)}t.str=o;function a(g,p){p instanceof n?g.push(...p._items):p instanceof r?g.push(p):g.push(d(p))}t.addCodeArg=a;function c(g){let p=1;for(;p<g.length-1;){if(g[p]===s){const m=l(g[p-1],g[p+1]);if(m!==void 0){g.splice(p-1,3,
|
|
767
767
|
m);continue}g[p++]="+"}p++}}function l(g,p){if(p==='""')return g;if(g==='""')return p;if(typeof g=="string")return p instanceof r||g[g.length-1]!=='"'?void 0:typeof p!="string"?`${g.slice(0,-1)}${p}"`:p[0]==='"'?g.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(g instanceof r))return`"${g}${p.slice(1)}`}function u(g,p){return p.emptyStr()?g:g.emptyStr()?p:o`${g}${p}`}t.strConcat=u;function d(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:E(Array.isArray(g)?g.join(
|
|
768
|
-
","):g)}function h(g){return new n(E(g))}t.stringify=h;function E(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=E;function
|
|
769
|
-
regexpCode=f}($o)),$o}var _o={},
|
|
768
|
+
","):g)}function h(g){return new n(E(g))}t.stringify=h;function E(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=E;function $(g){return typeof g=="string"&&t.IDENTIFIER.test(g)?new n(`.${g}`):i`[${g}]`}t.getProperty=$;function y(g){if(typeof g=="string"&&t.IDENTIFIER.test(g))return new n(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}t.getEsmExportName=y;function f(g){return new n(g.toString())}t.
|
|
769
|
+
regexpCode=f}($o)),$o}var _o={},Kc;function Yc(){return Kc||(Kc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=jn();class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};
|
|
770
770
|
class i{constructor({prefixes:l,parent:u}={}){this._names={},this._prefixes=l,this._parent=u}toName(l){return l instanceof e.Name?l:this.name(l)}name(l){return new e.Name(this._newName(l))}_newName(l){const u=this._names[l]||this._nameGroup(l);return`${l}${u.index++}`}_nameGroup(l){var u,d;if(!((d=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||d===void 0)&&d.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this.
|
|
771
771
|
_names[l]={prefix:l,index:0}}}t.Scope=i;class s extends e.Name{constructor(l,u){super(u),this.prefix=l}setValue(l,{property:u,itemIndex:d}){this.value=l,this.scopePath=(0,e._)`.${new e.Name(u)}[${d}]`}}t.ValueScopeName=s;const o=(0,e._)`\n`;class a extends i{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:e.nil}}get(){return this._scope}name(l){return new s(l,this._newName(l))}value(l,u){var d;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed\
|
|
772
|
-
in value");const h=this.toName(l),{prefix:E}=h
|
|
773
|
-
_)`${l}${d.scopePath}`})}scopeCode(l=this._values,u,d){return this._reduceValues(l,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},u,d)}_reduceValues(l,u,d={},h){let E=e.nil;for(const
|
|
774
|
-
opts._n}`;else throw new r(g);f.set(g,n.Completed)})}return E}}t.ValueScope=a}(_o)),_o}var
|
|
772
|
+
in value");const h=this.toName(l),{prefix:E}=h,$=(d=u.key)!==null&&d!==void 0?d:u.ref;let y=this._values[E];if(y){const p=y.get($);if(p)return p}else y=this._values[E]=new Map;y.set($,h);const f=this._scope[E]||(this._scope[E]=[]),g=f.length;return f[g]=u.ref,h.setValue(u,{property:E,itemIndex:g}),h}getValue(l,u){const d=this._values[l];if(d)return d.get(u)}scopeRefs(l,u=this._values){return this._reduceValues(u,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,e.
|
|
773
|
+
_)`${l}${d.scopePath}`})}scopeCode(l=this._values,u,d){return this._reduceValues(l,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},u,d)}_reduceValues(l,u,d={},h){let E=e.nil;for(const $ in l){const y=l[$];if(!y)continue;const f=d[$]=d[$]||new Map;y.forEach(g=>{if(f.has(g))return;f.set(g,n.Started);let p=u(g);if(p){const m=this.opts.es5?t.varKinds.var:t.varKinds.const;E=(0,e._)`${E}${m} ${g} = ${p};${this.opts._n}`}else if(p=h?.(g))E=(0,e._)`${E}${p}${this.
|
|
774
|
+
opts._n}`;else throw new r(g);f.set(g,n.Completed)})}return E}}t.ValueScope=a}(_o)),_o}var Jc;function pe(){return Jc||(Jc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=jn(),r=Yc();var n=jn();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,
|
|
775
775
|
get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,
|
|
776
|
-
get:function(){return n.Name}});var i=
|
|
776
|
+
get:function(){return n.Name}});var i=Yc();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e.
|
|
777
777
|
_Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{optimizeNodes(){return this}optimizeNames(w,A){return this}}class o extends s{constructor(w,A,R){super(),this.varKind=w,this.name=A,this.rhs=R}render({es5:w,_n:A}){const R=w?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${R} ${this.name}${J};`+A}optimizeNames(w,A){if(w[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,w,A)),this}get names(){
|
|
778
778
|
return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(w,A,R){super(),this.lhs=w,this.rhs=A,this.sideEffects=R}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,A){if(!(this.lhs instanceof e.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=j(this.rhs,w,A),this}get names(){const w=this.lhs instanceof e.Name?{}:{...this.lhs.names};return N(w,this.rhs)}}class c extends a{constructor(w,A,R,J){super(w,R,J),this.op=A}render({_n:w}){return`${this.
|
|
779
779
|
lhs} ${this.op}= ${this.rhs};`+w}}class l extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}}class u extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}}class d extends s{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}}class h extends s{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code}\
|
|
780
780
|
;`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,A){return this.code=j(this.code,w,A),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class E extends s{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((A,R)=>A+R.render(w),"")}optimizeNodes(){const{nodes:w}=this;let A=w.length;for(;A--;){const R=w[A].optimizeNodes();Array.isArray(R)?w.splice(A,1,...R):R?w[A]=R:w.splice(A,1)}return w.length>0?this:void 0}optimizeNames(w,A){
|
|
781
|
-
const{nodes:R}=this;let J=R.length;for(;J--;){const Z=R[J];Z.optimizeNames(w,A)||(M(w,Z.names),R.splice(J,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((w,A)=>B(w,A.names),{})}}class
|
|
781
|
+
const{nodes:R}=this;let J=R.length;for(;J--;){const Z=R[J];Z.optimizeNames(w,A)||(M(w,Z.names),R.splice(J,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((w,A)=>B(w,A.names),{})}}class $ extends E{render(w){return"{"+w._n+super.render(w)+"}"+w._n}}class y extends E{}class f extends ${}f.kind="else";class g extends ${constructor(w,A){super(A),this.condition=w}render(w){let A=`if(${this.condition})`+super.render(w);return this.else&&(A+="else "+this.else.render(w)),A}optimizeNodes(){
|
|
782
782
|
super.optimizeNodes();const w=this.condition;if(w===!0)return this.nodes;let A=this.else;if(A){const R=A.optimizeNodes();A=this.else=Array.isArray(R)?new f(R):R}if(A)return w===!1?A instanceof g?A:A.nodes:this.nodes.length?this:new g(Y(w),A instanceof g?[A]:A.nodes);if(!(w===!1||!this.nodes.length))return this}optimizeNames(w,A){var R;if(this.else=(R=this.else)===null||R===void 0?void 0:R.optimizeNames(w,A),!!(super.optimizeNames(w,A)||this.else))return this.condition=j(this.condition,w,A),this}get names(){
|
|
783
|
-
const w=super.names;return N(w,this.condition),this.else&&B(w,this.else.names),w}}g.kind="if";class p extends
|
|
784
|
-
es5?r.varKinds.var:this.varKind,{name:R,from:J,to:Z}=this;return`for(${A} ${R}=${J}; ${R}<${Z}; ${R}++)`+super.render(w)}get names(){const w=N(super.names,this.from);return N(w,this.to)}}class
|
|
785
|
-
super.names,this.iterable.names)}}class _ extends
|
|
786
|
-
(w=this.catch)===null||w===void 0||w.optimizeNodes(),(A=this.finally)===null||A===void 0||A.optimizeNodes(),this}optimizeNames(w,A){var R,J;return super.optimizeNames(w,A),(R=this.catch)===null||R===void 0||R.optimizeNames(w,A),(J=this.finally)===null||J===void 0||J.optimizeNames(w,A),this}get names(){const w=super.names;return this.catch&&B(w,this.catch.names),this.finally&&B(w,this.finally.names),w}}class
|
|
787
|
-
render(w)}}
|
|
788
|
-
`:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new
|
|
783
|
+
const w=super.names;return N(w,this.condition),this.else&&B(w,this.else.names),w}}g.kind="if";class p extends ${}p.kind="for";class m extends p{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,A){if(super.optimizeNames(w,A))return this.iteration=j(this.iteration,w,A),this}get names(){return B(super.names,this.iteration.names)}}class D extends p{constructor(w,A,R,J){super(),this.varKind=w,this.name=A,this.from=R,this.to=J}render(w){const A=w.
|
|
784
|
+
es5?r.varKinds.var:this.varKind,{name:R,from:J,to:Z}=this;return`for(${A} ${R}=${J}; ${R}<${Z}; ${R}++)`+super.render(w)}get names(){const w=N(super.names,this.from);return N(w,this.to)}}class v extends p{constructor(w,A,R,J){super(),this.loop=w,this.varKind=A,this.name=R,this.iterable=J}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,A){if(super.optimizeNames(w,A))return this.iterable=j(this.iterable,w,A),this}get names(){return B(
|
|
785
|
+
super.names,this.iterable.names)}}class _ extends ${constructor(w,A,R){super(),this.name=w,this.args=A,this.async=R}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}}_.kind="func";class b extends E{render(w){return"return "+super.render(w)}}b.kind="return";class I extends ${render(w){let A="try"+super.render(w);return this.catch&&(A+=this.catch.render(w)),this.finally&&(A+=this.finally.render(w)),A}optimizeNodes(){var w,A;return super.optimizeNodes(),
|
|
786
|
+
(w=this.catch)===null||w===void 0||w.optimizeNodes(),(A=this.finally)===null||A===void 0||A.optimizeNodes(),this}optimizeNames(w,A){var R,J;return super.optimizeNames(w,A),(R=this.catch)===null||R===void 0||R.optimizeNames(w,A),(J=this.finally)===null||J===void 0||J.optimizeNames(w,A),this}get names(){const w=super.names;return this.catch&&B(w,this.catch.names),this.finally&&B(w,this.finally.names),w}}class U extends ${constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.
|
|
787
|
+
render(w)}}U.kind="catch";class G extends ${render(w){return"finally"+super.render(w)}}G.kind="finally";class L{constructor(w,A={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...A,_n:A.lines?`
|
|
788
|
+
`:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,A){const R=this._extScope.value(w,A);return(this._values[R.prefix]||(this._values[R.prefix]=new Set)).add(R),R}getScopeValue(w,A){return this._extScope.getValue(w,A)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,A,R,J){
|
|
789
789
|
const Z=this._scope.toName(A);return R!==void 0&&J&&(this._constants[Z.str]=R),this._leafNode(new o(w,Z,R)),Z}const(w,A,R){return this._def(r.varKinds.const,w,A,R)}let(w,A,R){return this._def(r.varKinds.let,w,A,R)}var(w,A,R){return this._def(r.varKinds.var,w,A,R)}assign(w,A,R){return this._leafNode(new a(w,A,R))}add(w,A){return this._leafNode(new c(w,t.operators.ADD,A))}code(w){return typeof w=="function"?w():w!==e.nil&&this._leafNode(new h(w)),this}object(...w){const A=["{"];for(const[R,J]of w)
|
|
790
790
|
A.length>1&&A.push(","),A.push(R),(R!==J||this.opts.es5)&&(A.push(":"),(0,e.addCodeArg)(A,J));return A.push("}"),new e._Code(A)}if(w,A,R){if(this._blockNode(new g(w)),A&&R)this.code(A).else().code(R).endIf();else if(A)this.code(A).endIf();else if(R)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new g(w))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(g,f)}_for(w,A){return this._blockNode(w),A&&this.code(A).endFor(),this}for(w,A){
|
|
791
|
-
return this._for(new m(w),A)}forRange(w,A,R,J,Z=this.opts.es5?r.varKinds.var:r.varKinds.let){const oe=this._scope.toName(w);return this._for(new
|
|
792
|
-
if(this.opts.ownProperties)return this.forOf(w,(0,e._)`Object.keys(${A})`,R);const Z=this._scope.toName(w);return this._for(new
|
|
793
|
-
atch" and "finally"');const J=new I;if(this._blockNode(J),this.code(w),A){const Z=this.name("e");this._currNode=J.catch=new
|
|
791
|
+
return this._for(new m(w),A)}forRange(w,A,R,J,Z=this.opts.es5?r.varKinds.var:r.varKinds.let){const oe=this._scope.toName(w);return this._for(new D(Z,oe,A,R),()=>J(oe))}forOf(w,A,R,J=r.varKinds.const){const Z=this._scope.toName(w);if(this.opts.es5){const oe=A instanceof e.Name?A:this.var("_arr",A);return this.forRange("_i",0,(0,e._)`${oe}.length`,ae=>{this.var(Z,(0,e._)`${oe}[${ae}]`),R(Z)})}return this._for(new v("of",J,Z,A),()=>R(Z))}forIn(w,A,R,J=this.opts.es5?r.varKinds.var:r.varKinds.const){
|
|
792
|
+
if(this.opts.ownProperties)return this.forOf(w,(0,e._)`Object.keys(${A})`,R);const Z=this._scope.toName(w);return this._for(new v("in",J,Z,A),()=>R(Z))}endFor(){return this._endBlockNode(p)}label(w){return this._leafNode(new l(w))}break(w){return this._leafNode(new u(w))}return(w){const A=new b;if(this._blockNode(A),this.code(w),A.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(b)}try(w,A,R){if(!A&&!R)throw new Error('CodeGen: "try" without "c\
|
|
793
|
+
atch" and "finally"');const J=new I;if(this._blockNode(J),this.code(w),A){const Z=this.name("e");this._currNode=J.catch=new U(Z),A(Z)}return R&&(this._currNode=J.finally=new G,this.code(R)),this._endBlockNode(U,G)}throw(w){return this._leafNode(new d(w))}block(w,A){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(A),this}endBlock(w){const A=this._blockStarts.pop();if(A===void 0)throw new Error("CodeGen: not in self-balancing block");const R=this._nodes.length-A;if(R<0||
|
|
794
794
|
w!==void 0&&R!==w)throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${w} expected`);return this._nodes.length=A,this}func(w,A=e.nil,R,J){return this._blockNode(new _(w,A,R)),J&&this.code(J).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,A){
|
|
795
795
|
const R=this._currNode;if(R instanceof w||A&&R instanceof A)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${A?`${w.kind}/${A.kind}`:w.kind}"`)}_elseNode(w){const A=this._currNode;if(!(A instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=A.else=w,this}get _root(){return this._nodes[0]}get _currNode(){const w=this._nodes;return w[w.length-1]}set _currNode(w){const A=this._nodes;A[A.length-1]=w}}t.CodeGen=L;function B(k,w){for(const A in w)k[A]=
|
|
796
796
|
(k[A]||0)+(w[A]||0);return k}function N(k,w){return w instanceof e._CodeOrName?B(k,w.names):k}function j(k,w,A){if(k instanceof e.Name)return R(k);if(!J(k))return k;return new e._Code(k._items.reduce((Z,oe)=>(oe instanceof e.Name&&(oe=R(oe)),oe instanceof e._Code?Z.push(...oe._items):Z.push(oe),Z),[]));function R(Z){const oe=A[Z.str];return oe===void 0||w[Z.str]!==1?Z:(delete w[Z.str],oe)}function J(Z){return Z instanceof e._Code&&Z._items.some(oe=>oe instanceof e.Name&&w[oe.str]===1&&A[oe.str]!==
|
|
797
|
-
void 0)}}function M(k,w){for(const A in w)k[A]=(k[A]||0)-(w[A]||0)}function Y(k){return typeof k=="boolean"||typeof k=="number"||k===null?!k:(0,e._)`!${
|
|
798
|
-
|
|
799
|
-
"boolean"?_:Object.keys(_).length===0?!0:(i(
|
|
800
|
-
return!1}Ee.schemaHasRulesButRef=o;function a({topSchemaRef
|
|
801
|
-
return
|
|
802
|
-
()=>{
|
|
803
|
-
()
|
|
804
|
-
_.code))})}Ee.useFunc=g;var p;(function(
|
|
805
|
-
checkStrictMode=
|
|
806
|
-
Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return kn.default=e,kn}var
|
|
807
|
-
keyword:f,schemaType:g})=>g?(0,e.str)`"${f}" keyword must be ${g} ($data)`:(0,e.str)`"${f}" keyword is invalid ($data)`};function i(f,g=t.keywordError,p,m){const{it:
|
|
808
|
-
()=>f.if(g,()=>f.assign((0,e._)`${n.default.vErrors}.length`,g),()=>f.assign(n.default.vErrors,null)))}t.resetErrorsCount=o;function a({gen:f,keyword:g,schemaValue:p,data:m,errsCount:
|
|
809
|
-
(0,e._)`${_}.schemaPath`,(0,e.str)`${
|
|
810
|
-
(0,e._)`${m}.errors`,g),p.return(!1))}const u={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function d(f,g,p){const{createErrors:m}=f.it;return m===!1?(0,e._)`{}`:h(f,g,p)}function h(f,g,p={}){const{gen:m,it:
|
|
811
|
-
(0,e.str)`${f}${(0,r.getErrorPath)(g,r.Type.Str)}`:f;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,p)]}function
|
|
812
|
-
g(f):g||(0,e._)`{}`]),I.messages&&m.push([u.message,typeof p=="function"?p(f):p]),I.verbose&&m.push([u.schema,_],[u.parentSchema,(0,e._)`${G}${L}`],[n.default.data
|
|
813
|
-
ct"&&l.$async===!0?c.return(r.default.data):(c.assign((0,e._)`${u}.errors`,null),c.return(!0))}cr.topBoolOrEmptySchema=i;function s(a,c){const{gen:l,schema:u}=a;u===!1?(l.var(c,!1),o(a)):l.var(c,!0)}cr.boolOrEmptySchema=s;function o(a,c){const{gen:l,data:u}=a,d={gen:l,keyword:"false schema",data:u,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(d,n,void 0,c)}return cr}var xe={},lr={},
|
|
797
|
+
void 0)}}function M(k,w){for(const A in w)k[A]=(k[A]||0)-(w[A]||0)}function Y(k){return typeof k=="boolean"||typeof k=="number"||k===null?!k:(0,e._)`!${H(k)}`}t.not=Y;const z=C(t.operators.AND);function X(...k){return k.reduce(z)}t.and=X;const se=C(t.operators.OR);function q(...k){return k.reduce(se)}t.or=q;function C(k){return(w,A)=>w===e.nil?A:A===e.nil?w:(0,e._)`${H(w)} ${k} ${H(A)}`}function H(k){return k instanceof e.Name?k:(0,e._)`(${k})`}}(vo)),vo}var Ee={},Xc;function _e(){if(Xc)return Ee;
|
|
798
|
+
Xc=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.checkStrictMode=Ee.getErrorPath=Ee.Type=Ee.useFunc=Ee.setEvaluated=Ee.evaluatedPropsToName=Ee.mergeEvaluated=Ee.eachItem=Ee.unescapeJsonPointer=Ee.escapeJsonPointer=Ee.escapeFragment=Ee.unescapeFragment=Ee.schemaRefOrVal=Ee.schemaHasRulesButRef=Ee.schemaHasRules=Ee.checkUnknownRules=Ee.alwaysValidSchema=Ee.toHash=void 0;const t=pe(),e=jn();function r(v){const _={};for(const b of v)_[b]=!0;return _}Ee.toHash=r;function n(v,_){return typeof _==
|
|
799
|
+
"boolean"?_:Object.keys(_).length===0?!0:(i(v,_),!s(_,v.self.RULES.all))}Ee.alwaysValidSchema=n;function i(v,_=v.schema){const{opts:b,self:I}=v;if(!b.strictSchema||typeof _=="boolean")return;const U=I.RULES.keywords;for(const G in _)U[G]||D(v,`unknown keyword: "${G}"`)}Ee.checkUnknownRules=i;function s(v,_){if(typeof v=="boolean")return!v;for(const b in v)if(_[b])return!0;return!1}Ee.schemaHasRules=s;function o(v,_){if(typeof v=="boolean")return!v;for(const b in v)if(b!=="$ref"&&_.all[b])return!0;
|
|
800
|
+
return!1}Ee.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:_},b,I,U){if(!U){if(typeof b=="number"||typeof b=="boolean")return b;if(typeof b=="string")return(0,t._)`${b}`}return(0,t._)`${v}${_}${(0,t.getProperty)(I)}`}Ee.schemaRefOrVal=a;function c(v){return d(decodeURIComponent(v))}Ee.unescapeFragment=c;function l(v){return encodeURIComponent(u(v))}Ee.escapeFragment=l;function u(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}Ee.escapeJsonPointer=u;function d(v){
|
|
801
|
+
return v.replace(/~1/g,"/").replace(/~0/g,"~")}Ee.unescapeJsonPointer=d;function h(v,_){if(Array.isArray(v))for(const b of v)_(b);else _(v)}Ee.eachItem=h;function E({mergeNames:v,mergeToName:_,mergeValues:b,resultToName:I}){return(U,G,L,B)=>{const N=L===void 0?G:L instanceof t.Name?(G instanceof t.Name?v(U,G,L):_(U,G,L),L):G instanceof t.Name?(_(U,L,G),G):b(G,L);return B===t.Name&&!(N instanceof t.Name)?I(U,N):N}}Ee.mergeEvaluated={props:E({mergeNames:(v,_,b)=>v.if((0,t._)`${b} !== true && ${_} !== undefined`,
|
|
802
|
+
()=>{v.if((0,t._)`${_} === true`,()=>v.assign(b,!0),()=>v.assign(b,(0,t._)`${b} || {}`).code((0,t._)`Object.assign(${b}, ${_})`))}),mergeToName:(v,_,b)=>v.if((0,t._)`${b} !== true`,()=>{_===!0?v.assign(b,!0):(v.assign(b,(0,t._)`${b} || {}`),y(v,b,_))}),mergeValues:(v,_)=>v===!0?!0:{...v,..._},resultToName:$}),items:E({mergeNames:(v,_,b)=>v.if((0,t._)`${b} !== true && ${_} !== undefined`,()=>v.assign(b,(0,t._)`${_} === true ? true : ${b} > ${_} ? ${b} : ${_}`)),mergeToName:(v,_,b)=>v.if((0,t._)`${b} !== true`,
|
|
803
|
+
()=>v.assign(b,_===!0?!0:(0,t._)`${b} > ${_} ? ${b} : ${_}`)),mergeValues:(v,_)=>v===!0?!0:Math.max(v,_),resultToName:(v,_)=>v.var("items",_)})};function $(v,_){if(_===!0)return v.var("props",!0);const b=v.var("props",(0,t._)`{}`);return _!==void 0&&y(v,b,_),b}Ee.evaluatedPropsToName=$;function y(v,_,b){Object.keys(b).forEach(I=>v.assign((0,t._)`${_}${(0,t.getProperty)(I)}`,!0))}Ee.setEvaluated=y;const f={};function g(v,_){return v.scopeValue("func",{ref:_,code:f[_.code]||(f[_.code]=new e._Code(
|
|
804
|
+
_.code))})}Ee.useFunc=g;var p;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(p||(Ee.Type=p={}));function m(v,_,b){if(v instanceof t.Name){const I=_===p.Num;return b?I?(0,t._)`"[" + ${v} + "]"`:(0,t._)`"['" + ${v} + "']"`:I?(0,t._)`"/" + ${v}`:(0,t._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return b?(0,t.getProperty)(v).toString():"/"+u(v)}Ee.getErrorPath=m;function D(v,_,b=v.opts.strictSchema){if(b){if(_=`strict mode: ${_}`,b===!0)throw new Error(_);v.self.logger.warn(_)}}return Ee.
|
|
805
|
+
checkStrictMode=D,Ee}var kn={},Qc;function ct(){if(Qc)return kn;Qc=1,Object.defineProperty(kn,"__esModule",{value:!0});const t=pe(),e={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.
|
|
806
|
+
Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return kn.default=e,kn}var Zc;function Bn(){return Zc||(Zc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=pe(),r=_e(),n=ct();t.keywordError={message:({keyword:f})=>(0,e.str)`must pass "${f}" keyword validation`},t.keyword$DataError={message:({
|
|
807
|
+
keyword:f,schemaType:g})=>g?(0,e.str)`"${f}" keyword must be ${g} ($data)`:(0,e.str)`"${f}" keyword is invalid ($data)`};function i(f,g=t.keywordError,p,m){const{it:D}=f,{gen:v,compositeRule:_,allErrors:b}=D,I=d(f,g,p);m??(_||b)?c(v,I):l(D,(0,e._)`[${I}]`)}t.reportError=i;function s(f,g=t.keywordError,p){const{it:m}=f,{gen:D,compositeRule:v,allErrors:_}=m,b=d(f,g,p);c(D,b),v||_||l(m,n.default.vErrors)}t.reportExtraError=s;function o(f,g){f.assign(n.default.errors,g),f.if((0,e._)`${n.default.vErrors} !== null`,
|
|
808
|
+
()=>f.if(g,()=>f.assign((0,e._)`${n.default.vErrors}.length`,g),()=>f.assign(n.default.vErrors,null)))}t.resetErrorsCount=o;function a({gen:f,keyword:g,schemaValue:p,data:m,errsCount:D,it:v}){if(D===void 0)throw new Error("ajv implementation error");const _=f.name("err");f.forRange("i",D,n.default.errors,b=>{f.const(_,(0,e._)`${n.default.vErrors}[${b}]`),f.if((0,e._)`${_}.instancePath === undefined`,()=>f.assign((0,e._)`${_}.instancePath`,(0,e.strConcat)(n.default.instancePath,v.errorPath))),f.assign(
|
|
809
|
+
(0,e._)`${_}.schemaPath`,(0,e.str)`${v.errSchemaPath}/${g}`),v.opts.verbose&&(f.assign((0,e._)`${_}.schema`,p),f.assign((0,e._)`${_}.data`,m))})}t.extendErrors=a;function c(f,g){const p=f.const("err",g);f.if((0,e._)`${n.default.vErrors} === null`,()=>f.assign(n.default.vErrors,(0,e._)`[${p}]`),(0,e._)`${n.default.vErrors}.push(${p})`),f.code((0,e._)`${n.default.errors}++`)}function l(f,g){const{gen:p,validateName:m,schemaEnv:D}=f;D.$async?p.throw((0,e._)`new ${f.ValidationError}(${g})`):(p.assign(
|
|
810
|
+
(0,e._)`${m}.errors`,g),p.return(!1))}const u={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function d(f,g,p){const{createErrors:m}=f.it;return m===!1?(0,e._)`{}`:h(f,g,p)}function h(f,g,p={}){const{gen:m,it:D}=f,v=[E(D,p),$(f,p)];return y(f,g,v),m.object(...v)}function E({errorPath:f},{instancePath:g}){const p=g?
|
|
811
|
+
(0,e.str)`${f}${(0,r.getErrorPath)(g,r.Type.Str)}`:f;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,p)]}function $({keyword:f,it:{errSchemaPath:g}},{schemaPath:p,parentSchema:m}){let D=m?g:(0,e.str)`${g}/${f}`;return p&&(D=(0,e.str)`${D}${(0,r.getErrorPath)(p,r.Type.Str)}`),[u.schemaPath,D]}function y(f,{params:g,message:p},m){const{keyword:D,data:v,schemaValue:_,it:b}=f,{opts:I,propertyName:U,topSchemaRef:G,schemaPath:L}=b;m.push([u.keyword,D],[u.params,typeof g=="function"?
|
|
812
|
+
g(f):g||(0,e._)`{}`]),I.messages&&m.push([u.message,typeof p=="function"?p(f):p]),I.verbose&&m.push([u.schema,_],[u.parentSchema,(0,e._)`${G}${L}`],[n.default.data,v]),U&&m.push([u.propertyName,U])}}(Do)),Do}var el;function ky(){if(el)return cr;el=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.boolOrEmptySchema=cr.topBoolOrEmptySchema=void 0;const t=Bn(),e=pe(),r=ct(),n={message:"boolean schema is false"};function i(a){const{gen:c,schema:l,validateName:u}=a;l===!1?o(a,!1):typeof l=="obje\
|
|
813
|
+
ct"&&l.$async===!0?c.return(r.default.data):(c.assign((0,e._)`${u}.errors`,null),c.return(!0))}cr.topBoolOrEmptySchema=i;function s(a,c){const{gen:l,schema:u}=a;u===!1?(l.var(c,!1),o(a)):l.var(c,!0)}cr.boolOrEmptySchema=s;function o(a,c){const{gen:l,data:u}=a,d={gen:l,keyword:"false schema",data:u,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(d,n,void 0,c)}return cr}var xe={},lr={},tl;function rl(){if(tl)return lr;tl=1,Object.defineProperty(lr,"__esModule",{value:!0}),
|
|
814
814
|
lr.getRules=lr.isJSONType=void 0;const t=["string","number","integer","boolean","null","object","array"],e=new Set(t);function r(i){return typeof i=="string"&&e.has(i)}lr.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 lr.getRules=n,lr}var Ot={},
|
|
815
|
-
|
|
816
|
-
function xn(){if(
|
|
817
|
-
p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&m.push("null")}return m}xe.getSchemaTypes=o;function a(p){const m=Array.isArray(p)?p:p?[p]:[];if(m.every(t.isJSONType))return m;throw new Error("type must be JSONType or JSONType[]: "+m.join(","))}xe.getJSONTypes=a;function c(p,m){const{gen:v,
|
|
818
|
-
|
|
819
|
-
if(
|
|
820
|
-
|| (${I} == "string" && ${_} && ${_} == +${_})`).assign(
|
|
821
|
-
|| (${I} === "string" && ${_} && ${_} == +${_} && !(${_} % 1))`).assign(
|
|
822
|
-
|| ${I} === "boolean" || ${_} === null`).assign(
|
|
823
|
-
I((0,n._)`!(${m} % 1) && !isNaN(${m})`);break;case"number":b=I();break;default:return(0,n._)`typeof ${m} ${_} ${p}`}return
|
|
824
|
-
_=n.nil;b.number&&delete b.integer;for(const I in b)_=(0,n.and)(_,E(I,m,v
|
|
825
|
-
it:p}}return xe}var
|
|
826
|
-
i,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),a.if(h,(0,t._)`${d} = ${(0,t.stringify)(o)}`)}return
|
|
827
|
-
Ae.checkMissingProp=Ae.checkReportMissingProp=void 0;const t=pe(),e=_e(),r=ct(),n=_e();function i(p,m){const{gen:v,
|
|
828
|
-
return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Ae.hasPropFunc=a;function c(p,m,
|
|
829
|
-
return p?Object.keys(p).filter(m=>m!=="__proto__"):[]}Ae.allSchemaProperties=d;function h(p,m){return d(m).filter(
|
|
830
|
-
I.opts.dynamicRef&&N.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const j=(0,t._)`${B}, ${
|
|
831
|
-
data:v,
|
|
832
|
-
!_.opts.unevaluated)return;const I=m.let("valid",!1),
|
|
833
|
-
const t=pe(),e=ct(),r=ft(),n=Bn();function i(h,E){const{gen:y,
|
|
834
|
-
E.compile.call(
|
|
835
|
-
return
|
|
836
|
-
if((0,t._)`Array.isArray(${E})`,()=>{
|
|
837
|
-
stringify)(
|
|
838
|
-
f ${g}: ${p.join(",")}`);if(f.validateSchema&&!f.validateSchema(h[g])){const
|
|
815
|
+
nl;function il(){if(nl)return Ot;nl=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.shouldUseRule=Ot.shouldUseGroup=Ot.schemaHasRulesForType=void 0;function t({schema:n,self:i},s){const o=i.RULES.types[s];return o&&o!==!0&&e(n,o)}Ot.schemaHasRulesForType=t;function e(n,i){return i.rules.some(s=>r(n,s))}Ot.shouldUseGroup=e;function r(n,i){var s;return n[i.keyword]!==void 0||((s=i.definition.implements)===null||s===void 0?void 0:s.some(o=>n[o]!==void 0))}return Ot.shouldUseRule=r,Ot}var sl;
|
|
816
|
+
function xn(){if(sl)return xe;sl=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.reportTypeError=xe.checkDataTypes=xe.checkDataType=xe.coerceAndCheckDataType=xe.getJSONTypes=xe.getSchemaTypes=xe.DataType=void 0;const t=rl(),e=il(),r=Bn(),n=pe(),i=_e();var s;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(s||(xe.DataType=s={}));function o(p){const m=a(p.type);if(m.includes("null")){if(p.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!m.length&&
|
|
817
|
+
p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&m.push("null")}return m}xe.getSchemaTypes=o;function a(p){const m=Array.isArray(p)?p:p?[p]:[];if(m.every(t.isJSONType))return m;throw new Error("type must be JSONType or JSONType[]: "+m.join(","))}xe.getJSONTypes=a;function c(p,m){const{gen:D,data:v,opts:_}=p,b=u(m,_.coerceTypes),I=m.length>0&&!(b.length===0&&m.length===1&&(0,e.schemaHasRulesForType)(p,m[0]));if(I){const U=$(m,v,_.strictNumbers,s.Wrong);
|
|
818
|
+
D.if(U,()=>{b.length?d(p,m,b):f(p)})}return I}xe.coerceAndCheckDataType=c;const l=new Set(["string","number","integer","boolean","null"]);function u(p,m){return m?p.filter(D=>l.has(D)||m==="array"&&D==="array"):[]}function d(p,m,D){const{gen:v,data:_,opts:b}=p,I=v.let("dataType",(0,n._)`typeof ${_}`),U=v.let("coerced",(0,n._)`undefined`);b.coerceTypes==="array"&&v.if((0,n._)`${I} == 'object' && Array.isArray(${_}) && ${_}.length == 1`,()=>v.assign(_,(0,n._)`${_}[0]`).assign(I,(0,n._)`typeof ${_}`).
|
|
819
|
+
if($(m,_,b.strictNumbers),()=>v.assign(U,_))),v.if((0,n._)`${U} !== undefined`);for(const L of D)(l.has(L)||L==="array"&&b.coerceTypes==="array")&&G(L);v.else(),f(p),v.endIf(),v.if((0,n._)`${U} !== undefined`,()=>{v.assign(_,U),h(p,U)});function G(L){switch(L){case"string":v.elseIf((0,n._)`${I} == "number" || ${I} == "boolean"`).assign(U,(0,n._)`"" + ${_}`).elseIf((0,n._)`${_} === null`).assign(U,(0,n._)`""`);return;case"number":v.elseIf((0,n._)`${I} == "boolean" || ${_} === null
|
|
820
|
+
|| (${I} == "string" && ${_} && ${_} == +${_})`).assign(U,(0,n._)`+${_}`);return;case"integer":v.elseIf((0,n._)`${I} === "boolean" || ${_} === null
|
|
821
|
+
|| (${I} === "string" && ${_} && ${_} == +${_} && !(${_} % 1))`).assign(U,(0,n._)`+${_}`);return;case"boolean":v.elseIf((0,n._)`${_} === "false" || ${_} === 0 || ${_} === null`).assign(U,!1).elseIf((0,n._)`${_} === "true" || ${_} === 1`).assign(U,!0);return;case"null":v.elseIf((0,n._)`${_} === "" || ${_} === 0 || ${_} === false`),v.assign(U,null);return;case"array":v.elseIf((0,n._)`${I} === "string" || ${I} === "number"
|
|
822
|
+
|| ${I} === "boolean" || ${_} === null`).assign(U,(0,n._)`[${_}]`)}}}function h({gen:p,parentData:m,parentDataProperty:D},v){p.if((0,n._)`${m} !== undefined`,()=>p.assign((0,n._)`${m}[${D}]`,v))}function E(p,m,D,v=s.Correct){const _=v===s.Correct?n.operators.EQ:n.operators.NEQ;let b;switch(p){case"null":return(0,n._)`${m} ${_} null`;case"array":b=(0,n._)`Array.isArray(${m})`;break;case"object":b=(0,n._)`${m} && typeof ${m} == "object" && !Array.isArray(${m})`;break;case"integer":b=
|
|
823
|
+
I((0,n._)`!(${m} % 1) && !isNaN(${m})`);break;case"number":b=I();break;default:return(0,n._)`typeof ${m} ${_} ${p}`}return v===s.Correct?b:(0,n.not)(b);function I(U=n.nil){return(0,n.and)((0,n._)`typeof ${m} == "number"`,U,D?(0,n._)`isFinite(${m})`:n.nil)}}xe.checkDataType=E;function $(p,m,D,v){if(p.length===1)return E(p[0],m,D,v);let _;const b=(0,i.toHash)(p);if(b.array&&b.object){const I=(0,n._)`typeof ${m} != "object"`;_=b.null?I:(0,n._)`!${m} || ${I}`,delete b.null,delete b.array,delete b.object}else
|
|
824
|
+
_=n.nil;b.number&&delete b.integer;for(const I in b)_=(0,n.and)(_,E(I,m,D,v));return _}xe.checkDataTypes=$;const y={message:({schema:p})=>`must be ${p}`,params:({schema:p,schemaValue:m})=>typeof p=="string"?(0,n._)`{type: ${p}}`:(0,n._)`{type: ${m}}`};function f(p){const m=g(p);(0,r.reportError)(m,y)}xe.reportTypeError=f;function g(p){const{gen:m,data:D,schema:v}=p,_=(0,i.schemaRefOrVal)(p,v,"type");return{gen:m,keyword:"type",data:D,schema:v.type,schemaCode:_,schemaValue:_,parentSchema:v,params:{},
|
|
825
|
+
it:p}}return xe}var Qr={},ol;function By(){if(ol)return Qr;ol=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.assignDefaults=void 0;const t=pe(),e=_e();function r(i,s){const{properties:o,items:a}=i.schema;if(s==="object"&&o)for(const c in o)n(i,c,o[c].default);else s==="array"&&Array.isArray(a)&&a.forEach((c,l)=>n(i,l,c.default))}Qr.assignDefaults=r;function n(i,s,o){const{gen:a,compositeRule:c,data:l,opts:u}=i;if(o===void 0)return;const d=(0,t._)`${l}${(0,t.getProperty)(s)}`;if(c){(0,e.checkStrictMode)(
|
|
826
|
+
i,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;u.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),a.if(h,(0,t._)`${d} = ${(0,t.stringify)(o)}`)}return Qr}var lt={},Ae={},al;function ft(){if(al)return Ae;al=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.validateUnion=Ae.validateArray=Ae.usePattern=Ae.callValidateCode=Ae.schemaProperties=Ae.allSchemaProperties=Ae.noPropertyInData=Ae.propertyInData=Ae.isOwnProperty=Ae.hasPropFunc=Ae.reportMissingProp=
|
|
827
|
+
Ae.checkMissingProp=Ae.checkReportMissingProp=void 0;const t=pe(),e=_e(),r=ct(),n=_e();function i(p,m){const{gen:D,data:v,it:_}=p;D.if(u(D,v,m,_.opts.ownProperties),()=>{p.setParams({missingProperty:(0,t._)`${m}`},!0),p.error()})}Ae.checkReportMissingProp=i;function s({gen:p,data:m,it:{opts:D}},v,_){return(0,t.or)(...v.map(b=>(0,t.and)(u(p,m,b,D.ownProperties),(0,t._)`${_} = ${b}`)))}Ae.checkMissingProp=s;function o(p,m){p.setParams({missingProperty:m},!0),p.error()}Ae.reportMissingProp=o;function a(p){
|
|
828
|
+
return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Ae.hasPropFunc=a;function c(p,m,D){return(0,t._)`${a(p)}.call(${m}, ${D})`}Ae.isOwnProperty=c;function l(p,m,D,v){const _=(0,t._)`${m}${(0,t.getProperty)(D)} !== undefined`;return v?(0,t._)`${_} && ${c(p,m,D)}`:_}Ae.propertyInData=l;function u(p,m,D,v){const _=(0,t._)`${m}${(0,t.getProperty)(D)} === undefined`;return v?(0,t.or)(_,(0,t.not)(c(p,m,D))):_}Ae.noPropertyInData=u;function d(p){
|
|
829
|
+
return p?Object.keys(p).filter(m=>m!=="__proto__"):[]}Ae.allSchemaProperties=d;function h(p,m){return d(m).filter(D=>!(0,e.alwaysValidSchema)(p,m[D]))}Ae.schemaProperties=h;function E({schemaCode:p,data:m,it:{gen:D,topSchemaRef:v,schemaPath:_,errorPath:b},it:I},U,G,L){const B=L?(0,t._)`${p}, ${m}, ${v}${_}`:m,N=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,b)],[r.default.parentData,I.parentData],[r.default.parentDataProperty,I.parentDataProperty],[r.default.rootData,r.default.rootData]];
|
|
830
|
+
I.opts.dynamicRef&&N.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const j=(0,t._)`${B}, ${D.object(...N)}`;return G!==t.nil?(0,t._)`${U}.call(${G}, ${j})`:(0,t._)`${U}(${j})`}Ae.callValidateCode=E;const $=(0,t._)`new RegExp`;function y({gen:p,it:{opts:m}},D){const v=m.unicodeRegExp?"u":"",{regExp:_}=m.code,b=_(D,v);return p.scopeValue("pattern",{key:b.toString(),ref:b,code:(0,t._)`${_.code==="new RegExp"?$:(0,n.useFunc)(p,_)}(${D}, ${v})`})}Ae.usePattern=y;function f(p){const{gen:m,
|
|
831
|
+
data:D,keyword:v,it:_}=p,b=m.name("valid");if(_.allErrors){const U=m.let("valid",!0);return I(()=>m.assign(U,!1)),U}return m.var(b,!0),I(()=>m.break()),b;function I(U){const G=m.const("len",(0,t._)`${D}.length`);m.forRange("i",0,G,L=>{p.subschema({keyword:v,dataProp:L,dataPropType:e.Type.Num},b),m.if((0,t.not)(b),U)})}}Ae.validateArray=f;function g(p){const{gen:m,schema:D,keyword:v,it:_}=p;if(!Array.isArray(D))throw new Error("ajv implementation error");if(D.some(G=>(0,e.alwaysValidSchema)(_,G))&&
|
|
832
|
+
!_.opts.unevaluated)return;const I=m.let("valid",!1),U=m.name("_valid");m.block(()=>D.forEach((G,L)=>{const B=p.subschema({keyword:v,schemaProp:L,compositeRule:!0},U);m.assign(I,(0,t._)`${I} || ${U}`),p.mergeValidEvaluated(B,U)||m.if((0,t.not)(I))})),p.result(I,()=>p.reset(),()=>p.error(!0))}return Ae.validateUnion=g,Ae}var ul;function xy(){if(ul)return lt;ul=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.validateKeywordUsage=lt.validSchemaType=lt.funcKeywordCode=lt.macroKeywordCode=void 0;
|
|
833
|
+
const t=pe(),e=ct(),r=ft(),n=Bn();function i(h,E){const{gen:$,keyword:y,schema:f,parentSchema:g,it:p}=h,m=E.macro.call(p.self,f,g,p),D=l($,y,m);p.opts.validateSchema!==!1&&p.self.validateSchema(m,!0);const v=$.name("valid");h.subschema({schema:m,schemaPath:t.nil,errSchemaPath:`${p.errSchemaPath}/${y}`,topSchemaRef:D,compositeRule:!0},v),h.pass(v,()=>h.error(!0))}lt.macroKeywordCode=i;function s(h,E){var $;const{gen:y,keyword:f,schema:g,parentSchema:p,$data:m,it:D}=h;c(D,E);const v=!m&&E.compile?
|
|
834
|
+
E.compile.call(D.self,g,p,D):E.validate,_=l(y,f,v),b=y.let("valid");h.block$data(b,I),h.ok(($=E.valid)!==null&&$!==void 0?$:b);function I(){if(E.errors===!1)L(),E.modifying&&o(h),B(()=>h.error());else{const N=E.async?U():G();E.modifying&&o(h),B(()=>a(h,N))}}function U(){const N=y.let("ruleErrs",null);return y.try(()=>L((0,t._)`await `),j=>y.assign(b,!1).if((0,t._)`${j} instanceof ${D.ValidationError}`,()=>y.assign(N,(0,t._)`${j}.errors`),()=>y.throw(j))),N}function G(){const N=(0,t._)`${_}.errors`;
|
|
835
|
+
return y.assign(N,null),L(t.nil),N}function L(N=E.async?(0,t._)`await `:t.nil){const j=D.opts.passContext?e.default.this:e.default.self,M=!("compile"in E&&!m||E.schema===!1);y.assign(b,(0,t._)`${N}${(0,r.callValidateCode)(h,_,j,M)}`,E.modifying)}function B(N){var j;y.if((0,t.not)((j=E.valid)!==null&&j!==void 0?j:b),N)}}lt.funcKeywordCode=s;function o(h){const{gen:E,data:$,it:y}=h;E.if(y.parentData,()=>E.assign($,(0,t._)`${y.parentData}[${y.parentDataProperty}]`))}function a(h,E){const{gen:$}=h;$.
|
|
836
|
+
if((0,t._)`Array.isArray(${E})`,()=>{$.assign(e.default.vErrors,(0,t._)`${e.default.vErrors} === null ? ${E} : ${e.default.vErrors}.concat(${E})`).assign(e.default.errors,(0,t._)`${e.default.vErrors}.length`),(0,n.extendErrors)(h)},()=>h.error())}function c({schemaEnv:h},E){if(E.async&&!h.$async)throw new Error("async keyword in sync schema")}function l(h,E,$){if($===void 0)throw new Error(`keyword "${E}" failed to compile`);return h.scopeValue("keyword",typeof $=="function"?{ref:$}:{ref:$,code:(0,t.
|
|
837
|
+
stringify)($)})}function u(h,E,$=!1){return!E.length||E.some(y=>y==="array"?Array.isArray(h):y==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==y||$&&typeof h>"u")}lt.validSchemaType=u;function d({schema:h,opts:E,self:$,errSchemaPath:y},f,g){if(Array.isArray(f.keyword)?!f.keyword.includes(g):f.keyword!==g)throw new Error("ajv implementation error");const p=f.dependencies;if(p?.some(m=>!Object.prototype.hasOwnProperty.call(h,m)))throw new Error(`parent schema must have dependencies o\
|
|
838
|
+
f ${g}: ${p.join(",")}`);if(f.validateSchema&&!f.validateSchema(h[g])){const D=`keyword "${g}" value is invalid at path "${y}": `+$.errorsText(f.validateSchema.errors);if(E.validateSchema==="log")$.logger.error(D);else throw new Error(D)}}return lt.validateKeywordUsage=d,lt}var It={},cl;function My(){if(cl)return It;cl=1,Object.defineProperty(It,"__esModule",{value:!0}),It.extendSubschemaMode=It.extendSubschemaData=It.getSubschema=void 0;const t=pe(),e=_e();function r(s,{keyword:o,schemaProp:a,schema:c,
|
|
839
839
|
schemaPath:l,errSchemaPath:u,topSchemaRef:d}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const h=s.schema[o];return a===void 0?{schema:h,schemaPath:(0,t._)`${s.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${o}`}:{schema:h[a],schemaPath:(0,t._)`${s.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${o}/${(0,e.escapeFragment)(a)}`}}if(c!==void 0){if(l===void 0||
|
|
840
|
-
u===void 0||d===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:d,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}It.getSubschema=r;function n(s,o,{dataProp:a,dataPropType:c,data:l,dataTypes:u,propertyName:d}){if(l!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=o;if(a!==void 0){const{errorPath:y,
|
|
841
|
-
g=h.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0);E(g),s.errorPath=(0,t.str)`${
|
|
842
|
-
n;function i(s,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(s.compositeRule=c),l!==void 0&&(s.createErrors=l),u!==void 0&&(s.allErrors=u),s.jtdDiscriminator=o,s.jtdMetadata=a}return It.extendSubschemaMode=i,It}var Ve={},wo,
|
|
840
|
+
u===void 0||d===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:d,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}It.getSubschema=r;function n(s,o,{dataProp:a,dataPropType:c,data:l,dataTypes:u,propertyName:d}){if(l!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=o;if(a!==void 0){const{errorPath:$,dataPathArr:y,opts:f}=o,
|
|
841
|
+
g=h.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0);E(g),s.errorPath=(0,t.str)`${$}${(0,e.getErrorPath)(a,c,f.jsPropertySyntax)}`,s.parentDataProperty=(0,t._)`${a}`,s.dataPathArr=[...y,s.parentDataProperty]}if(l!==void 0){const $=l instanceof t.Name?l:h.let("data",l,!0);E($),d!==void 0&&(s.propertyName=d)}u&&(s.dataTypes=u);function E($){s.data=$,s.dataLevel=o.dataLevel+1,s.dataTypes=[],o.definedProperties=new Set,s.parentData=o.data,s.dataNames=[...o.dataNames,$]}}It.extendSubschemaData=
|
|
842
|
+
n;function i(s,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(s.compositeRule=c),l!==void 0&&(s.createErrors=l),u!==void 0&&(s.allErrors=u),s.jtdDiscriminator=o,s.jtdMetadata=a}return It.extendSubschemaMode=i,It}var Ve={},wo,ll;function fl(){return ll||(ll=1,wo=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=
|
|
843
843
|
n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}),wo}var bo={
|
|
844
|
-
exports:{}},
|
|
845
|
-
{default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(n,i,s,o,a,c,l,u,d,h){if(o&&typeof o=="object"&&!Array.isArray(o)){i(o,a,c,l,u,d,h);for(var E in o){var
|
|
846
|
-
typeof
|
|
847
|
-
"pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(
|
|
848
|
-
let f=0;for(const g in
|
|
849
|
-
if(typeof
|
|
850
|
-
X):X!==d(j)&&(X[0]==="#"?(I(G,_[X],X),_[X]=G):this.refs[X]=j),X}function z(X){if(typeof X=="string"){if(!E.test(X))throw new Error(`invalid anchor "${X}"`);Y.call(this,`#${X}`)}}}),_;function I(G,L,B){if(L!==void 0&&!e(G,L))throw
|
|
851
|
-
e=xn(),r=
|
|
852
|
-
_)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${T.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function
|
|
844
|
+
exports:{}},dl;function qy(){if(dl)return bo.exports;dl=1;var t=bo.exports=function(n,i,s){typeof i=="function"&&(s=i,i={}),s=i.cb||s;var o=typeof s=="function"?s:s.pre||function(){},a=s.post||function(){};e(i,o,a,n,"",n)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords=
|
|
845
|
+
{default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(n,i,s,o,a,c,l,u,d,h){if(o&&typeof o=="object"&&!Array.isArray(o)){i(o,a,c,l,u,d,h);for(var E in o){var $=o[E];if(Array.isArray($)){if(E in t.arrayKeywords)for(var y=0;y<$.length;y++)e(n,i,s,$[y],a+"/"+E+"/"+y,c,a,E,o,y)}else if(E in t.propsKeywords){if($&&
|
|
846
|
+
typeof $=="object")for(var f in $)e(n,i,s,$[f],a+"/"+E+"/"+r(f),c,a,E,o,f)}else(E in t.keywords||n.allKeys&&!(E in t.skipKeywords))&&e(n,i,s,$,a+"/"+E,c,a,E,o)}s(o,a,c,l,u,d,h)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return bo.exports}var hl;function Mn(){if(hl)return Ve;hl=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.getSchemaRefs=Ve.resolveUrl=Ve.normalizeId=Ve._getFullPath=Ve.getFullPath=Ve.inlineRef=void 0;const t=_e(),e=fl(),r=qy(),n=new Set(["type","format",
|
|
847
|
+
"pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(y,f=!0){return typeof y=="boolean"?!0:f===!0?!o(y):f?a(y)<=f:!1}Ve.inlineRef=i;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(y){for(const f in y){if(s.has(f))return!0;const g=y[f];if(Array.isArray(g)&&g.some(o)||typeof g=="object"&&o(g))return!0}return!1}function a(y){
|
|
848
|
+
let f=0;for(const g in y){if(g==="$ref")return 1/0;if(f++,!n.has(g)&&(typeof y[g]=="object"&&(0,t.eachItem)(y[g],p=>f+=a(p)),f===1/0))return 1/0}return f}function c(y,f="",g){g!==!1&&(f=d(f));const p=y.parse(f);return l(y,p)}Ve.getFullPath=c;function l(y,f){return y.serialize(f).split("#")[0]+"#"}Ve._getFullPath=l;const u=/#\/?$/;function d(y){return y?y.replace(u,""):""}Ve.normalizeId=d;function h(y,f,g){return g=d(g),y.resolve(f,g)}Ve.resolveUrl=h;const E=/^[a-z_][-a-z0-9._]*$/i;function $(y,f){
|
|
849
|
+
if(typeof y=="boolean")return{};const{schemaId:g,uriResolver:p}=this.opts,m=d(y[g]||f),D={"":m},v=c(p,m,!1),_={},b=new Set;return r(y,{allKeys:!0},(G,L,B,N)=>{if(N===void 0)return;const j=v+L;let M=D[N];typeof G[g]=="string"&&(M=Y.call(this,G[g])),z.call(this,G.$anchor),z.call(this,G.$dynamicAnchor),D[L]=M;function Y(X){const se=this.opts.uriResolver.resolve;if(X=d(M?se(M,X):X),b.has(X))throw U(X);b.add(X);let q=this.refs[X];return typeof q=="string"&&(q=this.refs[q]),typeof q=="object"?I(G,q.schema,
|
|
850
|
+
X):X!==d(j)&&(X[0]==="#"?(I(G,_[X],X),_[X]=G):this.refs[X]=j),X}function z(X){if(typeof X=="string"){if(!E.test(X))throw new Error(`invalid anchor "${X}"`);Y.call(this,`#${X}`)}}}),_;function I(G,L,B){if(L!==void 0&&!e(G,L))throw U(B)}function U(G){return new Error(`reference "${G}" resolves to more than one schema`)}}return Ve.getSchemaRefs=$,Ve}var pl;function Zr(){if(pl)return Rt;pl=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.getData=Rt.KeywordCxt=Rt.validateFunctionCode=void 0;const t=ky(),
|
|
851
|
+
e=xn(),r=il(),n=xn(),i=By(),s=xy(),o=My(),a=pe(),c=ct(),l=Mn(),u=_e(),d=Bn();function h(T){if(v(T)&&(b(T),D(T))){f(T);return}E(T,()=>(0,t.topBoolOrEmptySchema)(T))}Rt.validateFunctionCode=h;function E({gen:T,validateName:x,schema:Q,schemaEnv:ie,opts:O},P){O.code.es5?T.func(x,(0,a._)`${c.default.data}, ${c.default.valCxt}`,ie.$async,()=>{T.code((0,a._)`"use strict"; ${p(Q,O)}`),y(T,O),T.code(P)}):T.func(x,(0,a._)`${c.default.data}, ${$(O)}`,ie.$async,()=>T.code(p(Q,O)).code(P))}function $(T){return(0,a.
|
|
852
|
+
_)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${T.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function y(T,x){T.if(c.default.valCxt,()=>{T.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),T.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),T.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),
|
|
853
853
|
T.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),x.dynamicRef&&T.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{T.var(c.default.instancePath,(0,a._)`""`),T.var(c.default.parentData,(0,a._)`undefined`),T.var(c.default.parentDataProperty,(0,a._)`undefined`),T.var(c.default.rootData,c.default.data),x.dynamicRef&&T.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function f(T){const{schema:x,opts:Q,gen:ie}=T;E(T,()=>{Q.$comment&&x.
|
|
854
854
|
$comment&&N(T),G(T),ie.let(c.default.vErrors,null),ie.let(c.default.errors,0),Q.unevaluated&&g(T),I(T),j(T)})}function g(T){const{gen:x,validateName:Q}=T;T.evaluated=x.const("evaluated",(0,a._)`${Q}.evaluated`),x.if((0,a._)`${T.evaluated}.dynamicProps`,()=>x.assign((0,a._)`${T.evaluated}.props`,(0,a._)`undefined`)),x.if((0,a._)`${T.evaluated}.dynamicItems`,()=>x.assign((0,a._)`${T.evaluated}.items`,(0,a._)`undefined`))}function p(T,x){const Q=typeof T=="object"&&T[x.schemaId];return Q&&(x.code.source||
|
|
855
|
-
x.code.process)?(0,a._)`/*# sourceURL=${Q} */`:a.nil}function m(T,x){if(
|
|
856
|
-
checkUnknownRules)(T),
|
|
855
|
+
x.code.process)?(0,a._)`/*# sourceURL=${Q} */`:a.nil}function m(T,x){if(v(T)&&(b(T),D(T))){_(T,x);return}(0,t.boolOrEmptySchema)(T,x)}function D({schema:T,self:x}){if(typeof T=="boolean")return!T;for(const Q in T)if(x.RULES.all[Q])return!0;return!1}function v(T){return typeof T.schema!="boolean"}function _(T,x){const{schema:Q,gen:ie,opts:O}=T;O.$comment&&Q.$comment&&N(T),L(T),B(T);const P=ie.const("_errs",c.default.errors);I(T,P),ie.var(x,(0,a._)`${P} === ${c.default.errors}`)}function b(T){(0,u.
|
|
856
|
+
checkUnknownRules)(T),U(T)}function I(T,x){if(T.opts.jtd)return Y(T,[],!1,x);const Q=(0,e.getSchemaTypes)(T.schema),ie=(0,e.coerceAndCheckDataType)(T,Q);Y(T,Q,!ie,x)}function U(T){const{schema:x,errSchemaPath:Q,opts:ie,self:O}=T;x.$ref&&ie.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(x,O.RULES)&&O.logger.warn(`$ref: keywords ignored in schema at path "${Q}"`)}function G(T){const{schema:x,opts:Q}=T;x.default!==void 0&&Q.useDefaults&&Q.strictSchema&&(0,u.checkStrictMode)(T,"default is ignored\
|
|
857
857
|
in the schema root")}function L(T){const x=T.schema[T.opts.schemaId];x&&(T.baseId=(0,l.resolveUrl)(T.opts.uriResolver,T.baseId,x))}function B(T){if(T.schema.$async&&!T.schemaEnv.$async)throw new Error("async schema in sync schema")}function N({gen:T,schemaEnv:x,schema:Q,errSchemaPath:ie,opts:O}){const P=Q.$comment;if(O.$comment===!0)T.code((0,a._)`${c.default.self}.logger.log(${P})`);else if(typeof O.$comment=="function"){const ee=(0,a.str)`${ie}/$comment`,W=T.scopeValue("root",{ref:x.root});T.
|
|
858
858
|
code((0,a._)`${c.default.self}.opts.$comment(${P}, ${ee}, ${W}.schema)`)}}function j(T){const{gen:x,schemaEnv:Q,validateName:ie,ValidationError:O,opts:P}=T;Q.$async?x.if((0,a._)`${c.default.errors} === 0`,()=>x.return(c.default.data),()=>x.throw((0,a._)`new ${O}(${c.default.vErrors})`)):(x.assign((0,a._)`${ie}.errors`,c.default.vErrors),P.unevaluated&&M(T),x.return((0,a._)`${c.default.errors} === 0`))}function M({gen:T,evaluated:x,props:Q,items:ie}){Q instanceof a.Name&&T.assign((0,a._)`${x}.props`,
|
|
859
|
-
Q),ie instanceof a.Name&&T.assign((0,a._)`${x}.items`,ie)}function Y(T,x,Q,ie){const{gen:O,schema:P,data:ee,allErrors:W,opts:F,self:re}=T,{RULES:
|
|
859
|
+
Q),ie instanceof a.Name&&T.assign((0,a._)`${x}.items`,ie)}function Y(T,x,Q,ie){const{gen:O,schema:P,data:ee,allErrors:W,opts:F,self:re}=T,{RULES:V}=re;if(P.$ref&&(F.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(P,V))){O.block(()=>J(T,"$ref",V.all.$ref.definition));return}F.jtd||X(T,x),O.block(()=>{for(const fe of V.rules)ne(fe);ne(V.post)});function ne(fe){(0,r.shouldUseGroup)(P,fe)&&(fe.type?(O.if((0,n.checkDataType)(fe.type,ee,F.strictNumbers)),z(T,fe),x.length===1&&x[0]===fe.type&&Q&&(O.
|
|
860
860
|
else(),(0,n.reportTypeError)(T)),O.endIf()):z(T,fe),W||O.if((0,a._)`${c.default.errors} === ${ie||0}`))}}function z(T,x){const{gen:Q,schema:ie,opts:{useDefaults:O}}=T;O&&(0,i.assignDefaults)(T,x.type),Q.block(()=>{for(const P of x.rules)(0,r.shouldUseRule)(ie,P)&&J(T,P.keyword,P.definition,x.type)})}function X(T,x){T.schemaEnv.meta||!T.opts.strictTypes||(se(T,x),T.opts.allowUnionTypes||q(T,x),C(T,T.dataTypes))}function se(T,x){if(x.length){if(!T.dataTypes.length){T.dataTypes=x;return}x.forEach(Q=>{
|
|
861
|
-
k(T.dataTypes,Q)||A(T,`type "${Q}" not allowed by context "${T.dataTypes.join(",")}"`)}),w(T,x)}}function q(T,x){x.length>1&&!(x.length===2&&x.includes("null"))&&A(T,"use allowUnionTypes to allow union type keyword")}function C(T,x){const Q=T.self.RULES.all;for(const ie in Q){const O=Q[ie];if(typeof O=="object"&&(0,r.shouldUseRule)(T.schema,O)){const{type:P}=O.definition;P.length&&!P.some(ee=>
|
|
861
|
+
k(T.dataTypes,Q)||A(T,`type "${Q}" not allowed by context "${T.dataTypes.join(",")}"`)}),w(T,x)}}function q(T,x){x.length>1&&!(x.length===2&&x.includes("null"))&&A(T,"use allowUnionTypes to allow union type keyword")}function C(T,x){const Q=T.self.RULES.all;for(const ie in Q){const O=Q[ie];if(typeof O=="object"&&(0,r.shouldUseRule)(T.schema,O)){const{type:P}=O.definition;P.length&&!P.some(ee=>H(x,ee))&&A(T,`missing type "${P.join(",")}" for keyword "${ie}"`)}}}function H(T,x){return T.includes(x)||
|
|
862
862
|
x==="number"&&T.includes("integer")}function k(T,x){return T.includes(x)||x==="integer"&&T.includes("number")}function w(T,x){const Q=[];for(const ie of T.dataTypes)k(x,ie)?Q.push(ie):x.includes("integer")&&ie==="number"&&Q.push("integer");T.dataTypes=Q}function A(T,x){const Q=T.schemaEnv.baseId+T.errSchemaPath;x+=` at "${Q}" (strictTypes)`,(0,u.checkStrictMode)(T,x,T.opts.strictTypes)}class R{constructor(x,Q,ie){if((0,s.validateKeywordUsage)(x,Q,ie),this.gen=x.gen,this.allErrors=x.allErrors,this.
|
|
863
863
|
keyword=ie,this.data=x.data,this.schema=x.schema[ie],this.$data=Q.$data&&x.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(x,this.schema,ie,this.$data),this.schemaType=Q.schemaType,this.parentSchema=x.schema,this.params={},this.it=x,this.def=Q,this.$data)this.schemaCode=x.gen.const("vSchema",ae(this.$data,x));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,Q.schemaType,Q.allowUndefined))throw new Error(`${ie} value must be ${JSON.stringify(
|
|
864
864
|
Q.schemaType)}`);("code"in Q?Q.trackErrors:Q.errors!==!1)&&(this.errsCount=x.gen.const("_errs",c.default.errors))}result(x,Q,ie){this.failResult((0,a.not)(x),Q,ie)}failResult(x,Q,ie){this.gen.if(x),ie?ie():this.error(),Q?(this.gen.else(),Q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(x,Q){this.failResult((0,a.not)(x),void 0,Q)}fail(x){if(x===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(x),this.error(),this.allErrors?this.gen.
|
|
@@ -867,277 +867,277 @@ eyword definition');(0,d.resetErrorsCount)(this.gen,this.errsCount)}ok(x){this.a
|
|
|
867
867
|
nil&&ie.assign(x,!1)),ie.else()}invalid$data(){const{gen:x,schemaCode:Q,schemaType:ie,def:O,it:P}=this;return(0,a.or)(ee(),W());function ee(){if(ie.length){if(!(Q instanceof a.Name))throw new Error("ajv implementation error");const F=Array.isArray(ie)?ie:[ie];return(0,a._)`${(0,n.checkDataTypes)(F,Q,P.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function W(){if(O.validateSchema){const F=x.scopeValue("validate$data",{ref:O.validateSchema});return(0,a._)`!${F}(${Q})`}return a.nil}}subschema(x,Q){
|
|
868
868
|
const ie=(0,o.getSubschema)(this.it,x);(0,o.extendSubschemaData)(ie,this.it,x),(0,o.extendSubschemaMode)(ie,x);const O={...this.it,...ie,items:void 0,props:void 0};return m(O,Q),O}mergeEvaluated(x,Q){const{it:ie,gen:O}=this;ie.opts.unevaluated&&(ie.props!==!0&&x.props!==void 0&&(ie.props=u.mergeEvaluated.props(O,x.props,ie.props,Q)),ie.items!==!0&&x.items!==void 0&&(ie.items=u.mergeEvaluated.items(O,x.items,ie.items,Q)))}mergeValidEvaluated(x,Q){const{it:ie,gen:O}=this;if(ie.opts.unevaluated&&(ie.
|
|
869
869
|
props!==!0||ie.items!==!0))return O.if(Q,()=>this.mergeEvaluated(x,a.Name)),!0}}Rt.KeywordCxt=R;function J(T,x,Q,ie){const O=new R(T,Q,x);"code"in Q?Q.code(O,ie):O.$data&&Q.validate?(0,s.funcKeywordCode)(O,Q):"macro"in Q?(0,s.macroKeywordCode)(O,Q):(Q.compile||Q.validate)&&(0,s.funcKeywordCode)(O,Q)}const Z=/^\/(?:[^~]|~0|~1)*$/,oe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ae(T,{dataLevel:x,dataNames:Q,dataPathArr:ie}){let O,P;if(T==="")return c.default.rootData;if(T[0]==="/"){if(!Z.test(T))throw new Error(
|
|
870
|
-
`Invalid JSON-pointer: ${T}`);O=T,P=c.default.rootData}else{const re=oe.exec(T);if(!re)throw new Error(`Invalid JSON-pointer: ${T}`);const
|
|
871
|
-
ls up, current level is ${x}`}}return Rt.getData=ae,Rt}var qn={},
|
|
872
|
-
(0,t.resolveUrl)(n,i,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(n,this.missingRef))}}return Hn.default=e,Hn}var Xe={},
|
|
873
|
-
g.schemaId,this.root=g.root||this,this.baseId=(p=g.baseId)!==null&&p!==void 0?p:(0,n.normalizeId)(m?.[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=m?.$async,this.refs={}}}Xe.SchemaEnv=o;function a(f){const g=u.call(this,f);if(g)return g;const p=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:m,lines:
|
|
874
|
-
scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const I=_.scopeName("validate");f.validateName=I;const
|
|
875
|
-
{ref:f.schema}),validateName:I,ValidationError:b,schema:f.schema,schemaEnv:f,rootId:p,baseId:f.baseId||p,schemaPath:t.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let G;try{this._compilations.add(f),(0,s.validateFunctionCode)(
|
|
876
|
-
scope}`,G)(this,this.scope.get());if(this.scope.value(I,{ref:N}),N.errors=null,N.schema=f.schema,N.schemaEnv=f,f.$async&&(N.$async=!0),this.opts.code.source===!0&&(N.source={validateName:I,validateCode:L,scopeValues:_._values}),this.opts.unevaluated){const{props:j,items:M}=
|
|
877
|
-
N,f}catch(L){throw delete f.validate,delete f.validateName,G&&this.logger.error("Error compiling schema, function code:",G),L}finally{this._compilations.delete(f)}}Xe.compileSchema=a;function c(f,g,p){var m;p=(0,n.resolveUrl)(this.opts.uriResolver,g,p);const
|
|
878
|
-
resolveRef=c;function l(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:a.call(this,f)}function u(f){for(const g of this._compilations)if(d(g,f))return g}Xe.getCompilingSchema=u;function d(f,g){return f.schema===g.schema&&f.root===g.root&&f.baseId===g.baseId}function h(f,g){let p;for(;typeof(p=this.refs[g])=="string";)g=p;return p||this.schemas[g]||E.call(this,f,g)}function E(f,g){const p=this.opts.uriResolver.parse(g),m=(0,n._getFullPath)(this.opts.uriResolver,p);let
|
|
879
|
-
getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&m===
|
|
880
|
-
root:f,baseId:
|
|
881
|
-
g,
|
|
882
|
-
anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},
|
|
883
|
-
1;const{HEX:t}=zy()
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
k
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
s
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
deps:u
|
|
870
|
+
`Invalid JSON-pointer: ${T}`);O=T,P=c.default.rootData}else{const re=oe.exec(T);if(!re)throw new Error(`Invalid JSON-pointer: ${T}`);const V=+re[1];if(O=re[2],O==="#"){if(V>=x)throw new Error(F("property/index",V));return ie[x-V]}if(V>x)throw new Error(F("data",V));if(P=Q[x-V],!O)return P}let ee=P;const W=O.split("/");for(const re of W)re&&(P=(0,a._)`${P}${(0,a.getProperty)((0,u.unescapeJsonPointer)(re))}`,ee=(0,a._)`${ee} && ${P}`);return ee;function F(re,V){return`Cannot access ${re} ${V} leve\
|
|
871
|
+
ls up, current level is ${x}`}}return Rt.getData=ae,Rt}var qn={},ml;function Un(){if(ml)return qn;ml=1,Object.defineProperty(qn,"__esModule",{value:!0});class t extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return qn.default=t,qn}var Hn={},gl;function en(){if(gl)return Hn;gl=1,Object.defineProperty(Hn,"__esModule",{value:!0});const t=Mn();class e extends Error{constructor(n,i,s,o){super(o||`can't resolve reference ${s} from id ${i}`),this.missingRef=
|
|
872
|
+
(0,t.resolveUrl)(n,i,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(n,this.missingRef))}}return Hn.default=e,Hn}var Xe={},yl;function Vn(){if(yl)return Xe;yl=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.resolveSchema=Xe.getCompilingSchema=Xe.resolveRef=Xe.compileSchema=Xe.SchemaEnv=void 0;const t=pe(),e=Un(),r=ct(),n=Mn(),i=_e(),s=Zr();class o{constructor(g){var p;this.refs={},this.dynamicAnchors={};let m;typeof g.schema=="object"&&(m=g.schema),this.schema=g.schema,this.schemaId=
|
|
873
|
+
g.schemaId,this.root=g.root||this,this.baseId=(p=g.baseId)!==null&&p!==void 0?p:(0,n.normalizeId)(m?.[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=m?.$async,this.refs={}}}Xe.SchemaEnv=o;function a(f){const g=u.call(this,f);if(g)return g;const p=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:m,lines:D}=this.opts.code,{ownProperties:v}=this.opts,_=new t.CodeGen(this.scope,{es5:m,lines:D,ownProperties:v});let b;f.$async&&(b=_.
|
|
874
|
+
scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const I=_.scopeName("validate");f.validateName=I;const U={gen:_,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:_.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:
|
|
875
|
+
{ref:f.schema}),validateName:I,ValidationError:b,schema:f.schema,schemaEnv:f,rootId:p,baseId:f.baseId||p,schemaPath:t.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let G;try{this._compilations.add(f),(0,s.validateFunctionCode)(U),_.optimize(this.opts.code.optimize);const L=_.toString();G=`${_.scopeRefs(r.default.scope)}return ${L}`,this.opts.code.process&&(G=this.opts.code.process(G,f));const N=new Function(`${r.default.self}`,`${r.default.
|
|
876
|
+
scope}`,G)(this,this.scope.get());if(this.scope.value(I,{ref:N}),N.errors=null,N.schema=f.schema,N.schemaEnv=f,f.$async&&(N.$async=!0),this.opts.code.source===!0&&(N.source={validateName:I,validateCode:L,scopeValues:_._values}),this.opts.unevaluated){const{props:j,items:M}=U;N.evaluated={props:j instanceof t.Name?void 0:j,items:M instanceof t.Name?void 0:M,dynamicProps:j instanceof t.Name,dynamicItems:M instanceof t.Name},N.source&&(N.source.evaluated=(0,t.stringify)(N.evaluated))}return f.validate=
|
|
877
|
+
N,f}catch(L){throw delete f.validate,delete f.validateName,G&&this.logger.error("Error compiling schema, function code:",G),L}finally{this._compilations.delete(f)}}Xe.compileSchema=a;function c(f,g,p){var m;p=(0,n.resolveUrl)(this.opts.uriResolver,g,p);const D=f.refs[p];if(D)return D;let v=h.call(this,f,p);if(v===void 0){const _=(m=f.localRefs)===null||m===void 0?void 0:m[p],{schemaId:b}=this.opts;_&&(v=new o({schema:_,schemaId:b,root:f,baseId:g}))}if(v!==void 0)return f.refs[p]=l.call(this,v)}Xe.
|
|
878
|
+
resolveRef=c;function l(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:a.call(this,f)}function u(f){for(const g of this._compilations)if(d(g,f))return g}Xe.getCompilingSchema=u;function d(f,g){return f.schema===g.schema&&f.root===g.root&&f.baseId===g.baseId}function h(f,g){let p;for(;typeof(p=this.refs[g])=="string";)g=p;return p||this.schemas[g]||E.call(this,f,g)}function E(f,g){const p=this.opts.uriResolver.parse(g),m=(0,n._getFullPath)(this.opts.uriResolver,p);let D=(0,n.
|
|
879
|
+
getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&m===D)return y.call(this,p,f);const v=(0,n.normalizeId)(m),_=this.refs[v]||this.schemas[v];if(typeof _=="string"){const b=E.call(this,f,_);return typeof b?.schema!="object"?void 0:y.call(this,p,b)}if(typeof _?.schema=="object"){if(_.validate||a.call(this,_),v===(0,n.normalizeId)(g)){const{schema:b}=_,{schemaId:I}=this.opts,U=b[I];return U&&(D=(0,n.resolveUrl)(this.opts.uriResolver,D,U)),new o({schema:b,schemaId:I,
|
|
880
|
+
root:f,baseId:D})}return y.call(this,p,_)}}Xe.resolveSchema=E;const $=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(f,{baseId:g,schema:p,root:m}){var D;if(((D=f.fragment)===null||D===void 0?void 0:D[0])!=="/")return;for(const b of f.fragment.slice(1).split("/")){if(typeof p=="boolean")return;const I=p[(0,i.unescapeFragment)(b)];if(I===void 0)return;p=I;const U=typeof p=="object"&&p[this.opts.schemaId];!$.has(b)&&U&&(g=(0,n.resolveUrl)(this.opts.uriResolver,
|
|
881
|
+
g,U))}let v;if(typeof p!="boolean"&&p.$ref&&!(0,i.schemaHasRulesButRef)(p,this.RULES)){const b=(0,n.resolveUrl)(this.opts.uriResolver,g,p.$ref);v=E.call(this,m,b)}const{schemaId:_}=this.opts;if(v=v||new o({schema:p,schemaId:_,root:m,baseId:g}),v.schema!==v.root.schema)return v}return Xe}const El="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Dl="Meta-schema for $data reference (JSON AnySchema extension proposal)",vl="object",$l=["$data"],_l={$data:{type:"string",
|
|
882
|
+
anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},wl=!1,Uy={$id:El,description:Dl,type:vl,required:$l,properties:_l,additionalProperties:wl},Hy={__proto__:null,$id:El,additionalProperties:wl,default:Uy,description:Dl,properties:_l,required:$l,type:vl},Vy=yt(Hy);var zn={},tn={exports:{}},Ao,bl;function zy(){return bl||(bl=1,Ao={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),Ao}var Co,Al;function Gy(){if(Al)return Co;Al=
|
|
883
|
+
1;const{HEX:t}=zy(),e=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function r(y){if(a(y,".")<3)return{host:y,isIPV4:!1};const f=y.match(e)||[],[g]=f;return g?{host:o(g,"."),isIPV4:!0}:{host:y,isIPV4:!1}}function n(y,f=!1){let g="",p=!0;for(const m of y){if(t[m]===void 0)return;m!=="0"&&p===!0&&(p=!1),p||(g+=m)}return f&&g.length===0&&(g="0"),g}function i(y){let f=0;const g={error:!1,address:"",zone:""},p=[],m=[];let D=!1,v=!1,_=!1;function b(){if(m.length){
|
|
884
|
+
if(D===!1){const I=n(m);if(I!==void 0)p.push(I);else return g.error=!0,!1}m.length=0}return!0}for(let I=0;I<y.length;I++){const U=y[I];if(!(U==="["||U==="]"))if(U===":"){if(v===!0&&(_=!0),!b())break;if(f++,p.push(":"),f>7){g.error=!0;break}I-1>=0&&y[I-1]===":"&&(v=!0);continue}else if(U==="%"){if(!b())break;D=!0}else{m.push(U);continue}}return m.length&&(D?g.zone=m.join(""):_?p.push(m.join("")):p.push(n(m))),g.address=p.join(""),g}function s(y){if(a(y,":")<2)return{host:y,isIPV6:!1};const f=i(y);
|
|
885
|
+
if(f.error)return{host:y,isIPV6:!1};{let g=f.address,p=f.address;return f.zone&&(g+="%"+f.zone,p+="%25"+f.zone),{host:g,escapedHost:p,isIPV6:!0}}}function o(y,f){let g="",p=!0;const m=y.length;for(let D=0;D<m;D++){const v=y[D];v==="0"&&p?(D+1<=m&&y[D+1]===f||D+1===m)&&(g+=v,p=!1):(v===f?p=!0:p=!1,g+=v)}return g}function a(y,f){let g=0;for(let p=0;p<y.length;p++)y[p]===f&&g++;return g}const c=/^\.\.?\//u,l=/^\/\.(?:\/|$)/u,u=/^\/\.\.(?:\/|$)/u,d=/^\/?(?:.|\n)*?(?=\/|$)/u;function h(y){const f=[];
|
|
886
|
+
for(;y.length;)if(y.match(c))y=y.replace(c,"");else if(y.match(l))y=y.replace(l,"/");else if(y.match(u))y=y.replace(u,"/"),f.pop();else if(y==="."||y==="..")y="";else{const g=y.match(d);if(g){const p=g[0];y=y.slice(p.length),f.push(p)}else throw new Error("Unexpected dot segment condition")}return f.join("")}function E(y,f){const g=f!==!0?escape:unescape;return y.scheme!==void 0&&(y.scheme=g(y.scheme)),y.userinfo!==void 0&&(y.userinfo=g(y.userinfo)),y.host!==void 0&&(y.host=g(y.host)),y.path!==void 0&&
|
|
887
|
+
(y.path=g(y.path)),y.query!==void 0&&(y.query=g(y.query)),y.fragment!==void 0&&(y.fragment=g(y.fragment)),y}function $(y){const f=[];if(y.userinfo!==void 0&&(f.push(y.userinfo),f.push("@")),y.host!==void 0){let g=unescape(y.host);const p=r(g);if(p.isIPV4)g=p.host;else{const m=s(p.host);m.isIPV6===!0?g=`[${m.escapedHost}]`:g=y.host}f.push(g)}return(typeof y.port=="number"||typeof y.port=="string")&&(f.push(":"),f.push(String(y.port))),f.length?f.join(""):void 0}return Co={recomposeAuthority:$,normalizeComponentEncoding:E,
|
|
888
|
+
removeDotSegments:h,normalizeIPv4:r,normalizeIPv6:s,stringArrayToHexStripped:n},Co}var So,Cl;function Wy(){if(Cl)return So;Cl=1;const t=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(p){return typeof p.secure=="boolean"?p.secure:String(p.scheme).toLowerCase()==="wss"}function n(p){return p.host||(p.error=p.error||"HTTP URIs must have a host."),p}function i(p){const m=String(p.scheme).toLowerCase()==="\
|
|
889
|
+
https";return(p.port===(m?443:80)||p.port==="")&&(p.port=void 0),p.path||(p.path="/"),p}function s(p){return p.secure=r(p),p.resourceName=(p.path||"/")+(p.query?"?"+p.query:""),p.path=void 0,p.query=void 0,p}function o(p){if((p.port===(r(p)?443:80)||p.port==="")&&(p.port=void 0),typeof p.secure=="boolean"&&(p.scheme=p.secure?"wss":"ws",p.secure=void 0),p.resourceName){const[m,D]=p.resourceName.split("?");p.path=m&&m!=="/"?m:void 0,p.query=D,p.resourceName=void 0}return p.fragment=void 0,p}function a(p,m){
|
|
890
|
+
if(!p.path)return p.error="URN can not be parsed",p;const D=p.path.match(e);if(D){const v=m.scheme||p.scheme||"urn";p.nid=D[1].toLowerCase(),p.nss=D[2];const _=`${v}:${m.nid||p.nid}`,b=g[_];p.path=void 0,b&&(p=b.parse(p,m))}else p.error=p.error||"URN can not be parsed.";return p}function c(p,m){const D=m.scheme||p.scheme||"urn",v=p.nid.toLowerCase(),_=`${D}:${m.nid||v}`,b=g[_];b&&(p=b.serialize(p,m));const I=p,U=p.nss;return I.path=`${v||m.nid}:${U}`,m.skipEscape=!0,I}function l(p,m){const D=p;return D.
|
|
891
|
+
uuid=D.nss,D.nss=void 0,!m.tolerant&&(!D.uuid||!t.test(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}function u(p){const m=p;return m.nss=(p.uuid||"").toLowerCase(),m}const d={scheme:"http",domainHost:!0,parse:n,serialize:i},h={scheme:"https",domainHost:d.domainHost,parse:n,serialize:i},E={scheme:"ws",domainHost:!0,parse:s,serialize:o},$={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},g={http:d,https:h,ws:E,wss:$,urn:{scheme:"urn",parse:a,serialize:c,skipNormalize:!0},
|
|
892
|
+
"urn:uuid":{scheme:"urn:uuid",parse:l,serialize:u,skipNormalize:!0}};return So=g,So}var Sl;function Ky(){if(Sl)return tn.exports;Sl=1;const{normalizeIPv6:t,normalizeIPv4:e,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:i}=Gy(),s=Wy();function o(f,g){return typeof f=="string"?f=u($(f,g),g):typeof f=="object"&&(f=$(u(f,g),g)),f}function a(f,g,p){const m=Object.assign({scheme:"null"},p),D=c($(f,m),$(g,m),m,!0);return u(D,{...m,skipEscape:!0})}function c(f,g,p,m){const D={};return m||
|
|
893
|
+
(f=$(u(f,p),p),g=$(u(g,p),p)),p=p||{},!p.tolerant&&g.scheme?(D.scheme=g.scheme,D.userinfo=g.userinfo,D.host=g.host,D.port=g.port,D.path=r(g.path||""),D.query=g.query):(g.userinfo!==void 0||g.host!==void 0||g.port!==void 0?(D.userinfo=g.userinfo,D.host=g.host,D.port=g.port,D.path=r(g.path||""),D.query=g.query):(g.path?(g.path.charAt(0)==="/"?D.path=r(g.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?D.path="/"+g.path:f.path?D.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+
|
|
894
|
+
g.path:D.path=g.path,D.path=r(D.path)),D.query=g.query):(D.path=f.path,g.query!==void 0?D.query=g.query:D.query=f.query),D.userinfo=f.userinfo,D.host=f.host,D.port=f.port),D.scheme=f.scheme),D.fragment=g.fragment,D}function l(f,g,p){return typeof f=="string"?(f=unescape(f),f=u(i($(f,p),!0),{...p,skipEscape:!0})):typeof f=="object"&&(f=u(i(f,!0),{...p,skipEscape:!0})),typeof g=="string"?(g=unescape(g),g=u(i($(g,p),!0),{...p,skipEscape:!0})):typeof g=="object"&&(g=u(i(g,!0),{...p,skipEscape:!0})),
|
|
895
|
+
f.toLowerCase()===g.toLowerCase()}function u(f,g){const p={host:f.host,scheme:f.scheme,userinfo:f.userinfo,port:f.port,path:f.path,query:f.query,nid:f.nid,nss:f.nss,uuid:f.uuid,fragment:f.fragment,reference:f.reference,resourceName:f.resourceName,secure:f.secure,error:""},m=Object.assign({},g),D=[],v=s[(m.scheme||p.scheme||"").toLowerCase()];v&&v.serialize&&v.serialize(p,m),p.path!==void 0&&(m.skipEscape?p.path=unescape(p.path):(p.path=escape(p.path),p.scheme!==void 0&&(p.path=p.path.split("%3A").
|
|
896
|
+
join(":")))),m.reference!=="suffix"&&p.scheme&&D.push(p.scheme,":");const _=n(p);if(_!==void 0&&(m.reference!=="suffix"&&D.push("//"),D.push(_),p.path&&p.path.charAt(0)!=="/"&&D.push("/")),p.path!==void 0){let b=p.path;!m.absolutePath&&(!v||!v.absolutePath)&&(b=r(b)),_===void 0&&(b=b.replace(/^\/\//u,"/%2F")),D.push(b)}return p.query!==void 0&&D.push("?",p.query),p.fragment!==void 0&&D.push("#",p.fragment),D.join("")}const d=Array.from({length:127},(f,g)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.
|
|
897
|
+
fromCharCode(g)));function h(f){let g=0;for(let p=0,m=f.length;p<m;++p)if(g=f.charCodeAt(p),g>126||d[g])return!0;return!1}const E=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function $(f,g){const p=Object.assign({},g),m={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},D=f.indexOf("%")!==-1;let v=!1;p.reference==="suffix"&&(f=(p.scheme?p.scheme+":":"")+"//"+f);const _=f.match(
|
|
898
|
+
E);if(_){if(m.scheme=_[1],m.userinfo=_[3],m.host=_[4],m.port=parseInt(_[5],10),m.path=_[6]||"",m.query=_[7],m.fragment=_[8],isNaN(m.port)&&(m.port=_[5]),m.host){const I=e(m.host);if(I.isIPV4===!1){const U=t(I.host);m.host=U.host.toLowerCase(),v=U.isIPV6}else m.host=I.host,v=!0}m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&m.query===void 0&&!m.path?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference=
|
|
899
|
+
"uri",p.reference&&p.reference!=="suffix"&&p.reference!==m.reference&&(m.error=m.error||"URI is not a "+p.reference+" reference.");const b=s[(p.scheme||m.scheme||"").toLowerCase()];if(!p.unicodeSupport&&(!b||!b.unicodeSupport)&&m.host&&(p.domainHost||b&&b.domainHost)&&v===!1&&h(m.host))try{m.host=URL.domainToASCII(m.host.toLowerCase())}catch(I){m.error=m.error||"Host's domain name can not be converted to ASCII: "+I}(!b||b&&!b.skipNormalize)&&(D&&m.scheme!==void 0&&(m.scheme=unescape(m.scheme)),D&&
|
|
900
|
+
m.host!==void 0&&(m.host=unescape(m.host)),m.path&&(m.path=escape(unescape(m.path))),m.fragment&&(m.fragment=encodeURI(decodeURIComponent(m.fragment)))),b&&b.parse&&b.parse(m,p)}else m.error=m.error||"URI can not be parsed.";return m}const y={SCHEMES:s,normalize:o,resolve:a,resolveComponents:c,equal:l,serialize:u,parse:$};return tn.exports=y,tn.exports.default=y,tn.exports.fastUri=y,tn.exports}var Rl;function Yy(){if(Rl)return zn;Rl=1,Object.defineProperty(zn,"__esModule",{value:!0});const t=Ky();
|
|
901
|
+
return t.code='require("ajv/dist/runtime/uri").default',zn.default=t,zn}var Ol;function Il(){return Ol||(Ol=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Zr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=pe();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.
|
|
902
|
+
defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=Un(),i=en(),s=rl(),o=Vn(),a=pe(),c=Mn(),l=xn(),u=_e(),d=Vy,h=Yy(),E=(q,C)=>new RegExp(q,C);E.code="new RegExp";const $=["removeAdditional","useDefaults","coerceTypes"],y=new Set(
|
|
903
|
+
["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code:\
|
|
904
|
+
{process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},
|
|
905
|
+
g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function m(q){var C,H,k,w,A,R,J,Z,oe,ae,T,x,Q,ie,O,P,ee,W,F,re,V,ne,fe,we,Oe;const vt=q.strict,Ft=(C=q.code)===null||C===void 0?void 0:C.optimize,ka=Ft===!0||Ft===void 0?1:Ft||0,Ba=(k=(H=q.code)===null||H===void 0?void 0:H.regExp)!==null&&k!==void 0?k:E,gp=(w=q.uriResolver)!==null&&w!==void 0?w:h.default;return{strictSchema:(R=(A=q.strictSchema)!==null&&A!==void 0?A:
|
|
906
|
+
vt)!==null&&R!==void 0?R:!0,strictNumbers:(Z=(J=q.strictNumbers)!==null&&J!==void 0?J:vt)!==null&&Z!==void 0?Z:!0,strictTypes:(ae=(oe=q.strictTypes)!==null&&oe!==void 0?oe:vt)!==null&&ae!==void 0?ae:"log",strictTuples:(x=(T=q.strictTuples)!==null&&T!==void 0?T:vt)!==null&&x!==void 0?x:"log",strictRequired:(ie=(Q=q.strictRequired)!==null&&Q!==void 0?Q:vt)!==null&&ie!==void 0?ie:!1,code:q.code?{...q.code,optimize:ka,regExp:Ba}:{optimize:ka,regExp:Ba},loopRequired:(O=q.loopRequired)!==null&&O!==void 0?
|
|
907
|
+
O:p,loopEnum:(P=q.loopEnum)!==null&&P!==void 0?P:p,meta:(ee=q.meta)!==null&&ee!==void 0?ee:!0,messages:(W=q.messages)!==null&&W!==void 0?W:!0,inlineRefs:(F=q.inlineRefs)!==null&&F!==void 0?F:!0,schemaId:(re=q.schemaId)!==null&&re!==void 0?re:"$id",addUsedSchema:(V=q.addUsedSchema)!==null&&V!==void 0?V:!0,validateSchema:(ne=q.validateSchema)!==null&&ne!==void 0?ne:!0,validateFormats:(fe=q.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(we=q.unicodeRegExp)!==null&&we!==void 0?we:!0,int32range:(Oe=
|
|
908
|
+
q.int32range)!==null&&Oe!==void 0?Oe:!0,uriResolver:gp}}class D{constructor(C={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,C=this.opts={...C,...m(C)};const{es5:H,lines:k}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:y,es5:H,lines:k}),this.logger=B(C.logger);const w=C.validateFormats;C.validateFormats=!1,this.RULES=(0,s.getRules)(),v.call(this,f,C,"NOT SUPPORTED"),v.call(this,g,C,"DEPRECATED","warn"),this._metaOpts=
|
|
909
|
+
G.call(this),C.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),C.keywords&&U.call(this,C.keywords),typeof C.meta=="object"&&this.addMetaSchema(C.meta),b.call(this),C.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:C,meta:H,schemaId:k}=this.opts;let w=d;k==="id"&&(w={...d},w.id=w.$id,delete w.$id),H&&C&&this.addMetaSchema(w,w[k],!1)}defaultMeta(){const{meta:C,schemaId:H}=this.opts;return this.opts.defaultMeta=typeof C==
|
|
910
|
+
"object"?C[H]||C:void 0}validate(C,H){let k;if(typeof C=="string"){if(k=this.getSchema(C),!k)throw new Error(`no schema with key or ref "${C}"`)}else k=this.compile(C);const w=k(H);return"$async"in k||(this.errors=k.errors),w}compile(C,H){const k=this._addSchema(C,H);return k.validate||this._compileSchemaEnv(k)}compileAsync(C,H){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:k}=this.opts;return w.call(this,C,H);async function w(ae,T){
|
|
911
|
+
await A.call(this,ae.$schema);const x=this._addSchema(ae,T);return x.validate||R.call(this,x)}async function A(ae){ae&&!this.getSchema(ae)&&await w.call(this,{$ref:ae},!0)}async function R(ae){try{return this._compileSchemaEnv(ae)}catch(T){if(!(T instanceof i.default))throw T;return J.call(this,T),await Z.call(this,T.missingSchema),R.call(this,ae)}}function J({missingSchema:ae,missingRef:T}){if(this.refs[ae])throw new Error(`AnySchema ${ae} is loaded but ${T} cannot be resolved`)}async function Z(ae){
|
|
912
|
+
const T=await oe.call(this,ae);this.refs[ae]||await A.call(this,T.$schema),this.refs[ae]||this.addSchema(T,ae,H)}async function oe(ae){const T=this._loading[ae];if(T)return T;try{return await(this._loading[ae]=k(ae))}finally{delete this._loading[ae]}}}addSchema(C,H,k,w=this.opts.validateSchema){if(Array.isArray(C)){for(const R of C)this.addSchema(R,void 0,k,w);return this}let A;if(typeof C=="object"){const{schemaId:R}=this.opts;if(A=C[R],A!==void 0&&typeof A!="string")throw new Error(`schema ${R}\
|
|
913
|
+
must be string`)}return H=(0,c.normalizeId)(H||A),this._checkUnique(H),this.schemas[H]=this._addSchema(C,k,H,w,!0),this}addMetaSchema(C,H,k=this.opts.validateSchema){return this.addSchema(C,H,!0,k),this}validateSchema(C,H){if(typeof C=="boolean")return!0;let k;if(k=C.$schema,k!==void 0&&typeof k!="string")throw new Error("$schema must be a string");if(k=k||this.opts.defaultMeta||this.defaultMeta(),!k)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const w=this.validate(
|
|
914
|
+
k,C);if(!w&&H){const A="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(A);else throw new Error(A)}return w}getSchema(C){let H;for(;typeof(H=_.call(this,C))=="string";)C=H;if(H===void 0){const{schemaId:k}=this.opts,w=new o.SchemaEnv({schema:{},schemaId:k});if(H=o.resolveSchema.call(this,w,C),!H)return;this.refs[C]=H}return H.validate||this._compileSchemaEnv(H)}removeSchema(C){if(C instanceof RegExp)return this._removeAllSchemas(this.schemas,C),this._removeAllSchemas(
|
|
915
|
+
this.refs,C),this;switch(typeof C){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const H=_.call(this,C);return typeof H=="object"&&this._cache.delete(H.schema),delete this.schemas[C],delete this.refs[C],this}case"object":{const H=C;this._cache.delete(H);let k=C[this.opts.schemaId];return k&&(k=(0,c.normalizeId)(k),delete this.schemas[k],delete this.refs[k]),this}default:throw new Error("ajv.removeSchema: inval\
|
|
916
|
+
id parameter")}}addVocabulary(C){for(const H of C)this.addKeyword(H);return this}addKeyword(C,H){let k;if(typeof C=="string")k=C,typeof H=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),H.keyword=k);else if(typeof C=="object"&&H===void 0){if(H=C,k=H.keyword,Array.isArray(k)&&!k.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(j.call(this,k,H),!H)return(0,u.eachItem)(
|
|
917
|
+
k,A=>M.call(this,A)),this;z.call(this,H);const w={...H,type:(0,l.getJSONTypes)(H.type),schemaType:(0,l.getJSONTypes)(H.schemaType)};return(0,u.eachItem)(k,w.type.length===0?A=>M.call(this,A,w):A=>w.type.forEach(R=>M.call(this,A,w,R))),this}getKeyword(C){const H=this.RULES.all[C];return typeof H=="object"?H.definition:!!H}removeKeyword(C){const{RULES:H}=this;delete H.keywords[C],delete H.all[C];for(const k of H.rules){const w=k.rules.findIndex(A=>A.keyword===C);w>=0&&k.rules.splice(w,1)}return this}addFormat(C,H){
|
|
918
|
+
return typeof H=="string"&&(H=new RegExp(H)),this.formats[C]=H,this}errorsText(C=this.errors,{separator:H=", ",dataVar:k="data"}={}){return!C||C.length===0?"No errors":C.map(w=>`${k}${w.instancePath} ${w.message}`).reduce((w,A)=>w+H+A)}$dataMetaSchema(C,H){const k=this.RULES.all;C=JSON.parse(JSON.stringify(C));for(const w of H){const A=w.split("/").slice(1);let R=C;for(const J of A)R=R[J];for(const J in k){const Z=k[J];if(typeof Z!="object")continue;const{$data:oe}=Z.definition,ae=R[J];oe&&ae&&(R[J]=
|
|
919
|
+
se(ae))}}return C}_removeAllSchemas(C,H){for(const k in C){const w=C[k];(!H||H.test(k))&&(typeof w=="string"?delete C[k]:w&&!w.meta&&(this._cache.delete(w.schema),delete C[k]))}}_addSchema(C,H,k,w=this.opts.validateSchema,A=this.opts.addUsedSchema){let R;const{schemaId:J}=this.opts;if(typeof C=="object")R=C[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof C!="boolean")throw new Error("schema must be object or boolean")}let Z=this._cache.get(C);if(Z!==void 0)return Z;k=
|
|
920
|
+
(0,c.normalizeId)(R||k);const oe=c.getSchemaRefs.call(this,C,k);return Z=new o.SchemaEnv({schema:C,schemaId:J,meta:H,baseId:k,localRefs:oe}),this._cache.set(Z.schema,Z),A&&!k.startsWith("#")&&(k&&this._checkUnique(k),this.refs[k]=Z),w&&this.validateSchema(C,!0),Z}_checkUnique(C){if(this.schemas[C]||this.refs[C])throw new Error(`schema with key or id "${C}" already exists`)}_compileSchemaEnv(C){if(C.meta?this._compileMetaSchema(C):o.compileSchema.call(this,C),!C.validate)throw new Error("ajv impl\
|
|
921
|
+
ementation error");return C.validate}_compileMetaSchema(C){const H=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,C)}finally{this.opts=H}}}D.ValidationError=n.default,D.MissingRefError=i.default,t.default=D;function v(q,C,H,k="error"){for(const w in q){const A=w;A in C&&this.logger[k](`${H}: option ${w}. ${q[A]}`)}}function _(q){return q=(0,c.normalizeId)(q),this.schemas[q]||this.refs[q]}function b(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const C in q)
|
|
922
|
+
this.addSchema(q[C],C)}function I(){for(const q in this.opts.formats){const C=this.opts.formats[q];C&&this.addFormat(q,C)}}function U(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const C in q){const H=q[C];H.keyword||(H.keyword=C),this.addKeyword(H)}}function G(){const q={...this.opts};for(const C of $)delete q[C];return q}const L={log(){},warn(){},error(){}};function B(q){if(q===!1)return L;if(q===void 0)return console;
|
|
923
|
+
if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const N=/^[a-z_$][a-z0-9_$:-]*$/i;function j(q,C){const{RULES:H}=this;if((0,u.eachItem)(q,k=>{if(H.keywords[k])throw new Error(`Keyword ${k} is already defined`);if(!N.test(k))throw new Error(`Keyword ${k} has invalid name`)}),!!C&&C.$data&&!("code"in C||"validate"in C))throw new Error('$data keyword must have "code" or "validate" function')}function M(q,C,H){var k;const w=C?.post;if(H&&w)throw new Error(
|
|
924
|
+
'keyword with "post" flag cannot have "type"');const{RULES:A}=this;let R=w?A.post:A.rules.find(({type:Z})=>Z===H);if(R||(R={type:H,rules:[]},A.rules.push(R)),A.keywords[q]=!0,!C)return;const J={keyword:q,definition:{...C,type:(0,l.getJSONTypes)(C.type),schemaType:(0,l.getJSONTypes)(C.schemaType)}};C.before?Y.call(this,R,J,C.before):R.rules.push(J),A.all[q]=J,(k=C.implements)===null||k===void 0||k.forEach(Z=>this.addKeyword(Z))}function Y(q,C,H){const k=q.rules.findIndex(w=>w.keyword===H);k>=0?q.
|
|
925
|
+
rules.splice(k,0,C):(q.rules.push(C),this.logger.warn(`rule ${H} is not defined`))}function z(q){let{metaSchema:C}=q;C!==void 0&&(q.$data&&this.opts.$data&&(C=se(C)),q.validateSchema=this.compile(C,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function se(q){return{anyOf:[q,X]}}}(Eo)),Eo}var Gn={},Wn={},Kn={},Fl;function Jy(){if(Fl)return Kn;Fl=1,Object.defineProperty(Kn,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('\
|
|
926
|
+
NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Kn.default=t,Kn}var Vt={},Pl;function Ro(){if(Pl)return Vt;Pl=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.callRef=Vt.getValidate=void 0;const t=en(),e=ft(),r=pe(),n=ct(),i=Vn(),s=_e(),o={keyword:"$ref",schemaType:"string",code(l){const{gen:u,schema:d,it:h}=l,{baseId:E,schemaEnv:$,validateName:y,opts:f,self:g}=h,{root:p}=$;if((d==="#"||d==="#/")&&E===p.baseId)return D();const m=i.resolveRef.call(g,p,E,d);if(m===void 0)throw new t.
|
|
927
|
+
default(h.opts.uriResolver,E,d);if(m instanceof i.SchemaEnv)return v(m);return _(m);function D(){if($===p)return c(l,y,$,$.$async);const b=u.scopeValue("root",{ref:p});return c(l,(0,r._)`${b}.validate`,p,p.$async)}function v(b){const I=a(l,b);c(l,I,b,b.$async)}function _(b){const I=u.scopeValue("schema",f.code.source===!0?{ref:b,code:(0,r.stringify)(b)}:{ref:b}),U=u.name("valid"),G=l.subschema({schema:b,dataTypes:[],schemaPath:r.nil,topSchemaRef:I,errSchemaPath:d},U);l.mergeEvaluated(G),l.ok(U)}}};
|
|
928
|
+
function a(l,u){const{gen:d}=l;return u.validate?d.scopeValue("validate",{ref:u.validate}):(0,r._)`${d.scopeValue("wrapper",{ref:u})}.validate`}Vt.getValidate=a;function c(l,u,d,h){const{gen:E,it:$}=l,{allErrors:y,schemaEnv:f,opts:g}=$,p=g.passContext?n.default.this:r.nil;h?m():D();function m(){if(!f.$async)throw new Error("async schema referenced by sync schema");const b=E.let("valid");E.try(()=>{E.code((0,r._)`await ${(0,e.callValidateCode)(l,u,p)}`),_(u),y||E.assign(b,!0)},I=>{E.if((0,r._)`!(${I} instanceof ${$.
|
|
929
|
+
ValidationError})`,()=>E.throw(I)),v(I),y||E.assign(b,!1)}),l.ok(b)}function D(){l.result((0,e.callValidateCode)(l,u,p),()=>_(u),()=>v(u))}function v(b){const I=(0,r._)`${b}.errors`;E.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),E.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function _(b){var I;if(!$.opts.unevaluated)return;const U=(I=d?.validate)===null||I===void 0?void 0:I.evaluated;if($.props!==!0)if(U&&!U.dynamicProps)
|
|
930
|
+
U.props!==void 0&&($.props=s.mergeEvaluated.props(E,U.props,$.props));else{const G=E.var("props",(0,r._)`${b}.evaluated.props`);$.props=s.mergeEvaluated.props(E,G,$.props,r.Name)}if($.items!==!0)if(U&&!U.dynamicItems)U.items!==void 0&&($.items=s.mergeEvaluated.items(E,U.items,$.items));else{const G=E.var("items",(0,r._)`${b}.evaluated.items`);$.items=s.mergeEvaluated.items(E,G,$.items,r.Name)}}}return Vt.callRef=c,Vt.default=o,Vt}var Nl;function Tl(){if(Nl)return Wn;Nl=1,Object.defineProperty(Wn,
|
|
931
|
+
"__esModule",{value:!0});const t=Jy(),e=Ro(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return Wn.default=r,Wn}var Yn={},Jn={},Ll;function Xy(){if(Ll)return Jn;Ll=1,Object.defineProperty(Jn,"__esModule",{value:!0});const t=pe(),e=t.operators,r={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},n={message:({keyword:s,schemaCode:o})=>(0,t.
|
|
932
|
+
str)`must be ${r[s].okStr} ${o}`,params:({keyword:s,schemaCode:o})=>(0,t._)`{comparison: ${r[s].okStr}, limit: ${o}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:o,data:a,schemaCode:c}=s;s.fail$data((0,t._)`${a} ${r[o].fail} ${c} || isNaN(${a})`)}};return Jn.default=i,Jn}var Xn={},jl;function Qy(){if(jl)return Xn;jl=1,Object.defineProperty(Xn,"__esModule",{value:!0});const t=pe(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,
|
|
933
|
+
error:{message:({schemaCode:n})=>(0,t.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,t._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:s,schemaCode:o,it:a}=n,c=a.opts.multipleOfPrecision,l=i.let("res"),u=c?(0,t._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0,t._)`${l} !== parseInt(${l})`;n.fail$data((0,t._)`(${o} === 0 || (${l} = ${s}/${o}, ${u}))`)}};return Xn.default=r,Xn}var Qn={},Zn={},kl;function Zy(){if(kl)return Zn;kl=1,Object.defineProperty(Zn,"__esModule",{value:!0});function t(e){
|
|
934
|
+
const r=e.length;let n=0,i=0,s;for(;i<r;)n++,s=e.charCodeAt(i++),s>=55296&&s<=56319&&i<r&&(s=e.charCodeAt(i),(s&64512)===56320&&i++);return n}return Zn.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',Zn}var Bl;function eE(){if(Bl)return Qn;Bl=1,Object.defineProperty(Qn,"__esModule",{value:!0});const t=pe(),e=_e(),r=Zy(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:o}){const a=s==="maxLength"?"more":"fewer";
|
|
935
|
+
return(0,t.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){const{keyword:o,data:a,schemaCode:c,it:l}=s,u=o==="maxLength"?t.operators.GT:t.operators.LT,d=l.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,e.useFunc)(s.gen,r.default)}(${a})`;s.fail$data((0,t._)`${d} ${u} ${c}`)}};return Qn.default=i,Qn}var ei={},xl;function tE(){if(xl)return ei;xl=1,Object.defineProperty(ei,"__esModule",{value:!0});const t=ft(),e=pe(),n={keyword:"pattern",
|
|
936
|
+
type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,e.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,e._)`{pattern: ${i}}`},code(i){const{data:s,$data:o,schema:a,schemaCode:c,it:l}=i,u=l.opts.unicodeRegExp?"u":"",d=o?(0,e._)`(new RegExp(${c}, ${u}))`:(0,t.usePattern)(i,a);i.fail$data((0,e._)`!${d}.test(${s})`)}};return ei.default=n,ei}var ti={},Ml;function rE(){if(Ml)return ti;Ml=1,Object.defineProperty(ti,"__esModule",{value:!0});const t=pe(),r={keyword:[
|
|
937
|
+
"maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${i} properties`},params:({schemaCode:n})=>(0,t._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:o}=n,a=i==="maxProperties"?t.operators.GT:t.operators.LT;n.fail$data((0,t._)`Object.keys(${s}).length ${a} ${o}`)}};return ti.default=r,ti}var ri={},ql;function nE(){if(ql)return ri;ql=1,Object.
|
|
938
|
+
defineProperty(ri,"__esModule",{value:!0});const t=ft(),e=pe(),r=_e(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,e.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,e._)`{missingProperty: ${s}}`},code(s){const{gen:o,schema:a,schemaCode:c,data:l,$data:u,it:d}=s,{opts:h}=d;if(!u&&a.length===0)return;const E=a.length>=h.loopRequired;if(d.allErrors?$():y(),h.strictRequired){const p=s.parentSchema.
|
|
939
|
+
properties,{definedProperties:m}=s.it;for(const D of a)if(p?.[D]===void 0&&!m.has(D)){const v=d.schemaEnv.baseId+d.errSchemaPath,_=`required property "${D}" is not defined at "${v}" (strictRequired)`;(0,r.checkStrictMode)(d,_,d.opts.strictRequired)}}function $(){if(E||u)s.block$data(e.nil,f);else for(const p of a)(0,t.checkReportMissingProp)(s,p)}function y(){const p=o.let("missing");if(E||u){const m=o.let("valid",!0);s.block$data(m,()=>g(p,m)),s.ok(m)}else o.if((0,t.checkMissingProp)(s,a,p)),(0,t.
|
|
940
|
+
reportMissingProp)(s,p),o.else()}function f(){o.forOf("prop",c,p=>{s.setParams({missingProperty:p}),o.if((0,t.noPropertyInData)(o,l,p,h.ownProperties),()=>s.error())})}function g(p,m){s.setParams({missingProperty:p}),o.forOf(p,c,()=>{o.assign(m,(0,t.propertyInData)(o,l,p,h.ownProperties)),o.if((0,e.not)(m),()=>{s.error(),o.break()})},e.nil)}}};return ri.default=i,ri}var ni={},Ul;function iE(){if(Ul)return ni;Ul=1,Object.defineProperty(ni,"__esModule",{value:!0});const t=pe(),r={keyword:["maxItem\
|
|
941
|
+
s","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${i} items`},params:({schemaCode:n})=>(0,t._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:o}=n,a=i==="maxItems"?t.operators.GT:t.operators.LT;n.fail$data((0,t._)`${s}.length ${a} ${o}`)}};return ni.default=r,ni}var ii={},si={},Hl;function Oo(){if(Hl)return si;Hl=1,Object.defineProperty(si,"__esModule",{value:!0});
|
|
942
|
+
const t=fl();return t.code='require("ajv/dist/runtime/equal").default',si.default=t,si}var Vl;function sE(){if(Vl)return ii;Vl=1,Object.defineProperty(ii,"__esModule",{value:!0});const t=xn(),e=pe(),r=_e(),n=Oo(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:a}})=>(0,e.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0,e._)`{i: ${o}, j: ${a}}`},code(o){const{gen:a,data:c,$data:l,schema:u,
|
|
943
|
+
parentSchema:d,schemaCode:h,it:E}=o;if(!l&&!u)return;const $=a.let("valid"),y=d.items?(0,t.getSchemaTypes)(d.items):[];o.block$data($,f,(0,e._)`${h} === false`),o.ok($);function f(){const D=a.let("i",(0,e._)`${c}.length`),v=a.let("j");o.setParams({i:D,j:v}),a.assign($,!0),a.if((0,e._)`${D} > 1`,()=>(g()?p:m)(D,v))}function g(){return y.length>0&&!y.some(D=>D==="object"||D==="array")}function p(D,v){const _=a.name("item"),b=(0,t.checkDataTypes)(y,_,E.opts.strictNumbers,t.DataType.Wrong),I=a.const(
|
|
944
|
+
"indices",(0,e._)`{}`);a.for((0,e._)`;${D}--;`,()=>{a.let(_,(0,e._)`${c}[${D}]`),a.if(b,(0,e._)`continue`),y.length>1&&a.if((0,e._)`typeof ${_} == "string"`,(0,e._)`${_} += "_"`),a.if((0,e._)`typeof ${I}[${_}] == "number"`,()=>{a.assign(v,(0,e._)`${I}[${_}]`),o.error(),a.assign($,!1).break()}).code((0,e._)`${I}[${_}] = ${D}`)})}function m(D,v){const _=(0,r.useFunc)(a,n.default),b=a.name("outer");a.label(b).for((0,e._)`;${D}--;`,()=>a.for((0,e._)`${v} = ${D}; ${v}--;`,()=>a.if((0,e._)`${_}(${c}[${D}], ${c}[${v}])`,
|
|
945
|
+
()=>{o.error(),a.assign($,!1).break(b)})))}}};return ii.default=s,ii}var oi={},zl;function oE(){if(zl)return oi;zl=1,Object.defineProperty(oi,"__esModule",{value:!0});const t=pe(),e=_e(),r=Oo(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,t._)`{allowedValue: ${s}}`},code(s){const{gen:o,data:a,$data:c,schemaCode:l,schema:u}=s;c||u&&typeof u=="object"?s.fail$data((0,t._)`!${(0,e.useFunc)(o,r.default)}(${a}, ${l})`):s.fail((0,t._)`${u} !== ${a}`)}};
|
|
946
|
+
return oi.default=i,oi}var ai={},Gl;function aE(){if(Gl)return ai;Gl=1,Object.defineProperty(ai,"__esModule",{value:!0});const t=pe(),e=_e(),r=Oo(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,t._)`{allowedValues: ${s}}`},code(s){const{gen:o,data:a,$data:c,schema:l,schemaCode:u,it:d}=s;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const h=l.length>=d.opts.loopEnum;let E;const $=()=>E??
|
|
947
|
+
(E=(0,e.useFunc)(o,r.default));let y;if(h||c)y=o.let("valid"),s.block$data(y,f);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const p=o.const("vSchema",u);y=(0,t.or)(...l.map((m,D)=>g(p,D)))}s.pass(y);function f(){o.assign(y,!1),o.forOf("v",u,p=>o.if((0,t._)`${$()}(${a}, ${p})`,()=>o.assign(y,!0).break()))}function g(p,m){const D=l[m];return typeof D=="object"&&D!==null?(0,t._)`${$()}(${a}, ${p}[${m}])`:(0,t._)`${a} === ${D}`}}};return ai.default=i,ai}var Wl;function Kl(){
|
|
948
|
+
if(Wl)return Yn;Wl=1,Object.defineProperty(Yn,"__esModule",{value:!0});const t=Xy(),e=Qy(),r=eE(),n=tE(),i=rE(),s=nE(),o=iE(),a=sE(),c=oE(),l=aE(),u=[t.default,e.default,r.default,n.default,i.default,s.default,o.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return Yn.default=u,Yn}var ui={},vr={},Yl;function Jl(){if(Yl)return vr;Yl=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.validateAdditionalItems=void 0;
|
|
949
|
+
const t=pe(),e=_e(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){const{parentSchema:o,it:a}=s,{items:c}=o;if(!Array.isArray(c)){(0,e.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(s,c)}};function i(s,o){const{gen:a,schema:c,data:l,keyword:u,it:d}=s;d.items=
|
|
950
|
+
!0;const h=a.const("len",(0,t._)`${l}.length`);if(c===!1)s.setParams({len:o.length}),s.pass((0,t._)`${h} <= ${o.length}`);else if(typeof c=="object"&&!(0,e.alwaysValidSchema)(d,c)){const $=a.var("valid",(0,t._)`${h} <= ${o.length}`);a.if((0,t.not)($),()=>E($)),s.ok($)}function E($){a.forRange("i",o.length,h,y=>{s.subschema({keyword:u,dataProp:y,dataPropType:e.Type.Num},$),d.allErrors||a.if((0,t.not)($),()=>a.break())})}}return vr.validateAdditionalItems=i,vr.default=n,vr}var ci={},$r={},Xl;function Ql(){
|
|
951
|
+
if(Xl)return $r;Xl=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.validateTuple=void 0;const t=pe(),e=_e(),r=ft(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:o,it:a}=s;if(Array.isArray(o))return i(s,"additionalItems",o);a.items=!0,!(0,e.alwaysValidSchema)(a,o)&&s.ok((0,r.validateArray)(s))}};function i(s,o,a=s.schema){const{gen:c,parentSchema:l,data:u,keyword:d,it:h}=s;y(l),h.opts.unevaluated&&a.length&&h.items!==!0&&(h.
|
|
952
|
+
items=e.mergeEvaluated.items(c,a.length,h.items));const E=c.name("valid"),$=c.const("len",(0,t._)`${u}.length`);a.forEach((f,g)=>{(0,e.alwaysValidSchema)(h,f)||(c.if((0,t._)`${$} > ${g}`,()=>s.subschema({keyword:d,schemaProp:g,dataProp:g},E)),s.ok(E))});function y(f){const{opts:g,errSchemaPath:p}=h,m=a.length,D=m===f.minItems&&(m===f.maxItems||f[o]===!1);if(g.strictTuples&&!D){const v=`"${d}" is ${m}-tuple, but minItems or maxItems/${o} are not specified or different at path "${p}"`;(0,e.checkStrictMode)(
|
|
953
|
+
h,v,g.strictTuples)}}}return $r.validateTuple=i,$r.default=n,$r}var Zl;function uE(){if(Zl)return ci;Zl=1,Object.defineProperty(ci,"__esModule",{value:!0});const t=Ql(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,t.validateTuple)(r,"items")};return ci.default=e,ci}var li={},ef;function cE(){if(ef)return li;ef=1,Object.defineProperty(li,"__esModule",{value:!0});const t=pe(),e=_e(),r=ft(),n=Jl(),s={keyword:"items",type:"array",schemaType:["object","bo\
|
|
954
|
+
olean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,t.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,t._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:c,it:l}=o,{prefixItems:u}=c;l.items=!0,!(0,e.alwaysValidSchema)(l,a)&&(u?(0,n.validateAdditionalItems)(o,u):o.ok((0,r.validateArray)(o)))}};return li.default=s,li}var fi={},tf;function lE(){if(tf)return fi;tf=1,Object.defineProperty(fi,"__esModule",{value:!0});const t=pe(),e=_e(),n={keyword:"contains",
|
|
955
|
+
type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:s}})=>s===void 0?(0,t.str)`must contain at least ${i} valid item(s)`:(0,t.str)`must contain at least ${i} and no more than ${s} valid item(s)`,params:({params:{min:i,max:s}})=>s===void 0?(0,t._)`{minContains: ${i}}`:(0,t._)`{minContains: ${i}, maxContains: ${s}}`},code(i){const{gen:s,schema:o,parentSchema:a,data:c,it:l}=i;let u,d;const{minContains:h,maxContains:E}=a;l.opts.next?(u=
|
|
956
|
+
h===void 0?1:h,d=E):u=1;const $=s.const("len",(0,t._)`${c}.length`);if(i.setParams({min:u,max:d}),d===void 0&&u===0){(0,e.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&u>d){(0,e.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,e.alwaysValidSchema)(l,o)){let m=(0,t._)`${$} >= ${u}`;d!==void 0&&(m=(0,t._)`${m} && ${$} <= ${d}`),i.pass(m);return}l.items=!0;const y=s.name("valid");d===void 0&&
|
|
957
|
+
u===1?g(y,()=>s.if(y,()=>s.break())):u===0?(s.let(y,!0),d!==void 0&&s.if((0,t._)`${c}.length > 0`,f)):(s.let(y,!1),f()),i.result(y,()=>i.reset());function f(){const m=s.name("_valid"),D=s.let("count",0);g(m,()=>s.if(m,()=>p(D)))}function g(m,D){s.forRange("i",0,$,v=>{i.subschema({keyword:"contains",dataProp:v,dataPropType:e.Type.Num,compositeRule:!0},m),D()})}function p(m){s.code((0,t._)`${m}++`),d===void 0?s.if((0,t._)`${m} >= ${u}`,()=>s.assign(y,!0).break()):(s.if((0,t._)`${m} > ${d}`,()=>s.assign(
|
|
958
|
+
y,!1).break()),u===1?s.assign(y,!0):s.if((0,t._)`${m} >= ${u}`,()=>s.assign(y,!0)))}}};return fi.default=n,fi}var Io={},rf;function Fo(){return rf||(rf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=pe(),r=_e(),n=ft();t.error={message:({params:{property:c,depsCount:l,deps:u}})=>{const d=l===1?"property":"properties";return(0,e.str)`must have ${d} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:l,
|
|
959
|
+
deps:u,missingProperty:d}})=>(0,e._)`{property: ${c},
|
|
960
960
|
missingProperty: ${d},
|
|
961
961
|
depsCount: ${l},
|
|
962
|
-
deps: ${u}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){const[l,u]=s(c);o(c,l),a(c,u)}};function s({schema:c}){const l={},u={};for(const d in c){if(d==="__proto__")continue;const h=Array.isArray(c[d])?l:u;h[d]=c[d]}return[l,u]}function o(c,l=c.schema){const{gen:u,data:d,it:h}=c;if(Object.keys(l).length===0)return;const E=u.let("missing");for(const
|
|
963
|
-
c.setParams({property:y
|
|
964
|
-
c.mergeValidEvaluated(f
|
|
965
|
-
lid");s.forIn("key",a,u=>{i.setParams({propertyName:u}),i.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),s.if((0,t.not)(l),()=>{i.error(!0),c.allErrors||s.break()})}),i.ok(l)}};return di.default=n,di}var hi={},
|
|
966
|
-
message:"must NOT have additional properties",params:({params:o})=>(0,e._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:c,parentSchema:l,data:u,errsCount:d,it:h}=o;if(!d)throw new Error("ajv implementation error");const{allErrors:E,opts
|
|
967
|
-
a.forIn("key",u,_=>{!
|
|
968
|
-
!1){o.setParams({additionalProperty:_}),o.error(),E||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(h,c)){const b=a.name("valid")
|
|
969
|
-
function dE(){if(
|
|
970
|
-
r.mergeEvaluated.props(o,(0,r.toHash)(d),u.props));const h=d.filter(f=>!(0,r.alwaysValidSchema)(u,a[f]));if(h.length===0)return;const E=o.name("valid");for(const f of h)
|
|
971
|
-
pi}var mi={},
|
|
972
|
-
"valid");u.props!==!0&&!(u.props instanceof e.Name)&&(u.props=(0,n.evaluatedPropsToName)(o,u.props));const{props:f}=u;g();function g(){for(const
|
|
973
|
-
ies",schemaProp:v,
|
|
974
|
-
not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return gi.default=e,gi}var yi={},
|
|
962
|
+
deps: ${u}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){const[l,u]=s(c);o(c,l),a(c,u)}};function s({schema:c}){const l={},u={};for(const d in c){if(d==="__proto__")continue;const h=Array.isArray(c[d])?l:u;h[d]=c[d]}return[l,u]}function o(c,l=c.schema){const{gen:u,data:d,it:h}=c;if(Object.keys(l).length===0)return;const E=u.let("missing");for(const $ in l){const y=l[$];if(y.length===0)continue;const f=(0,n.propertyInData)(u,d,$,h.opts.ownProperties);
|
|
963
|
+
c.setParams({property:$,depsCount:y.length,deps:y.join(", ")}),h.allErrors?u.if(f,()=>{for(const g of y)(0,n.checkReportMissingProp)(c,g)}):(u.if((0,e._)`${f} && (${(0,n.checkMissingProp)(c,y,E)})`),(0,n.reportMissingProp)(c,E),u.else())}}t.validatePropertyDeps=o;function a(c,l=c.schema){const{gen:u,data:d,keyword:h,it:E}=c,$=u.name("valid");for(const y in l)(0,r.alwaysValidSchema)(E,l[y])||(u.if((0,n.propertyInData)(u,d,y,E.opts.ownProperties),()=>{const f=c.subschema({keyword:h,schemaProp:y},$);
|
|
964
|
+
c.mergeValidEvaluated(f,$)},()=>u.var($,!0)),c.ok($))}t.validateSchemaDeps=a,t.default=i}(Io)),Io}var di={},nf;function fE(){if(nf)return di;nf=1,Object.defineProperty(di,"__esModule",{value:!0});const t=pe(),e=_e(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,t._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:s,schema:o,data:a,it:c}=i;if((0,e.alwaysValidSchema)(c,o))return;const l=s.name("va\
|
|
965
|
+
lid");s.forIn("key",a,u=>{i.setParams({propertyName:u}),i.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),s.if((0,t.not)(l),()=>{i.error(!0),c.allErrors||s.break()})}),i.ok(l)}};return di.default=n,di}var hi={},sf;function of(){if(sf)return hi;sf=1,Object.defineProperty(hi,"__esModule",{value:!0});const t=ft(),e=pe(),r=ct(),n=_e(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{
|
|
966
|
+
message:"must NOT have additional properties",params:({params:o})=>(0,e._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:c,parentSchema:l,data:u,errsCount:d,it:h}=o;if(!d)throw new Error("ajv implementation error");const{allErrors:E,opts:$}=h;if(h.props=!0,$.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,c))return;const y=(0,t.allSchemaProperties)(l.properties),f=(0,t.allSchemaProperties)(l.patternProperties);g(),o.ok((0,e._)`${d} === ${r.default.errors}`);function g(){
|
|
967
|
+
a.forIn("key",u,_=>{!y.length&&!f.length?D(_):a.if(p(_),()=>D(_))})}function p(_){let b;if(y.length>8){const I=(0,n.schemaRefOrVal)(h,l.properties,"properties");b=(0,t.isOwnProperty)(a,I,_)}else y.length?b=(0,e.or)(...y.map(I=>(0,e._)`${_} === ${I}`)):b=e.nil;return f.length&&(b=(0,e.or)(b,...f.map(I=>(0,e._)`${(0,t.usePattern)(o,I)}.test(${_})`))),(0,e.not)(b)}function m(_){a.code((0,e._)`delete ${u}[${_}]`)}function D(_){if($.removeAdditional==="all"||$.removeAdditional&&c===!1){m(_);return}if(c===
|
|
968
|
+
!1){o.setParams({additionalProperty:_}),o.error(),E||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(h,c)){const b=a.name("valid");$.removeAdditional==="failing"?(v(_,b,!1),a.if((0,e.not)(b),()=>{o.reset(),m(_)})):(v(_,b),E||a.if((0,e.not)(b),()=>a.break()))}}function v(_,b,I){const U={keyword:"additionalProperties",dataProp:_,dataPropType:n.Type.Str};I===!1&&Object.assign(U,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(U,b)}}};return hi.default=s,hi}var pi={},af;
|
|
969
|
+
function dE(){if(af)return pi;af=1,Object.defineProperty(pi,"__esModule",{value:!0});const t=Zr(),e=ft(),r=_e(),n=of(),i={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:o,schema:a,parentSchema:c,data:l,it:u}=s;u.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(u,n.default,"additionalProperties"));const d=(0,e.allSchemaProperties)(a);for(const f of d)u.definedProperties.add(f);u.opts.unevaluated&&d.length&&u.props!==!0&&(u.props=
|
|
970
|
+
r.mergeEvaluated.props(o,(0,r.toHash)(d),u.props));const h=d.filter(f=>!(0,r.alwaysValidSchema)(u,a[f]));if(h.length===0)return;const E=o.name("valid");for(const f of h)$(f)?y(f):(o.if((0,e.propertyInData)(o,l,f,u.opts.ownProperties)),y(f),u.allErrors||o.else().var(E,!0),o.endIf()),s.it.definedProperties.add(f),s.ok(E);function $(f){return u.opts.useDefaults&&!u.compositeRule&&a[f].default!==void 0}function y(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},E)}}};return pi.default=i,
|
|
971
|
+
pi}var mi={},uf;function hE(){if(uf)return mi;uf=1,Object.defineProperty(mi,"__esModule",{value:!0});const t=ft(),e=pe(),r=_e(),n=_e(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:o,schema:a,data:c,parentSchema:l,it:u}=s,{opts:d}=u,h=(0,t.allSchemaProperties)(a),E=h.filter(D=>(0,r.alwaysValidSchema)(u,a[D]));if(h.length===0||E.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const $=d.strictSchema&&!d.allowMatchingProperties&&l.properties,y=o.name(
|
|
972
|
+
"valid");u.props!==!0&&!(u.props instanceof e.Name)&&(u.props=(0,n.evaluatedPropsToName)(o,u.props));const{props:f}=u;g();function g(){for(const D of h)$&&p(D),u.allErrors?m(D):(o.var(y,!0),m(D),o.if(y))}function p(D){for(const v in $)new RegExp(D).test(v)&&(0,r.checkStrictMode)(u,`property ${v} matches pattern ${D} (use allowMatchingProperties)`)}function m(D){o.forIn("key",c,v=>{o.if((0,e._)`${(0,t.usePattern)(s,D)}.test(${v})`,()=>{const _=E.includes(D);_||s.subschema({keyword:"patternPropert\
|
|
973
|
+
ies",schemaProp:D,dataProp:v,dataPropType:n.Type.Str},y),u.opts.unevaluated&&f!==!0?o.assign((0,e._)`${f}[${v}]`,!0):!_&&!u.allErrors&&o.if((0,e.not)(y),()=>o.break())})})}}};return mi.default=i,mi}var gi={},cf;function pE(){if(cf)return gi;cf=1,Object.defineProperty(gi,"__esModule",{value:!0});const t=_e(),e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:s}=r;if((0,t.alwaysValidSchema)(s,i)){r.fail();return}const o=n.name("valid");r.subschema({keyword:"\
|
|
974
|
+
not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return gi.default=e,gi}var yi={},lf;function mE(){if(lf)return yi;lf=1,Object.defineProperty(yi,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ft().validateUnion,error:{message:"must match a schema in anyOf"}};return yi.default=e,yi}var Ei={},ff;function gE(){if(ff)return Ei;ff=1,Object.defineProperty(Ei,"__esModule",{value:!0});
|
|
975
975
|
const t=pe(),e=_e(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,t._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:s,schema:o,parentSchema:a,it:c}=i;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const l=o,u=s.let("valid",!1),d=s.let("passing",null),h=s.name("_valid");i.setParams({passing:d}),s.block(E),i.result(u,()=>i.reset(),()=>i.error(
|
|
976
|
-
!0));function E(){l.forEach((y
|
|
977
|
-
schema:i,it:s}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=n.name("valid");i.forEach((a,c)=>{if((0,t.alwaysValidSchema)(s,a))return;const l=r.subschema({keyword:"allOf",schemaProp:c},o);r.ok(o),r.mergeEvaluated(l)})}};return Di.default=e,Di}var vi={},
|
|
978
|
-
ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:o,parentSchema:a,it:c}=s;a.then===void 0&&a.else===void 0&&(0,e.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=i(c,"then"),u=i(c,"else");if(!l&&!u)return;const d=o.let("valid",!0),h=o.name("_valid");if(E(),s.reset(),l&&u){const
|
|
979
|
-
error(!0));function E(){const
|
|
980
|
-
e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,t.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return $i.default=e,$i}var
|
|
981
|
-
a.default,s.default,c.default,l.default];return g?p.push(e.default,n.default):p.push(t.default,r.default),p.push(i.default),p}return ui.default=f,ui}var _i={},_r={},
|
|
982
|
-
getProperty)(c)}`,h=u.errSchemaPath==="#"?u.validateName:o(a);l.if((0,t._)`!${d}`,()=>l.assign(d,h))}_r.dynamicAnchor=s;function o(a){const{schemaEnv:c,schema:l,self:u}=a.it,{root:d,baseId:h,localRefs:E,meta
|
|
983
|
-
void 0;const t=pe(),e=ct(),r=Ro(),n={keyword:"$dynamicRef",schemaType:"string",code:s=>i(s,s.schema)};function i(s,o){const{gen:a,keyword:c,it:l}=s;if(o[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const u=o.slice(1);if(l.allErrors)d();else{const E=a.let("valid",!1);d(E),s.ok(E)}function d(E){if(l.schemaEnv.root.dynamicAnchors[u]){const
|
|
984
|
-
function h(E
|
|
985
|
-
bi,"__esModule",{value:!0});const t=
|
|
986
|
-
ct",schemaType:"object",error:t.error,code:r=>(0,t.validatePropertyDeps)(r)};return Ci.default=e,Ci}var Si={},
|
|
987
|
-
schemaType:"number",code({keyword:r,parentSchema:n,it:i}){n.contains===void 0&&(0,t.checkStrictMode)(i,`"${r}" without "contains" is ignored`)}};return Ri.default=e,Ri}var
|
|
988
|
-
operties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){const{gen:o,schema:a,data:c,errsCount:l,it:u}=s;if(!l)throw new Error("ajv implementation error");const{allErrors:d,props:h}=u;h instanceof t.Name?o.if((0,t._)`${h} !== true`,()=>o.forIn("key",c,f=>o.if(
|
|
989
|
-
u.props=!0,s.ok((0,t._)`${l} === ${r.default.errors}`);function E(f){if(a===!1){s.setParams({unevaluatedProperty:f}),s.error(),d||o.break();return}if(!(0,e.alwaysValidSchema)(u,a)){const g=o.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:e.Type.Str},g),d||o.if((0,t.not)(g),()=>o.break())}}function
|
|
990
|
-
i,Ii}var Fi={},
|
|
991
|
-
"object"&&!(0,e.alwaysValidSchema)(c,o)){const h=s.var("valid",(0,t._)`${u} <= ${l}`);s.if((0,t.not)(h),()=>d(h,l)),i.ok(h)}c.items=!0;function d(h,E){s.forRange("i",E,u
|
|
992
|
-
|
|
993
|
-
code:d.code.formats}),p=s.const("fDef",(0,t._)`${g}[${l}]`),m=s.let("fType"),
|
|
994
|
-
_)`(typeof ${
|
|
995
|
-
c)}`:void 0,G=s.scopeValue("formats",{key:c,ref:I,code:
|
|
996
|
-
Pi,"__esModule",{value:!0});const e=[IE().default];return Pi.default=e,Pi}var fr={},
|
|
997
|
-
e=
|
|
998
|
-
e=PE(),r=Vn(),n=
|
|
999
|
-
propertyName;if(typeof
|
|
1000
|
-
c.assign(
|
|
1001
|
-
default(h.opts.uriResolver,h.baseId,j)}const N=(
|
|
1002
|
-
"properties/${
|
|
1003
|
-
s://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},
|
|
1004
|
-
|
|
1005
|
-
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}},NE={$schema:
|
|
1006
|
-
$comment:
|
|
976
|
+
!0));function E(){l.forEach(($,y)=>{let f;(0,e.alwaysValidSchema)(c,$)?s.var(h,!0):f=i.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},h),y>0&&s.if((0,t._)`${h} && ${u}`).assign(u,!1).assign(d,(0,t._)`[${d}, ${y}]`).else(),s.if(h,()=>{s.assign(u,!0),s.assign(d,y),f&&i.mergeEvaluated(f,t.Name)})})}}};return Ei.default=n,Ei}var Di={},df;function yE(){if(df)return Di;df=1,Object.defineProperty(Di,"__esModule",{value:!0});const t=_e(),e={keyword:"allOf",schemaType:"array",code(r){const{gen:n,
|
|
977
|
+
schema:i,it:s}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=n.name("valid");i.forEach((a,c)=>{if((0,t.alwaysValidSchema)(s,a))return;const l=r.subschema({keyword:"allOf",schemaProp:c},o);r.ok(o),r.mergeEvaluated(l)})}};return Di.default=e,Di}var vi={},hf;function EE(){if(hf)return vi;hf=1,Object.defineProperty(vi,"__esModule",{value:!0});const t=pe(),e=_e(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.
|
|
978
|
+
ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:o,parentSchema:a,it:c}=s;a.then===void 0&&a.else===void 0&&(0,e.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=i(c,"then"),u=i(c,"else");if(!l&&!u)return;const d=o.let("valid",!0),h=o.name("_valid");if(E(),s.reset(),l&&u){const y=o.let("ifClause");s.setParams({ifClause:y}),o.if(h,$("then",y),$("else",y))}else l?o.if(h,$("then")):o.if((0,t.not)(h),$("else"));s.pass(d,()=>s.
|
|
979
|
+
error(!0));function E(){const y=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);s.mergeEvaluated(y)}function $(y,f){return()=>{const g=s.subschema({keyword:y},h);o.assign(d,h),s.mergeValidEvaluated(g,d),f?o.assign(f,(0,t._)`${y}`):s.setParams({ifClause:y})}}}};function i(s,o){const a=s.schema[o];return a!==void 0&&!(0,e.alwaysValidSchema)(s,a)}return vi.default=n,vi}var $i={},pf;function DE(){if(pf)return $i;pf=1,Object.defineProperty($i,"__esModule",{value:!0});const t=_e(),
|
|
980
|
+
e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,t.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return $i.default=e,$i}var mf;function gf(){if(mf)return ui;mf=1,Object.defineProperty(ui,"__esModule",{value:!0});const t=Jl(),e=uE(),r=Ql(),n=cE(),i=lE(),s=Fo(),o=fE(),a=of(),c=dE(),l=hE(),u=pE(),d=mE(),h=gE(),E=yE(),$=EE(),y=DE();function f(g=!1){const p=[u.default,d.default,h.default,E.default,$.default,y.default,o.default,
|
|
981
|
+
a.default,s.default,c.default,l.default];return g?p.push(e.default,n.default):p.push(t.default,r.default),p.push(i.default),p}return ui.default=f,ui}var _i={},_r={},yf;function Ef(){if(yf)return _r;yf=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.dynamicAnchor=void 0;const t=pe(),e=ct(),r=Vn(),n=Ro(),i={keyword:"$dynamicAnchor",schemaType:"string",code:a=>s(a,a.schema)};function s(a,c){const{gen:l,it:u}=a;u.schemaEnv.root.dynamicAnchors[c]=!0;const d=(0,t._)`${e.default.dynamicAnchors}${(0,t.
|
|
982
|
+
getProperty)(c)}`,h=u.errSchemaPath==="#"?u.validateName:o(a);l.if((0,t._)`!${d}`,()=>l.assign(d,h))}_r.dynamicAnchor=s;function o(a){const{schemaEnv:c,schema:l,self:u}=a.it,{root:d,baseId:h,localRefs:E,meta:$}=c.root,{schemaId:y}=u.opts,f=new r.SchemaEnv({schema:l,schemaId:y,root:d,baseId:h,localRefs:E,meta:$});return r.compileSchema.call(u,f),(0,n.getValidate)(a,f)}return _r.default=i,_r}var wr={},Df;function vf(){if(Df)return wr;Df=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.dynamicRef=
|
|
983
|
+
void 0;const t=pe(),e=ct(),r=Ro(),n={keyword:"$dynamicRef",schemaType:"string",code:s=>i(s,s.schema)};function i(s,o){const{gen:a,keyword:c,it:l}=s;if(o[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const u=o.slice(1);if(l.allErrors)d();else{const E=a.let("valid",!1);d(E),s.ok(E)}function d(E){if(l.schemaEnv.root.dynamicAnchors[u]){const $=a.let("_v",(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(u)}`);a.if($,h($,E),h(l.validateName,E))}else h(l.validateName,E)()}
|
|
984
|
+
function h(E,$){return $?()=>a.block(()=>{(0,r.callRef)(s,E),a.let($,!0)}):()=>(0,r.callRef)(s,E)}}return wr.dynamicRef=i,wr.default=n,wr}var wi={},$f;function vE(){if($f)return wi;$f=1,Object.defineProperty(wi,"__esModule",{value:!0});const t=Ef(),e=_e(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,e.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return wi.default=r,wi}var bi={},_f;function $E(){if(_f)return bi;_f=1,Object.defineProperty(
|
|
985
|
+
bi,"__esModule",{value:!0});const t=vf(),e={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,t.dynamicRef)(r,r.schema)};return bi.default=e,bi}var wf;function _E(){if(wf)return _i;wf=1,Object.defineProperty(_i,"__esModule",{value:!0});const t=Ef(),e=vf(),r=vE(),n=$E(),i=[t.default,e.default,r.default,n.default];return _i.default=i,_i}var Ai={},Ci={},bf;function wE(){if(bf)return Ci;bf=1,Object.defineProperty(Ci,"__esModule",{value:!0});const t=Fo(),e={keyword:"dependentRequired",type:"obje\
|
|
986
|
+
ct",schemaType:"object",error:t.error,code:r=>(0,t.validatePropertyDeps)(r)};return Ci.default=e,Ci}var Si={},Af;function bE(){if(Af)return Si;Af=1,Object.defineProperty(Si,"__esModule",{value:!0});const t=Fo(),e={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,t.validateSchemaDeps)(r)};return Si.default=e,Si}var Ri={},Cf;function AE(){if(Cf)return Ri;Cf=1,Object.defineProperty(Ri,"__esModule",{value:!0});const t=_e(),e={keyword:["maxContains","minContains"],type:"array",
|
|
987
|
+
schemaType:"number",code({keyword:r,parentSchema:n,it:i}){n.contains===void 0&&(0,t.checkStrictMode)(i,`"${r}" without "contains" is ignored`)}};return Ri.default=e,Ri}var Sf;function CE(){if(Sf)return Ai;Sf=1,Object.defineProperty(Ai,"__esModule",{value:!0});const t=wE(),e=bE(),r=AE(),n=[t.default,e.default,r.default];return Ai.default=n,Ai}var Oi={},Ii={},Rf;function SE(){if(Rf)return Ii;Rf=1,Object.defineProperty(Ii,"__esModule",{value:!0});const t=pe(),e=_e(),r=ct(),i={keyword:"unevaluatedPr\
|
|
988
|
+
operties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){const{gen:o,schema:a,data:c,errsCount:l,it:u}=s;if(!l)throw new Error("ajv implementation error");const{allErrors:d,props:h}=u;h instanceof t.Name?o.if((0,t._)`${h} !== true`,()=>o.forIn("key",c,f=>o.if($(h,f),()=>E(f)))):h!==!0&&o.forIn("key",c,f=>h===void 0?E(f):o.if(y(h,f),()=>E(f))),
|
|
989
|
+
u.props=!0,s.ok((0,t._)`${l} === ${r.default.errors}`);function E(f){if(a===!1){s.setParams({unevaluatedProperty:f}),s.error(),d||o.break();return}if(!(0,e.alwaysValidSchema)(u,a)){const g=o.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:e.Type.Str},g),d||o.if((0,t.not)(g),()=>o.break())}}function $(f,g){return(0,t._)`!${f} || !${f}[${g}]`}function y(f,g){const p=[];for(const m in f)f[m]===!0&&p.push((0,t._)`${g} !== ${m}`);return(0,t.and)(...p)}}};return Ii.default=
|
|
990
|
+
i,Ii}var Fi={},Of;function RE(){if(Of)return Fi;Of=1,Object.defineProperty(Fi,"__esModule",{value:!0});const t=pe(),e=_e(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){const{gen:s,schema:o,data:a,it:c}=i,l=c.items||0;if(l===!0)return;const u=s.const("len",(0,t._)`${a}.length`);if(o===!1)i.setParams({len:l}),i.fail((0,t._)`${u} > ${l}`);else if(typeof o==
|
|
991
|
+
"object"&&!(0,e.alwaysValidSchema)(c,o)){const h=s.var("valid",(0,t._)`${u} <= ${l}`);s.if((0,t.not)(h),()=>d(h,l)),i.ok(h)}c.items=!0;function d(h,E){s.forRange("i",E,u,$=>{i.subschema({keyword:"unevaluatedItems",dataProp:$,dataPropType:e.Type.Num},h),c.allErrors||s.if((0,t.not)(h),()=>s.break())})}}};return Fi.default=n,Fi}var If;function OE(){if(If)return Oi;If=1,Object.defineProperty(Oi,"__esModule",{value:!0});const t=SE(),e=RE(),r=[t.default,e.default];return Oi.default=r,Oi}var Pi={},Ni={},
|
|
992
|
+
Ff;function IE(){if(Ff)return Ni;Ff=1,Object.defineProperty(Ni,"__esModule",{value:!0});const t=pe(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,t.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,t._)`{format: ${n}}`},code(n,i){const{gen:s,data:o,$data:a,schema:c,schemaCode:l,it:u}=n,{opts:d,errSchemaPath:h,schemaEnv:E,self:$}=u;if(!d.validateFormats)return;a?y():f();function y(){const g=s.scopeValue("formats",{ref:$.formats,
|
|
993
|
+
code:d.code.formats}),p=s.const("fDef",(0,t._)`${g}[${l}]`),m=s.let("fType"),D=s.let("format");s.if((0,t._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>s.assign(m,(0,t._)`${p}.type || "string"`).assign(D,(0,t._)`${p}.validate`),()=>s.assign(m,(0,t._)`"string"`).assign(D,p)),n.fail$data((0,t.or)(v(),_()));function v(){return d.strictSchema===!1?t.nil:(0,t._)`${l} && !${D}`}function _(){const b=E.$async?(0,t._)`(${p}.async ? await ${D}(${o}) : ${D}(${o}))`:(0,t._)`${D}(${o})`,I=(0,t.
|
|
994
|
+
_)`(typeof ${D} == "function" ? ${b} : ${D}.test(${o}))`;return(0,t._)`${D} && ${D} !== true && ${m} === ${i} && !${I}`}}function f(){const g=$.formats[c];if(!g){v();return}if(g===!0)return;const[p,m,D]=_(g);p===i&&n.pass(b());function v(){if(d.strictSchema===!1){$.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${c}" ignored in schema at path "${h}"`}}function _(I){const U=I instanceof RegExp?(0,t.regexpCode)(I):d.code.formats?(0,t._)`${d.code.formats}${(0,t.getProperty)(
|
|
995
|
+
c)}`:void 0,G=s.scopeValue("formats",{key:c,ref:I,code:U});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,t._)`${G}.validate`]:["string",I,G]}function b(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!E.$async)throw new Error("async format in sync schema");return(0,t._)`await ${D}(${o})`}return typeof m=="function"?(0,t._)`${D}(${o})`:(0,t._)`${D}.test(${o})`}}}};return Ni.default=r,Ni}var Pf;function Nf(){if(Pf)return Pi;Pf=1,Object.defineProperty(
|
|
996
|
+
Pi,"__esModule",{value:!0});const e=[IE().default];return Pi.default=e,Pi}var fr={},Tf;function Lf(){return Tf||(Tf=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.contentVocabulary=fr.metadataVocabulary=void 0,fr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],fr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),fr}var jf;function FE(){if(jf)return Gn;jf=1,Object.defineProperty(Gn,"__esModule",{value:!0});const t=Tl(),
|
|
997
|
+
e=Kl(),r=gf(),n=_E(),i=CE(),s=OE(),o=Nf(),a=Lf(),c=[n.default,t.default,e.default,(0,r.default)(!0),o.default,a.metadataVocabulary,a.contentVocabulary,i.default,s.default];return Gn.default=c,Gn}var Ti={},rn={},kf;function PE(){if(kf)return rn;kf=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.DiscrError=void 0;var t;return function(e){e.Tag="tag",e.Mapping="mapping"}(t||(rn.DiscrError=t={})),rn}var Bf;function xf(){if(Bf)return Ti;Bf=1,Object.defineProperty(Ti,"__esModule",{value:!0});const t=pe(),
|
|
998
|
+
e=PE(),r=Vn(),n=en(),i=_e(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===e.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:l}})=>(0,t._)`{error: ${a}, tag: ${l}, tagValue: ${c}}`},code(a){const{gen:c,data:l,schema:u,parentSchema:d,it:h}=a,{oneOf:E}=d;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const $=u.
|
|
999
|
+
propertyName;if(typeof $!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!E)throw new Error("discriminator: requires oneOf keyword");const y=c.let("valid",!1),f=c.const("tag",(0,t._)`${l}${(0,t.getProperty)($)}`);c.if((0,t._)`typeof ${f} == "string"`,()=>g(),()=>a.error(!1,{discrError:e.DiscrError.Tag,tag:f,tagName:$})),a.ok(y);function g(){const D=m();c.if(!1);for(const v in D)c.elseIf((0,t._)`${f} === ${v}`),
|
|
1000
|
+
c.assign(y,p(D[v]));c.else(),a.error(!1,{discrError:e.DiscrError.Mapping,tag:f,tagName:$}),c.endIf()}function p(D){const v=c.name("valid"),_=a.subschema({keyword:"oneOf",schemaProp:D},v);return a.mergeEvaluated(_,t.Name),v}function m(){var D;const v={},_=I(d);let b=!0;for(let L=0;L<E.length;L++){let B=E[L];if(B?.$ref&&!(0,i.schemaHasRulesButRef)(B,h.self.RULES)){const j=B.$ref;if(B=r.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,j),B instanceof r.SchemaEnv&&(B=B.schema),B===void 0)throw new n.
|
|
1001
|
+
default(h.opts.uriResolver,h.baseId,j)}const N=(D=B?.properties)===null||D===void 0?void 0:D[$];if(typeof N!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${$}"`);b=b&&(_||I(B)),U(N,L)}if(!b)throw new Error(`discriminator: "${$}" must be required`);return v;function I({required:L}){return Array.isArray(L)&&L.includes($)}function U(L,B){if(L.const)G(L.const,B);else if(L.enum)for(const N of L.enum)G(N,B);else throw new Error(`discriminator:\
|
|
1002
|
+
"properties/${$}" must have "const" or "enum"`)}function G(L,B){if(typeof L!="string"||L in v)throw new Error(`discriminator: "${$}" values must be unique strings`);v[L]=B}}}};return Ti.default=o,Ti}var Li={};const Mf="https://json-schema.org/draft/2020-12/schema",qf="https://json-schema.org/draft/2020-12/schema",Uf={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"http\
|
|
1003
|
+
s://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},Hf="meta",Vf="Core and Validation specifications meta-schema",zf=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],Gf=["object","boolean"],
|
|
1004
|
+
Wf="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",Kf={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{
|
|
1005
|
+
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}},NE={$schema:Mf,$id:qf,$vocabulary:Uf,$dynamicAnchor:Hf,title:Vf,allOf:zf,type:Gf,$comment:Wf,properties:Kf},TE={__proto__:null,
|
|
1006
|
+
$comment:Wf,$dynamicAnchor:Hf,$id:qf,$schema:Mf,$vocabulary:Uf,allOf:zf,default:NE,properties:Kf,title:Vf,type:Gf},LE=yt(TE),Yf="https://json-schema.org/draft/2020-12/schema",Jf="https://json-schema.org/draft/2020-12/meta/applicator",Xf={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Qf="meta",Zf="Applicator vocabulary meta-schema",ed=["object","boolean"],td={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"\
|
|
1007
1007
|
#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs\
|
|
1008
|
-
/schemaArray"},not:{$dynamicRef:"#meta"}},
|
|
1009
|
-
unevaluated":!0},
|
|
1010
|
-
tent",
|
|
1011
|
-
ma",
|
|
1012
|
-
type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},
|
|
1013
|
-
$schema:
|
|
1014
|
-
$id:
|
|
1015
|
-
examples:{type:"array",items:!0}},XE={$schema:
|
|
1008
|
+
/schemaArray"},not:{$dynamicRef:"#meta"}},rd={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},jE={$schema:Yf,$id:Jf,$vocabulary:Xf,$dynamicAnchor:Qf,title:Zf,type:ed,properties:td,$defs:rd},kE={__proto__:null,$defs:rd,$dynamicAnchor:Qf,$id:Jf,$schema:Yf,$vocabulary:Xf,default:jE,properties:td,title:Zf,type:ed},BE=yt(kE),nd="https://json-schema.org/draft/2020-12/schema",id="https://json-schema.org/draft/2020-12/meta/unevaluated",sd={"https://json-schema.org/draft/2020-12/vocab/\
|
|
1009
|
+
unevaluated":!0},od="meta",ad="Unevaluated applicator vocabulary meta-schema",ud=["object","boolean"],cd={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},xE={$schema:nd,$id:id,$vocabulary:sd,$dynamicAnchor:od,title:ad,type:ud,properties:cd},ME={__proto__:null,$dynamicAnchor:od,$id:id,$schema:nd,$vocabulary:sd,default:xE,properties:cd,title:ad,type:ud},qE=yt(ME),ld="https://json-schema.org/draft/2020-12/schema",fd="https://json-schema.org/draft/2020-12/meta/con\
|
|
1010
|
+
tent",dd={"https://json-schema.org/draft/2020-12/vocab/content":!0},hd="meta",pd="Content vocabulary meta-schema",md=["object","boolean"],gd={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},UE={$schema:ld,$id:fd,$vocabulary:dd,$dynamicAnchor:hd,title:pd,type:md,properties:gd},HE={__proto__:null,$dynamicAnchor:hd,$id:fd,$schema:ld,$vocabulary:dd,default:UE,properties:gd,title:pd,type:md},VE=yt(HE),yd="https://json-schema.org/draft/2020-12/sche\
|
|
1011
|
+
ma",Ed="https://json-schema.org/draft/2020-12/meta/core",Dd={"https://json-schema.org/draft/2020-12/vocab/core":!0},vd="meta",$d="Core vocabulary meta-schema",_d=["object","boolean"],wd={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{
|
|
1012
|
+
type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},bd={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},zE={$schema:yd,$id:Ed,$vocabulary:Dd,$dynamicAnchor:vd,title:$d,type:_d,properties:wd,$defs:bd},GE={__proto__:null,$defs:bd,$dynamicAnchor:vd,$id:Ed,
|
|
1013
|
+
$schema:yd,$vocabulary:Dd,default:zE,properties:wd,title:$d,type:_d},WE=yt(GE),Ad="https://json-schema.org/draft/2020-12/schema",Cd="https://json-schema.org/draft/2020-12/meta/format-annotation",Sd={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Rd="meta",Od="Format vocabulary meta-schema for annotation results",Id=["object","boolean"],Fd={format:{type:"string"}},KE={$schema:Ad,$id:Cd,$vocabulary:Sd,$dynamicAnchor:Rd,title:Od,type:Id,properties:Fd},YE={__proto__:null,$dynamicAnchor:Rd,
|
|
1014
|
+
$id:Cd,$schema:Ad,$vocabulary:Sd,default:KE,properties:Fd,title:Od,type:Id},JE=yt(YE),Pd="https://json-schema.org/draft/2020-12/schema",Nd="https://json-schema.org/draft/2020-12/meta/meta-data",Td={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},Ld="meta",jd="Meta-data vocabulary meta-schema",kd=["object","boolean"],Bd={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},
|
|
1015
|
+
examples:{type:"array",items:!0}},XE={$schema:Pd,$id:Nd,$vocabulary:Td,$dynamicAnchor:Ld,title:jd,type:kd,properties:Bd},QE={__proto__:null,$dynamicAnchor:Ld,$id:Nd,$schema:Pd,$vocabulary:Td,default:XE,properties:Bd,title:jd,type:kd},ZE=yt(QE),xd="https://json-schema.org/draft/2020-12/schema",Md="https://json-schema.org/draft/2020-12/meta/validation",qd={"https://json-schema.org/draft/2020-12/vocab/validation":!0},Ud="meta",Hd="Validation vocabulary meta-schema",Vd=["object","boolean"],zd={type:{
|
|
1016
1016
|
anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{
|
|
1017
|
-
$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"}}},
|
|
1018
|
-
#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},eD={$schema:
|
|
1019
|
-
dule",{value:!0});const t=LE,e=BE,r=qE,n=VE,i=WE,s=JE,o=ZE,a=rD,c=["/properties"];function l(u){return[t,e,r,n,i,d(this,s),o,d(this,a)].forEach(h=>this.addMetaSchema(h,void 0,!1)),this;function d(h,E){return u?h.$dataMetaSchema(E,c):E}}return Li.default=l,Li}var
|
|
1020
|
-
o="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(E={}){super({...E,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(E=>this.addVocabulary(E)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:E,meta
|
|
1021
|
-
(this.getSchema(o)?o:void 0)}}e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=
|
|
1022
|
-
e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=Un();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=
|
|
1023
|
-
return
|
|
1017
|
+
$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"}}},Gd={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"\
|
|
1018
|
+
#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},eD={$schema:xd,$id:Md,$vocabulary:qd,$dynamicAnchor:Ud,title:Hd,type:Vd,properties:zd,$defs:Gd},tD={__proto__:null,$defs:Gd,$dynamicAnchor:Ud,$id:Md,$schema:xd,$vocabulary:qd,default:eD,properties:zd,title:Hd,type:Vd},rD=yt(tD);var Wd;function nD(){if(Wd)return Li;Wd=1,Object.defineProperty(Li,"__esMo\
|
|
1019
|
+
dule",{value:!0});const t=LE,e=BE,r=qE,n=VE,i=WE,s=JE,o=ZE,a=rD,c=["/properties"];function l(u){return[t,e,r,n,i,d(this,s),o,d(this,a)].forEach(h=>this.addMetaSchema(h,void 0,!1)),this;function d(h,E){return u?h.$dataMetaSchema(E,c):E}}return Li.default=l,Li}var Kd;function iD(){return Kd||(Kd=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;const r=Il(),n=FE(),i=xf(),s=nD(),
|
|
1020
|
+
o="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(E={}){super({...E,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(E=>this.addVocabulary(E)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:E,meta:$}=this.opts;$&&(s.default.call(this,E),this.refs["http://json-schema.org/schema"]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
1021
|
+
(this.getSchema(o)?o:void 0)}}e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=Zr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=pe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(
|
|
1022
|
+
e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=Un();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=en();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}(Ln,Ln.exports)),Ln.exports}var sD=iD(),ji={exports:{}},Po={},Yd;function oD(){
|
|
1023
|
+
return Yd||(Yd=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(L,B){return{validate:L,compare:B}}t.fullFormats={date:e(s,o),time:e(c(!0),l),"date-time":e(h(!0),E),"iso-time":e(c(),u),"iso-date-time":e(h(),$),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
|
|
1024
1024
|
"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,
|
|
1025
1025
|
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,
|
|
1026
1026
|
regex:G,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:m,int32:{type:"number",validate:_},int64:{type:"number",validate:b},float:{type:"number",validate:I},double:{type:"number",validate:I},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
1027
|
-
o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,E),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i
|
|
1027
|
+
o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,E),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,$),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
1028
1028
|
email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(L){return L%4===0&&(L%100!==0||L%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 s(L){const B=n.exec(L);if(!B)return!1;const N=+B[1],j=+B[2],M=+B[3];return j>=1&&j<=12&&M>=1&&M<=(j===2&&r(N)?29:i[j])}function o(L,B){if(L&&B)return L>B?1:L<B?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
1029
|
-
function c(L){return function(N){const j=a.exec(N);if(!j)return!1;const M=+j[1],Y=+j[2],z=+j[3],X=j[4],se=j[5]==="-"?-1:1,q=+(j[6]||0),C=+(j[7]||0);if(q>23||C>59||L&&!X)return!1;if(M<=23&&Y<=59&&z<60)return!0;const
|
|
1030
|
-
N[1]+N[2]+N[3],B=j[1]+j[2]+j[3],L>B?1:L<B?-1:0}const d=/t|\s/i;function h(L){const B=c(L);return function(j){const M=j.split(d);return M.length===2&&s(M[0])&&B(M[1])}}function E(L,B){if(!(L&&B))return;const N=new Date(L).valueOf(),j=new Date(B).valueOf();if(N&&j)return N-j}function
|
|
1031
|
-
function g(L){return
|
|
1032
|
-
Bi,"__esModule",{value:!0});const t=
|
|
1033
|
-
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},
|
|
1029
|
+
function c(L){return function(N){const j=a.exec(N);if(!j)return!1;const M=+j[1],Y=+j[2],z=+j[3],X=j[4],se=j[5]==="-"?-1:1,q=+(j[6]||0),C=+(j[7]||0);if(q>23||C>59||L&&!X)return!1;if(M<=23&&Y<=59&&z<60)return!0;const H=Y-C*se,k=M-q*se-(H<0?1:0);return(k===23||k===-1)&&(H===59||H===-1)&&z<61}}function l(L,B){if(!(L&&B))return;const N=new Date("2020-01-01T"+L).valueOf(),j=new Date("2020-01-01T"+B).valueOf();if(N&&j)return N-j}function u(L,B){if(!(L&&B))return;const N=a.exec(L),j=a.exec(B);if(N&&j)return L=
|
|
1030
|
+
N[1]+N[2]+N[3],B=j[1]+j[2]+j[3],L>B?1:L<B?-1:0}const d=/t|\s/i;function h(L){const B=c(L);return function(j){const M=j.split(d);return M.length===2&&s(M[0])&&B(M[1])}}function E(L,B){if(!(L&&B))return;const N=new Date(L).valueOf(),j=new Date(B).valueOf();if(N&&j)return N-j}function $(L,B){if(!(L&&B))return;const[N,j]=L.split(d),[M,Y]=B.split(d),z=o(N,M);if(z!==void 0)return z||l(j,Y)}const y=/\/|:/,f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
1031
|
+
function g(L){return y.test(L)&&f.test(L)}const p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(L){return p.lastIndex=0,p.test(L)}const D=-2147483648,v=2**31-1;function _(L){return Number.isInteger(L)&&L<=v&&L>=D}function b(L){return Number.isInteger(L)}function I(){return!0}const U=/[^\\]\\Z/;function G(L){if(U.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}}(Po)),Po}var No={},ki={exports:{}},Bi={},Jd;function aD(){if(Jd)return Bi;Jd=1,Object.defineProperty(
|
|
1032
|
+
Bi,"__esModule",{value:!0});const t=Tl(),e=Kl(),r=gf(),n=Nf(),i=Lf(),s=[t.default,e.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return Bi.default=s,Bi}const Xd="http://json-schema.org/draft-07/schema#",Qd="http://json-schema.org/draft-07/schema#",Zd="Core schema meta-schema",eh={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},
|
|
1033
|
+
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},th=["object","boolean"],rh={$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},
|
|
1034
1034
|
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\
|
|
1035
1035
|
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:"\
|
|
1036
1036
|
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\
|
|
1037
|
-
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},uD={$schema:
|
|
1038
|
-
s=lD,o=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(
|
|
1039
|
-
(this.getSchema(a)?a:void 0)}}e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=
|
|
1040
|
-
"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=Un();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=
|
|
1037
|
+
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},uD={$schema:Xd,$id:Qd,title:Zd,definitions:eh,type:th,properties:rh,default:!0},cD={__proto__:null,$id:Qd,$schema:Xd,default:uD,definitions:eh,properties:rh,title:Zd,type:th},lD=yt(cD);var nh;function fD(){return nh||(nh=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const r=Il(),n=aD(),i=xf(),
|
|
1038
|
+
s=lD,o=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach($=>this.addVocabulary($)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const $=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema($,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
1039
|
+
(this.getSchema(a)?a:void 0)}}e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=Zr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=pe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,
|
|
1040
|
+
"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=Un();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=en();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}(ki,ki.exports)),ki.exports}var ih;function dD(){return ih||(ih=1,function(t){Object.
|
|
1041
1041
|
defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=fD(),r=pe(),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}},s={message:({keyword:a,schemaCode:c})=>(0,r.str)`should be ${i[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0,r._)`{comparison: ${i[a].okStr}, limit: ${c}}`};t.formatLimitDefinition=
|
|
1042
|
-
{keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:c,data:l,schemaCode:u,keyword:d,it:h}=a,{opts:E,self
|
|
1043
|
-
p(
|
|
1044
|
-
a);t.default=o}(No)),No}var
|
|
1045
|
-
throw new Error(`Unknown format "${l}"`);return h};function c(l,u,d,h){var E
|
|
1042
|
+
{keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:c,data:l,schemaCode:u,keyword:d,it:h}=a,{opts:E,self:$}=h;if(!E.validateFormats)return;const y=new e.KeywordCxt(h,$.RULES.all.format.definition,"format");y.$data?f():g();function f(){const m=c.scopeValue("formats",{ref:$.formats,code:E.code.formats}),D=c.const("fmt",(0,r._)`${m}[${y.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${D} != "object"`,(0,r._)`${D} instanceof RegExp`,(0,r._)`typeof ${D}.compare != "function"`,
|
|
1043
|
+
p(D)))}function g(){const m=y.schema,D=$.formats[m];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw new Error(`"${d}": format "${m}" does not define "compare" function`);const v=c.scopeValue("formats",{key:m,ref:D,code:E.code.formats?(0,r._)`${E.code.formats}${(0,r.getProperty)(m)}`:void 0});a.fail$data(p(v))}function p(m){return(0,r._)`${m}.compare(${l}, ${u}) ${i[d].fail} 0`}},dependencies:["format"]};const o=a=>(a.addKeyword(t.formatLimitDefinition),
|
|
1044
|
+
a);t.default=o}(No)),No}var sh;function hD(){return sh||(sh=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=oD(),n=dD(),i=pe(),s=new i.Name("fullFormats"),o=new i.Name("fastFormats"),a=(l,u={keywords:!0})=>{if(Array.isArray(u))return c(l,u,r.fullFormats,s),l;const[d,h]=u.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,s],E=u.formats||r.formatNames;return c(l,E,d,h),u.keywords&&(0,n.default)(l),l};a.get=(l,u="full")=>{const h=(u==="fast"?r.fastFormats:r.fullFormats)[l];if(!h)
|
|
1045
|
+
throw new Error(`Unknown format "${l}"`);return h};function c(l,u,d,h){var E,$;(E=($=l.opts.code).formats)!==null&&E!==void 0||($.formats=(0,i._)`require("ajv-formats/dist/formats").${h}`);for(const y of u)l.addFormat(y,d[y])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}(ji,ji.exports)),ji.exports}var pD=hD();const mD=Ji(pD),gD=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const i=Object.getOwnPropertyDescriptor(t,r),s=Object.getOwnPropertyDescriptor(
|
|
1046
1046
|
e,r);!yD(i,s)&&n||Object.defineProperty(t,r,s)},yD=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},ED=(t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},DD=(t,e)=>`/* Wrapped ${t}*/
|
|
1047
1047
|
${e}`,vD=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),$D=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),_D=(t,e,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=DD.bind(null,n,e.toString());Object.defineProperty(i,"name",$D);const{writable:s,enumerable:o,configurable:a}=vD;Object.defineProperty(t,"toString",{value:i,writable:s,enumerable:o,configurable:a})};function wD(t,e,{ignoreNonConfigurable:r=!1}={}){const{name:n}=t;for(const i of Reflect.ownKeys(e))gD(t,
|
|
1048
|
-
e,i,r);return ED(t,e),_D(t,e,n),t}const
|
|
1049
|
-
void 0),s&&(c=t.apply(d,u))},E=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(c=t.apply(d,u))}
|
|
1050
|
-
MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},To}var Lo,
|
|
1051
|
-
MAX_LENGTH:i}=Mi(),s=qi();e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={};let d=0;const h="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",i],[h,n]]
|
|
1052
|
-
`\\d*[a-zA-Z-]${h}*`),
|
|
1053
|
-
PRERELEASEIDENTIFIER]})*))`),
|
|
1054
|
-
GEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),
|
|
1055
|
-
$`),
|
|
1056
|
-
$`),
|
|
1057
|
-
"$1$2$3",
|
|
1058
|
-
|
|
1048
|
+
e,i,r);return ED(t,e),_D(t,e,n),t}const oh=(t,e={})=>{if(typeof t!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:s=!0}=e;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,c;const l=function(...u){const d=this,h=()=>{o=void 0,a&&(clearTimeout(a),a=
|
|
1049
|
+
void 0),s&&(c=t.apply(d,u))},E=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(c=t.apply(d,u))},$=i&&!o;return clearTimeout(o),o=setTimeout(h,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout(E,n)),$&&(c=t.apply(d,u)),c};return wD(l,t),l.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},l};var xi={exports:{}},To,ah;function Mi(){if(ah)return To;ah=1;const t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=e-6;return To={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:n,
|
|
1050
|
+
MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},To}var Lo,uh;function qi(){return uh||(uh=1,Lo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Lo}var ch;function nn(){return ch||(ch=1,function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,
|
|
1051
|
+
MAX_LENGTH:i}=Mi(),s=qi();e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={};let d=0;const h="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",i],[h,n]],$=f=>{for(const[g,p]of E)f=f.split(`${g}*`).join(`${g}{0,${p}}`).split(`${g}+`).join(`${g}{1,${p}}`);return f},y=(f,g,p)=>{const m=$(g),D=d++;s(f,D,g),u[f]=D,c[D]=g,l[D]=m,o[D]=new RegExp(g,p?"g":void 0),a[D]=new RegExp(m,p?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*"),y("NUMERICIDENTIFIERLOOSE","\\d+"),y("NONNUMERICIDENTIFIER",
|
|
1052
|
+
`\\d*[a-zA-Z-]${h}*`),y("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),y("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),y("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),y("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.
|
|
1053
|
+
PRERELEASEIDENTIFIER]})*))`),y("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),y("BUILDIDENTIFIER",`${h}+`),y("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),y("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),y("FULL",`^${c[u.FULLPLAIN]}$`),y("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),y("LOOSE",`^${c[u.LOOSEPLAIN]}$`),y("GTLT","((?:<|>)?=?)"),y("XRAN\
|
|
1054
|
+
GEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),y("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),y("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),y("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),y("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}\
|
|
1055
|
+
$`),y("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),y("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),y("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),y("COERCERTL",c[u.COERCE],!0),y("COERCERTLFULL",c[u.COERCEFULL],!0),y("LONETILDE","(?:~>?)"),y("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",y("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}\
|
|
1056
|
+
$`),y("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),y("LONECARET","(?:\\^)"),y("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",y("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),y("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),y("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),y("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),y("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=
|
|
1057
|
+
"$1$2$3",y("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(xi,xi.exports)),xi.exports}var jo,lh;function ko(){if(lh)return jo;lh=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return jo=n=>n?typeof n!="object"?t:n:e,jo}var Bo,fh;function dh(){if(fh)return Bo;
|
|
1058
|
+
fh=1;const t=/^[0-9]+$/,e=(n,i)=>{const s=t.test(n),o=t.test(i);return s&&o&&(n=+n,i=+i),n===i?0:s&&!o?-1:o&&!s?1:n<i?-1:1};return Bo={compareIdentifiers:e,rcompareIdentifiers:(n,i)=>e(i,n)},Bo}var xo,hh;function ze(){if(hh)return xo;hh=1;const t=qi(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=Mi(),{safeRe:n,safeSrc:i,t:s}=nn(),o=ko(),{compareIdentifiers:a}=dh();class c{constructor(u,d){if(d=o(d),u instanceof c){if(u.loose===!!d.loose&&u.includePrerelease===!!d.includePrerelease)return u;u=u.version}else if(typeof u!=
|
|
1059
1059
|
"string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",u,d),this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease;const h=u.trim().match(d.loose?n[s.LOOSE]:n[s.FULL]);if(!h)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+h[1],this.minor=+h[2],this.patch=+h[3],this.major>r||this.major<0)throw new TypeError("Invalid major versi\
|
|
1060
|
-
on");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");h[4]?this.prerelease=h[4].split(".").map(E=>{if(/^[0-9]+$/.test(E)){const
|
|
1060
|
+
on");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");h[4]?this.prerelease=h[4].split(".").map(E=>{if(/^[0-9]+$/.test(E)){const $=+E;if($>=0&&$<r)return $}return E}):this.prerelease=[],this.build=h[5]?h[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){
|
|
1061
1061
|
return this.version}compare(u){if(t("SemVer.compare",this.version,this.options,u),!(u instanceof c)){if(typeof u=="string"&&u===this.version)return 0;u=new c(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof c||(u=new c(u,this.options)),a(this.major,u.major)||a(this.minor,u.minor)||a(this.patch,u.patch)}comparePre(u){if(u instanceof c||(u=new c(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.
|
|
1062
1062
|
prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let d=0;do{const h=this.prerelease[d],E=u.prerelease[d];if(t("prerelease compare",d,h,E),h===void 0&&E===void 0)return 0;if(E===void 0)return 1;if(h===void 0)return-1;if(h===E)continue;return a(h,E)}while(++d)}compareBuild(u){u instanceof c||(u=new c(u,this.options));let d=0;do{const h=this.build[d],E=u.build[d];if(t("build compare",d,h,E),h===void 0&&E===void 0)return 0;if(E===void 0)return 1;
|
|
1063
|
-
if(h===void 0)return-1;if(h===E)continue;return a(h,E)}while(++d)}inc(u,d,h){if(u.startsWith("pre")){if(!d&&h===!1)throw new Error("invalid increment argument: identifier is empty");if(d){const E=new RegExp(`^${this.options.loose?i[s.PRERELEASELOOSE]:i[s.PRERELEASE]}$`)
|
|
1063
|
+
if(h===void 0)return-1;if(h===E)continue;return a(h,E)}while(++d)}inc(u,d,h){if(u.startsWith("pre")){if(!d&&h===!1)throw new Error("invalid increment argument: identifier is empty");if(d){const E=new RegExp(`^${this.options.loose?i[s.PRERELEASELOOSE]:i[s.PRERELEASE]}$`),$=`-${d}`.match(E);if(!$||$[1]!==d)throw new Error(`invalid identifier: ${d}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",d,h);break;case"preminor":this.prerelease.length=
|
|
1064
1064
|
0,this.patch=0,this.minor++,this.inc("pre",d,h);break;case"prepatch":this.prerelease.length=0,this.inc("patch",d,h),this.inc("pre",d,h);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",d,h),this.inc("pre",d,h);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];
|
|
1065
|
-
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 E=Number(h)?1:0;if(this.prerelease.length===0)this.prerelease=[E];else{let
|
|
1066
|
-
ady exists");this.prerelease.push(E)}}if(d){let
|
|
1067
|
-
Mo}var qo,
|
|
1068
|
-
if(
|
|
1069
|
-
(r,n)=>new t(r,n).major,zo}var Go,
|
|
1070
|
-
return Jo;
|
|
1071
|
-
ta}var ra,
|
|
1072
|
-
|
|
1073
|
-
<=":return s(a,l,u);default:throw new TypeError(`Invalid operator: ${c}`)}},fa}var da,
|
|
1074
|
-
|
|
1075
|
-
map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return ha=t,ha}var pa,
|
|
1076
|
-
this.includePrerelease=!!Y.includePrerelease,this.raw=M.trim().replace(t," "),this.set=this.raw.split("||").map(z=>this.parseRange(z.trim())).filter(z=>z.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const z=this.set[0];if(this.set=this.set.filter(X=>!
|
|
1077
|
-
void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const Y=this.set[M];for(let z=0;z<Y.length;z++)z>0&&(this.formatted+=" "),this.formatted+=Y[z].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const z=((this.options.includePrerelease&&E)|(this.options.loose
|
|
1078
|
-
o("hyphen replace",M),M=M.replace(c[l.COMPARATORTRIM],u),o("comparator trim",M),M=M.replace(c[l.TILDETRIM],d),o("tilde trim",M),M=M.replace(c[l.CARETTRIM],h),o("caret trim",M);let C=M.split(" ").map(A=>p(A,this.options)).join(" ").split(/\s+/).map(A=>L(A,this.options));se&&(C=C.filter(A=>(o("loose invalid filter",A,this.options),!!A.match(c[l.COMPARATORLOOSE])))),o("range list",C);const
|
|
1079
|
-
"")&&
|
|
1080
|
-
tildeTrimReplace:d,caretTrimReplace:h}=
|
|
1081
|
-
TILDELOOSE]:c[l.TILDE];return j.replace(Y,(z,X,se,q,C)=>{o("tilde",j,z,X,se,q,C);let
|
|
1082
|
-
o("caret",j,X,se,q,C,
|
|
1083
|
-
.${C} <${+se+1}.0.0-0`),o("caret return",k),k})},I=(j,M)=>(o("replaceXRanges",j,M),j.split(/\s+/).map(Y=>
|
|
1084
|
-
(
|
|
1085
|
-
1}.0-0`:R?
|
|
1065
|
+
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 E=Number(h)?1:0;if(this.prerelease.length===0)this.prerelease=[E];else{let $=this.prerelease.length;for(;--$>=0;)typeof this.prerelease[$]=="number"&&(this.prerelease[$]++,$=-2);if($===-1){if(d===this.prerelease.join(".")&&h===!1)throw new Error("invalid increment argument: identifier alre\
|
|
1066
|
+
ady exists");this.prerelease.push(E)}}if(d){let $=[d,E];h===!1&&($=[d]),a(this.prerelease[0],d)===0?isNaN(this.prerelease[1])&&(this.prerelease=$):this.prerelease=$}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return xo=c,xo}var Mo,ph;function br(){if(ph)return Mo;ph=1;const t=ze();return Mo=(r,n,i=!1)=>{if(r instanceof t)return r;try{return new t(r,n)}catch(s){if(!i)return null;throw s}},
|
|
1067
|
+
Mo}var qo,mh;function bD(){if(mh)return qo;mh=1;const t=br();return qo=(r,n)=>{const i=t(r,n);return i?i.version:null},qo}var Uo,gh;function AD(){if(gh)return Uo;gh=1;const t=br();return Uo=(r,n)=>{const i=t(r.trim().replace(/^[=v]+/,""),n);return i?i.version:null},Uo}var Ho,yh;function CD(){if(yh)return Ho;yh=1;const t=ze();return Ho=(r,n,i,s,o)=>{typeof i=="string"&&(o=s,s=i,i=void 0);try{return new t(r instanceof t?r.version:r,i).inc(n,s,o).version}catch{return null}},Ho}var Vo,Eh;function SD(){
|
|
1068
|
+
if(Eh)return Vo;Eh=1;const t=br();return Vo=(r,n)=>{const i=t(r,null,!0),s=t(n,null,!0),o=i.compare(s);if(o===0)return null;const a=o>0,c=a?i:s,l=a?s:i,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}const h=u?"pre":"";return i.major!==s.major?h+"major":i.minor!==s.minor?h+"minor":i.patch!==s.patch?h+"patch":"prerelease"},Vo}var zo,Dh;function RD(){if(Dh)return zo;Dh=1;const t=ze();return zo=
|
|
1069
|
+
(r,n)=>new t(r,n).major,zo}var Go,vh;function OD(){if(vh)return Go;vh=1;const t=ze();return Go=(r,n)=>new t(r,n).minor,Go}var Wo,$h;function ID(){if($h)return Wo;$h=1;const t=ze();return Wo=(r,n)=>new t(r,n).patch,Wo}var Ko,_h;function FD(){if(_h)return Ko;_h=1;const t=br();return Ko=(r,n)=>{const i=t(r,n);return i&&i.prerelease.length?i.prerelease:null},Ko}var Yo,wh;function dt(){if(wh)return Yo;wh=1;const t=ze();return Yo=(r,n,i)=>new t(r,i).compare(new t(n,i)),Yo}var Jo,bh;function PD(){if(bh)
|
|
1070
|
+
return Jo;bh=1;const t=dt();return Jo=(r,n,i)=>t(n,r,i),Jo}var Xo,Ah;function ND(){if(Ah)return Xo;Ah=1;const t=dt();return Xo=(r,n)=>t(r,n,!0),Xo}var Qo,Ch;function Zo(){if(Ch)return Qo;Ch=1;const t=ze();return Qo=(r,n,i)=>{const s=new t(r,i),o=new t(n,i);return s.compare(o)||s.compareBuild(o)},Qo}var ea,Sh;function TD(){if(Sh)return ea;Sh=1;const t=Zo();return ea=(r,n)=>r.sort((i,s)=>t(i,s,n)),ea}var ta,Rh;function LD(){if(Rh)return ta;Rh=1;const t=Zo();return ta=(r,n)=>r.sort((i,s)=>t(s,i,n)),
|
|
1071
|
+
ta}var ra,Oh;function Ui(){if(Oh)return ra;Oh=1;const t=dt();return ra=(r,n,i)=>t(r,n,i)>0,ra}var na,Ih;function ia(){if(Ih)return na;Ih=1;const t=dt();return na=(r,n,i)=>t(r,n,i)<0,na}var sa,Fh;function Ph(){if(Fh)return sa;Fh=1;const t=dt();return sa=(r,n,i)=>t(r,n,i)===0,sa}var oa,Nh;function Th(){if(Nh)return oa;Nh=1;const t=dt();return oa=(r,n,i)=>t(r,n,i)!==0,oa}var aa,Lh;function ua(){if(Lh)return aa;Lh=1;const t=dt();return aa=(r,n,i)=>t(r,n,i)>=0,aa}var ca,jh;function la(){if(jh)return ca;
|
|
1072
|
+
jh=1;const t=dt();return ca=(r,n,i)=>t(r,n,i)<=0,ca}var fa,kh;function Bh(){if(kh)return fa;kh=1;const t=Ph(),e=Th(),r=Ui(),n=ua(),i=ia(),s=la();return fa=(a,c,l,u)=>{switch(c){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return t(a,l,u);case"!=":return e(a,l,u);case">":return r(a,l,u);case">=":return n(a,l,u);case"<":return i(a,l,u);case"\
|
|
1073
|
+
<=":return s(a,l,u);default:throw new TypeError(`Invalid operator: ${c}`)}},fa}var da,xh;function jD(){if(xh)return da;xh=1;const t=ze(),e=br(),{safeRe:r,t:n}=nn();return da=(s,o)=>{if(s instanceof t)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;o=o||{};let a=null;if(!o.rtl)a=s.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const E=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let $;for(;($=E.exec(s))&&(!a||a.index+a[0].length!==s.length);)(!a||
|
|
1074
|
+
$.index+$[0].length!==a.index+a[0].length)&&(a=$),E.lastIndex=$.index+$[1].length+$[2].length;E.lastIndex=-1}if(a===null)return null;const c=a[2],l=a[3]||"0",u=a[4]||"0",d=o.includePrerelease&&a[5]?`-${a[5]}`:"",h=o.includePrerelease&&a[6]?`+${a[6]}`:"";return e(`${c}.${l}.${u}${d}${h}`,o)},da}var ha,Mh;function kD(){if(Mh)return ha;Mh=1;class t{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.
|
|
1075
|
+
map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return ha=t,ha}var pa,qh;function ht(){if(qh)return pa;qh=1;const t=/\s+/g;class e{constructor(M,Y){if(Y=i(Y),M instanceof e)return M.loose===!!Y.loose&&M.includePrerelease===!!Y.includePrerelease?M:new e(M.raw,Y);if(M instanceof s)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=Y,this.loose=!!Y.loose,
|
|
1076
|
+
this.includePrerelease=!!Y.includePrerelease,this.raw=M.trim().replace(t," "),this.set=this.raw.split("||").map(z=>this.parseRange(z.trim())).filter(z=>z.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const z=this.set[0];if(this.set=this.set.filter(X=>!y(X[0])),this.set.length===0)this.set=[z];else if(this.set.length>1){for(const X of this.set)if(X.length===1&&f(X[0])){this.set=[X];break}}}this.formatted=void 0}get range(){if(this.formatted===
|
|
1077
|
+
void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const Y=this.set[M];for(let z=0;z<Y.length;z++)z>0&&(this.formatted+=" "),this.formatted+=Y[z].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const z=((this.options.includePrerelease&&E)|(this.options.loose&&$))+":"+M,X=n.get(z);if(X)return X;const se=this.options.loose,q=se?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];M=M.replace(q,B(this.options.includePrerelease)),
|
|
1078
|
+
o("hyphen replace",M),M=M.replace(c[l.COMPARATORTRIM],u),o("comparator trim",M),M=M.replace(c[l.TILDETRIM],d),o("tilde trim",M),M=M.replace(c[l.CARETTRIM],h),o("caret trim",M);let C=M.split(" ").map(A=>p(A,this.options)).join(" ").split(/\s+/).map(A=>L(A,this.options));se&&(C=C.filter(A=>(o("loose invalid filter",A,this.options),!!A.match(c[l.COMPARATORLOOSE])))),o("range list",C);const H=new Map,k=C.map(A=>new s(A,this.options));for(const A of k){if(y(A))return[A];H.set(A.value,A)}H.size>1&&H.has(
|
|
1079
|
+
"")&&H.delete("");const w=[...H.values()];return n.set(z,w),w}intersects(M,Y){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(z=>g(z,Y)&&M.set.some(X=>g(X,Y)&&z.every(se=>X.every(q=>se.intersects(q,Y)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new a(M,this.options)}catch{return!1}for(let Y=0;Y<this.set.length;Y++)if(N(this.set[Y],M,this.options))return!0;return!1}}pa=e;const r=kD(),n=new r,i=ko(),s=Hi(),o=qi(),a=ze(),{safeRe:c,t:l,comparatorTrimReplace:u,
|
|
1080
|
+
tildeTrimReplace:d,caretTrimReplace:h}=nn(),{FLAG_INCLUDE_PRERELEASE:E,FLAG_LOOSE:$}=Mi(),y=j=>j.value==="<0.0.0-0",f=j=>j.value==="",g=(j,M)=>{let Y=!0;const z=j.slice();let X=z.pop();for(;Y&&z.length;)Y=z.every(se=>X.intersects(se,M)),X=z.pop();return Y},p=(j,M)=>(o("comp",j,M),j=_(j,M),o("caret",j),j=D(j,M),o("tildes",j),j=I(j,M),o("xrange",j),j=G(j,M),o("stars",j),j),m=j=>!j||j.toLowerCase()==="x"||j==="*",D=(j,M)=>j.trim().split(/\s+/).map(Y=>v(Y,M)).join(" "),v=(j,M)=>{const Y=M.loose?c[l.
|
|
1081
|
+
TILDELOOSE]:c[l.TILDE];return j.replace(Y,(z,X,se,q,C)=>{o("tilde",j,z,X,se,q,C);let H;return m(X)?H="":m(se)?H=`>=${X}.0.0 <${+X+1}.0.0-0`:m(q)?H=`>=${X}.${se}.0 <${X}.${+se+1}.0-0`:C?(o("replaceTilde pr",C),H=`>=${X}.${se}.${q}-${C} <${X}.${+se+1}.0-0`):H=`>=${X}.${se}.${q} <${X}.${+se+1}.0-0`,o("tilde return",H),H})},_=(j,M)=>j.trim().split(/\s+/).map(Y=>b(Y,M)).join(" "),b=(j,M)=>{o("caret",j,M);const Y=M.loose?c[l.CARETLOOSE]:c[l.CARET],z=M.includePrerelease?"-0":"";return j.replace(Y,(X,se,q,C,H)=>{
|
|
1082
|
+
o("caret",j,X,se,q,C,H);let k;return m(se)?k="":m(q)?k=`>=${se}.0.0${z} <${+se+1}.0.0-0`:m(C)?se==="0"?k=`>=${se}.${q}.0${z} <${se}.${+q+1}.0-0`:k=`>=${se}.${q}.0${z} <${+se+1}.0.0-0`:H?(o("replaceCaret pr",H),se==="0"?q==="0"?k=`>=${se}.${q}.${C}-${H} <${se}.${q}.${+C+1}-0`:k=`>=${se}.${q}.${C}-${H} <${se}.${+q+1}.0-0`:k=`>=${se}.${q}.${C}-${H} <${+se+1}.0.0-0`):(o("no pr"),se==="0"?q==="0"?k=`>=${se}.${q}.${C}${z} <${se}.${q}.${+C+1}-0`:k=`>=${se}.${q}.${C}${z} <${se}.${+q+1}.0-0`:k=`>=${se}.${q}\
|
|
1083
|
+
.${C} <${+se+1}.0.0-0`),o("caret return",k),k})},I=(j,M)=>(o("replaceXRanges",j,M),j.split(/\s+/).map(Y=>U(Y,M)).join(" ")),U=(j,M)=>{j=j.trim();const Y=M.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return j.replace(Y,(z,X,se,q,C,H)=>{o("xRange",j,z,X,se,q,C,H);const k=m(se),w=k||m(q),A=w||m(C),R=A;return X==="="&&R&&(X=""),H=M.includePrerelease?"-0":"",k?X===">"||X==="<"?z="<0.0.0-0":z="*":X&&R?(w&&(q=0),C=0,X===">"?(X=">=",w?(se=+se+1,q=0,C=0):(q=+q+1,C=0)):X==="<="&&(X="<",w?se=+se+1:q=+q+1),X==="<"&&
|
|
1084
|
+
(H="-0"),z=`${X+se}.${q}.${C}${H}`):w?z=`>=${se}.0.0${H} <${+se+1}.0.0-0`:A&&(z=`>=${se}.${q}.0${H} <${se}.${+q+1}.0-0`),o("xRange return",z),z})},G=(j,M)=>(o("replaceStars",j,M),j.trim().replace(c[l.STAR],"")),L=(j,M)=>(o("replaceGTE0",j,M),j.trim().replace(c[M.includePrerelease?l.GTE0PRE:l.GTE0],"")),B=j=>(M,Y,z,X,se,q,C,H,k,w,A,R)=>(m(z)?Y="":m(X)?Y=`>=${z}.0.0${j?"-0":""}`:m(se)?Y=`>=${z}.${X}.0${j?"-0":""}`:q?Y=`>=${Y}`:Y=`>=${Y}${j?"-0":""}`,m(k)?H="":m(w)?H=`<${+k+1}.0.0-0`:m(A)?H=`<${k}.${+w+
|
|
1085
|
+
1}.0-0`:R?H=`<=${k}.${w}.${A}-${R}`:j?H=`<${k}.${w}.${+A+1}-0`:H=`<=${H}`,`${Y} ${H}`.trim()),N=(j,M,Y)=>{for(let z=0;z<j.length;z++)if(!j[z].test(M))return!1;if(M.prerelease.length&&!Y.includePrerelease){for(let z=0;z<j.length;z++)if(o(j[z].semver),j[z].semver!==s.ANY&&j[z].semver.prerelease.length>0){const X=j[z].semver;if(X.major===M.major&&X.minor===M.minor&&X.patch===M.patch)return!0}return!1}return!0};return pa}var ma,Uh;function Hi(){if(Uh)return ma;Uh=1;const t=Symbol("SemVer ANY");class e{static get ANY(){
|
|
1086
1086
|
return t}constructor(u,d){if(d=r(d),u instanceof e){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const d=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],h=u.match(d);if(!h)throw new TypeError(`Invalid comparator: ${u}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=
|
|
1087
1087
|
""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=t}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===t||u===t)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return s(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new c(this.
|
|
1088
1088
|
value,d).test(u.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||s(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||s(this.
|
|
1089
|
-
semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}ma=e;const r=ko(),{safeRe:n,t:i}=
|
|
1090
|
-
return Ea=(n,i,s)=>{let o=null,a=null,c=null;try{c=new e(i,s)}catch{return null}return n.forEach(l=>{c.test(l)&&(!o||a.compare(l)===-1)&&(o=l,a=new t(o,s))}),o},Ea}var Da,
|
|
1091
|
-
"0.0.0");if(i.test(o)||(o=new t("0.0.0-0"),i.test(o)))return o;o=null;for(let a=0;a<i.set.length;++a){const c=i.set[a];let l=null;c.forEach(u=>{const d=new t(u.semver.version);switch(u.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||r(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),l&&(!o||r(o,l))&&(o=l)}return o&&i.test(o)?o:null},va}var $a,
|
|
1092
|
-
|
|
1093
|
-
_=null;if(
|
|
1094
|
-
1;const t=ht();return Ca=(r,n,i)=>(r=new t(r,i),n=new t(n,i),r.intersects(n,i)),Ca}var Sa,
|
|
1095
|
-
"string"?n.raw:String(n);return u.length<d.length?u:n},Sa}var Ra,
|
|
1096
|
-
d=o:d=a}if(h.length===1&&h[0].semver===r){if(E.includePrerelease)return!0;h=a}const
|
|
1097
|
-
let p,m,v
|
|
1098
|
-
if(p=l(
|
|
1099
|
-
d.semver,h.semver,E);return
|
|
1100
|
-
X=UD(),se=wa(),q=HD(),C=VD(),
|
|
1101
|
-
RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Oa}var Ia=KD();const Ar=Ji(Ia),YD=Object.prototype.toString,JD="[object Uint8Array]",XD="[object ArrayBuffer]";function
|
|
1102
|
-
if(!ZD(t))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}function
|
|
1103
|
-
\`${typeof t}\``)}const nv=new globalThis.TextEncoder;function Fa(t){return rv(t),nv.encode(t)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const iv=mD.default,
|
|
1089
|
+
semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}ma=e;const r=ko(),{safeRe:n,t:i}=nn(),s=Bh(),o=qi(),a=ze(),c=ht();return ma}var ga,Hh;function Vi(){if(Hh)return ga;Hh=1;const t=ht();return ga=(r,n,i)=>{try{n=new t(n,i)}catch{return!1}return n.test(r)},ga}var ya,Vh;function BD(){if(Vh)return ya;Vh=1;const t=ht();return ya=(r,n)=>new t(r,n).set.map(i=>i.map(s=>s.value).join(" ").trim().split(" ")),ya}var Ea,zh;function xD(){if(zh)return Ea;zh=1;const t=ze(),e=ht();
|
|
1090
|
+
return Ea=(n,i,s)=>{let o=null,a=null,c=null;try{c=new e(i,s)}catch{return null}return n.forEach(l=>{c.test(l)&&(!o||a.compare(l)===-1)&&(o=l,a=new t(o,s))}),o},Ea}var Da,Gh;function MD(){if(Gh)return Da;Gh=1;const t=ze(),e=ht();return Da=(n,i,s)=>{let o=null,a=null,c=null;try{c=new e(i,s)}catch{return null}return n.forEach(l=>{c.test(l)&&(!o||a.compare(l)===1)&&(o=l,a=new t(o,s))}),o},Da}var va,Wh;function qD(){if(Wh)return va;Wh=1;const t=ze(),e=ht(),r=Ui();return va=(i,s)=>{i=new e(i,s);let o=new t(
|
|
1091
|
+
"0.0.0");if(i.test(o)||(o=new t("0.0.0-0"),i.test(o)))return o;o=null;for(let a=0;a<i.set.length;++a){const c=i.set[a];let l=null;c.forEach(u=>{const d=new t(u.semver.version);switch(u.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||r(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),l&&(!o||r(o,l))&&(o=l)}return o&&i.test(o)?o:null},va}var $a,Kh;function UD(){if(Kh)return $a;
|
|
1092
|
+
Kh=1;const t=ht();return $a=(r,n)=>{try{return new t(r,n).range||"*"}catch{return null}},$a}var _a,Yh;function wa(){if(Yh)return _a;Yh=1;const t=ze(),e=Hi(),{ANY:r}=e,n=ht(),i=Vi(),s=Ui(),o=ia(),a=la(),c=ua();return _a=(u,d,h,E)=>{u=new t(u,E),d=new n(d,E);let $,y,f,g,p;switch(h){case">":$=s,y=a,f=o,g=">",p=">=";break;case"<":$=o,y=c,f=s,g="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(u,d,E))return!1;for(let m=0;m<d.set.length;++m){const D=d.set[m];let v=null,
|
|
1093
|
+
_=null;if(D.forEach(b=>{b.semver===r&&(b=new e(">=0.0.0")),v=v||b,_=_||b,$(b.semver,v.semver,E)?v=b:f(b.semver,_.semver,E)&&(_=b)}),v.operator===g||v.operator===p||(!_.operator||_.operator===g)&&y(u,_.semver))return!1;if(_.operator===p&&f(u,_.semver))return!1}return!0},_a}var ba,Jh;function HD(){if(Jh)return ba;Jh=1;const t=wa();return ba=(r,n,i)=>t(r,n,">",i),ba}var Aa,Xh;function VD(){if(Xh)return Aa;Xh=1;const t=wa();return Aa=(r,n,i)=>t(r,n,"<",i),Aa}var Ca,Qh;function zD(){if(Qh)return Ca;Qh=
|
|
1094
|
+
1;const t=ht();return Ca=(r,n,i)=>(r=new t(r,i),n=new t(n,i),r.intersects(n,i)),Ca}var Sa,Zh;function GD(){if(Zh)return Sa;Zh=1;const t=Vi(),e=dt();return Sa=(r,n,i)=>{const s=[];let o=null,a=null;const c=r.sort((h,E)=>e(h,E,i));for(const h of c)t(h,n,i)?(a=h,o||(o=h)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);const l=[];for(const[h,E]of s)h===E?l.push(h):!E&&h===c[0]?l.push("*"):E?h===c[0]?l.push(`<=${E}`):l.push(`${h} - ${E}`):l.push(`>=${h}`);const u=l.join(" || "),d=typeof n.raw==
|
|
1095
|
+
"string"?n.raw:String(n);return u.length<d.length?u:n},Sa}var Ra,ep;function WD(){if(ep)return Ra;ep=1;const t=ht(),e=Hi(),{ANY:r}=e,n=Vi(),i=dt(),s=(d,h,E={})=>{if(d===h)return!0;d=new t(d,E),h=new t(h,E);let $=!1;e:for(const y of d.set){for(const f of h.set){const g=c(y,f,E);if($=$||g!==null,g)continue e}if($)return!1}return!0},o=[new e(">=0.0.0-0")],a=[new e(">=0.0.0")],c=(d,h,E)=>{if(d===h)return!0;if(d.length===1&&d[0].semver===r){if(h.length===1&&h[0].semver===r)return!0;E.includePrerelease?
|
|
1096
|
+
d=o:d=a}if(h.length===1&&h[0].semver===r){if(E.includePrerelease)return!0;h=a}const $=new Set;let y,f;for(const I of d)I.operator===">"||I.operator===">="?y=l(y,I,E):I.operator==="<"||I.operator==="<="?f=u(f,I,E):$.add(I.semver);if($.size>1)return null;let g;if(y&&f){if(g=i(y.semver,f.semver,E),g>0)return null;if(g===0&&(y.operator!==">="||f.operator!=="<="))return null}for(const I of $){if(y&&!n(I,String(y),E)||f&&!n(I,String(f),E))return null;for(const U of h)if(!n(I,String(U),E))return!1;return!0}
|
|
1097
|
+
let p,m,D,v,_=f&&!E.includePrerelease&&f.semver.prerelease.length?f.semver:!1,b=y&&!E.includePrerelease&&y.semver.prerelease.length?y.semver:!1;_&&_.prerelease.length===1&&f.operator==="<"&&_.prerelease[0]===0&&(_=!1);for(const I of h){if(v=v||I.operator===">"||I.operator===">=",D=D||I.operator==="<"||I.operator==="<=",y){if(b&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===b.major&&I.semver.minor===b.minor&&I.semver.patch===b.patch&&(b=!1),I.operator===">"||I.operator===">="){
|
|
1098
|
+
if(p=l(y,I,E),p===I&&p!==y)return!1}else if(y.operator===">="&&!n(y.semver,String(I),E))return!1}if(f){if(_&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===_.major&&I.semver.minor===_.minor&&I.semver.patch===_.patch&&(_=!1),I.operator==="<"||I.operator==="<="){if(m=u(f,I,E),m===I&&m!==f)return!1}else if(f.operator==="<="&&!n(f.semver,String(I),E))return!1}if(!I.operator&&(f||y)&&g!==0)return!1}return!(y&&D&&!f&&g!==0||f&&v&&!y&&g!==0||b||_)},l=(d,h,E)=>{if(!d)return h;const $=i(
|
|
1099
|
+
d.semver,h.semver,E);return $>0?d:$<0||h.operator===">"&&d.operator===">="?h:d},u=(d,h,E)=>{if(!d)return h;const $=i(d.semver,h.semver,E);return $<0?d:$>0||h.operator==="<"&&d.operator==="<="?h:d};return Ra=s,Ra}var Oa,tp;function KD(){if(tp)return Oa;tp=1;const t=nn(),e=Mi(),r=ze(),n=dh(),i=br(),s=bD(),o=AD(),a=CD(),c=SD(),l=RD(),u=OD(),d=ID(),h=FD(),E=dt(),$=PD(),y=ND(),f=Zo(),g=TD(),p=LD(),m=Ui(),D=ia(),v=Ph(),_=Th(),b=ua(),I=la(),U=Bh(),G=jD(),L=Hi(),B=ht(),N=Vi(),j=BD(),M=xD(),Y=MD(),z=qD(),
|
|
1100
|
+
X=UD(),se=wa(),q=HD(),C=VD(),H=zD(),k=GD(),w=WD();return Oa={parse:i,valid:s,clean:o,inc:a,diff:c,major:l,minor:u,patch:d,prerelease:h,compare:E,rcompare:$,compareLoose:y,compareBuild:f,sort:g,rsort:p,gt:m,lt:D,eq:v,neq:_,gte:b,lte:I,cmp:U,coerce:G,Comparator:L,Range:B,satisfies:N,toComparators:j,maxSatisfying:M,minSatisfying:Y,minVersion:z,validRange:X,outside:se,gtr:q,ltr:C,intersects:H,simplifyRange:k,subset:w,SemVer:r,re:t.re,src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:e.SEMVER_SPEC_VERSION,RELEASE_TYPES:e.
|
|
1101
|
+
RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Oa}var Ia=KD();const Ar=Ji(Ia),YD=Object.prototype.toString,JD="[object Uint8Array]",XD="[object ArrayBuffer]";function rp(t,e,r){return t?t.constructor===e?!0:YD.call(t)===r:!1}function np(t){return rp(t,Uint8Array,JD)}function QD(t){return rp(t,ArrayBuffer,XD)}function ZD(t){return np(t)||QD(t)}function ev(t){if(!np(t))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof t}\``)}function tv(t){
|
|
1102
|
+
if(!ZD(t))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}function ip(t,e){if(t.length===0)return new Uint8Array(0);e??=t.reduce((i,s)=>i+s.length,0);const r=new Uint8Array(e);let n=0;for(const i of t)ev(i),r.set(i,n),n+=i.length;return r}const sp={utf8:new globalThis.TextDecoder("utf8")};function op(t,e="utf8"){return tv(t),sp[e]??=new globalThis.TextDecoder(e),sp[e].decode(t)}function rv(t){if(typeof t!="string")throw new TypeError(`Expected \`string\`, got\
|
|
1103
|
+
\`${typeof t}\``)}const nv=new globalThis.TextEncoder;function Fa(t){return rv(t),nv.encode(t)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const iv=mD.default,ap="aes-256-cbc",Cr=()=>Object.create(null),sv=t=>t!=null,ov=(t,e)=>{const r=new Set(["undefined","symbol","function"]),n=typeof e;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${t}\` is not allowed as it's not supported by JSON`)},zi="__internal__",Pa=`${zi}.migrations.version`;class av{path;events;#n;#t;#e;#r={};constructor(e={}){
|
|
1104
1104
|
const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=vy(r.projectName,{suffix:r.projectSuffix}).config}if(this.#e=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError("The `schema` option must be an object.");const o=new sD.Ajv2020({allErrors:!0,useDefaults:!0,
|
|
1105
1105
|
...r.ajvOptions});iv(o);const a={...r.rootSchema,type:"object",properties:r.schema};this.#n=o.compile(a);for(const[c,l]of Object.entries(r.schema??{}))l?.default&&(this.#r[c]=l.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#t=r.encryptionKey;const n=r.fileExtension?`.${r.fileExtension}`:"";this.path=be.resolve(r.cwd,`${r.configName??"config"}${n}`);const i=this.
|
|
1106
1106
|
store,s=Object.assign(Cr(),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(s);try{sm.deepEqual(i,s)}catch{this.store=s}r.watch&&this._watch()}get(e,r){if(this.#e.accessPropertiesByDotNotation)return this._get(e,r);const{store:n}=this;return e in n?n[e]:r}set(e,r){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of \
|
|
1107
|
-
type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${zi} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(s,o)=>{ov(s,o),this.#e.accessPropertiesByDotNotation?
|
|
1107
|
+
type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${zi} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(s,o)=>{ov(s,o),this.#e.accessPropertiesByDotNotation?qc(n,s,o):n[s]=o};if(typeof e=="object"){const s=e;for(const[o,a]of Object.entries(s))i(o,a)}else i(e,r);this.store=n}has(e){return this.#e.accessPropertiesByDotNotation?
|
|
1108
1108
|
gy(this.store,e):e in this.store}reset(...e){for(const r of e)sv(this.#r[r])&&this.set(r,this.#r[r])}delete(e){const{store:r}=this;this.#e.accessPropertiesByDotNotation?my(r,e):delete r[e],this.store=r}clear(){this.store=Cr();for(const e of Object.keys(this.#r))this.reset(e)}onDidChange(e,r){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);
|
|
1109
1109
|
return this._handleChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{const e=ge.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(e),n=this._deserialize(r);return this._validate(n),Object.assign(Cr(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Cr();
|
|
1110
|
-
if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Cr();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[e,r]of Object.entries(this.store))yield[e,r]}_encryptData(e){if(!this.#t)return typeof e=="string"?e:
|
|
1110
|
+
if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Cr();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[e,r]of Object.entries(this.store))yield[e,r]}_encryptData(e){if(!this.#t)return typeof e=="string"?e:op(e);try{const r=e.slice(0,16),n=Pr.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),i=Pr.createDecipheriv(ap,n,r),s=e.slice(17),o=typeof s=="string"?Fa(s):s;return op(ip([i.update(
|
|
1111
1111
|
o),i.final()]))}catch{}return e.toString()}_handleChange(e,r){let n=e();const i=()=>{const s=n,o=e();im(o,s)||(n=o,r.call(this,o,s))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0," ");_validate(e){if(!this.#n||this.#n(e)||!this.#n.errors)return;const n=this.#n.errors.map(({instancePath:i,message:s=""})=>`\`${i.slice(1)}\` ${s}`);throw new Error("Config schema violation: "+n.join(
|
|
1112
|
-
"; "))}_ensureDirectory(){ge.mkdirSync(be.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(this.#t){const n=Pr.randomBytes(16),i=Pr.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),s=Pr.createCipheriv(
|
|
1113
|
-
throw n}}_watch(){this._ensureDirectory(),ge.existsSync(this.path)||this._write(Cr()),Te.platform==="win32"?ge.watch(this.path,{persistent:!1},
|
|
1112
|
+
"; "))}_ensureDirectory(){ge.mkdirSync(be.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(this.#t){const n=Pr.randomBytes(16),i=Pr.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),s=Pr.createCipheriv(ap,i,n);r=ip([n,Fa(":"),s.update(Fa(r)),s.final()])}if(Te.env.SNAP)ge.writeFileSync(this.path,r,{mode:this.#e.configFileMode});else try{Gc(this.path,r,{mode:this.#e.configFileMode})}catch(n){if(n?.code==="EXDEV"){ge.writeFileSync(this.path,r,{mode:this.#e.configFileMode});return}
|
|
1113
|
+
throw n}}_watch(){this._ensureDirectory(),ge.existsSync(this.path)||this._write(Cr()),Te.platform==="win32"?ge.watch(this.path,{persistent:!1},oh(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):ge.watchFile(this.path,{persistent:!1},oh(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(e,r,n){let i=this._get(Pa,"0.0.0");const s=Object.keys(e).filter(a=>this._shouldPerformMigration(a,i,r));let o={...this.store};for(const a of s)try{n&&n(this,{fromVersion:i,
|
|
1114
1114
|
toVersion:a,finalVersion:r,versions:s});const c=e[a];c?.(this),this._set(Pa,a),i=a,o={...this.store}}catch(c){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(i)||!Ar.eq(i,r))&&this._set(Pa,r)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===zi?!0:typeof e!="string"?!1:this.#e.accessPropertiesByDotNotation?!!e.startsWith(`${zi}.`):!1}_isVersionInRangeFormat(e){
|
|
1115
|
-
return Ar.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&Ar.satisfies(r,e)?!1:Ar.satisfies(n,e):!(Ar.lte(e,r)||Ar.gt(e,n))}_get(e,r){return py(this.store,e,r)}_set(e,r){const{store:n}=this;
|
|
1116
|
-
${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}}class
|
|
1117
|
-
Headers(e);for(const[s,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(s):r.set(s,o);return r};function Wi(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Na(t[r]??[],e[r]??[])}const
|
|
1118
|
-
entries(i))
|
|
1119
|
-
BodyInit type")return!1;throw i}return t&&!e})(),cv=typeof globalThis.AbortController=="function",lv=typeof globalThis.ReadableStream=="function",fv=typeof globalThis.FormData=="function",
|
|
1120
|
-
fetch:!0},pv={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},mv=t=>
|
|
1121
|
-
Dv=(t={})=>{if(typeof t=="number")return{...
|
|
1115
|
+
return Ar.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&Ar.satisfies(r,e)?!1:Ar.satisfies(n,e):!(Ar.lte(e,r)||Ar.gt(e,n))}_get(e,r){return py(this.store,e,r)}_set(e,r){const{store:n}=this;qc(n,e,r),this.store=n}}class up extends Error{response;request;options;constructor(e,r,n){const i=e.status||e.status===0?e.status:"",s=e.statusText||"",o=`${i} ${s}`.trim(),a=o?`status code ${o}`:"an unknown error";super(`Request failed with ${a}: ${r.method}\
|
|
1116
|
+
${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}}class cp extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}const sn=t=>t!==null&&typeof t=="object",Gi=(...t)=>{for(const e of t)if((!sn(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Na({},...t)},lp=(t={},e={})=>{const r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.
|
|
1117
|
+
Headers(e);for(const[s,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(s):r.set(s,o);return r};function Wi(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Na(t[r]??[],e[r]??[])}const fp=(t={},e={})=>({beforeRequest:Wi(t,e,"beforeRequest"),beforeRetry:Wi(t,e,"beforeRetry"),afterResponse:Wi(t,e,"afterResponse"),beforeError:Wi(t,e,"beforeError")}),Na=(...t)=>{let e={},r={},n={};for(const i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(sn(i)){for(let[s,o]of Object.
|
|
1118
|
+
entries(i))sn(o)&&s in e&&(o=Na(e[s],o)),e={...e,[s]:o};sn(i.hooks)&&(n=fp(n,i.hooks),e.hooks=n),sn(i.headers)&&(r=lp(r,i.headers),e.headers=r)}return e},uv=(()=>{let t=!1,e=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported\
|
|
1119
|
+
BodyInit type")return!1;throw i}return t&&!e})(),cv=typeof globalThis.AbortController=="function",lv=typeof globalThis.ReadableStream=="function",fv=typeof globalThis.FormData=="function",dp=["get","post","put","patch","head","delete"],dv={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Ta=2147483647,hp=Symbol("stop"),hv={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,
|
|
1120
|
+
fetch:!0},pv={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},mv=t=>dp.includes(t)?t.toUpperCase():t,gv=["get","put","head","delete","options","trace"],yv=[408,413,429,500,502,503,504],Ev=[413,429,503],pp={limit:2,methods:gv,statusCodes:yv,afterStatusCodes:Ev,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},
|
|
1121
|
+
Dv=(t={})=>{if(typeof t=="number")return{...pp,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...pp,...t}};async function vv(t,e,r,n){return new Promise((i,s)=>{const o=setTimeout(()=>{r&&r.abort(),s(new cp(t))},n.timeout);n.fetch(t,e).then(i).catch(s).then(()=>{clearTimeout(o)})})}async function $v(t,{signal:e}){return new Promise((r,n)=>{
|
|
1122
1122
|
e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(s),n(e.reason)}const s=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}const _v=(t,e)=>{const r={};for(const n in e)!(n in pv)&&!(n in hv)&&!(n in t)&&(r[n]=e[n]);return r};class Yi{static create(e,r){const n=new Yi(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Ta)throw new RangeError(`The \`timeout\` option cannot be greater than ${Ta}`);await Promise.resolve();let a=await n.
|
|
1123
|
-
_fetch();for(const c of n._options.hooks.afterResponse){const l=await c(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let c=new
|
|
1123
|
+
_fetch();for(const c of n._options.hooks.afterResponse){const l=await c(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let c=new up(a,n.request,n._options);for(const l of n._options.hooks.beforeError)c=await l(c);throw c}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!lv)throw new Error(
|
|
1124
1124
|
"Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},o=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(const[a,c]of Object.entries(dv))o[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||c);const l=await o;if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}
|
|
1125
|
-
return l[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:
|
|
1125
|
+
return l[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:lp(this._input.headers,r.headers),hooks:fp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:mv(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Dv(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&
|
|
1126
1126
|
!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(cv){this.abortController=new globalThis.AbortController;const n=this._options.
|
|
1127
1127
|
signal??this._input.signal;n?.aborted&&this.abortController.abort(n?.reason),n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(uv&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.
|
|
1128
1128
|
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()),s=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(fv&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=
|
|
1129
|
-
new globalThis.Request(new globalThis.Request(s,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof
|
|
1129
|
+
new globalThis.Request(new globalThis.Request(s,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof cp)throw e;if(e instanceof up){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;const n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.
|
|
1130
1130
|
includes(e.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 s=this._options.retry.maxRetryAfter??i;return i<s?i:s}if(e.response.status===413)throw e}const r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){const n=Math.
|
|
1131
|
-
min(this._calculateRetryDelay(r),Ta);if(this._retryCount<1)throw r;await $v(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})===
|
|
1131
|
+
min(this._calculateRetryDelay(r),Ta);if(this._retryCount<1)throw r;await $v(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})===hp)return;return this._retry(e)}}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 e=_v(this.request,this.
|
|
1132
1132
|
_options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):vv(r,e,this.abortController,this._options)}_stream(e,r){const n=Number(e.headers.get("content-length"))||0;let i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(s){const o=e.body.getReader();r&&
|
|
1133
|
-
r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){const{done:c,value:l}=await o.read();if(c){s.close();return}if(r){i+=l.byteLength;const u=n===0?0:i/n;r({percent:u,transferredBytes:i,totalBytes:n},l)}s.enqueue(l),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}}const La=t=>{const e=(r,n)=>Yi.create(r,Gi(t,n));for(const r of
|
|
1134
|
-
on"&&(r=r(t??{})),La(Gi(t,r))),e.stop=
|
|
1135
|
-
""))}async function Cv(){try{const t=await Sv();os(t,"No version found in latest npm"),ja.set({lastUpdateCheck:Date.now(),latestVersion:t}),Ia.gt(t,dr)?zt(["Update available: ",K.dim(dr),K.reset(" \u2192 "),K.green(t)].join("")):zt(K.dim("Up to date: ")+" "+K.green(dr))}catch(t){za.error(
|
|
1133
|
+
r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){const{done:c,value:l}=await o.read();if(c){s.close();return}if(r){i+=l.byteLength;const u=n===0?0:i/n;r({percent:u,transferredBytes:i,totalBytes:n},l)}s.enqueue(l),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}}const La=t=>{const e=(r,n)=>Yi.create(r,Gi(t,n));for(const r of dp)e[r]=(n,i)=>Yi.create(n,Gi(t,i,{method:r}));return e.create=r=>La(Gi(r)),e.extend=r=>(typeof r=="functi\
|
|
1134
|
+
on"&&(r=r(t??{})),La(Gi(t,r))),e.stop=hp,e},wv=La(),ja=new av({projectName:Ip,serialize:t=>Ct.stringify(t,null,2),deserialize:t=>Ct.parse(t)}),bv=1e3*60*60*24,mp="check-update";function Av(){if(lm||as===mp)return;const t=ja.get("lastUpdateCheck"),e=ja.get("latestVersion");(Fp(e)||Xi(t)||t+bv<Date.now())&&Pp("likec4",["check-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:mp}}).catch(()=>{}),e&&Ia.gt(e,dr)&&zt(["Update available: ",K.dim(dr),K.reset(" \u2192 "),K.green(e)].join(
|
|
1135
|
+
""))}async function Cv(){try{const t=await Sv();os(t,"No version found in latest npm"),ja.set({lastUpdateCheck:Date.now(),latestVersion:t}),Ia.gt(t,dr)?zt(["Update available: ",K.dim(dr),K.reset(" \u2192 "),K.green(t)].join("")):zt(K.dim("Up to date: ")+" "+K.green(dr))}catch(t){za.error(Np(t))}}async function Sv(){return(await wv("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}
|
|
1136
1136
|
async function Rv(t,e,r){const n=".ts";e=e??De(t.workspace,"likec4.generated"+n),Or(e)!==n&&(e=e+n),await $t(Gt(e),{recursive:!0});const i=await t.diagrams(),s=Hg([...i]);await Kt(e,s),r.info(`${K.dim("generated")} ${Wt(process.cwd(),e)}`)}async function Ov(t,e,r){await $t(e,{recursive:!0}),r.info(`${K.dim("format")} ${K.green("dot")}`),r.info(`${K.dim("outdir")} ${e}`);const n=new Set,i=await t.viewsService.computedViews();let s=0;for(const o of i)try{const a=await t.viewsService.layouter.dot(o),
|
|
1137
|
-
c=o.relativePath??"";c!==""&&!n.has(c)&&(await $t(De(e,c),{recursive:!0}),n.add(c));const l=De(e,c,o.id+".dot");await Kt(l,a),r.info(`${K.dim("generated")} ${Wt(process.cwd(),l)}`),s++}catch(a){za.error(`error while generating ${o.id}`,{error:a})}s>0&&r.info(`${K.dim("total")} ${s} files`)}async function Iv(t,e,r,n){await $t(r,{recursive:!0}),n.info(`${K.dim("format")} ${K.green(e)}`),n.info(`${K.dim("outdir")} ${r}`);let i,s;switch(e){case"d2":i=".d2",s=
|
|
1138
|
-
|
|
1139
|
-
s=await
|
|
1140
|
-
t,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${K.dim("format")} ${K.green("model")}`);const o=await s.layoutedModel();for(const d of o.views())d.$view.hasLayoutDrift&&n.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(d.id));let a=De(s.workspace,"likec4-model.ts");if(r&&(a=ns(r)?r:De(r),Pt(r)&&(await ss(r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);const c=
|
|
1137
|
+
c=o.relativePath??"";c!==""&&!n.has(c)&&(await $t(De(e,c),{recursive:!0}),n.add(c));const l=De(e,c,o.id+".dot");await Kt(l,a),r.info(`${K.dim("generated")} ${Wt(process.cwd(),l)}`),s++}catch(a){za.error(`error while generating ${o.id}`,{error:a})}s>0&&r.info(`${K.dim("total")} ${s} files`)}async function Iv(t,e,r,n){await $t(r,{recursive:!0}),n.info(`${K.dim("format")} ${K.green(e)}`),n.info(`${K.dim("outdir")} ${r}`);let i,s;switch(e){case"d2":i=".d2",s=Cc;break;case"mermaid":i=".mmd",s=Sc;break;default:
|
|
1138
|
+
tu(e)}const o=new Set,a=await t.diagrams();let c=0;for(const l of a)try{let u=l.relativePath??".";u.includes("/")?u=u.slice(0,u.lastIndexOf("/")):u=".",u!==""&&!o.has(u)&&(await $t(De(r,u),{recursive:!0}),o.add(u));const d=De(r,u,l.id+i),h=s(l);await Kt(d,h),n.info(`${K.dim("generated")} ${Wt(process.cwd(),d)}`),c++}catch(u){n.error(`error while generating ${l.id}`,{error:u})}c>0&&n.info(`${K.dim("total")} ${c} files`)}async function Ki({path:t,useDotBin:e,...r}){const n=pt("c4:codegen"),i=Sr(n),
|
|
1139
|
+
s=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});if((await s.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await Rv(s,r.outfile,n);break}case"dot":{await Ov(s,r.outdir??t,n);break}case"d2":case"mermaid":{await Iv(s,r.format,r.outdir??t,n);break}default:tu(r)}i.stopAndLog()}async function Fv({path:t,useDotBin:e,outfile:r}){const n=pt("c4:codegen"),i=Sr(n),s=await gt.fromWorkspace(
|
|
1140
|
+
t,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${K.dim("format")} ${K.green("model")}`);const o=await s.layoutedModel();for(const d of o.views())d.$view.hasLayoutDrift&&n.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(d.id));let a=De(s.workspace,"likec4-model.ts");if(r&&(a=ns(r)?r:De(r),Pt(r)&&(await ss(r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);const c=on(a);n.info(`${K.dim("filename")} ${c}`);const l=Or(c).toLocaleLowerCase();
|
|
1141
1141
|
if(![".ts",".mts",".cts"].includes(l))throw n.error(`output file ${r} has extension "${l}"`),new Error(`output file ${r} must be a .ts, .mts or .cts file`);const u=Gt(a);n.info(`${K.dim("outdir")} ${u}`),await $t(u,{recursive:!0}),await Kt(a,qg(o),{encoding:"utf-8"}),zt(Qi(`
|
|
1142
1142
|
${K.dim("Source with LikeC4Model generated:")}
|
|
1143
1143
|
${Wt(Zi(),a)}
|
|
@@ -1146,23 +1146,23 @@ if(![".ts",".mts",".cts"].includes(l))throw n.error(`output file ${r} has extens
|
|
|
1146
1146
|
${K.underline("https://likec4.dev/tooling/code-generation/model/")}
|
|
1147
1147
|
`).trim(),{padding:2,borderColor:"green",borderStyle:"round"}),i.stopAndLog()}async function Pv({languageServices:t,outDir:e,filename:r="likec4-react.mjs"}){const n=Ss,i=Os();return n.info(`${K.cyan("likec4 app root")} ${K.dim(i)}`),n.info(K.cyan("outDir")+" "+K.dim(e)),{customLogger:n,root:i,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:Ps()},esbuild:{banner:`'use client'
|
|
1148
1148
|
`+Rs.banner,footer:Rs.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!1,target:"es2022",copyPublicDir:!1,chunkSizeWarningLimit:Fs,lib:{entry:"react/likec4.tsx",fileName(s,o){return r},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/rea\
|
|
1149
|
-
ct","likec4/model","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(s,o){s.code!=="SOURCEMAP_ERROR"&&o(s)}}},plugins:[
|
|
1150
|
-
1,new Error("no views found");o.forEach(E=>{E.hasLayoutDrift&&n.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(E.id))});let a=De(s.workspace,"likec4-views.js");if(r&&(a=ns(r)?r:De(r),Pt(r)&&(await ss(r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);const c=Gt(a);n.info(`${K.dim("outdir")} ${c}`);const l=
|
|
1151
|
-
ile ${r} has extension "${u}"`),new Error(`output file ${r} must be a .js, .jsx or .mjs`);const d=await Pv({languageServices:s,outDir:c,filename:l});await Fr({...d,logLevel:"warn"});const h=await s.layoutedModel();await Kt(De(c,
|
|
1149
|
+
ct","likec4/model","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(s,o){s.code!=="SOURCEMAP_ERROR"&&o(s)}}},plugins:[Za({}),uo({languageServices:t,useOverviewGraph:!1})]}}async function Nv({path:t,useDotBin:e,outfile:r}){const n=pt("c4:codegen"),i=Sr(n),s=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${K.dim("format")} ${K.green("react")}`);const o=await s.diagrams();if(o.length===0)throw process.exitCode=
|
|
1150
|
+
1,new Error("no views found");o.forEach(E=>{E.hasLayoutDrift&&n.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(E.id))});let a=De(s.workspace,"likec4-views.js");if(r&&(a=ns(r)?r:De(r),Pt(r)&&(await ss(r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);const c=Gt(a);n.info(`${K.dim("outdir")} ${c}`);const l=on(a);n.info(`${K.dim("filename")} ${l}`);const u=Or(l).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(u))throw n.error(`output f\
|
|
1151
|
+
ile ${r} has extension "${u}"`),new Error(`output file ${r} must be a .js, .jsx or .mjs`);const d=await Pv({languageServices:s,outDir:c,filename:l});await Fr({...d,logLevel:"warn"});const h=await s.layoutedModel();await Kt(De(c,on(a,u)+(u===".mjs"?".d.mts":".d.ts")),Vg(h)),zt(Qi(`
|
|
1152
1152
|
${K.dim("Source generated:")}
|
|
1153
1153
|
${Wt(Zi(),a)}
|
|
1154
1154
|
|
|
1155
1155
|
${K.dim("How to use:")}
|
|
1156
1156
|
${K.underline("https://likec4.dev/tooling/code-generation/react/")}
|
|
1157
|
-
`),{padding:2,borderColor:"green",borderStyle:"round"}),i.stopAndLog()}async function Tv({path:t,useDotBin:e,webcomponentPrefix:r="likec4",outfile:n}){const i=
|
|
1158
|
-
l layout can not be applied, view:")+" "+K.red(
|
|
1159
|
-
"created temp public")} ${d}`);const h=await lo({languageServices:o,outDir:d,filename:l,webcomponentPrefix:r,base:"/"});
|
|
1157
|
+
`),{padding:2,borderColor:"green",borderStyle:"round"}),i.stopAndLog()}async function Tv({path:t,useDotBin:e,webcomponentPrefix:r="likec4",outfile:n}){const i=pt("c4:codegen"),s=Sr(i),o=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});i.info(`${K.dim("format")} ${K.green("webcomponent")}`);const a=await o.diagrams();if(!Ga(a,1))throw i.warn("no views found"),process.exitCode=1,new Error("no views found");a.forEach($=>{$.hasLayoutDrift&&i.warn(K.yellow("drift detected, manua\
|
|
1158
|
+
l layout can not be applied, view:")+" "+K.red($.id))});let c=De(o.workspace,"likec4-views.js");if(n&&(c=ns(n)?n:De(n),Pt(n)&&(await ss(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);mt.debug(`${K.dim("outfilepath")} ${c}`);const l=on(c);mt.debug(`${K.dim("filename")} ${l}`);const u=Or(l).toLocaleLowerCase();if(u!==".js"&&u!==".mjs")throw mt.warn(`output file ${n} has extension "${u}"`),new Error(`output file ${n} must be a .js or .mjs`);const d=await Is();mt.debug(`${K.dim(
|
|
1159
|
+
"created temp public")} ${d}`);const h=await lo({languageServices:o,outDir:d,filename:l,webcomponentPrefix:r,base:"/"});mt.debug(`${K.dim("vite build webcomponent")}`),await Fr({...h,logLevel:"warn"});const E=De(d,l);if(!Pt(E))throw new Error(`output file not found: ${E}`);await $t(Gt(c),{recursive:!0}),await Jp(E,c),i.info(`${K.dim("generated")} ${c}`),mt.debug(`${K.dim("remove temp public")}`),await Xp(d,{recursive:!0,force:!0}),zt(Qi(`
|
|
1160
1160
|
${K.dim("Webcomponents generated to:")}
|
|
1161
1161
|
${Wt(Zi(),c)}
|
|
1162
1162
|
|
|
1163
1163
|
${K.dim("Setup and usage instructions:")}
|
|
1164
1164
|
${K.blue("https://likec4.dev/tooling/code-generation/webcomponent/")}
|
|
1165
|
-
`)),s.stopAndLog()}const Lv={command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:t=>t.positional("path",
|
|
1165
|
+
`)),s.stopAndLog()}const Lv={command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:t=>t.positional("path",zr).command("react [path]","generate react component to render likec4 view",e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:Qe}).option("use-dot",at),async e=>{await Nv({useDotBin:e.useDotBin,path:e.path,outfile:e.outfile})}).command({command:"w\
|
|
1166
1166
|
ebcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:Qe}).option("webcomponent-prefix",Cs).option("use-dot",at),handler:async e=>{await Tv({useDotBin:e.useDotBin,path:e.path,outfile:e.outfile,webcomponentPrefix:e.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:e=>e.option("\
|
|
1167
1167
|
outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:Qe}).option("use-dot",at),handler:async e=>{await Fv({path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).command({command:"views-data [path]",aliases:["views"],describe:"generate likec4 views data (.ts)",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:Qe}).option("use-dot",at),handler:async e=>{await Ki({format:"views",path:e.path,useDotBin:e.
|
|
1168
1168
|
useDotBin,outfile:e.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:e=>e.option("outdir",wn).option("use-dot",at),handler:async e=>{await Ki({format:"dot",path:e.path,useDotBin:e.useDotBin,outdir:e.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:e=>e.option("outdir",wn).option("use-dot",at),handler:async e=>{await Ki({format:"d2",path:e.path,useDotBin:e.useDotBin,outdir:e.outdir})}}).command({command:"mermaid [path]",
|
|
@@ -1174,26 +1174,28 @@ aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:e=>e.option("ou
|
|
|
1174
1174
|
likec4 gen ts --outfile ../likec4.ts
|
|
1175
1175
|
likec4 gen mmd --outdir assets/
|
|
1176
1176
|
likec4 gen dot -o out .
|
|
1177
|
-
`),handler:()=>{}};async function jv({path:t,useDotBin:e,outfile:r}){const n=
|
|
1178
|
-
bold("Usage:")} $0 export <format> [path]`).positional("path",
|
|
1177
|
+
`),handler:()=>{}};async function jv({path:t,useDotBin:e,outfile:r}){const n=pt("c4:export"),i=Sr(n),s=await(await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"})).layoutedModel();Or(r)!==".json"&&(r=r+".json"),await $t(Gt(r),{recursive:!0});const o=JSON.stringify(s.$model,null,2);await Kt(r,o),n.info(`${K.dim("generated")} ${Wt(process.cwd(),r)}`),i.stopAndLog("\u2713 export in ")}const kv={command:"export <format> [path]",describe:"Export to images or JSON",builder:t=>t.usage(`${K.
|
|
1178
|
+
bold("Usage:")} $0 export <format> [path]`).positional("path",zr).command({command:"png [path]",describe:"export views to PNG",builder:e=>e.option("output",wn).option("theme",{choices:["light","dark"],desc:"color-scheme to use, default is light"}).option("flat",{boolean:!0,type:"boolean",desc:"ignore sources structure and export all PNGs in output directory"}).option("use-dot",at).options({ignore:{boolean:!0,alias:"i",desc:"continue if some views failed to export"},timeout:{type:"number",alias:"\
|
|
1179
1179
|
t",desc:"(sec) timeout for playwright ",default:10},"max-attempts":{type:"number",describe:"",desc:"(number) max attempts to export failing view",default:3},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server"}}).epilog(`${K.bold("Examples:")}
|
|
1180
1180
|
${K.green("$0 export png")}
|
|
1181
1181
|
${K.gray("Search for likec4 files in current directory and output PNG next to sources")}
|
|
1182
1182
|
|
|
1183
1183
|
${K.green("$0 export png --theme dark -o ./png src/likec4 ")}
|
|
1184
1184
|
${K.gray("Search for likec4 files in src/likec4 and output PNG with dark theme to png folder")}
|
|
1185
|
-
`),handler:async e=>{os(e.timeout>=1,"timeout must be >= 1"),os(e["max-attempts"]>=1,"max-attempts must be >= 1"),await
|
|
1185
|
+
`),handler:async e=>{os(e.timeout>=1,"timeout must be >= 1"),os(e["max-attempts"]>=1,"max-attempts must be >= 1"),await kc({path:e.path,useDotBin:e.useDotBin,output:e.output,timeoutMs:e.timeout*1e3,maxAttempts:e.maxAttempts,ignore:e.ignore===!0,outputType:e.flat?"flat":"relative",serverUrl:e.serverUrl,theme:e.theme??"light"})}}).command({command:"json [path]",describe:"export model to JSON",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.jso\
|
|
1186
1186
|
n",normalize:!0,coerce:De}).option("use-dot",at).epilog(`${K.bold("Examples:")}
|
|
1187
1187
|
${K.green("$0 export json")}
|
|
1188
1188
|
${K.gray("Search for likec4 files in current directory and output JSON to likec4.json")}
|
|
1189
1189
|
|
|
1190
1190
|
${K.green("$0 export json -o ./generated/likec4.json src/likec4 ")}
|
|
1191
1191
|
${K.gray("Search for likec4 files in src/likec4 and output JSON to generated/likec4.json")}
|
|
1192
|
-
`),handler:async e=>{await jv({path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).updateStrings({"Commands:":K.bold("Formats:")}),handler:()=>{}};async function Bv(t){const{isDev:e,...r}=await co({...t,likec4AssetsDir:"",webcomponentPrefix:void 0}),n=await fo({port:Nn(62001,62010)}),i=t?.open??!1;return await tm({...r,mode:"production",preview:{host:t.listen??"127.0.0.1",port:n,open:i}})}async function xv({path:t,output:e,base:r,listen:n}){const i=await
|
|
1193
|
-
s=await Bv({base:r,languageServices:i,outputDir:e,open:!0,listen:n});
|
|
1192
|
+
`),handler:async e=>{await jv({path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).updateStrings({"Commands:":K.bold("Formats:")}),handler:()=>{}};async function Bv(t){const{isDev:e,...r}=await co({...t,likec4AssetsDir:"",webcomponentPrefix:void 0}),n=await fo({port:Nn(62001,62010)}),i=t?.open??!1;return await tm({...r,mode:"production",preview:{host:t.listen??"127.0.0.1",port:n,open:i}})}async function xv({path:t,output:e,base:r,listen:n}){const i=await gt.fromWorkspace(t,{logger:"vite"}),
|
|
1193
|
+
s=await Bv({base:r,languageServices:i,outputDir:e,open:!0,listen:n});Fc(s)}const Mv={command:"preview [path]",describe:"Start local server to preview production build",builder:t=>t.positional("path",{type:"string",desc:`Directory with LikeC4 source files
|
|
1194
1194
|
if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"},listen:{alias:"l",type:"string",desc:"ip address of the network interface to listen on"}}).coerce(["path","output"],Qe).default("path",Qe("."),".").default("listen","127.0.0.1","localhost"),async handler(t){await xv(t)}};async function qv({path:t,useDotBin:e,webcomponentPrefix:r,
|
|
1195
|
-
useHashHistory:n,useOverview:i=!1,base:s,listen:o}){const a=await
|
|
1196
|
-
"no preview server url");return}d.info(K.cyan("wait 5sec before generating previews")),await
|
|
1197
|
-
tart local dev server to preview LikeC4 views",builder:t=>t.positional("path",
|
|
1198
|
-
{
|
|
1199
|
-
|
|
1195
|
+
useHashHistory:n,useOverview:i=!1,base:s,listen:o}){const a=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"}),c=await an(Rr(un(),".likec4-assets-"));process.env.NODE_ENV="development";const l=await Lc({buildWebcomponent:!0,hmr:!0,base:s,webcomponentPrefix:r,languageServices:a,useHashHistory:n,useOverviewGraph:i,likec4AssetsDir:c,listen:o});if(l.config.logger.clearScreen("info"),Fc(l),!i)return;const u=await a.diagrams();if(Ga(u,1)){const d=pt("c4:export"),h=Ic(l);if(!h){d.error(
|
|
1196
|
+
"no preview server url");return}d.info(K.cyan("wait 5sec before generating previews")),await ru(5e3);try{await jc({serverUrl:h,logger:d,views:u,theme:"light",output:c,outputType:"flat"}),await ru(1e3),d.info(K.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(E){d.error(K.red("Failed to generate previews")),d.error(E)}}else l.config.logger.warn("no views found, no previews generated")}const Uv={command:"start [path]",aliases:["serve","dev"],describe:"S\
|
|
1197
|
+
tart local dev server to preview LikeC4 views",builder:t=>t.positional("path",zr).option("base",Gu).option("webcomponent-prefix",Cs).option("use-hash-history",zu).option("use-overview",Wu).option("use-dot",at).option("listen",C0),handler:async t=>{await qv({path:t.path,useDotBin:t["use-dot"],base:t.base,useOverview:t["use-overview"]??!1,webcomponentPrefix:t["webcomponent-prefix"],useHashHistory:t["use-hash-history"],listen:t.listen})}};async function Hv({path:t,ignoreLayout:e}){const r=await gt.
|
|
1198
|
+
fromWorkspace(t,{logger:"vite"}),n=pt("c4:views");let i=!0;return i=await s(r)&&i,i=(e||await o(r,n))&&i,i?0:Wa(1);function s(a){return a.getErrors().length===0}async function o(a,c){const l=await a.diagrams();let u=!1;for(const d of l)d.hasLayoutDrift===!0&&(u=!0,c.error(K.red(`Layout drift detected on view '${d.id}' at ${De(t,d.relativePath??".")}`)));return!u}}const Vv={command:"validate [path]",aliases:[],describe:"Validate model syntax and manual layout",builder:t=>t.positional("path",zr).option(
|
|
1199
|
+
"ignore-layout",{boolean:!0,default:!1,description:"do not validate layout of views"}),handler:async t=>{await Hv({path:t.path,ignoreLayout:t["ignore-layout"]})}};async function zv(){return await Tp({sinks:{console:Lp()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:as==="development"?"debug":"info"}]}),Av(),await b0(Hm(Bp)).scriptName("likec4").usage("Usage: $0 <command>").command(Uv).command(dy).command(Lv).command(kv).command(Mv).command(Vv).command({command:"check-update",describe:"\
|
|
1200
|
+
Check for updates",handler:async()=>{await Cv()}}).help("help").version(dr).alias("v","version").alias("h","help").demandCommand(1,"Please run with valid command").strict().recommendCommands().showHelpOnFail(!0,"Something is wrong, run with --help").updateStrings({"Options:":K.bold("Options:"),"Positionals:":K.bold("Arguments:"),"Commands:":K.bold("Commands:"),"Examples:":K.bold("Examples:")}).wrap(Va(kp.columns-20,{min:80,max:120})).parseAsync()}zv().catch(()=>{Wa(1)}),process.on("unhandledReje\
|
|
1201
|
+
ction",t=>{console.error("Unhandled rejection",t)});
|