werkmeister 0.87.2 → 0.87.3
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/dist/budget-BLK2WAB7.js +4 -0
- package/dist/cache-HYS5M4AY.js +4 -0
- package/dist/chunk-22YIK2BP.js +40 -0
- package/dist/chunk-2IE5JCIK.js +4 -0
- package/dist/chunk-47HAXWC4.js +4 -0
- package/dist/chunk-7D4A3HVZ.js +5 -0
- package/dist/chunk-7I5GWJOR.js +45 -0
- package/dist/chunk-7YUHPLUW.js +5 -0
- package/dist/chunk-A5QL5RDB.js +4 -0
- package/dist/chunk-AEDQ3BHS.js +24 -0
- package/dist/chunk-ANDUBI2O.js +23 -0
- package/dist/chunk-ATYTAZNX.js +4 -0
- package/dist/chunk-AXXV337U.js +18 -0
- package/dist/chunk-C4J3VWL3.js +26 -0
- package/dist/chunk-CBTQBN4M.js +110 -0
- package/dist/chunk-CVIURF6M.js +180 -0
- package/dist/chunk-CVK35MQA.js +4 -0
- package/dist/chunk-CVMWX5W5.js +146 -0
- package/dist/chunk-DL73WFKY.js +4 -0
- package/dist/chunk-DMZPGI56.js +13 -0
- package/dist/chunk-DNDCV7NJ.js +6 -0
- package/dist/chunk-EHWLRQV7.js +410 -0
- package/dist/chunk-EOBOW6TP.js +48 -0
- package/dist/chunk-FUA5NLXY.js +57 -0
- package/dist/chunk-GMROWN6L.js +10 -0
- package/dist/chunk-GMYAKGU2.js +4 -0
- package/dist/chunk-GUFHPPBN.js +4 -0
- package/dist/chunk-H3J3PJGY.js +7 -0
- package/dist/chunk-HKKHKLTS.js +11 -0
- package/dist/chunk-I3QYJM3C.js +4 -0
- package/dist/chunk-I7X6WZIM.js +4 -0
- package/dist/chunk-IFSWSRJW.js +5 -0
- package/dist/chunk-JPAIPFJZ.js +6 -0
- package/dist/chunk-JYCKRH6K.js +68 -0
- package/dist/chunk-K6GRVJQO.js +4 -0
- package/dist/chunk-N72DCINT.js +82 -0
- package/dist/chunk-NX6LSFJH.js +4 -0
- package/dist/chunk-OC7PYYEG.js +145 -0
- package/dist/chunk-OSW5G2B6.js +82 -0
- package/dist/chunk-OTPRXRNK.js +23 -0
- package/dist/chunk-P3NAQKV7.js +6 -0
- package/dist/chunk-PLREOZEU.js +4 -0
- package/dist/chunk-Q2CVZANF.js +42 -0
- package/dist/chunk-QAQMYRCU.js +4 -0
- package/dist/chunk-QEYZ7HOT.js +36 -0
- package/dist/chunk-QO5K65QU.js +5 -0
- package/dist/chunk-QVMMQ5JU.js +41 -0
- package/dist/chunk-RJQTC65O.js +33 -0
- package/dist/chunk-RO5NEK3B.js +4 -0
- package/dist/chunk-RS7NMSUP.js +4 -0
- package/dist/chunk-S62C4SVE.js +4 -0
- package/dist/chunk-SNY4QE2J.js +137 -0
- package/dist/chunk-SUWACJLK.js +5 -0
- package/dist/chunk-TCABDYVJ.js +4 -0
- package/dist/chunk-U4733O5I.js +13 -0
- package/dist/chunk-U4RIK7SI.js +15 -0
- package/dist/chunk-USRMIMWS.js +11 -0
- package/dist/chunk-UTVZKLGU.js +89 -0
- package/dist/chunk-UU5QPEC3.js +9 -0
- package/dist/chunk-VNP6M5VF.js +294 -0
- package/dist/chunk-WITTY5DQ.js +4 -0
- package/dist/chunk-X7GPCYQ7.js +4 -0
- package/dist/chunk-XGIW27EP.js +4 -0
- package/dist/chunk-XMARLDYZ.js +11 -0
- package/dist/chunk-XS5OH4RT.js +9 -0
- package/dist/chunk-YSPELKLM.js +8 -0
- package/dist/chunk-ZQOM25KE.js +31 -0
- package/dist/chunk-ZUSETSI2.js +4 -0
- package/dist/chunk-ZYR6KZ3U.js +4 -0
- package/dist/clean-XPY5QAR2.js +8 -0
- package/dist/close_out-3G6LG5CE.js +8 -0
- package/dist/code-LB6A5M22.js +4 -0
- package/dist/config-NTIS2QLB.js +4 -0
- package/dist/connect-MNBVLTKZ.js +11 -0
- package/dist/daemon-3A47MBS2.js +4 -0
- package/dist/dashboard.js +20 -1898
- package/dist/detect-QMRHHFXH.js +13 -0
- package/dist/down-WKZSBYCI.js +17 -0
- package/dist/fixture-OLAE2KUV.js +14 -0
- package/dist/form-cli.js +3 -1507
- package/dist/hooks-ULLFLRUW.js +4 -0
- package/dist/hooks_gen-GKZVUPMO.js +4 -0
- package/dist/infra-A3C7FDNR.js +4 -0
- package/dist/init_workspace-TU76APJQ.js +4 -0
- package/dist/intercept-SOU6VA2K.js +7 -0
- package/dist/issue-XC7UEFIP.js +5 -0
- package/dist/lib/agent_state.js +1 -6
- package/dist/lib/gate.js +1 -2
- package/dist/lib/pr_guard.js +1 -1
- package/dist/list_workspaces-4FBP4CIS.js +7 -0
- package/dist/logs-GFJHTAOE.js +6 -0
- package/dist/main.js +42 -1852
- package/dist/mcp-proxy.js +12 -229
- package/dist/mcp.js +30 -1930
- package/dist/migrate-PB3PLOPH.js +8 -0
- package/dist/notes-BT4GAPYP.js +4 -0
- package/dist/open-ZM2OEFSN.js +6 -0
- package/dist/optimize-2IZXOEM6.js +11 -0
- package/dist/pause-UPYUR576.js +4 -0
- package/dist/pr-UT66UXR7.js +5 -0
- package/dist/proxy_reload-PXGCYXTX.js +6 -0
- package/dist/registry-BYQSBFX2.js +4 -0
- package/dist/remove-E3D5UE6C.js +7 -0
- package/dist/remove_workspace-HH5DY2PQ.js +8 -0
- package/dist/restart-WACF24Q5.js +8 -0
- package/dist/resume-WUHWDN5P.js +8 -0
- package/dist/safari-LADKSYXB.js +8 -0
- package/dist/sandbox-KCOIOWUC.js +4 -0
- package/dist/services-HGBYH2BF.js +6 -0
- package/dist/setup-IHMHWCWE.js +5 -0
- package/dist/skills-AGQ43EYJ.js +4 -0
- package/dist/slots-FUNR4X2E.js +4 -0
- package/dist/standards-R42OMGAN.js +4 -0
- package/dist/start_args-5VUTUZJK.js +4 -0
- package/dist/starting_prompt-VSXMHUES.js +4 -0
- package/dist/stats-SBCCNRRR.js +4 -0
- package/dist/status-YRBJF4LX.js +13 -0
- package/dist/stop-UOWK5NZB.js +9 -0
- package/dist/telepresence-KGO67FZ6.js +4 -0
- package/dist/test-IGAOSBIZ.js +6 -0
- package/dist/tokens-2IJEBSSK.js +6 -0
- package/dist/up-LO6N5V5M.js +11 -0
- package/dist/v4-IBDIQBRV.js +4 -0
- package/dist/wait_load-LVY5WRZP.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/workspace-LDQAAZM6.js +4 -0
- package/package.json +3 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{h as H}from"./chunk-ZQOM25KE.js";import{r as W}from"./chunk-C4J3VWL3.js";import{C as B,G as A,a as ne,l as K,w as U,y as G,z as L}from"./chunk-OC7PYYEG.js";import{a as N}from"./chunk-RO5NEK3B.js";import{a as c,e as se,f as R}from"./chunk-K6GRVJQO.js";R();var w=se(ne(),1);import*as l from"node:fs";import*as V from"node:os";import*as _ from"node:path";R();import*as $ from"node:fs";import*as X from"node:path";var ue=`# Port Allocation Scheme
|
|
4
|
+
# Each feature slot (1-12) gets a dedicated port range.
|
|
5
|
+
#
|
|
6
|
+
# k8s port-forward listen-ports (the 9000-range) are NOT defined here \u2014 they
|
|
7
|
+
# live per-service in services.yaml as \`k8s_forward_port:\` (single source of
|
|
8
|
+
# truth for the forward table).
|
|
9
|
+
|
|
10
|
+
feature_slots:
|
|
11
|
+
count: 12
|
|
12
|
+
base_port: 11100
|
|
13
|
+
ports_per_slot: 20
|
|
14
|
+
# Slot 1: 11100-11119
|
|
15
|
+
# Slot 2: 11200-11219
|
|
16
|
+
# ...
|
|
17
|
+
# Slot 12: 12200-12219
|
|
18
|
+
`,me=`# Per-million-token USD rates for estimating Claude Code usage cost.
|
|
19
|
+
# Add or reprice models here \u2014 no code change needed. Unknown models show
|
|
20
|
+
# token counts with no dollar estimate. Rates are approximate; update when
|
|
21
|
+
# published pricing changes.
|
|
22
|
+
models:
|
|
23
|
+
claude-opus-4-8: { input: 15, output: 75, cacheWrite: 18.75, cacheRead: 1.50 }
|
|
24
|
+
claude-sonnet-5: { input: 3, output: 15, cacheWrite: 3.75, cacheRead: 0.30 }
|
|
25
|
+
claude-haiku-4-5: { input: 1, output: 5, cacheWrite: 1.25, cacheRead: 0.10 }
|
|
26
|
+
`;function he(){return["# Machine-global secrets \u2014 real values, never committed.","#","# A service declares the keys it needs via `secrets:` in its services.yaml","# entry; `werkmeister feature up` writes them, as plain KEY, into that service's own","# <workspace>/.env.<service>, and fails fast when one is missing or empty.","#","# Namespace a key by service as <SERVICE>__KEY (service name uppercased,","# - -> _), e.g. MOBILE__EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=... It wins over a","# plain KEY=... line, which stays a shared fallback. Namespaced keys a","# service doesn't declare (e.g. test logins for agents) reach no container.",""].join(`
|
|
27
|
+
`)+`
|
|
28
|
+
`}c(he,"renderSecretsEnv");function J(e){return`# Machine-local registry overrides \u2014 hand-edit freely.
|
|
29
|
+
#
|
|
30
|
+
# \`werkmeister registry sync\` (and \`werkmeister machine setup\`) regenerate ~/.werkmeister/services.yaml
|
|
31
|
+
# from every <repo>/.werkmeister/services.yaml under paths.repos_root, then merge
|
|
32
|
+
# this file over the result: maps merge, scalars and lists replace. A key here
|
|
33
|
+
# beats every fragment, e.g.
|
|
34
|
+
#
|
|
35
|
+
# services:
|
|
36
|
+
# frontend:
|
|
37
|
+
# memory_limit: 2G
|
|
38
|
+
#
|
|
39
|
+
# Leave a repo's fragment out of the registry on this machine (its services,
|
|
40
|
+
# setup_services and infrastructure); delete the name to re-enable:
|
|
41
|
+
#
|
|
42
|
+
# disabled_fragments: [demo-services]
|
|
43
|
+
#
|
|
44
|
+
# Kube context for a dev cluster \u2014 consumed by \`werkmeister infra intercept\`.
|
|
45
|
+
k8s_context: ${e.trim()||"orbstack"}
|
|
46
|
+
`}c(J,"renderServicesLocalYaml");function z(e,n,r=420){return $.existsSync(e)?{path:e,status:"present"}:($.mkdirSync(X.dirname(e),{recursive:!0}),$.writeFileSync(e,n,{mode:r}),$.chmodSync(e,r),{path:e,status:"created"})}c(z,"seedFile");var C={archetypes:{"node-web":{standards:["ui","config","testing"],mcp_servers:["context7"],test:"npm test"},"node-service":{standards:["service","testing"],test:"npm test"},"node-tool":{standards:["engineering","testing"],validate:"Library: run the unit/smoke tests. No URL, cookie, or Caddy step applies."},"mcp-client":{standards:["engineering","testing"],validate:"Build, then npm run test:integration (Extension Development Host via @vscode/test-cli). Walk the open items in MANUAL-CHECKLIST.md for anything visual."}},caches:{"pnpm-store":{path:"/pnpm-store",env:{npm_config_store_dir:"/pnpm-store"},detect:["pnpm-lock.yaml"]},turbo:{path:"/turbo-cache",env:{TURBO_CACHE_DIR:"/turbo-cache",TURBO_CACHE_MAX_AGE:"14d"},detect:["turbo.json"],max_age:"14d"}},mcp_servers:{context7:{type:"stdio",command:"npx",args:["-y","@upstash/context7-mcp"],env:{CONTEXT7_API_KEY:"${CONTEXT7_API_KEY:-}"}},werkmeister:{type:"http",url:"http://host.docker.internal:${WERKMEISTER_MCP_PORT:-3002}/mcp",headers:{Authorization:"Bearer ${WERKMEISTER_MCP_TOKEN}"}}}};var D=_.join(N,"services.yaml");function M(e){let n=_.join(e,D);return l.existsSync(n)?n:null}c(M,"fragmentPath");var ie="# GENERATED by `werkmeister registry sync` \u2014 do not edit.",F=c(e=>e.startsWith("# GENERATED by "),"isGenerated"),x=["services","setup_services","infrastructure","caches"],ae=["archetypes","caches","mcp_servers","k8s_context","services","infrastructure","setup_services","repos"],y=class extends Error{static{c(this,"RegistryError")}};function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}c(m,"isDict");function q(e){if(!l.existsSync(e))return[];let n=[];for(let r of l.readdirSync(e).sort()){let s=M(_.join(e,r));s&&(l.statSync(_.join(e,r,".git"),{throwIfNoEntry:!1})?.isFile()||n.push(P(r,s)))}return n}c(q,"discoverFragments");function P(e,n){let r;try{r=(0,w.parse)(l.readFileSync(n,"utf8"))}catch(s){throw new y(`${n}: ${s instanceof Error?s.message:String(s)}`)}return{repo:e,path:n,doc:m(r)?r:{}}}c(P,"readFragment");var ce=/\{\{\s*(home|repos_root|workspaces_root|werkmeister_home|local_domain)\s*\}\}/g;function I(e,n){if(typeof e=="string")return e.replace(ce,(r,s)=>n[s]);if(Array.isArray(e))return e.map(r=>I(r,n));if(m(e)){let r={};for(let[s,o]of Object.entries(e))r[s]=I(o,n);return r}return e}c(I,"expandPlaceholders");function Q(e,n){let r={...e};for(let[s,o]of Object.entries(n))r[s]=m(o)&&m(r[s])?Q(r[s],o):o;return r}c(Q,"deepMerge");function j(e,n,r,s){let o=e.get(n);if(o!==void 0&&o!==r)throw new y(`${s} is defined by both ${o} and ${r}`);e.set(n,r)}c(j,"claim");function Z(e,n){let r={archetypes:structuredClone(n.defaults.archetypes??{}),caches:structuredClone(n.defaults.caches??{}),mcp_servers:structuredClone(n.defaults.mcp_servers??{}),services:{},infrastructure:{},setup_services:{},repos:{}},s=new Map;for(let o of Object.keys(r.caches))s.set(`caches/${o}`,"werkmeister");for(let o of e){let i=I(o.doc,n.paths);for(let t of Object.keys(i))if(!(t.startsWith("x-")||t==="repo"||x.includes(t)))throw new y(`${o.path}: unexpected top-level key \`${t}\` \u2014 a fragment may only contain ${x.join(", ")}, repo (and x-* anchor blocks)`);if(i.repo!==void 0){if(!m(i.repo))throw new y(`${o.path}: \`repo:\` must be a map`);Object.assign(r.repos[o.repo]??={services:[],path_mappings:{}},i.repo)}for(let t of x){let d=i[t]??{};if(!m(d))throw new y(`${o.path}: \`${t}:\` must be a map`);for(let[f,a]of Object.entries(d)){if(!m(a))throw new y(`${o.path}: \`${t}.${f}\` must be a map`);j(s,`${t}/${f}`,o.repo,`${t}.${f}`);let p=a;if(t==="services"||t==="setup_services"){if(a.repo!==void 0&&a.repo!==o.repo)throw new y(`${o.path}: ${t}.${f} says repo: ${a.repo} but lives in ${o.repo}`);p={repo:o.repo,...a}}if(t==="services"){p.port_offset!==void 0&&j(s,`port_offset/${p.port_offset}`,`${o.repo}:${f}`,`port_offset ${p.port_offset}`);let k=r.repos[o.repo]??={services:[],path_mappings:{}};k.services.push(f);let g=String(p.path??".").replace(/^\/+|\/+$/g,"");g!==""&&g!=="."&&(k.path_mappings[g]=f)}(t==="services"||t==="infrastructure")&&p.k8s_forward_port!==void 0&&j(s,`k8s_forward_port/${p.k8s_forward_port}`,`${o.repo}:${f}`,`k8s_forward_port ${p.k8s_forward_port}`),r[t][f]=p}}}return Q(r,n.local)}c(Z,"mergeRegistry");var v="disabled_fragments";function ee(e,n,r){let{[v]:s,...o}=n,i=s??[];if(!Array.isArray(i)||!i.every(a=>typeof a=="string"))throw new y(`${r}: ${v} must be a list of repo names`);let t=new Set(i),d=e.filter(a=>t.has(a.repo)),f=structuredClone(o);for(let a of["services","setup_services","infrastructure"]){let p=f[a];if(m(p))for(let[k,g]of Object.entries(p))(d.some(E=>m(E.doc[a])&&k in E.doc[a])||m(g)&&t.has(g.repo))&&delete p[k]}if(m(f.repos))for(let a of t)delete f.repos[a];return{fragments:e.filter(a=>!t.has(a.repo)),skipped:d,unknown:i.filter(a=>!e.some(p=>p.repo===a)),local:f}}c(ee,"applyDisabled");function fe(e,n,r,s=[]){let o={};for(let t of ae)t in e&&(o[t]=e[t]);for(let t of Object.keys(e))t in o||(o[t]=e[t]);return[ie,"# Edit a repo's .werkmeister/services.yaml fragment, or the machine overrides file, then","# run `werkmeister registry sync` (or `werkmeister machine setup`). Regenerated from:",...n.map(t=>`# Source: ${t}`),...s.map(t=>`# Disabled: ${t}`),`# Machine overrides: ${r}`,""].join(`
|
|
47
|
+
`)+(0,w.stringify)(o,{lineWidth:0})}c(fe,"renderRegistry");function pe(e){if(!l.existsSync(e))return null;let n=l.readFileSync(e,"utf8");if(F(n))return null;try{let r=(0,w.parse)(n),s=m(r)?r.k8s_context:void 0;return typeof s=="string"&&s.trim()?s.trim():null}catch{return null}}c(pe,"inheritedK8sContext");function le(e,n){let r;try{r=(0,w.parse)(e)}catch{return[]}if(!m(r))return[];let s=[];for(let o of x){let i=r[o];if(m(i))for(let t of Object.keys(i))t in(n[o]??{})||s.push(`${o}.${t}`)}return s}c(le,"orphanedEntries");function Ee(e,n){let r=c(t=>{try{let d=t===null?null:(0,w.parse)(t);return m(d)?d:{}}catch{return{}}},"sections"),s=r(e),o=r(n),i={added:[],removed:[],changed:[]};for(let t of x){let d=m(s[t])?s[t]:{},f=m(o[t])?o[t]:{};for(let a of new Set([...Object.keys(d),...Object.keys(f)])){let p=`${t}.${a}`;a in d?a in f?JSON.stringify(d[a])!==JSON.stringify(f[a])&&i.changed.push(p):i.removed.push(p):i.added.push(p)}}for(let t of Object.values(i))t.sort();return i}c(Ee,"registryChanges");function te(){return{home:V.homedir(),repos_root:A(),workspaces_root:B(),werkmeister_home:U(),local_domain:W().local_domain}}c(te,"placeholderPaths");function re(e){if(!l.existsSync(e))return{};let n;try{n=(0,w.parse)(l.readFileSync(e,"utf8"))}catch(r){throw new y(`${e}: ${r instanceof Error?r.message:String(r)}`)}if(n==null)return{};if(!m(n))throw new y(`${e}: must be a map of registry keys`);return n}c(re,"readLocalOverlay");function de(e,n,r=A()){let s=M(n);if(!s)return null;let o=q(r).filter(a=>a.repo!==e);o.push(P(e,s));let i=L(),t=re(i),d=t[v];Array.isArray(d)&&(t[v]=d.filter(a=>a!==e));let f=ee(o,t,i);return Z(f.fragments,{defaults:C,local:f.local,paths:te()})}c(de,"branchRegistry");function Se(e,n){let r={...e};for(let s of H(n)){let o=_.basename(s),i;try{i=de(o,s)}catch(t){K(`${o}: branch fragment ignored: ${t instanceof Error?t.message:String(t)}`);continue}for(let[t,d]of Object.entries(i?.services??{}))d.repo===o&&(r[t]=d)}return r}c(Se,"workspaceServices");function xe(e={}){let n="config services.yaml",r=e.reposRoot??A(),s=e.target??G(),o=L();if(e.generatedOnly&&l.existsSync(s)&&!F(l.readFileSync(s,"utf8")))return[{label:n,ok:!1,detail:`${s} is hand-written \u2014 left as is; \`werkmeister registry sync\` converts it (with a backup)`}];let i,t,d,f="";try{if(!e.checkOnly&&!e.target&&!l.existsSync(o)){let h=pe(s)??"orbstack";z(o,J(h)),f=`; seeded ${o} (k8s_context: ${h} \u2014 edit there)`}let u=q(r);if(u.length===0)return[{label:n,ok:!1,detail:`no ${D} found under ${r} \u2014 clone your team's repos there and re-run \`werkmeister machine setup\` (or answer yes to the demo apps)`}];let S=re(o);if(e.from){let h=M(e.from);if(!h)return[{label:n,ok:!1,detail:`no ${D} in ${e.from}`}];let O=_.basename(e.from);u=[...u.filter(T=>T.repo!==O),P(O,h)];let Y=S[v];Array.isArray(Y)&&(S[v]=Y.filter(T=>T!==O))}i=ee(u,S,o),t=Z(i.fragments,{defaults:C,local:i.local,paths:te()}),d=fe(t,i.fragments.map(h=>h.path),o,i.skipped.map(h=>h.path))}catch(u){return[{label:n,ok:!1,detail:u instanceof Error?u.message:String(u)}]}let a=[...i.skipped.map(u=>({label:`fragment ${u.repo}`,ok:!0,detail:`disabled in ${o} \u2014 skipped`})),...i.unknown.map(u=>({label:`fragment ${u}`,ok:!0,detail:`listed in ${v} in ${o}, but no fragment under ${r}`}))],p=c(u=>[u,...a],"report"),k=i.fragments.length,g=`${k} fragment${k===1?"":"s"}`,b=l.existsSync(s)?l.readFileSync(s,"utf8"):null;if(b===d)return p({label:n,ok:!0,detail:`up to date (${g}) at ${s}${f}`});if(e.checkOnly)return p({label:n,ok:!1,detail:b===null?`missing \u2014 would generate ${s} from ${g}`:`drift \u2014 would regenerate ${s} from ${g}`});let E="";if(b!==null&&!F(b)){let u=Math.floor((e.now??Date.now)()/1e3),S=`${s}.bak-${u}`;l.copyFileSync(s,S),E=`; hand-written registry backed up to ${S}`;let h=le(b,t);h.length&&(E+=`; not in any fragment: ${h.join(", ")}`)}try{l.mkdirSync(_.dirname(s),{recursive:!0}),l.writeFileSync(s,d)}catch(u){return p({label:n,ok:!1,detail:`could not write ${s}: ${u}`})}return p({label:n,ok:!0,detail:`generated ${s} from ${g}${E}${f}`})}c(xe,"syncRegistry");export{ue as a,me as b,he as c,J as d,z as e,D as f,y as g,q as h,Z as i,pe as j,Ee as k,de as l,Se as m,xe as n};
|
|
48
|
+
//# sourceMappingURL=chunk-EOBOW6TP.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{i as _,j}from"./chunk-S62C4SVE.js";import{a as R}from"./chunk-ATYTAZNX.js";import{F as O}from"./chunk-XMARLDYZ.js";import{l as y,m as I,n as N}from"./chunk-H3J3PJGY.js";import{b as h}from"./chunk-WITTY5DQ.js";import{M as x,R as A,S as F,j as g,k as v,l as d,n as p,o as T}from"./chunk-OC7PYYEG.js";import{b as S}from"./chunk-RO5NEK3B.js";import{a,f as $}from"./chunk-K6GRVJQO.js";$();import*as n from"node:fs";import{createRequire as C}from"node:module";import*as c from"node:path";var m="1.63.0",P=600,D=["playwright.config.ts","playwright.config.js","playwright.config.mjs"];function U(t){let e=[t];try{for(let s of n.readdirSync(t,{withFileTypes:!0}))s.isDirectory()&&n.existsSync(c.join(t,s.name,".git"))&&e.push(c.join(t,s.name))}catch{}return e}a(U,"playwrightSearchDirs");function k(t){for(let e of t)if(n.existsSync(e)&&n.statSync(e).isDirectory()&&D.some(s=>n.existsSync(c.join(e,s))))return e;return null}a(k,"playwrightCwd");function M(t){let e=U(t).slice(1).map(f=>c.basename(f)),s="";try{s=/^SERVICES=(.*)$/m.exec(n.readFileSync(c.join(t,".env"),"utf8"))?.[1]??""}catch{}let l=s.split(",").map(f=>f.trim()).filter(Boolean),r=x(),i=R(r),u=j(_(e,A(),l),r,F(),new Set(Object.keys(i))).map(f=>` - ${f.service} \u2014 test: ${f.test??"\u2014"} \u2014 validate: ${f.validate}`);return"No Playwright suite found for this workspace (no playwright.config.{ts,js,mjs} in the workspace root or a repo worktree), so nothing was run."+(u.length?`
|
|
4
|
+
Validate each service as follows:
|
|
5
|
+
${u.join(`
|
|
6
|
+
`)}`:"")}a(M,"noSuiteMessage");function b(t){try{let e=C(c.join(t,"package.json")).resolve("@playwright/test/package.json");return JSON.parse(n.readFileSync(e,"utf8")).version??null}catch{return null}}a(b,"installedPlaywrightVersion");async function Q({feature:t,workspace:e,extraArgs:s=[],signal:l}){let r=await O(t),i=k(U(e));if(i===null)return{status:1,cwd:i,slot:r,message:M(e)};r===null&&(d(`Feature '${t}' does not have an allocated slot`),d("Start it first with: werkmeister feature up "+t),d("Running tests anyway with feature header routing..."));let w={...process.env,WERKMEISTER_FEATURE:t,SANDBOX_FEATURE:t};r&&(w.WERKMEISTER_SLOT=String(r)),g(`Working directory: ${i}`);let u=b(i);u!==m&&d(`@playwright/test is ${u??"not installed"} here, but \`werkmeister machine setup\` installs Chromium for ${m} -- the browser may be missing. Fix with: npm install -D @playwright/test@${m}`),g(`WERKMEISTER_FEATURE=${t}`);let f=["npx","playwright","test",...s];g(`Running: ${f.join(" ")}`),p(`
|
|
7
|
+
`);let E=T();try{let o=await N(f,{env:w,cwd:i,timeout:P,signal:l,...E?{}:{capture:!0}});return E||(o.stdout&&p(o.stdout),o.stderr&&p(o.stderr,"stderr")),{status:o.status,cwd:i,slot:r}}catch(o){throw!E&&o instanceof y&&(o.stdout&&p(o.stdout),o.stderr&&p(o.stderr,"stderr")),o instanceof y&&o.code==="ENOENT"?new h(`npx not found. Ensure Node.js is installed and npx is on your PATH.
|
|
8
|
+
You may also need to run: npm install -D @playwright/test`,"NPX_MISSING"):o instanceof y&&o.code==="ETIMEDOUT"?new h("Playwright tests timed out after 10 minutes","TEST_TIMEOUT"):o}}a(Q,"runFeatureTests");function Z(t){if(!t){let s=Object.values(R()).find(l=>l.hostname)?.hostname;if(!s)throw new h("No service declares a feature_router: block in services.yaml. Add one, or pass --base-url.","NO_FEATURE_ROUTER");t=`https://${s}`}let e=new URL(t).hostname;return{baseUrl:t.replace(/\/+$/,""),cookieDomain:`.${e.split(".").slice(1).join(".")}`}}a(Z,"featureIngress");var L=a(t=>`import { defineConfig, devices } from '@playwright/test';
|
|
9
|
+
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
testDir: '.',
|
|
12
|
+
fullyParallel: false,
|
|
13
|
+
retries: 0,
|
|
14
|
+
reporter: 'line',
|
|
15
|
+
use: {
|
|
16
|
+
// Filled by \`werkmeister feature test --scaffold\` from the configured feature ingress.
|
|
17
|
+
baseURL: '${t}',
|
|
18
|
+
ignoreHTTPSErrors: true,
|
|
19
|
+
extraHTTPHeaders: {
|
|
20
|
+
'X-Feature': process.env.WERKMEISTER_FEATURE || '',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
projects: [
|
|
24
|
+
{
|
|
25
|
+
name: 'chromium',
|
|
26
|
+
use: { ...devices['Desktop Chrome'] },
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
`,"playwrightConfig"),W=a((t,{baseUrl:e,cookieDomain:s})=>`import { test, expect } from '@playwright/test';
|
|
31
|
+
|
|
32
|
+
const FEATURE = process.env.WERKMEISTER_FEATURE!;
|
|
33
|
+
|
|
34
|
+
// Filled by \`werkmeister feature test --scaffold\` from the configured feature ingress.
|
|
35
|
+
const BASE_URL = '${e}';
|
|
36
|
+
|
|
37
|
+
test('feature: ${t}', async ({ page, context }) => {
|
|
38
|
+
// Set the feature cookie so routing works at the browser level
|
|
39
|
+
await context.addCookies([{
|
|
40
|
+
name: 'X-Feature',
|
|
41
|
+
value: FEATURE,
|
|
42
|
+
domain: '${s}',
|
|
43
|
+
path: '/',
|
|
44
|
+
maxAge: 2592000,
|
|
45
|
+
}]);
|
|
46
|
+
|
|
47
|
+
await page.goto('/');
|
|
48
|
+
|
|
49
|
+
// TODO: Add assertions specific to your feature
|
|
50
|
+
await expect(page).toHaveURL(\`\${BASE_URL}/\`);
|
|
51
|
+
|
|
52
|
+
// Pause here \u2014 Playwright Inspector opens so you can interact with the browser.
|
|
53
|
+
// Close the inspector or press Resume when done.
|
|
54
|
+
await page.pause();
|
|
55
|
+
});
|
|
56
|
+
`,"featureSpec");function tt(t,e,s){if(c.basename(t)!==t)throw new h(`Invalid feature name: ${t}`,"BAD_FEATURE_NAME");let l=[["playwright.config.ts",L(s.baseUrl)],[`${t}.spec.ts`,W(t,s)]],r=[];for(let[i,w]of l){let u=c.join(e,i);n.existsSync(u)||(n.writeFileSync(u,w),r.push(u))}return r}a(tt,"scaffoldFeatureTests");function et(t){let e=b(t);if(e===m){g(`@playwright/test ${e} present`);return}if(e){d(`workspace pins @playwright/test ${e}, but \`werkmeister machine setup\` installs Chromium for ${m} -- if launch fails, run: npx playwright@${e} install chromium`);return}let s=["npm","install","--save-dev",`@playwright/test@${m}`];if(!n.existsSync(S(t)))throw new h(`${t} is not a workspace (no ${c.basename(S(t))}/) -- pass --workspace, or install manually there: ${s.join(" ")}`,"NOT_A_WORKSPACE");let l=T(),r;try{r=I(s,{cwd:t,...l?{}:{capture:!0}})}catch(i){r={status:127,stderr:i instanceof Error?i.message:String(i)}}if(r.status!==0)throw!l&&r.stderr&&p(r.stderr,"stderr"),new h(`\`${s.join(" ")}\` failed in ${t}`,"PLAYWRIGHT_INSTALL");v(`installed @playwright/test ${m}`)}a(et,"ensurePlaywright");export{m as a,Q as b,Z as c,tt as d,et as e};
|
|
57
|
+
//# sourceMappingURL=chunk-FUA5NLXY.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{y as Y}from"./chunk-XMARLDYZ.js";import{d as N,e as L}from"./chunk-U4RIK7SI.js";import{l as R,m as g}from"./chunk-H3J3PJGY.js";import{b as J}from"./chunk-WITTY5DQ.js";import{E as K,J as M,M as h,P as U,Y as B,Z as f,a as ne,j as l,k as y,l as A,m as p,t as W,x}from"./chunk-OC7PYYEG.js";import{a as n,e as oe,f as u}from"./chunk-K6GRVJQO.js";u();var q=oe(ne(),1);import*as $ from"node:fs";import*as S from"node:path";var se=/@sha256:[0-9a-f]{64}$/;function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}n(m,"isDict");function ie(e,r){let t=(e??x()).infra,o=m(t)?t.baseline:void 0;if(!m(o))return[];let i=r??h();return Object.entries(o).map(([s,a])=>{let d=`config.yaml infra.baseline.${s}`,H=i[s];if(!m(H))throw new Error(`${d}: no such service in services.yaml`);let b=m(a)?a.image:void 0;if(typeof b!="string"||!se.test(b))throw new Error(`${d}.image must be pinned as <image>@sha256:<digest>, got ${JSON.stringify(b)}. Resolve one with: docker pull <image>:<tag> && docker inspect --format='{{index .RepoDigests 0}}' <image>:<tag>`);let _=m(a)?a.environment??{}:{};if(!m(_)||Object.values(_).some(v=>m(v)||Array.isArray(v)))throw new Error(`${d}.environment must be a map of plain values`);return{service:s,image:b,port:Number(H.internal_port??3e3),environment:Object.fromEntries(Object.entries(_).map(([v,te])=>[v,String(te)]))}})}n(ie,"baselineSpecs");function I(){return S.join(f(),"compose","baseline.override.yml")}n(I,"baselineOverridePath");var ae=["# AUTO-GENERATED by `werkmeister infra connect` from ~/.werkmeister/config.yaml infra.baseline \u2014 do not edit.","# Merged over infra/compose/shared-infra.yml by every `docker compose` call the CLI makes."];function ce(e){let r=Object.fromEntries(e.map(t=>{let o=`baseline-${t.service}`;return[o,{image:t.image,container_name:`w9r-${o}`,restart:"unless-stopped",...Object.keys(t.environment).length>0?{environment:t.environment}:{},networks:{"werkmeister-shared":{aliases:[o]}}}]}));return[...ae,(0,q.stringify)({services:r},{aliasDuplicateObjects:!1})].join(`
|
|
4
|
+
`)}n(ce,"renderBaselineOverride");function Fe(e=!1){let r=ie(),t=I();$.mkdirSync(S.dirname(t),{recursive:!0}),$.writeFileSync(t,ce(r)),e||l(`Generated ${t}`)}n(Fe,"generateBaselineOverride");u();import*as w from"node:fs";import*as k from"node:path";function E(e,r){return K(e??h(),r??U())}n(E,"forwardSpecs");function fe(e,r){return E(e,r).map(t=>`${t.name}|${t.listen}|${t.remote}|${t.ns}|${t.prefix}|${t.health}`)}n(fe,"buildForwardRows");function z(){return k.join(f(),"k8s-port-forward","forwards")}n(z,"forwardsFilePath");function P(){return k.join(f(),"compose","k8s-forwards.override.yml")}n(P,"overrideFilePath");function ue(e){e=e??z(),w.mkdirSync(k.dirname(e),{recursive:!0});let r=["# AUTO-GENERATED by `werkmeister infra connect` from ~/.werkmeister/services.yaml \u2014 do not edit.","# Format: name|listen_port|remote_port|namespace|pod_prefix|health_path",...fe(),""].join(`
|
|
5
|
+
`);return w.writeFileSync(e,r),e}n(ue,"generateForwardsFile");var V=["# AUTO-GENERATED by `werkmeister infra connect` from ~/.werkmeister/services.yaml \u2014 do not edit.","# Merged over infra/compose/shared-infra.yml by every `docker compose` call the CLI makes."];function le(e){return e.length===0?[...V,"services:"," k8s-forwards: {}",""].join(`
|
|
6
|
+
`):[...V,"services:"," k8s-forwards:"," ports:",...e.map(r=>` - "${r.listen}:${r.listen}" # ${r.name}`)," networks:"," werkmeister-shared:"," aliases:",...e.map(r=>` - k8s-${r.name}`),""].join(`
|
|
7
|
+
`)}n(le,"renderK8sForwardsOverride");function X(e=!1){ue();let r=P();w.mkdirSync(k.dirname(r),{recursive:!0}),w.writeFileSync(r,le(E())),e||l(`Generated ${z()} and ${r}`)}n(X,"generateK8sForwards");u();import*as D from"node:fs";import*as F from"node:path";var j="w9r-infra",He="sandbox-infra",C="w9r-k8s-forwards";function me(){let r=x().infra?.profiles;return Array.isArray(r)?r.filter(t=>typeof t=="string"&&t!==""):[]}n(me,"infraProfiles");function Q(){let e=P();D.existsSync(e)||X(!0);let r=I();return{argv:["docker","compose","-f",F.join(B(),"compose","shared-infra.yml"),"-f",e,...D.existsSync(r)?["-f",r]:[],"-p",j,...me().flatMap(t=>["--profile",t])],env:{...process.env,WERKMEISTER_STATE_DIR:f()},cwd:F.dirname(f())}}n(Q,"composeInvocation");u();import*as c from"node:fs";import*as Z from"node:http";import*as G from"node:net";import*as O from"node:path";import{setTimeout as de}from"node:timers/promises";async function pe(){return{"k8s-forwards":(await N(j,"k8s-forwards",{all:!1})??[]).some(r=>r.health==="healthy"||r.state==="running"&&!r.health)}}n(pe,"checkPortForwardHealth");function he(e,r){if(!e)return!0;let t=new Map;for(let o of e){let i=Y(o.labels,"feature");if(!i)continue;let s=t.get(i)??{local:[],running:!1};s.local.push(o.service),s.running||=o.state==="running",t.set(i,s)}return[...t.values()].some(o=>o.running&&M(o.local,r))}n(he,"clusterNeeded");async function we(e){let r;try{r=h()}catch{return!0}return he(e===void 0?await N():e,r)}n(we,"forwarderNeeded");function ke(e){return c.existsSync(e)&&c.statSync(e).isDirectory()}n(ke,"isDir");function ye(e){return/server:\s*https:\/\/(127\.0\.0\.1|localhost)\b/.test(e)?e.replace(/(server:\s*https:\/\/)(127\.0\.0\.1|localhost)\b/g,"$1host.docker.internal").replace(/^(\s*)certificate-authority-data:.*$/gm,"$1insecure-skip-tls-verify: true"):e}n(ye,"shimLocalApiServer");function ge(){let e=O.join(f(),"k8s-port-forward","kubeconfig");ke(e)&&c.rmSync(e,{recursive:!0,force:!0}),c.mkdirSync(O.dirname(e),{recursive:!0}),l("Refreshing k8s-port-forward/kubeconfig from current context...");try{let r=g(["kubectl","config","view","--raw","--minify","--flatten"],{capture:!0,timeout:30});if(r.status===0){c.writeFileSync(e,ye(r.stdout));let t=g(["kubectl","--kubeconfig",e,"config","current-context"],{capture:!0,timeout:15}),o=t.status===0?t.stdout.trim():"?";y(`Kubeconfig pinned to context: ${o}`)}else p(`kubectl config view failed: ${r.stderr.trim()}`)}catch(r){if(r instanceof R&&(r.code==="ENOENT"||r.code==="ETIMEDOUT"))p(`Could not generate kubeconfig: ${r.message}`);else throw r}return c.existsSync(e)&&c.statSync(e).isFile()}n(ge,"refreshKubeconfig");function Ee(){try{return g(["kubectl","--request-timeout=3s","get","--raw","/readyz"],{capture:!0,timeout:20}).status===0}catch(e){if(e instanceof R)return!1;throw e}}n(Ee,"clusterReachable");async function er(){if(W())return l("k8s port-forwards skipped (WERKMEISTER_FIXTURE)"),"healthy";if((await pe())["k8s-forwards"]??!1)return y("k8s port-forwards container is healthy"),"healthy";if(A("k8s port-forwards container is unhealthy \u2014 restarting..."),!ge())return p("Not restarting k8s-forwards without a kubeconfig file to mount"),"failed";if(!Ee())return A("No reachable k8s cluster \u2014 skipping port-forwards; services not run locally are unavailable"),"failed";let{argv:r,env:t,cwd:o}=Q();try{let i=g([...r,"up","-d","--force-recreate","k8s-forwards"],{capture:!0,timeout:60,env:t,cwd:o});return i.status!==0?(p(`Failed to restart k8s-forwards: ${i.stderr.trim()}`),"failed"):(y("k8s port-forwards container restarted"),"restarted")}catch(i){if(i instanceof R)return p(`Failed to restart k8s-forwards: ${i.message}`),"failed";throw i}}n(er,"ensurePortForwardsHealthy");async function rr(e=3e4,r=500){let t=E();if(!t.length)return;l("Waiting for port-forwards to reconnect...");let o=Date.now()+e;for(;;){if(t=(await Promise.all(t.map(async s=>({spec:s,ok:(await re(s.listen,s.health)).ok})))).filter(s=>!s.ok).map(s=>s.spec),!t.length){y("k8s port-forwards are carrying traffic");return}if(Date.now()>=o)throw new J(`k8s port-forwards did not come back within ${Math.round(e/1e3)}s: ${t.map(s=>`${s.name}:${s.listen}`).join(", ")}
|
|
8
|
+
Check \`docker logs ${C}\` and your kubeconfig.`,"FORWARDS_NEVER_READY");await de(r)}}n(rr,"waitForForwards");function be(e,r,t=3500){return new Promise(o=>{let i=Z.get({host:"127.0.0.1",port:e,path:r,timeout:t},s=>{s.resume();let a=s.statusCode??0;o({ok:a<500,detail:`HTTP ${a}`})});i.on("timeout",()=>{i.destroy(),o({ok:!1,detail:"timeout"})}),i.on("error",s=>o({ok:!1,detail:s.code??s.message}))})}n(be,"checkHttpHealth");var ee={redis:{send:Buffer.from(`PING\r
|
|
9
|
+
`),ok:n(e=>e.toString("latin1").startsWith("+PONG"),"ok")},postgres:{send:Buffer.from([0,0,0,8,4,210,22,47]),ok:n(e=>e[0]===83||e[0]===78,"ok")}};function ve(e,r,t=3500){return new Promise(o=>{let i=ee[r],s=G.connect({host:"127.0.0.1",port:e,timeout:t});s.on("connect",()=>s.write(i.send)),s.once("data",a=>{s.destroy();let d=i.ok(a);o({ok:d,detail:d?`${r} ok`:`${r} bad reply`})}),s.on("timeout",()=>{s.destroy(),o({ok:!1,detail:"timeout (connected, no reply)"})}),s.on("error",a=>o({ok:!1,detail:a.code??a.message})),s.on("close",()=>o({ok:!1,detail:"closed without reply"}))})}n(ve,"checkWireHealth");function xe(e,r=2500){return new Promise(t=>{let o=G.connect({host:"127.0.0.1",port:e,timeout:r});o.on("connect",()=>{o.destroy(),t({ok:!0,detail:"tcp open"})}),o.on("timeout",()=>{o.destroy(),t({ok:!1,detail:"timeout"})}),o.on("error",i=>t({ok:!1,detail:i.code??i.message}))})}n(xe,"checkTcpHealth");function re(e,r){return r.startsWith("/")?be(e,r):ee[r]?ve(e,r):r?Promise.resolve({ok:!1,detail:`unknown probe "${r}"`}):xe(e)}n(re,"checkForwardHealth");async function Re(e,r){return(await re(e,r)).ok?"alive":"dead"}n(Re,"classifyForward");async function tr(){let e=await L(C),r;try{r=E()}catch{return[]}let t=e?null:await we()?"container_down":"stopped",o=[];for(let i of r)o.push({name:i.name,listen_port:i.listen,remote_port:i.remote,health_path:i.health,status:t??await Re(i.listen,i.health)});return o}n(tr,"getPerServiceStatus");export{ie as a,Fe as b,X as c,j as d,He as e,C as f,me as g,Q as h,pe as i,we as j,ge as k,er as l,rr as m,re as n,tr as o};
|
|
10
|
+
//# sourceMappingURL=chunk-GMROWN6L.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{a as s}from"./chunk-DMZPGI56.js";import{a as e,e as o,f as i}from"./chunk-K6GRVJQO.js";i();var r=o(s(),1);function p(n){if(n)try{return r.default.parse(n).type}catch{let t=(n.split(";",1)[0]??"").trim().toLowerCase();return t===""||n.slice(t.length).includes(",")?void 0:t}}e(p,"mediaTypeEssence");function u(n){return n==="application/json"?!0:p(n)==="application/json"}e(u,"isJsonContentType");export{p as a,u as b};
|
|
4
|
+
//# sourceMappingURL=chunk-GMYAKGU2.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{a as r,f as c}from"./chunk-K6GRVJQO.js";c();import*as t from"node:fs";import*as s from"node:path";var i="compose.yml",p="docker-compose.yml";function f(o){try{return t.statSync(o).isFile()}catch{return!1}}r(f,"isFile");function m(o){for(let e of[i,p]){let n=s.join(o,e);if(f(n))return n}return null}r(m,"findWorkspaceCompose");function u(o){let e=s.join(o,p),n=s.join(o,i);f(e)&&!t.existsSync(n)&&t.renameSync(e,n)}r(u,"migrateWorkspaceCompose");export{i as a,p as b,m as c,u as d};
|
|
4
|
+
//# sourceMappingURL=chunk-GUFHPPBN.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{a as $,b as I}from"./chunk-WITTY5DQ.js";import{s as T,t as C}from"./chunk-OC7PYYEG.js";import{a as r,f as E}from"./chunk-K6GRVJQO.js";E();import{spawn as k}from"node:child_process";import{writeFileSync as B}from"node:fs";import g from"node:fs/promises";import h from"node:os";import m from"node:path";import{stripVTControlCharacters as A}from"node:util";function z(t){return A(t)}r(z,"stripAnsi");async function J(t){try{return await g.access(t,g.constants.X_OK),!0}catch{return!1}}r(J,"isExecutable");async function Y(t){try{return(await g.stat(t)).isFile()}catch{return!1}}r(Y,"isFile");var M=["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR"];function O(t=process.env){return Object.fromEntries(Object.entries(t).filter(([e])=>!M.includes(e)))}r(O,"gitEnv");function D(){let t=[m.join(h.homedir(),".local","bin"),m.join(h.homedir(),".cargo","bin"),"/opt/homebrew/bin","/usr/local/bin","/usr/bin","/bin"],e=process.env.PATH?process.env.PATH.split(m.delimiter):[],o=[...new Set([...t,...e])].join(m.delimiter);return O({...process.env,PATH:o})}r(D,"childEnv");var y=r(()=>T("GH_BIN")||(C()?w("gh"):"gh"),"ghBin"),K=r(()=>process.env.CLAUDE_BIN||w("claude"),"fixtureClaudeBin"),Z=r(()=>process.env.CODEX_BIN||w("codex"),"fixtureCodexBin"),P=r(()=>T("DOCKER_BIN")||"docker","dockerBin");function x(t){return t==="gh"?y():t==="docker"?P():C()?t==="claude"?K():t==="kubectl"?w("kubectl"):t:t}r(x,"toolBin");var _=new Map;function w(t){let e=_.get(t);if(e)return e;let o=m.join(h.tmpdir(),`werkmeister-fixture-${t}-${process.pid}`);return B(o,`#!/bin/sh
|
|
4
|
+
echo "${t} called under WERKMEISTER_FIXTURE: $*" >&2
|
|
5
|
+
exit 1
|
|
6
|
+
`,{mode:493}),_.set(t,o),o}r(w,"fixtureStub");function tt(t,e,o=h.homedir()){return new Promise((i,u)=>{let n=k(x(t),e,{cwd:o,env:D(),stdio:["ignore","pipe","pipe"]}),c="",a="",p=setTimeout(()=>{n.kill("SIGKILL"),u(new I("The `claude` CLI timed out after 120s.",$))},12e4);n.stdout.on("data",s=>c+=s.toString()),n.stderr.on("data",s=>a+=s.toString()),n.on("error",s=>{clearTimeout(p),u(s)}),n.on("close",s=>{clearTimeout(p),i({stdout:c,stderr:a,code:s})})})}r(tt,"runCapture");function et(t){return`'${t.replace(/'/g,"'\\''")}'`}r(et,"shellQuote");E();import{spawn as G,spawnSync as U}from"node:child_process";var v=r((t,e)=>t[0]==="git"?O(e):e,"spawnEnv"),S=r(t=>t*Number(process.env.WERKMEISTER_TIMEOUT_SCALE||1)*1e3,"timeoutMs"),l=class extends Error{static{r(this,"ProcError")}status;stdout;stderr;cmd;code;constructor(e,o,i,u="",n="",c){super(e),this.name="ProcError",this.cmd=o,this.status=i,this.stdout=u,this.stderr=n,this.code=c}};function ut(t,e={}){let o=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(o[0]="pipe");let i=U(x(t[0]),t.slice(1),{cwd:e.cwd,env:v(t,e.env),input:e.input,timeout:e.timeout!==void 0?S(e.timeout):void 0,encoding:"utf8",stdio:o}),u=i.stdout??"",n=i.stderr??"";if(i.error){let a=i.error.code;throw a==="ETIMEDOUT"?new l(`Command timed out after ${e.timeout}s: ${t.join(" ")}`,t,i.status??-1,u,n,"ETIMEDOUT"):a==="ENOENT"?new l(`Command not found: ${t[0]}`,t,-1,u,n,"ENOENT"):new l(`Command failed to start: ${t.join(" ")} (${i.error.message})`,t,i.status??-1,u,n,a)}let c=i.status??-1;if(e.check&&c!==0)throw new l(`Command failed with exit code ${c}: ${t.join(" ")}`,t,c,u,n);return{status:c,stdout:u,stderr:n}}r(ut,"run");function ct(t,e={}){return new Promise((o,i)=>{let u=e.capture?["pipe","pipe","pipe"]:["inherit","inherit","inherit"];e.input!==void 0&&(u[0]="pipe");let n=G(x(t[0]),t.slice(1),{cwd:e.cwd,env:v(t,e.env),stdio:u,signal:e.signal,timeout:e.timeout!==void 0?S(e.timeout):void 0}),c="",a="";n.stdout?.on("data",d=>c+=d.toString()),n.stderr?.on("data",d=>a+=d.toString()),e.input!==void 0&&n.stdin?.end(e.input);let p=!1,s=r((d,f,b)=>{p||(p=!0,i(new l(d,t,f,c,a,b)))},"fail"),N=r(d=>{p||(p=!0,o({status:d,stdout:c,stderr:a}))},"done"),R=r(()=>e.signal?.aborted===!0,"aborted");n.on("error",d=>{let f=d.code;if(R()){s(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(f==="ENOENT"){s(`Command not found: ${t[0]}`,-1,"ENOENT");return}s(`Command failed to start: ${t.join(" ")} (${d.message})`,-1,f)}),n.on("close",d=>{if(R()){s(`Command aborted: ${t.join(" ")}`,-1,"ABORT_ERR");return}if(n.killed&&e.timeout!==void 0){s(`Command timed out after ${e.timeout}s: ${t.join(" ")}`,-1,"ETIMEDOUT");return}let f=d??-1;if(e.check&&f!==0){s(`Command failed with exit code ${f}: ${t.join(" ")}`,f);return}N(f)})})}r(ct,"runAsync");export{z as a,J as b,Y as c,O as d,D as e,y as f,K as g,Z as h,x as i,tt as j,et as k,l,ut as m,ct as n};
|
|
7
|
+
//# sourceMappingURL=chunk-H3J3PJGY.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{a as o,c as v,f}from"./chunk-K6GRVJQO.js";var et=v(C=>{"use strict";f();Object.defineProperty(C,"__esModule",{value:!0});C.regexpCode=C.getEsmExportName=C.getProperty=C.safeStringify=C.stringify=C.strConcat=C.addCodeArg=C.str=C._=C.nil=C._Code=C.Name=C.IDENTIFIER=C._CodeOrName=void 0;var Xe=class{static{o(this,"_CodeOrName")}};C._CodeOrName=Xe;C.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Se=class extends Xe{static{o(this,"Name")}constructor(e){if(super(),!C.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};C.Name=Se;var ee=class extends Xe{static{o(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,s)=>`${r}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,s)=>(s instanceof Se&&(r[s.str]=(r[s.str]||0)+1),r),{})}};C._Code=ee;C.nil=new ee("");function nn(t,...e){let r=[t[0]],s=0;for(;s<e.length;)fr(r,e[s]),r.push(t[++s]);return new ee(r)}o(nn,"_");C._=nn;var dr=new ee("+");function on(t,...e){let r=[Ye(t[0])],s=0;for(;s<e.length;)r.push(dr),fr(r,e[s]),r.push(dr,Ye(t[++s]));return Gi(r),new ee(r)}o(on,"str");C.str=on;function fr(t,e){e instanceof ee?t.push(...e._items):e instanceof Se?t.push(e):t.push(Wi(e))}o(fr,"addCodeArg");C.addCodeArg=fr;function Gi(t){let e=1;for(;e<t.length-1;){if(t[e]===dr){let r=Ji(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}o(Gi,"optimize");function Ji(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Se||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Se))return`"${t}${e.slice(1)}`}o(Ji,"mergeExprItems");function Bi(t,e){return e.emptyStr()?t:t.emptyStr()?e:on`${t}${e}`}o(Bi,"strConcat");C.strConcat=Bi;function Wi(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ye(Array.isArray(t)?t.join(","):t)}o(Wi,"interpolate");function Qi(t){return new ee(Ye(t))}o(Qi,"stringify");C.stringify=Qi;function Ye(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Ye,"safeStringify");C.safeStringify=Ye;function Zi(t){return typeof t=="string"&&C.IDENTIFIER.test(t)?new ee(`.${t}`):nn`[${t}]`}o(Zi,"getProperty");C.getProperty=Zi;function Xi(t){if(typeof t=="string"&&C.IDENTIFIER.test(t))return new ee(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}o(Xi,"getEsmExportName");C.getEsmExportName=Xi;function Yi(t){return new ee(t.toString())}o(Yi,"regexpCode");C.regexpCode=Yi});var mr=v(Q=>{"use strict";f();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var W=et(),hr=class extends Error{static{o(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ot;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ot||(Q.UsedValueState=Ot={}));Q.varKinds={const:new W.Name("const"),let:new W.Name("let"),var:new W.Name("var")};var kt=class{static{o(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof W.Name?e:this.name(e)}name(e){return new W.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=kt;var qt=class extends W.Name{static{o(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=(0,W._)`.${new W.Name(r)}[${s}]`}};Q.ValueScopeName=qt;var ea=(0,W._)`\n`,pr=class extends kt{static{o(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ea:W.nil}}get(){return this._scope}name(e){return new qt(e,this._newName(e))}value(e,r){var s;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,a=(s=r.key)!==null&&s!==void 0?s:r.ref,c=this._values[i];if(c){let l=c.get(a);if(l)return l}else c=this._values[i]=new Map;c.set(a,n);let u=this._scope[i]||(this._scope[i]=[]),d=u.length;return u[d]=r.ref,n.setValue(r,{property:i,itemIndex:d}),n}getValue(e,r){let s=this._values[e];if(s)return s.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,W._)`${e}${s.scopePath}`})}scopeCode(e=this._values,r,s){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,s)}_reduceValues(e,r,s={},n){let i=W.nil;for(let a in e){let c=e[a];if(!c)continue;let u=s[a]=s[a]||new Map;c.forEach(d=>{if(u.has(d))return;u.set(d,Ot.Started);let l=r(d);if(l){let h=this.opts.es5?Q.varKinds.var:Q.varKinds.const;i=(0,W._)`${i}${h} ${d} = ${l};${this.opts._n}`}else if(l=n?.(d))i=(0,W._)`${i}${l}${this.opts._n}`;else throw new hr(d);u.set(d,Ot.Completed)})}return i}};Q.ValueScope=pr});var q=v(k=>{"use strict";f();Object.defineProperty(k,"__esModule",{value:!0});k.or=k.and=k.not=k.CodeGen=k.operators=k.varKinds=k.ValueScopeName=k.ValueScope=k.Scope=k.Name=k.regexpCode=k.stringify=k.getProperty=k.nil=k.strConcat=k.str=k._=void 0;var j=et(),ne=mr(),ge=et();Object.defineProperty(k,"_",{enumerable:!0,get:o(function(){return ge._},"get")});Object.defineProperty(k,"str",{enumerable:!0,get:o(function(){return ge.str},"get")});Object.defineProperty(k,"strConcat",{enumerable:!0,get:o(function(){return ge.strConcat},"get")});Object.defineProperty(k,"nil",{enumerable:!0,get:o(function(){return ge.nil},"get")});Object.defineProperty(k,"getProperty",{enumerable:!0,get:o(function(){return ge.getProperty},"get")});Object.defineProperty(k,"stringify",{enumerable:!0,get:o(function(){return ge.stringify},"get")});Object.defineProperty(k,"regexpCode",{enumerable:!0,get:o(function(){return ge.regexpCode},"get")});Object.defineProperty(k,"Name",{enumerable:!0,get:o(function(){return ge.Name},"get")});var Tt=mr();Object.defineProperty(k,"Scope",{enumerable:!0,get:o(function(){return Tt.Scope},"get")});Object.defineProperty(k,"ValueScope",{enumerable:!0,get:o(function(){return Tt.ValueScope},"get")});Object.defineProperty(k,"ValueScopeName",{enumerable:!0,get:o(function(){return Tt.ValueScopeName},"get")});Object.defineProperty(k,"varKinds",{enumerable:!0,get:o(function(){return Tt.varKinds},"get")});k.operators={GT:new j._Code(">"),GTE:new j._Code(">="),LT:new j._Code("<"),LTE:new j._Code("<="),EQ:new j._Code("==="),NEQ:new j._Code("!=="),NOT:new j._Code("!"),OR:new j._Code("||"),AND:new j._Code("&&"),ADD:new j._Code("+")};var he=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},yr=class extends he{static{o(this,"Def")}constructor(e,r,s){super(),this.varKind=e,this.name=r,this.rhs=s}render({es5:e,_n:r}){let s=e?ne.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Me(this.rhs,e,r)),this}get names(){return this.rhs instanceof j._CodeOrName?this.rhs.names:{}}},It=class extends he{static{o(this,"Assign")}constructor(e,r,s){super(),this.lhs=e,this.rhs=r,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof j.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Me(this.rhs,e,r),this}get names(){let e=this.lhs instanceof j.Name?{}:{...this.lhs.names};return Rt(e,this.rhs)}},gr=class extends It{static{o(this,"AssignOp")}constructor(e,r,s,n){super(e,s,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},_r=class extends he{static{o(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},$r=class extends he{static{o(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},vr=class extends he{static{o(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},wr=class extends he{static{o(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Me(this.code,e,r),this}get names(){return this.code instanceof j._CodeOrName?this.code.names:{}}},tt=class extends he{static{o(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,s)=>r+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let s=e[r].optimizeNodes();Array.isArray(s)?e.splice(r,1,...s):s?e[r]=s:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:s}=this,n=s.length;for(;n--;){let i=s[n];i.optimizeNames(e,r)||(ta(e,i.names),s.splice(n,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Oe(e,r.names),{})}},pe=class extends tt{static{o(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},br=class extends tt{static{o(this,"Root")}},De=class extends pe{static{o(this,"Else")}};De.kind="else";var Pe=class t extends pe{static{o(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let s=r.optimizeNodes();r=this.else=Array.isArray(s)?new De(s):s}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(an(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Me(this.condition,e,r),this}get names(){let e=super.names;return Rt(e,this.condition),this.else&&Oe(e,this.else.names),e}};Pe.kind="if";var Ne=class extends pe{static{o(this,"For")}};Ne.kind="for";var Er=class extends Ne{static{o(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Me(this.iteration,e,r),this}get names(){return Oe(super.names,this.iteration.names)}},Sr=class extends Ne{static{o(this,"ForRange")}constructor(e,r,s,n){super(),this.varKind=e,this.name=r,this.from=s,this.to=n}render(e){let r=e.es5?ne.varKinds.var:this.varKind,{name:s,from:n,to:i}=this;return`for(${r} ${s}=${n}; ${s}<${i}; ${s}++)`+super.render(e)}get names(){let e=Rt(super.names,this.from);return Rt(e,this.to)}},jt=class extends Ne{static{o(this,"ForIter")}constructor(e,r,s,n){super(),this.loop=e,this.varKind=r,this.name=s,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Me(this.iterable,e,r),this}get names(){return Oe(super.names,this.iterable.names)}},rt=class extends pe{static{o(this,"Func")}constructor(e,r,s){super(),this.name=e,this.args=r,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};rt.kind="func";var st=class extends tt{static{o(this,"Return")}render(e){return"return "+super.render(e)}};st.kind="return";var Pr=class extends pe{static{o(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var s,n;return super.optimizeNames(e,r),(s=this.catch)===null||s===void 0||s.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Oe(e,this.catch.names),this.finally&&Oe(e,this.finally.names),e}},nt=class extends pe{static{o(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};nt.kind="catch";var ot=class extends pe{static{o(this,"Finally")}render(e){return"finally"+super.render(e)}};ot.kind="finally";var Nr=class{static{o(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
4
|
+
`:""},this._extScope=e,this._scope=new ne.Scope({parent:e}),this._nodes=[new br]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let s=this._extScope.value(e,r);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,s,n){let i=this._scope.toName(r);return s!==void 0&&n&&(this._constants[i.str]=s),this._leafNode(new yr(e,i,s)),i}const(e,r,s){return this._def(ne.varKinds.const,e,r,s)}let(e,r,s){return this._def(ne.varKinds.let,e,r,s)}var(e,r,s){return this._def(ne.varKinds.var,e,r,s)}assign(e,r,s){return this._leafNode(new It(e,r,s))}add(e,r){return this._leafNode(new gr(e,k.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==j.nil&&this._leafNode(new wr(e)),this}object(...e){let r=["{"];for(let[s,n]of e)r.length>1&&r.push(","),r.push(s),(s!==n||this.opts.es5)&&(r.push(":"),(0,j.addCodeArg)(r,n));return r.push("}"),new j._Code(r)}if(e,r,s){if(this._blockNode(new Pe(e)),r&&s)this.code(r).else().code(s).endIf();else if(r)this.code(r).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Pe(e))}else(){return this._elseNode(new De)}endIf(){return this._endBlockNode(Pe,De)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Er(e),r)}forRange(e,r,s,n,i=this.opts.es5?ne.varKinds.var:ne.varKinds.let){let a=this._scope.toName(e);return this._for(new Sr(i,a,r,s),()=>n(a))}forOf(e,r,s,n=ne.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let a=r instanceof j.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,j._)`${a}.length`,c=>{this.var(i,(0,j._)`${a}[${c}]`),s(i)})}return this._for(new jt("of",n,i,r),()=>s(i))}forIn(e,r,s,n=this.opts.es5?ne.varKinds.var:ne.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,j._)`Object.keys(${r})`,s);let i=this._scope.toName(e);return this._for(new jt("in",n,i,r),()=>s(i))}endFor(){return this._endBlockNode(Ne)}label(e){return this._leafNode(new _r(e))}break(e){return this._leafNode(new $r(e))}return(e){let r=new st;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(st)}try(e,r,s){if(!r&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Pr;if(this._blockNode(n),this.code(e),r){let i=this.name("e");this._currNode=n.catch=new nt(i),r(i)}return s&&(this._currNode=n.finally=new ot,this.code(s)),this._endBlockNode(nt,ot)}throw(e){return this._leafNode(new vr(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-r;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=j.nil,s,n){return this._blockNode(new rt(e,r,s)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(rt)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let s=this._currNode;if(s instanceof e||r&&s instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Pe))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};k.CodeGen=Nr;function Oe(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}o(Oe,"addNames");function Rt(t,e){return e instanceof j._CodeOrName?Oe(t,e.names):t}o(Rt,"addExprNames");function Me(t,e,r){if(t instanceof j.Name)return s(t);if(!n(t))return t;return new j._Code(t._items.reduce((i,a)=>(a instanceof j.Name&&(a=s(a)),a instanceof j._Code?i.push(...a._items):i.push(a),i),[]));function s(i){let a=r[i.str];return a===void 0||e[i.str]!==1?i:(delete e[i.str],a)}function n(i){return i instanceof j._Code&&i._items.some(a=>a instanceof j.Name&&e[a.str]===1&&r[a.str]!==void 0)}}o(Me,"optimizeExpr");function ta(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}o(ta,"subtractNames");function an(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,j._)`!${Or(t)}`}o(an,"not");k.not=an;var ra=cn(k.operators.AND);function sa(...t){return t.reduce(ra)}o(sa,"and");k.and=sa;var na=cn(k.operators.OR);function oa(...t){return t.reduce(na)}o(oa,"or");k.or=oa;function cn(t){return(e,r)=>e===j.nil?r:r===j.nil?e:(0,j._)`${Or(e)} ${t} ${Or(r)}`}o(cn,"mappend");function Or(t){return t instanceof j.Name?t:(0,j._)`(${t})`}o(Or,"par")});var R=v(I=>{"use strict";f();Object.defineProperty(I,"__esModule",{value:!0});I.checkStrictMode=I.getErrorPath=I.Type=I.useFunc=I.setEvaluated=I.evaluatedPropsToName=I.mergeEvaluated=I.eachItem=I.unescapeJsonPointer=I.escapeJsonPointer=I.escapeFragment=I.unescapeFragment=I.schemaRefOrVal=I.schemaHasRulesButRef=I.schemaHasRules=I.checkUnknownRules=I.alwaysValidSchema=I.toHash=void 0;var M=q(),ia=et();function aa(t){let e={};for(let r of t)e[r]=!0;return e}o(aa,"toHash");I.toHash=aa;function ca(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(dn(t,e),!fn(e,t.self.RULES.all))}o(ca,"alwaysValidSchema");I.alwaysValidSchema=ca;function dn(t,e=t.schema){let{opts:r,self:s}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=s.RULES.keywords;for(let i in e)n[i]||mn(t,`unknown keyword: "${i}"`)}o(dn,"checkUnknownRules");I.checkUnknownRules=dn;function fn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}o(fn,"schemaHasRules");I.schemaHasRules=fn;function ua(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}o(ua,"schemaHasRulesButRef");I.schemaHasRulesButRef=ua;function la({topSchemaRef:t,schemaPath:e},r,s,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,M._)`${r}`}return(0,M._)`${t}${e}${(0,M.getProperty)(s)}`}o(la,"schemaRefOrVal");I.schemaRefOrVal=la;function da(t){return hn(decodeURIComponent(t))}o(da,"unescapeFragment");I.unescapeFragment=da;function fa(t){return encodeURIComponent(qr(t))}o(fa,"escapeFragment");I.escapeFragment=fa;function qr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}o(qr,"escapeJsonPointer");I.escapeJsonPointer=qr;function hn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(hn,"unescapeJsonPointer");I.unescapeJsonPointer=hn;function ha(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}o(ha,"eachItem");I.eachItem=ha;function un({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:s}){return(n,i,a,c)=>{let u=a===void 0?i:a instanceof M.Name?(i instanceof M.Name?t(n,i,a):e(n,i,a),a):i instanceof M.Name?(e(n,a,i),i):r(i,a);return c===M.Name&&!(u instanceof M.Name)?s(n,u):u}}o(un,"makeMergeEvaluated");I.mergeEvaluated={props:un({mergeNames:o((t,e,r)=>t.if((0,M._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,M._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,M._)`${r} || {}`).code((0,M._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:o((t,e,r)=>t.if((0,M._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,M._)`${r} || {}`),Ir(t,r,e))}),"mergeToName"),mergeValues:o((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:pn}),items:un({mergeNames:o((t,e,r)=>t.if((0,M._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,M._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:o((t,e,r)=>t.if((0,M._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,M._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:o((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:o((t,e)=>t.var("items",e),"resultToName")})};function pn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,M._)`{}`);return e!==void 0&&Ir(t,r,e),r}o(pn,"evaluatedPropsToName");I.evaluatedPropsToName=pn;function Ir(t,e,r){Object.keys(r).forEach(s=>t.assign((0,M._)`${e}${(0,M.getProperty)(s)}`,!0))}o(Ir,"setEvaluated");I.setEvaluated=Ir;var ln={};function pa(t,e){return t.scopeValue("func",{ref:e,code:ln[e.code]||(ln[e.code]=new ia._Code(e.code))})}o(pa,"useFunc");I.useFunc=pa;var kr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(kr||(I.Type=kr={}));function ma(t,e,r){if(t instanceof M.Name){let s=e===kr.Num;return r?s?(0,M._)`"[" + ${t} + "]"`:(0,M._)`"['" + ${t} + "']"`:s?(0,M._)`"/" + ${t}`:(0,M._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,M.getProperty)(t).toString():"/"+qr(t)}o(ma,"getErrorPath");I.getErrorPath=ma;function mn(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}o(mn,"checkStrictMode");I.checkStrictMode=mn});var me=v(jr=>{"use strict";f();Object.defineProperty(jr,"__esModule",{value:!0});var K=q(),ya={data:new K.Name("data"),valCxt:new K.Name("valCxt"),instancePath:new K.Name("instancePath"),parentData:new K.Name("parentData"),parentDataProperty:new K.Name("parentDataProperty"),rootData:new K.Name("rootData"),dynamicAnchors:new K.Name("dynamicAnchors"),vErrors:new K.Name("vErrors"),errors:new K.Name("errors"),this:new K.Name("this"),self:new K.Name("self"),scope:new K.Name("scope"),json:new K.Name("json"),jsonPos:new K.Name("jsonPos"),jsonLen:new K.Name("jsonLen"),jsonPart:new K.Name("jsonPart")};jr.default=ya});var it=v(H=>{"use strict";f();Object.defineProperty(H,"__esModule",{value:!0});H.extendErrors=H.resetErrorsCount=H.reportExtraError=H.reportError=H.keyword$DataError=H.keywordError=void 0;var T=q(),Ct=R(),J=me();H.keywordError={message:o(({keyword:t})=>(0,T.str)`must pass "${t}" keyword validation`,"message")};H.keyword$DataError={message:o(({keyword:t,schemaType:e})=>e?(0,T.str)`"${t}" keyword must be ${e} ($data)`:(0,T.str)`"${t}" keyword is invalid ($data)`,"message")};function ga(t,e=H.keywordError,r,s){let{it:n}=t,{gen:i,compositeRule:a,allErrors:c}=n,u=_n(t,e,r);s??(a||c)?yn(i,u):gn(n,(0,T._)`[${u}]`)}o(ga,"reportError");H.reportError=ga;function _a(t,e=H.keywordError,r){let{it:s}=t,{gen:n,compositeRule:i,allErrors:a}=s,c=_n(t,e,r);yn(n,c),i||a||gn(s,J.default.vErrors)}o(_a,"reportExtraError");H.reportExtraError=_a;function $a(t,e){t.assign(J.default.errors,e),t.if((0,T._)`${J.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,T._)`${J.default.vErrors}.length`,e),()=>t.assign(J.default.vErrors,null)))}o($a,"resetErrorsCount");H.resetErrorsCount=$a;function va({gen:t,keyword:e,schemaValue:r,data:s,errsCount:n,it:i}){if(n===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",n,J.default.errors,c=>{t.const(a,(0,T._)`${J.default.vErrors}[${c}]`),t.if((0,T._)`${a}.instancePath === undefined`,()=>t.assign((0,T._)`${a}.instancePath`,(0,T.strConcat)(J.default.instancePath,i.errorPath))),t.assign((0,T._)`${a}.schemaPath`,(0,T.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,T._)`${a}.schema`,r),t.assign((0,T._)`${a}.data`,s))})}o(va,"extendErrors");H.extendErrors=va;function yn(t,e){let r=t.const("err",e);t.if((0,T._)`${J.default.vErrors} === null`,()=>t.assign(J.default.vErrors,(0,T._)`[${r}]`),(0,T._)`${J.default.vErrors}.push(${r})`),t.code((0,T._)`${J.default.errors}++`)}o(yn,"addError");function gn(t,e){let{gen:r,validateName:s,schemaEnv:n}=t;n.$async?r.throw((0,T._)`new ${t.ValidationError}(${e})`):(r.assign((0,T._)`${s}.errors`,e),r.return(!1))}o(gn,"returnErrors");var ke={keyword:new T.Name("keyword"),schemaPath:new T.Name("schemaPath"),params:new T.Name("params"),propertyName:new T.Name("propertyName"),message:new T.Name("message"),schema:new T.Name("schema"),parentSchema:new T.Name("parentSchema")};function _n(t,e,r){let{createErrors:s}=t.it;return s===!1?(0,T._)`{}`:wa(t,e,r)}o(_n,"errorObjectCode");function wa(t,e,r={}){let{gen:s,it:n}=t,i=[ba(n,r),Ea(t,r)];return Sa(t,e,i),s.object(...i)}o(wa,"errorObject");function ba({errorPath:t},{instancePath:e}){let r=e?(0,T.str)`${t}${(0,Ct.getErrorPath)(e,Ct.Type.Str)}`:t;return[J.default.instancePath,(0,T.strConcat)(J.default.instancePath,r)]}o(ba,"errorInstancePath");function Ea({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:s}){let n=s?e:(0,T.str)`${e}/${t}`;return r&&(n=(0,T.str)`${n}${(0,Ct.getErrorPath)(r,Ct.Type.Str)}`),[ke.schemaPath,n]}o(Ea,"errorSchemaPath");function Sa(t,{params:e,message:r},s){let{keyword:n,data:i,schemaValue:a,it:c}=t,{opts:u,propertyName:d,topSchemaRef:l,schemaPath:h}=c;s.push([ke.keyword,n],[ke.params,typeof e=="function"?e(t):e||(0,T._)`{}`]),u.messages&&s.push([ke.message,typeof r=="function"?r(t):r]),u.verbose&&s.push([ke.schema,a],[ke.parentSchema,(0,T._)`${l}${h}`],[J.default.data,i]),d&&s.push([ke.propertyName,d])}o(Sa,"extraErrorProps")});var vn=v(xe=>{"use strict";f();Object.defineProperty(xe,"__esModule",{value:!0});xe.boolOrEmptySchema=xe.topBoolOrEmptySchema=void 0;var Pa=it(),Na=q(),Oa=me(),ka={message:"boolean schema is false"};function qa(t){let{gen:e,schema:r,validateName:s}=t;r===!1?$n(t,!1):typeof r=="object"&&r.$async===!0?e.return(Oa.default.data):(e.assign((0,Na._)`${s}.errors`,null),e.return(!0))}o(qa,"topBoolOrEmptySchema");xe.topBoolOrEmptySchema=qa;function Ia(t,e){let{gen:r,schema:s}=t;s===!1?(r.var(e,!1),$n(t)):r.var(e,!0)}o(Ia,"boolOrEmptySchema");xe.boolOrEmptySchema=Ia;function $n(t,e){let{gen:r,data:s}=t,n={gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Pa.reportError)(n,ka,void 0,e)}o($n,"falseSchemaError")});var Rr=v(Fe=>{"use strict";f();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getRules=Fe.isJSONType=void 0;var ja=["string","number","integer","boolean","null","object","array"],Ra=new Set(ja);function Ta(t){return typeof t=="string"&&Ra.has(t)}o(Ta,"isJSONType");Fe.isJSONType=Ta;function Ca(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}o(Ca,"getRules");Fe.getRules=Ca});var Tr=v(_e=>{"use strict";f();Object.defineProperty(_e,"__esModule",{value:!0});_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function Aa({schema:t,self:e},r){let s=e.RULES.types[r];return s&&s!==!0&&wn(t,s)}o(Aa,"schemaHasRulesForType");_e.schemaHasRulesForType=Aa;function wn(t,e){return e.rules.some(r=>bn(t,r))}o(wn,"shouldUseGroup");_e.shouldUseGroup=wn;function bn(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(s=>t[s]!==void 0))}o(bn,"shouldUseRule");_e.shouldUseRule=bn});var at=v(L=>{"use strict";f();Object.defineProperty(L,"__esModule",{value:!0});L.reportTypeError=L.checkDataTypes=L.checkDataType=L.coerceAndCheckDataType=L.getJSONTypes=L.getSchemaTypes=L.DataType=void 0;var Da=Rr(),Ma=Tr(),xa=it(),O=q(),En=R(),Ve;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ve||(L.DataType=Ve={}));function Fa(t){let e=Sn(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}o(Fa,"getSchemaTypes");L.getSchemaTypes=Fa;function Sn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Da.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}o(Sn,"getJSONTypes");L.getJSONTypes=Sn;function Va(t,e){let{gen:r,data:s,opts:n}=t,i=za(e,n.coerceTypes),a=e.length>0&&!(i.length===0&&e.length===1&&(0,Ma.schemaHasRulesForType)(t,e[0]));if(a){let c=Ar(e,s,n.strictNumbers,Ve.Wrong);r.if(c,()=>{i.length?Ua(t,e,i):Dr(t)})}return a}o(Va,"coerceAndCheckDataType");L.coerceAndCheckDataType=Va;var Pn=new Set(["string","number","integer","boolean","null"]);function za(t,e){return e?t.filter(r=>Pn.has(r)||e==="array"&&r==="array"):[]}o(za,"coerceToTypes");function Ua(t,e,r){let{gen:s,data:n,opts:i}=t,a=s.let("dataType",(0,O._)`typeof ${n}`),c=s.let("coerced",(0,O._)`undefined`);i.coerceTypes==="array"&&s.if((0,O._)`${a} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>s.assign(n,(0,O._)`${n}[0]`).assign(a,(0,O._)`typeof ${n}`).if(Ar(e,n,i.strictNumbers),()=>s.assign(c,n))),s.if((0,O._)`${c} !== undefined`);for(let d of r)(Pn.has(d)||d==="array"&&i.coerceTypes==="array")&&u(d);s.else(),Dr(t),s.endIf(),s.if((0,O._)`${c} !== undefined`,()=>{s.assign(n,c),Ka(t,c)});function u(d){switch(d){case"string":s.elseIf((0,O._)`${a} == "number" || ${a} == "boolean"`).assign(c,(0,O._)`"" + ${n}`).elseIf((0,O._)`${n} === null`).assign(c,(0,O._)`""`);return;case"number":s.elseIf((0,O._)`${a} == "boolean" || ${n} === null
|
|
5
|
+
|| (${a} == "string" && ${n} && ${n} == +${n})`).assign(c,(0,O._)`+${n}`);return;case"integer":s.elseIf((0,O._)`${a} === "boolean" || ${n} === null
|
|
6
|
+
|| (${a} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(c,(0,O._)`+${n}`);return;case"boolean":s.elseIf((0,O._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(c,!1).elseIf((0,O._)`${n} === "true" || ${n} === 1`).assign(c,!0);return;case"null":s.elseIf((0,O._)`${n} === "" || ${n} === 0 || ${n} === false`),s.assign(c,null);return;case"array":s.elseIf((0,O._)`${a} === "string" || ${a} === "number"
|
|
7
|
+
|| ${a} === "boolean" || ${n} === null`).assign(c,(0,O._)`[${n}]`)}}o(u,"coerceSpecificType")}o(Ua,"coerceData");function Ka({gen:t,parentData:e,parentDataProperty:r},s){t.if((0,O._)`${e} !== undefined`,()=>t.assign((0,O._)`${e}[${r}]`,s))}o(Ka,"assignParentData");function Cr(t,e,r,s=Ve.Correct){let n=s===Ve.Correct?O.operators.EQ:O.operators.NEQ,i;switch(t){case"null":return(0,O._)`${e} ${n} null`;case"array":i=(0,O._)`Array.isArray(${e})`;break;case"object":i=(0,O._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=a((0,O._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=a();break;default:return(0,O._)`typeof ${e} ${n} ${t}`}return s===Ve.Correct?i:(0,O.not)(i);function a(c=O.nil){return(0,O.and)((0,O._)`typeof ${e} == "number"`,c,r?(0,O._)`isFinite(${e})`:O.nil)}}o(Cr,"checkDataType");L.checkDataType=Cr;function Ar(t,e,r,s){if(t.length===1)return Cr(t[0],e,r,s);let n,i=(0,En.toHash)(t);if(i.array&&i.object){let a=(0,O._)`typeof ${e} != "object"`;n=i.null?a:(0,O._)`!${e} || ${a}`,delete i.null,delete i.array,delete i.object}else n=O.nil;i.number&&delete i.integer;for(let a in i)n=(0,O.and)(n,Cr(a,e,r,s));return n}o(Ar,"checkDataTypes");L.checkDataTypes=Ar;var Ha={message:o(({schema:t})=>`must be ${t}`,"message"),params:o(({schema:t,schemaValue:e})=>typeof t=="string"?(0,O._)`{type: ${t}}`:(0,O._)`{type: ${e}}`,"params")};function Dr(t){let e=La(t);(0,xa.reportError)(e,Ha)}o(Dr,"reportTypeError");L.reportTypeError=Dr;function La(t){let{gen:e,data:r,schema:s}=t,n=(0,En.schemaRefOrVal)(t,s,"type");return{gen:e,keyword:"type",data:r,schema:s.type,schemaCode:n,schemaValue:n,parentSchema:s,params:{},it:t}}o(La,"getTypeErrorContext")});var On=v(At=>{"use strict";f();Object.defineProperty(At,"__esModule",{value:!0});At.assignDefaults=void 0;var ze=q(),Ga=R();function Ja(t,e){let{properties:r,items:s}=t.schema;if(e==="object"&&r)for(let n in r)Nn(t,n,r[n].default);else e==="array"&&Array.isArray(s)&&s.forEach((n,i)=>Nn(t,i,n.default))}o(Ja,"assignDefaults");At.assignDefaults=Ja;function Nn(t,e,r){let{gen:s,compositeRule:n,data:i,opts:a}=t;if(r===void 0)return;let c=(0,ze._)`${i}${(0,ze.getProperty)(e)}`;if(n){(0,Ga.checkStrictMode)(t,`default is ignored for: ${c}`);return}let u=(0,ze._)`${c} === undefined`;a.useDefaults==="empty"&&(u=(0,ze._)`${u} || ${c} === null || ${c} === ""`),s.if(u,(0,ze._)`${c} = ${(0,ze.stringify)(r)}`)}o(Nn,"assignDefault")});var te=v(D=>{"use strict";f();Object.defineProperty(D,"__esModule",{value:!0});D.validateUnion=D.validateArray=D.usePattern=D.callValidateCode=D.schemaProperties=D.allSchemaProperties=D.noPropertyInData=D.propertyInData=D.isOwnProperty=D.hasPropFunc=D.reportMissingProp=D.checkMissingProp=D.checkReportMissingProp=void 0;var x=q(),Mr=R(),$e=me(),Ba=R();function Wa(t,e){let{gen:r,data:s,it:n}=t;r.if(Fr(r,s,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,x._)`${e}`},!0),t.error()})}o(Wa,"checkReportMissingProp");D.checkReportMissingProp=Wa;function Qa({gen:t,data:e,it:{opts:r}},s,n){return(0,x.or)(...s.map(i=>(0,x.and)(Fr(t,e,i,r.ownProperties),(0,x._)`${n} = ${i}`)))}o(Qa,"checkMissingProp");D.checkMissingProp=Qa;function Za(t,e){t.setParams({missingProperty:e},!0),t.error()}o(Za,"reportMissingProp");D.reportMissingProp=Za;function kn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,x._)`Object.prototype.hasOwnProperty`})}o(kn,"hasPropFunc");D.hasPropFunc=kn;function xr(t,e,r){return(0,x._)`${kn(t)}.call(${e}, ${r})`}o(xr,"isOwnProperty");D.isOwnProperty=xr;function Xa(t,e,r,s){let n=(0,x._)`${e}${(0,x.getProperty)(r)} !== undefined`;return s?(0,x._)`${n} && ${xr(t,e,r)}`:n}o(Xa,"propertyInData");D.propertyInData=Xa;function Fr(t,e,r,s){let n=(0,x._)`${e}${(0,x.getProperty)(r)} === undefined`;return s?(0,x.or)(n,(0,x.not)(xr(t,e,r))):n}o(Fr,"noPropertyInData");D.noPropertyInData=Fr;function qn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}o(qn,"allSchemaProperties");D.allSchemaProperties=qn;function Ya(t,e){return qn(e).filter(r=>!(0,Mr.alwaysValidSchema)(t,e[r]))}o(Ya,"schemaProperties");D.schemaProperties=Ya;function ec({schemaCode:t,data:e,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:i},it:a},c,u,d){let l=d?(0,x._)`${t}, ${e}, ${s}${n}`:e,h=[[$e.default.instancePath,(0,x.strConcat)($e.default.instancePath,i)],[$e.default.parentData,a.parentData],[$e.default.parentDataProperty,a.parentDataProperty],[$e.default.rootData,$e.default.rootData]];a.opts.dynamicRef&&h.push([$e.default.dynamicAnchors,$e.default.dynamicAnchors]);let _=(0,x._)`${l}, ${r.object(...h)}`;return u!==x.nil?(0,x._)`${c}.call(${u}, ${_})`:(0,x._)`${c}(${_})`}o(ec,"callValidateCode");D.callValidateCode=ec;var tc=(0,x._)`new RegExp`;function rc({gen:t,it:{opts:e}},r){let s=e.unicodeRegExp?"u":"",{regExp:n}=e.code,i=n(r,s);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,x._)`${n.code==="new RegExp"?tc:(0,Ba.useFunc)(t,n)}(${r}, ${s})`})}o(rc,"usePattern");D.usePattern=rc;function sc(t){let{gen:e,data:r,keyword:s,it:n}=t,i=e.name("valid");if(n.allErrors){let c=e.let("valid",!0);return a(()=>e.assign(c,!1)),c}return e.var(i,!0),a(()=>e.break()),i;function a(c){let u=e.const("len",(0,x._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:s,dataProp:d,dataPropType:Mr.Type.Num},i),e.if((0,x.not)(i),c)})}o(a,"validateItems")}o(sc,"validateArray");D.validateArray=sc;function nc(t){let{gen:e,schema:r,keyword:s,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Mr.alwaysValidSchema)(n,u))&&!n.opts.unevaluated)return;let a=e.let("valid",!1),c=e.name("_valid");e.block(()=>r.forEach((u,d)=>{let l=t.subschema({keyword:s,schemaProp:d,compositeRule:!0},c);e.assign(a,(0,x._)`${a} || ${c}`),t.mergeValidEvaluated(l,c)||e.if((0,x.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}o(nc,"validateUnion");D.validateUnion=nc});var Rn=v(ue=>{"use strict";f();Object.defineProperty(ue,"__esModule",{value:!0});ue.validateKeywordUsage=ue.validSchemaType=ue.funcKeywordCode=ue.macroKeywordCode=void 0;var B=q(),qe=me(),oc=te(),ic=it();function ac(t,e){let{gen:r,keyword:s,schema:n,parentSchema:i,it:a}=t,c=e.macro.call(a.self,n,i,a),u=jn(r,s,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let d=r.name("valid");t.subschema({schema:c,schemaPath:B.nil,errSchemaPath:`${a.errSchemaPath}/${s}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}o(ac,"macroKeywordCode");ue.macroKeywordCode=ac;function cc(t,e){var r;let{gen:s,keyword:n,schema:i,parentSchema:a,$data:c,it:u}=t;lc(u,e);let d=!c&&e.compile?e.compile.call(u.self,i,a,u):e.validate,l=jn(s,n,d),h=s.let("valid");t.block$data(h,_),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function _(){if(e.errors===!1)p(),e.modifying&&In(t),y(()=>t.error());else{let $=e.async?g():m();e.modifying&&In(t),y(()=>uc(t,$))}}o(_,"validateKeyword");function g(){let $=s.let("ruleErrs",null);return s.try(()=>p((0,B._)`await `),S=>s.assign(h,!1).if((0,B._)`${S} instanceof ${u.ValidationError}`,()=>s.assign($,(0,B._)`${S}.errors`),()=>s.throw(S))),$}o(g,"validateAsync");function m(){let $=(0,B._)`${l}.errors`;return s.assign($,null),p(B.nil),$}o(m,"validateSync");function p($=e.async?(0,B._)`await `:B.nil){let S=u.opts.passContext?qe.default.this:qe.default.self,P=!("compile"in e&&!c||e.schema===!1);s.assign(h,(0,B._)`${$}${(0,oc.callValidateCode)(t,l,S,P)}`,e.modifying)}o(p,"assignValid");function y($){var S;s.if((0,B.not)((S=e.valid)!==null&&S!==void 0?S:h),$)}o(y,"reportErrs")}o(cc,"funcKeywordCode");ue.funcKeywordCode=cc;function In(t){let{gen:e,data:r,it:s}=t;e.if(s.parentData,()=>e.assign(r,(0,B._)`${s.parentData}[${s.parentDataProperty}]`))}o(In,"modifyData");function uc(t,e){let{gen:r}=t;r.if((0,B._)`Array.isArray(${e})`,()=>{r.assign(qe.default.vErrors,(0,B._)`${qe.default.vErrors} === null ? ${e} : ${qe.default.vErrors}.concat(${e})`).assign(qe.default.errors,(0,B._)`${qe.default.vErrors}.length`),(0,ic.extendErrors)(t)},()=>t.error())}o(uc,"addErrs");function lc({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}o(lc,"checkAsyncKeyword");function jn(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,B.stringify)(r)})}o(jn,"useKeyword");function dc(t,e,r=!1){return!e.length||e.some(s=>s==="array"?Array.isArray(t):s==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==s||r&&typeof t>"u")}o(dc,"validSchemaType");ue.validSchemaType=dc;function fc({schema:t,opts:e,self:r,errSchemaPath:s},n,i){if(Array.isArray(n.keyword)?!n.keyword.includes(i):n.keyword!==i)throw new Error("ajv implementation error");let a=n.dependencies;if(a?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[i])){let u=`keyword "${i}" value is invalid at path "${s}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}o(fc,"validateKeywordUsage");ue.validateKeywordUsage=fc});var Cn=v(ve=>{"use strict";f();Object.defineProperty(ve,"__esModule",{value:!0});ve.extendSubschemaMode=ve.extendSubschemaData=ve.getSubschema=void 0;var le=q(),Tn=R();function hc(t,{keyword:e,schemaProp:r,schema:s,schemaPath:n,errSchemaPath:i,topSchemaRef:a}){if(e!==void 0&&s!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return r===void 0?{schema:c,schemaPath:(0,le._)`${t.schemaPath}${(0,le.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:c[r],schemaPath:(0,le._)`${t.schemaPath}${(0,le.getProperty)(e)}${(0,le.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Tn.escapeFragment)(r)}`}}if(s!==void 0){if(n===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:n,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}o(hc,"getSubschema");ve.getSubschema=hc;function pc(t,e,{dataProp:r,dataPropType:s,data:n,dataTypes:i,propertyName:a}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(r!==void 0){let{errorPath:d,dataPathArr:l,opts:h}=e,_=c.let("data",(0,le._)`${e.data}${(0,le.getProperty)(r)}`,!0);u(_),t.errorPath=(0,le.str)`${d}${(0,Tn.getErrorPath)(r,s,h.jsPropertySyntax)}`,t.parentDataProperty=(0,le._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(n!==void 0){let d=n instanceof le.Name?n:c.let("data",n,!0);u(d),a!==void 0&&(t.propertyName=a)}i&&(t.dataTypes=i);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}o(u,"dataContextProps")}o(pc,"extendSubschemaData");ve.extendSubschemaData=pc;function mc(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:s,createErrors:n,allErrors:i}){s!==void 0&&(t.compositeRule=s),n!==void 0&&(t.createErrors=n),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}o(mc,"extendSubschemaMode");ve.extendSubschemaMode=mc});var Vr=v((Oh,An)=>{"use strict";f();An.exports=o(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 s,n,i;if(Array.isArray(e)){if(s=e.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),s=i.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=s;n--!==0;){var a=i[n];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r},"equal")});var Mn=v((Ih,Dn)=>{"use strict";f();var we=Dn.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var s=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Dt(e,s,n,t,"",t)};we.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};we.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};we.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};we.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Dt(t,e,r,s,n,i,a,c,u,d){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,n,i,a,c,u,d);for(var l in s){var h=s[l];if(Array.isArray(h)){if(l in we.arrayKeywords)for(var _=0;_<h.length;_++)Dt(t,e,r,h[_],n+"/"+l+"/"+_,i,n,l,s,_)}else if(l in we.propsKeywords){if(h&&typeof h=="object")for(var g in h)Dt(t,e,r,h[g],n+"/"+l+"/"+yc(g),i,n,l,s,g)}else(l in we.keywords||t.allKeys&&!(l in we.skipKeywords))&&Dt(t,e,r,h,n+"/"+l,i,n,l,s)}r(s,n,i,a,c,u,d)}}o(Dt,"_traverse");function yc(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}o(yc,"escapeJsonPtr")});var ct=v(Z=>{"use strict";f();Object.defineProperty(Z,"__esModule",{value:!0});Z.getSchemaRefs=Z.resolveUrl=Z.normalizeId=Z._getFullPath=Z.getFullPath=Z.inlineRef=void 0;var gc=R(),_c=Vr(),$c=Mn(),vc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function wc(t,e=!0){return typeof t=="boolean"?!0:e===!0?!zr(t):e?xn(t)<=e:!1}o(wc,"inlineRef");Z.inlineRef=wc;var bc=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function zr(t){for(let e in t){if(bc.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(zr)||typeof r=="object"&&zr(r))return!0}return!1}o(zr,"hasRef");function xn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!vc.has(r)&&(typeof t[r]=="object"&&(0,gc.eachItem)(t[r],s=>e+=xn(s)),e===1/0))return 1/0}return e}o(xn,"countKeys");function Fn(t,e="",r){r!==!1&&(e=Ue(e));let s=t.parse(e);return Vn(t,s)}o(Fn,"getFullPath");Z.getFullPath=Fn;function Vn(t,e){return t.serialize(e).split("#")[0]+"#"}o(Vn,"_getFullPath");Z._getFullPath=Vn;var Ec=/#\/?$/;function Ue(t){return t?t.replace(Ec,""):""}o(Ue,"normalizeId");Z.normalizeId=Ue;function Sc(t,e,r){return r=Ue(r),t.resolve(e,r)}o(Sc,"resolveUrl");Z.resolveUrl=Sc;var Pc=/^[a-z_][-a-z0-9._]*$/i;function Nc(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:s}=this.opts,n=Ue(t[r]||e),i={"":n},a=Fn(s,n,!1),c={},u=new Set;return $c(t,{allKeys:!0},(h,_,g,m)=>{if(m===void 0)return;let p=a+_,y=i[m];typeof h[r]=="string"&&(y=$.call(this,h[r])),S.call(this,h.$anchor),S.call(this,h.$dynamicAnchor),i[_]=y;function $(P){let A=this.opts.uriResolver.resolve;if(P=Ue(y?A(y,P):P),u.has(P))throw l(P);u.add(P);let N=this.refs[P];return typeof N=="string"&&(N=this.refs[N]),typeof N=="object"?d(h,N.schema,P):P!==Ue(p)&&(P[0]==="#"?(d(h,c[P],P),c[P]=h):this.refs[P]=p),P}o($,"addRef");function S(P){if(typeof P=="string"){if(!Pc.test(P))throw new Error(`invalid anchor "${P}"`);$.call(this,`#${P}`)}}o(S,"addAnchor")}),c;function d(h,_,g){if(_!==void 0&&!_c(h,_))throw l(g)}o(d,"checkAmbiguosRef");function l(h){return new Error(`reference "${h}" resolves to more than one schema`)}o(l,"ambiguos")}o(Nc,"getSchemaRefs");Z.getSchemaRefs=Nc});var dt=v(be=>{"use strict";f();Object.defineProperty(be,"__esModule",{value:!0});be.getData=be.KeywordCxt=be.validateFunctionCode=void 0;var Ln=vn(),zn=at(),Kr=Tr(),Mt=at(),Oc=On(),lt=Rn(),Ur=Cn(),b=q(),E=me(),kc=ct(),ye=R(),ut=it();function qc(t){if(Bn(t)&&(Wn(t),Jn(t))){Rc(t);return}Gn(t,()=>(0,Ln.topBoolOrEmptySchema)(t))}o(qc,"validateFunctionCode");be.validateFunctionCode=qc;function Gn({gen:t,validateName:e,schema:r,schemaEnv:s,opts:n},i){n.code.es5?t.func(e,(0,b._)`${E.default.data}, ${E.default.valCxt}`,s.$async,()=>{t.code((0,b._)`"use strict"; ${Un(r,n)}`),jc(t,n),t.code(i)}):t.func(e,(0,b._)`${E.default.data}, ${Ic(n)}`,s.$async,()=>t.code(Un(r,n)).code(i))}o(Gn,"validateFunction");function Ic(t){return(0,b._)`{${E.default.instancePath}="", ${E.default.parentData}, ${E.default.parentDataProperty}, ${E.default.rootData}=${E.default.data}${t.dynamicRef?(0,b._)`, ${E.default.dynamicAnchors}={}`:b.nil}}={}`}o(Ic,"destructureValCxt");function jc(t,e){t.if(E.default.valCxt,()=>{t.var(E.default.instancePath,(0,b._)`${E.default.valCxt}.${E.default.instancePath}`),t.var(E.default.parentData,(0,b._)`${E.default.valCxt}.${E.default.parentData}`),t.var(E.default.parentDataProperty,(0,b._)`${E.default.valCxt}.${E.default.parentDataProperty}`),t.var(E.default.rootData,(0,b._)`${E.default.valCxt}.${E.default.rootData}`),e.dynamicRef&&t.var(E.default.dynamicAnchors,(0,b._)`${E.default.valCxt}.${E.default.dynamicAnchors}`)},()=>{t.var(E.default.instancePath,(0,b._)`""`),t.var(E.default.parentData,(0,b._)`undefined`),t.var(E.default.parentDataProperty,(0,b._)`undefined`),t.var(E.default.rootData,E.default.data),e.dynamicRef&&t.var(E.default.dynamicAnchors,(0,b._)`{}`)})}o(jc,"destructureValCxtES5");function Rc(t){let{schema:e,opts:r,gen:s}=t;Gn(t,()=>{r.$comment&&e.$comment&&Zn(t),Mc(t),s.let(E.default.vErrors,null),s.let(E.default.errors,0),r.unevaluated&&Tc(t),Qn(t),Vc(t)})}o(Rc,"topSchemaObjCode");function Tc(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,b._)`${r}.evaluated`),e.if((0,b._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,b._)`${t.evaluated}.props`,(0,b._)`undefined`)),e.if((0,b._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,b._)`${t.evaluated}.items`,(0,b._)`undefined`))}o(Tc,"resetEvaluated");function Un(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,b._)`/*# sourceURL=${r} */`:b.nil}o(Un,"funcSourceUrl");function Cc(t,e){if(Bn(t)&&(Wn(t),Jn(t))){Ac(t,e);return}(0,Ln.boolOrEmptySchema)(t,e)}o(Cc,"subschemaCode");function Jn({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}o(Jn,"schemaCxtHasRules");function Bn(t){return typeof t.schema!="boolean"}o(Bn,"isSchemaObj");function Ac(t,e){let{schema:r,gen:s,opts:n}=t;n.$comment&&r.$comment&&Zn(t),xc(t),Fc(t);let i=s.const("_errs",E.default.errors);Qn(t,i),s.var(e,(0,b._)`${i} === ${E.default.errors}`)}o(Ac,"subSchemaObjCode");function Wn(t){(0,ye.checkUnknownRules)(t),Dc(t)}o(Wn,"checkKeywords");function Qn(t,e){if(t.opts.jtd)return Kn(t,[],!1,e);let r=(0,zn.getSchemaTypes)(t.schema),s=(0,zn.coerceAndCheckDataType)(t,r);Kn(t,r,!s,e)}o(Qn,"typeAndKeywords");function Dc(t){let{schema:e,errSchemaPath:r,opts:s,self:n}=t;e.$ref&&s.ignoreKeywordsWithRef&&(0,ye.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}o(Dc,"checkRefsAndKeywords");function Mc(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ye.checkStrictMode)(t,"default is ignored in the schema root")}o(Mc,"checkNoDefault");function xc(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,kc.resolveUrl)(t.opts.uriResolver,t.baseId,e))}o(xc,"updateContext");function Fc(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}o(Fc,"checkAsyncSchema");function Zn({gen:t,schemaEnv:e,schema:r,errSchemaPath:s,opts:n}){let i=r.$comment;if(n.$comment===!0)t.code((0,b._)`${E.default.self}.logger.log(${i})`);else if(typeof n.$comment=="function"){let a=(0,b.str)`${s}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,b._)`${E.default.self}.opts.$comment(${i}, ${a}, ${c}.schema)`)}}o(Zn,"commentKeyword");function Vc(t){let{gen:e,schemaEnv:r,validateName:s,ValidationError:n,opts:i}=t;r.$async?e.if((0,b._)`${E.default.errors} === 0`,()=>e.return(E.default.data),()=>e.throw((0,b._)`new ${n}(${E.default.vErrors})`)):(e.assign((0,b._)`${s}.errors`,E.default.vErrors),i.unevaluated&&zc(t),e.return((0,b._)`${E.default.errors} === 0`))}o(Vc,"returnResults");function zc({gen:t,evaluated:e,props:r,items:s}){r instanceof b.Name&&t.assign((0,b._)`${e}.props`,r),s instanceof b.Name&&t.assign((0,b._)`${e}.items`,s)}o(zc,"assignEvaluated");function Kn(t,e,r,s){let{gen:n,schema:i,data:a,allErrors:c,opts:u,self:d}=t,{RULES:l}=d;if(i.$ref&&(u.ignoreKeywordsWithRef||!(0,ye.schemaHasRulesButRef)(i,l))){n.block(()=>Yn(t,"$ref",l.all.$ref.definition));return}u.jtd||Uc(t,e),n.block(()=>{for(let _ of l.rules)h(_);h(l.post)});function h(_){(0,Kr.shouldUseGroup)(i,_)&&(_.type?(n.if((0,Mt.checkDataType)(_.type,a,u.strictNumbers)),Hn(t,_),e.length===1&&e[0]===_.type&&r&&(n.else(),(0,Mt.reportTypeError)(t)),n.endIf()):Hn(t,_),c||n.if((0,b._)`${E.default.errors} === ${s||0}`))}o(h,"groupKeywords")}o(Kn,"schemaKeywords");function Hn(t,e){let{gen:r,schema:s,opts:{useDefaults:n}}=t;n&&(0,Oc.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,Kr.shouldUseRule)(s,i)&&Yn(t,i.keyword,i.definition,e.type)})}o(Hn,"iterateKeywords");function Uc(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Kc(t,e),t.opts.allowUnionTypes||Hc(t,e),Lc(t,t.dataTypes))}o(Uc,"checkStrictTypes");function Kc(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Xn(t.dataTypes,r)||Hr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Jc(t,e)}}o(Kc,"checkContextTypes");function Hc(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Hr(t,"use allowUnionTypes to allow union type keyword")}o(Hc,"checkMultipleTypes");function Lc(t,e){let r=t.self.RULES.all;for(let s in r){let n=r[s];if(typeof n=="object"&&(0,Kr.shouldUseRule)(t.schema,n)){let{type:i}=n.definition;i.length&&!i.some(a=>Gc(e,a))&&Hr(t,`missing type "${i.join(",")}" for keyword "${s}"`)}}}o(Lc,"checkKeywordTypes");function Gc(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}o(Gc,"hasApplicableType");function Xn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}o(Xn,"includesType");function Jc(t,e){let r=[];for(let s of t.dataTypes)Xn(e,s)?r.push(s):e.includes("integer")&&s==="number"&&r.push("integer");t.dataTypes=r}o(Jc,"narrowSchemaTypes");function Hr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ye.checkStrictMode)(t,e,t.opts.strictTypes)}o(Hr,"strictTypesError");var xt=class{static{o(this,"KeywordCxt")}constructor(e,r,s){if((0,lt.validateKeywordUsage)(e,r,s),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=s,this.data=e.data,this.schema=e.schema[s],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ye.schemaRefOrVal)(e,this.schema,s,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",eo(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,lt.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${s} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",E.default.errors))}result(e,r,s){this.failResult((0,b.not)(e),r,s)}failResult(e,r,s){this.gen.if(e),s?s():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,b.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,b._)`${r} !== undefined && (${(0,b.or)(this.invalid$data(),e)})`)}error(e,r,s){if(r){this.setParams(r),this._error(e,s),this.setParams({});return}this._error(e,s)}_error(e,r){(e?ut.reportExtraError:ut.reportError)(this,this.def.error,r)}$dataError(){(0,ut.reportError)(this,this.def.$dataError||ut.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ut.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,s=b.nil){this.gen.block(()=>{this.check$data(e,s),r()})}check$data(e=b.nil,r=b.nil){if(!this.$data)return;let{gen:s,schemaCode:n,schemaType:i,def:a}=this;s.if((0,b.or)((0,b._)`${n} === undefined`,r)),e!==b.nil&&s.assign(e,!0),(i.length||a.validateSchema)&&(s.elseIf(this.invalid$data()),this.$dataError(),e!==b.nil&&s.assign(e,!1)),s.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:s,def:n,it:i}=this;return(0,b.or)(a(),c());function a(){if(s.length){if(!(r instanceof b.Name))throw new Error("ajv implementation error");let u=Array.isArray(s)?s:[s];return(0,b._)`${(0,Mt.checkDataTypes)(u,r,i.opts.strictNumbers,Mt.DataType.Wrong)}`}return b.nil}function c(){if(n.validateSchema){let u=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,b._)`!${u}(${r})`}return b.nil}}subschema(e,r){let s=(0,Ur.getSubschema)(this.it,e);(0,Ur.extendSubschemaData)(s,this.it,e),(0,Ur.extendSubschemaMode)(s,e);let n={...this.it,...s,items:void 0,props:void 0};return Cc(n,r),n}mergeEvaluated(e,r){let{it:s,gen:n}=this;s.opts.unevaluated&&(s.props!==!0&&e.props!==void 0&&(s.props=ye.mergeEvaluated.props(n,e.props,s.props,r)),s.items!==!0&&e.items!==void 0&&(s.items=ye.mergeEvaluated.items(n,e.items,s.items,r)))}mergeValidEvaluated(e,r){let{it:s,gen:n}=this;if(s.opts.unevaluated&&(s.props!==!0||s.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,b.Name)),!0}};be.KeywordCxt=xt;function Yn(t,e,r,s){let n=new xt(t,r,e);"code"in r?r.code(n,s):n.$data&&r.validate?(0,lt.funcKeywordCode)(n,r):"macro"in r?(0,lt.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,lt.funcKeywordCode)(n,r)}o(Yn,"keywordCode");var Bc=/^\/(?:[^~]|~0|~1)*$/,Wc=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function eo(t,{dataLevel:e,dataNames:r,dataPathArr:s}){let n,i;if(t==="")return E.default.rootData;if(t[0]==="/"){if(!Bc.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,i=E.default.rootData}else{let d=Wc.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+d[1];if(n=d[2],n==="#"){if(l>=e)throw new Error(u("property/index",l));return s[e-l]}if(l>e)throw new Error(u("data",l));if(i=r[e-l],!n)return i}let a=i,c=n.split("/");for(let d of c)d&&(i=(0,b._)`${i}${(0,b.getProperty)((0,ye.unescapeJsonPointer)(d))}`,a=(0,b._)`${a} && ${i}`);return a;function u(d,l){return`Cannot access ${d} ${l} levels up, current level is ${e}`}}o(eo,"getData");be.getData=eo});var Ft=v(Gr=>{"use strict";f();Object.defineProperty(Gr,"__esModule",{value:!0});var Lr=class extends Error{static{o(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Gr.default=Lr});var ft=v(Wr=>{"use strict";f();Object.defineProperty(Wr,"__esModule",{value:!0});var Jr=ct(),Br=class extends Error{static{o(this,"MissingRefError")}constructor(e,r,s,n){super(n||`can't resolve reference ${s} from id ${r}`),this.missingRef=(0,Jr.resolveUrl)(e,r,s),this.missingSchema=(0,Jr.normalizeId)((0,Jr.getFullPath)(e,this.missingRef))}};Wr.default=Br});var zt=v(re=>{"use strict";f();Object.defineProperty(re,"__esModule",{value:!0});re.resolveSchema=re.getCompilingSchema=re.resolveRef=re.compileSchema=re.SchemaEnv=void 0;var oe=q(),Qc=Ft(),Ie=me(),ie=ct(),to=R(),Zc=dt(),Ke=class{static{o(this,"SchemaEnv")}constructor(e){var r;this.refs={},this.dynamicAnchors={};let s;typeof e.schema=="object"&&(s=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,ie.normalizeId)(s?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=s?.$async,this.refs={}}};re.SchemaEnv=Ke;function Zr(t){let e=ro.call(this,t);if(e)return e;let r=(0,ie.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:s,lines:n}=this.opts.code,{ownProperties:i}=this.opts,a=new oe.CodeGen(this.scope,{es5:s,lines:n,ownProperties:i}),c;t.$async&&(c=a.scopeValue("Error",{ref:Qc.default,code:(0,oe._)`require("ajv/dist/runtime/validation_error").default`}));let u=a.scopeName("validate");t.validateName=u;let d={gen:a,allErrors:this.opts.allErrors,data:Ie.default.data,parentData:Ie.default.parentData,parentDataProperty:Ie.default.parentDataProperty,dataNames:[Ie.default.data],dataPathArr:[oe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,oe.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:oe.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,oe._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,Zc.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let h=a.toString();l=`${a.scopeRefs(Ie.default.scope)}return ${h}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let g=new Function(`${Ie.default.self}`,`${Ie.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:h,scopeValues:a._values}),this.opts.unevaluated){let{props:m,items:p}=d;g.evaluated={props:m instanceof oe.Name?void 0:m,items:p instanceof oe.Name?void 0:p,dynamicProps:m instanceof oe.Name,dynamicItems:p instanceof oe.Name},g.source&&(g.source.evaluated=(0,oe.stringify)(g.evaluated))}return t.validate=g,t}catch(h){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),h}finally{this._compilations.delete(t)}}o(Zr,"compileSchema");re.compileSchema=Zr;function Xc(t,e,r){var s;r=(0,ie.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let i=tu.call(this,t,r);if(i===void 0){let a=(s=t.localRefs)===null||s===void 0?void 0:s[r],{schemaId:c}=this.opts;a&&(i=new Ke({schema:a,schemaId:c,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=Yc.call(this,i)}o(Xc,"resolveRef");re.resolveRef=Xc;function Yc(t){return(0,ie.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Zr.call(this,t)}o(Yc,"inlineOrCompile");function ro(t){for(let e of this._compilations)if(eu(e,t))return e}o(ro,"getCompilingSchema");re.getCompilingSchema=ro;function eu(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}o(eu,"sameSchemaEnv");function tu(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Vt.call(this,t,e)}o(tu,"resolve");function Vt(t,e){let r=this.opts.uriResolver.parse(e),s=(0,ie._getFullPath)(this.opts.uriResolver,r),n=(0,ie.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&s===n)return Qr.call(this,r,t);let i=(0,ie.normalizeId)(s),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let c=Vt.call(this,t,a);return typeof c?.schema!="object"?void 0:Qr.call(this,r,c)}if(typeof a?.schema=="object"){if(a.validate||Zr.call(this,a),i===(0,ie.normalizeId)(e)){let{schema:c}=a,{schemaId:u}=this.opts,d=c[u];return d&&(n=(0,ie.resolveUrl)(this.opts.uriResolver,n,d)),new Ke({schema:c,schemaId:u,root:t,baseId:n})}return Qr.call(this,r,a)}}o(Vt,"resolveSchema");re.resolveSchema=Vt;var ru=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qr(t,{baseId:e,schema:r,root:s}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,to.unescapeFragment)(c)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!ru.has(c)&&d&&(e=(0,ie.resolveUrl)(this.opts.uriResolver,e,d))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,to.schemaHasRulesButRef)(r,this.RULES)){let c=(0,ie.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Vt.call(this,s,c)}let{schemaId:a}=this.opts;if(i=i||new Ke({schema:r,schemaId:a,root:s,baseId:e}),i.schema!==i.root.schema)return i}o(Qr,"getJsonPointer")});var so=v((Bh,su)=>{su.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ss=v((Wh,lo)=>{"use strict";f();var nu=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Yr=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),ou=RegExp.prototype.test.bind(/^\d*$/u),je=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),es=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),oo=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),ts=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),iu=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),X=new Array(256);{let t="0123456789ABCDEF";for(let e=0;e<256;e++)X[e]="%"+t[e>>4]+t[e&15]}function G(t){return t<2048?X[192|t>>6]+X[128|t&63]:t<65536?X[224|t>>12]+X[128|t>>6&63]+X[128|t&63]:X[240|t>>18]+X[128|t>>12&63]+X[128|t>>6&63]+X[128|t&63]}o(G,"percentEncodeNonAscii");function au(t){let e="",r=0,s=0;for(s=0;s<t.length;s++)if(r=t[s].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[s];break}for(s+=1;s<t.length;s++){if(r=t[s].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[s]}return e}o(au,"stringArrayToHexStripped");var cu=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),uu=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),lu=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),du=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function fu(t){if(t.length===0)return!1;for(let e=0;e<t.length;e++)if(!lu(t[e])){if(t[e]==="%"&&e+2<t.length&&je(t.slice(e+1,e+3))){e+=2;continue}return!1}return!0}o(fu,"isZoneIdentifier");function no(t){let e=-1,r=0,s=-1,n=0;for(let c=0;c<t.length;c++)t[c]==="0"?(s===-1&&(s=c),n++,n>r&&(r=n,e=s)):(s=-1,n=0);if(r<2)return t.join(":");let i=t.slice(0,e).join(":"),a=t.slice(e+r).join(":");return i+"::"+a}o(no,"compressIPv6ZeroRun");function hu(t){let e=t.indexOf("::");if(e!==-1&&t.indexOf("::",e+1)!==-1)return;let r=e===-1?t.split(":"):t.slice(0,e).split(":"),s=e===-1?[]:t.slice(e+2).split(":");e!==-1&&(r.length===1&&r[0]===""&&(r.length=0),s.length===1&&s[0]===""&&(s.length=0));let n=r.concat(s),i=0;for(let c=0;c<n.length;c++){let u=n[c];if(u==="")return;if(u.indexOf(".")!==-1){if(c!==n.length-1||e!==-1&&s.length===0||!Yr(u))return;i+=2;continue}if(!cu(u))return;n[c]=parseInt(u,16).toString(16),i++}if(e===-1)return i!==8?void 0:no(n);if(i>=8)return;let a=n.slice(0,r.length);for(let c=i;c<8;c++)a.push("0");for(let c=r.length;c<n.length;c++)a.push(n[c]);return no(a)}o(hu,"normalizeIPv6Address");function Xr(t){let e=t[0]==="["&&t[t.length-1]==="]";if((t[0]==="["||t[t.length-1]==="]")&&!e)return{host:t,isIPV6:!1,error:!0};let s=e?t.slice(1,-1):t;if(e&&uu(s))return s=s.toLowerCase(),{host:`[${s}]`,escapedHost:s,isIPV6:!1,isIPVFuture:!0};if(pu(s,":")<2)return{host:t,isIPV6:!1,error:e};let n="",i=s.indexOf("%");if(i!==-1){let c=s.slice(i,i+3).toLowerCase()==="%25"?3:1;if(n=s.slice(i+c),!fu(n))return{host:t,isIPV6:!1,error:!0};s=s.slice(0,i)}let a=hu(s);return a===void 0?{host:t,isIPV6:!1,error:!0}:{host:a+(n?"%"+n:""),escapedHost:a+(n?"%25"+n:""),isIPV6:!0}}o(Xr,"normalizeIPv6");function pu(t,e){let r=0;for(let s=0;s<t.length;s++)t[s]===e&&r++;return r}o(pu,"findToken");function mu(t){let e=t,r=[],s=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((s=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,s)),e=e.slice(s)}return r.join("")}o(mu,"removeDotSegments");var yu={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},gu=/[@/?#:]/g,_u=/[@/?#]/g;function io(t,e){let r=e?_u:gu;return r.lastIndex=0,t.replace(r,s=>yu[s])}o(io,"reescapeHostDelimiters");function ao(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let s=0;s<t.length;s++){if(t[s]==="%"&&s+2<t.length){let n=t.slice(s+1,s+3);if(je(n)){let i=n.toUpperCase(),a=String.fromCharCode(parseInt(i,16));e&&es(a)?r+=a:r+="%"+i,s+=2;continue}}r+=t[s]}return r}o(ao,"normalizePercentEncoding");function $u(t){let e="";for(let r=0;r<t.length;r++){let s=t[r];if(s==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(je(n)){let i=n.toUpperCase(),a=String.fromCharCode(parseInt(i,16));a!=="."&&es(a)?e+=a:e+="%"+i,r+=2;continue}}if(oo(s))e+=s;else{let n=t.charCodeAt(r);if(n<128)e+=uo(n)?s:X[n];else if(n<55296||n>57343)e+=G(n);else if(n<=56319&&r+1<t.length){let i=t.charCodeAt(r+1);i>=56320&&i<=57343?(e+=G(65536+(n-55296<<10)+(i-56320)),r++):e+=G(65533)}else e+=G(65533)}}return e}o($u,"normalizePathEncoding");function vu(t,e=!1){let r="",s=e&&t[0]!=="/";for(let n=0;n<t.length;n++){let i=t[n];if(i==="%"&&n+2<t.length){let a=t.slice(n+1,n+3);if(je(a)){r+="%"+a.toUpperCase(),n+=2;continue}}if(i==="/"&&(s=!1),oo(i)&&(i!==":"||!s))r+=i;else{let a=t.charCodeAt(n);if(a<128)r+=X[a];else if(a<55296||a>57343)r+=G(a);else if(a<=56319&&n+1<t.length){let c=t.charCodeAt(n+1);c>=56320&&c<=57343?(r+=G(65536+(a-55296<<10)+(c-56320)),n++):r+=G(65533)}else r+=G(65533)}}return r}o(vu,"serializePathEncoding");function rs(t,e){let r="";for(let s=0;s<t.length;s++){let n=t[s];if(n==="%"&&s+2<t.length){let i=t.slice(s+1,s+3);if(je(i)){r+="%"+i.toUpperCase(),s+=2;continue}}if(e(n))r+=n;else{let i=t.charCodeAt(s);if(i<128)r+=X[i];else if(i<55296||i>57343)r+=G(i);else if(i<=56319&&s+1<t.length){let a=t.charCodeAt(s+1);a>=56320&&a<=57343?(r+=G(65536+(i-55296<<10)+(a-56320)),s++):r+=G(65533)}else r+=G(65533)}}return r}o(rs,"encodeComponent");function co(t){return rs(t,iu)}o(co,"encodeUserinfo");function wu(t){return rs(t,ts)}o(wu,"encodeQuery");function bu(t){return rs(t,ts)}o(bu,"encodeFragment");function uo(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===42||t===43||t===45||t===46||t===47||t===64||t===95}o(uo,"isEscapeSafe");function Eu(t){let e="";for(let r=0;r<t.length;r++){let s=t[r];if(s==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(je(n)){let i=n.toUpperCase(),a=String.fromCharCode(parseInt(i,16));es(a)?e+=a:e+="%"+i,r+=2;continue}}if(ts(s))e+=s;else{let n=t.charCodeAt(r);if(n<128)e+=uo(n)?s:X[n];else if(n<55296||n>57343)e+=G(n);else if(n<=56319&&r+1<t.length){let i=t.charCodeAt(r+1);i>=56320&&i<=57343?(e+=G(65536+(n-55296<<10)+(i-56320)),r++):e+=G(65533)}else e+=G(65533)}}return e}o(Eu,"normalizeQueryFragmentEncoding");function Su(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let s=t.slice(r+1,r+3);if(je(s)){e+="%"+s.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}o(Su,"escapePreservingEscapes");function Pu(t){let e=[];if(t.userinfo!==void 0&&(e.push(co(t.userinfo)),e.push("@")),t.host!==void 0){let r=t.host;if(!Yr(r)){let s=Xr(r);s.isIPV6!==!0&&s.isIPVFuture!==!0&&(r=ao(r,!0),s=Xr(r)),s.isIPV6===!0||s.isIPVFuture===!0?r=`[${s.escapedHost}]`:r=io(r,!1)}e.push(r)}if(typeof t.port=="number"||typeof t.port=="string"){let r=String(t.port);if(!ou(r))throw new TypeError("URI port is malformed.");e.push(":"),e.push(r)}return e.length?e.join(""):void 0}o(Pu,"recomposeAuthority");lo.exports={nonSimpleDomain:du,recomposeAuthority:Pu,reescapeHostDelimiters:io,normalizePercentEncoding:ao,normalizePathEncoding:$u,serializePathEncoding:vu,normalizeQueryFragmentEncoding:Eu,encodeUserinfo:co,encodeQuery:wu,encodeFragment:bu,escapePreservingEscapes:Su,removeDotSegments:mu,isIPv4:Yr,isUUID:nu,normalizeIPv6:Xr,stringArrayToHexStripped:au}});var yo=v((Xh,mo)=>{"use strict";f();var{isUUID:Nu}=ss(),Ou=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,ku=["http","https","ws","wss","urn","urn:uuid"];function qu(t){return ku.indexOf(t)!==-1}o(qu,"isValidSchemeName");function ns(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}o(ns,"wsIsSecure");function fo(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}o(fo,"httpParse");function ho(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}o(ho,"httpSerialize");function Iu(t){return t.secure=ns(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}o(Iu,"wsParse");function ju(t){if((t.port===(ns(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let e=t.resourceName.indexOf("?"),r=e===-1?t.resourceName:t.resourceName.slice(0,e);t.path=r&&r!=="/"?r:void 0,t.query=e===-1?void 0:t.resourceName.slice(e+1),t.resourceName=void 0}return t.fragment=void 0,t}o(ju,"wsSerialize");function Ru(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(Ou);if(r&&r[0]===t.path){let s=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${s}:${e.nid||t.nid}`,i=os(n);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}o(Ru,"urnParse");function Tu(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",s=t.nid.toLowerCase(),n=`${r}:${e.nid||s}`,i=os(n);i&&(t=i.serialize(t,e));let a=t,c=t.nss;return a.path=`${s||e.nid}:${c}`,e.skipEscape=!0,a}o(Tu,"urnSerialize");function Cu(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Nu(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(Cu,"urnuuidParse");function Au(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}o(Au,"urnuuidSerialize");var po={scheme:"http",domainHost:!0,parse:fo,serialize:ho},Du={scheme:"https",domainHost:po.domainHost,parse:fo,serialize:ho},Ut={scheme:"ws",domainHost:!0,parse:Iu,serialize:ju},Mu={scheme:"wss",domainHost:Ut.domainHost,parse:Ut.parse,serialize:Ut.serialize},xu={scheme:"urn",parse:Ru,serialize:Tu,skipNormalize:!0},Fu={scheme:"urn:uuid",parse:Cu,serialize:Au,skipNormalize:!0},Kt={http:po,https:Du,ws:Ut,wss:Mu,urn:xu,"urn:uuid":Fu};Object.setPrototypeOf(Kt,null);function os(t){return t&&(Kt[t]||Kt[t.toLowerCase()])||void 0}o(os,"getSchemeHandler");mo.exports={wsIsSecure:ns,SCHEMES:Kt,isValidSchemeName:qu,getSchemeHandler:os}});var qo=v((tp,Gt)=>{"use strict";f();var{normalizeIPv6:wo,removeDotSegments:pt,recomposeAuthority:Vu,normalizePercentEncoding:is,normalizePathEncoding:zu,serializePathEncoding:go,normalizeQueryFragmentEncoding:_o,encodeQuery:Uu,encodeFragment:Ku,reescapeHostDelimiters:Hu,isIPv4:bo,nonSimpleDomain:Lu}=ss(),{SCHEMES:Eo,getSchemeHandler:as}=yo(),So=/^[A-Za-z][A-Za-z0-9+.-]*$/u,Po="URI scheme is malformed.";function $o(t){let e=unescape(String(t));if(!So.test(e))throw new TypeError(Po);return e}o($o,"decodeValidScheme");function Gu(t,e){return typeof t=="string"?t=el(t,e):typeof t=="object"&&(t=Lt(Re(t,e),e)),t}o(Gu,"normalize");function Ju(t,e,r){let s=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:n,malformedAuthorityOrPort:i,malformedPercentEncoding:a,malformedSchemeSpecific:c,malformedHost:u,malformedScheme:d}=Ht(t,s),{parsed:l,malformedAuthorityOrPort:h,malformedPercentEncoding:_,malformedSchemeSpecific:g,malformedHost:m,malformedScheme:p}=Ht(e,s);if(i||h||a||_||c||g||u||m||d||p)throw new Error(n.error||l.error||"URI is malformed.");let y=No(n,l,s,!0),$=as(r&&r.scheme||y.scheme),S=y.host,P=S!==void 0&&S!==""&&(bo(S)||wo(S).isIPV6);Oo(y,r||{},$,P);let A=S&&S.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(S);if(y.error&&!A)throw new Error(y.error);return s.skipEscape=!0,Re(y,s)}o(Ju,"resolve");function No(t,e,r,s){let n={};return s||(t=Lt(Re(t,r),r),e=Lt(Re(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=pt(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=pt(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=pt(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=pt(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}o(No,"resolveComponent");function Bu(t,e,r){let s=vo(t,r),n=vo(e,r);return s!==void 0&&n!==void 0&&s===n}o(Bu,"equal");function Re(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},s=Object.assign({},e),n=[];r.scheme&&(r.scheme=$o(r.scheme));let i=as(s.scheme||r.scheme);i&&i.serialize&&i.serialize(r,s);let a=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,c=!s.skipEscape&&r.scheme===void 0&&!a;r.path!==void 0&&(s.skipEscape?r.path=is(r.path):r.path=go(r.path,c)),s.reference!=="suffix"&&r.scheme&&(r.scheme=$o(r.scheme),n.push(r.scheme,":"));let u=Vu(r);if(u!==void 0&&(s.reference!=="suffix"&&n.push("//"),n.push(u),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let d=r.path;!s.absolutePath&&(!i||!i.absolutePath)&&(d=pt(d)),c&&(d=go(d,!0)),u===void 0&&d[0]==="/"&&d[1]==="/"&&(d="/%2F"+d.slice(2)),n.push(d)}return r.query!==void 0&&n.push("?",Uu(r.query)),r.fragment!==void 0&&n.push("#",Ku(r.fragment)),n.join("")}o(Re,"serialize");var Wu=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,Qu=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,Zu=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function Xu(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}o(Xu,"getParseError");function ht(t){if(t===void 0)return!1;let e=t.indexOf("%");for(;e!==-1;){if(e+2>=t.length||!/^[\da-f]{2}$/iu.test(t.slice(e+1,e+3)))return!0;e=t.indexOf("%",e+3)}return!1}o(ht,"hasMalformedPercentEncoding");function cs(t){return t[0]==="["&&t[t.length-1]==="]"}o(cs,"isIPLiteral");function Yu(t){let e=t[4];return ht(t[3])||e!==void 0&&!cs(e)&&ht(e)||ht(t[6])||ht(t[7])||ht(t[8])}o(Yu,"hasMalformedComponentPercentEncoding");function Oo(t,e,r,s){if(!e.unicodeSupport&&(!r||!r.unicodeSupport)&&t.host&&!cs(t.host)&&(e.domainHost||r&&r.domainHost)&&s===!1&&Lu(t.host))try{t.host=new URL("http://"+t.host).hostname}catch(n){return t.error=t.error||"Host's domain name can not be converted to ASCII: "+n,!0}return!1}o(Oo,"canonicalizeHost");function Ht(t,e){let r=Object.assign({},e),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,i=!1,a=!1,c=!1,u=!1,d=!1,l=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let h=t.match(Qu);h!==null&&h[1].indexOf("\\")!==-1&&(s.error="URI authority must not contain a literal backslash.",n=!0);let _=t.match(Zu);if(_!==null){let m=_[1],p=m.replace(/[\t\n\r]/g,"");p.length>=2&&(p.slice(0,2)!=="//"?(s.error=s.error||"URI authority must not contain a literal backslash.",n=!0):m.length!==p.length&&(s.error=s.error||"URI authority introducer must not contain whitespace.",n=!0))}let g=t.match(Wu);if(g){if(s.scheme=g[1],s.userinfo=g[3],s.host=g[4],s.port=parseInt(g[5],10),s.path=g[6]||"",s.query=g[7],s.fragment=g[8],s.scheme!==void 0){let y=unescape(s.scheme);So.test(y)?s.scheme=y.toLowerCase():(s.error=s.error||Po,d=!0)}i=Yu(g),i&&(s.error=s.error||"URI contains malformed percent-encoding."),isNaN(s.port)&&(s.port=g[5]);let m=Xu(s,g);if(m!==void 0&&(s.error=s.error||m,n=!0),s.host)if(bo(s.host)===!1){let $=cs(s.host),S=s.host.indexOf("[")!==-1||s.host.indexOf("]")!==-1,P=wo(s.host);l=P.isIPV6||P.isIPVFuture===!0,u=S&&(!$||P.error===!0),s.host=l?P.host:P.host.toLowerCase(),u&&(s.error=s.error||"URI host is malformed.",n=!0)}else l=!0;s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path?s.reference="same-document":s.scheme===void 0?s.reference="relative":s.fragment===void 0?s.reference="absolute":s.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==s.reference&&(s.error=s.error||"URI is not a "+r.reference+" reference.");let p=as(r.scheme||s.scheme);if(u||(c=Oo(s,r,p,l)),t.indexOf("%")!==-1&&s.host!==void 0&&!u){let y=l?s.host:is(s.host,!0);l||(y=is(y.toLowerCase())),s.host=Hu(y,l)}(!p||p&&!p.skipNormalize)&&(s.path&&(s.path=zu(s.path)),s.query&&(s.query=_o(s.query)),s.fragment&&(s.fragment=_o(s.fragment))),p&&p.parse&&(p.parse(s,r),p===Eo.urn&&s.nid===void 0&&(a=!0))}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:n,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:d}}o(Ht,"parseWithStatus");function Lt(t,e){return Ht(t,e).parsed}o(Lt,"parse");function el(t,e){return ko(t,e).normalized}o(el,"normalizeString");function ko(t,e){let{parsed:r,malformedAuthorityOrPort:s,malformedPercentEncoding:n,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}=Ht(t,e);return{normalized:s||n||i||a||c?t:Re(r,e),malformedAuthorityOrPort:s,malformedPercentEncoding:n,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}}o(ko,"normalizeStringWithStatus");function vo(t,e){if(typeof t!="string"&&typeof t!="object")return;let r;try{r=typeof t=="string"?t:Re(t,e)}catch{return}let{normalized:s,malformedAuthorityOrPort:n,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:u}=ko(r,e);return n||i||a||c||u?void 0:s}o(vo,"normalizeComparableURI");var us={SCHEMES:Eo,normalize:Gu,resolve:Ju,resolveComponent:No,equal:Bu,serialize:Re,parse:Lt};Gt.exports=us;Gt.exports.default=us;Gt.exports.fastUri=us});var jo=v(ls=>{"use strict";f();Object.defineProperty(ls,"__esModule",{value:!0});var Io=qo();Io.code='require("ajv/dist/runtime/uri").default';ls.default=Io});var Fo=v(z=>{"use strict";f();Object.defineProperty(z,"__esModule",{value:!0});z.CodeGen=z.Name=z.nil=z.stringify=z.str=z._=z.KeywordCxt=void 0;var tl=dt();Object.defineProperty(z,"KeywordCxt",{enumerable:!0,get:o(function(){return tl.KeywordCxt},"get")});var He=q();Object.defineProperty(z,"_",{enumerable:!0,get:o(function(){return He._},"get")});Object.defineProperty(z,"str",{enumerable:!0,get:o(function(){return He.str},"get")});Object.defineProperty(z,"stringify",{enumerable:!0,get:o(function(){return He.stringify},"get")});Object.defineProperty(z,"nil",{enumerable:!0,get:o(function(){return He.nil},"get")});Object.defineProperty(z,"Name",{enumerable:!0,get:o(function(){return He.Name},"get")});Object.defineProperty(z,"CodeGen",{enumerable:!0,get:o(function(){return He.CodeGen},"get")});var rl=Ft(),Do=ft(),sl=Rr(),mt=zt(),nl=q(),yt=ct(),Jt=at(),fs=R(),Ro=so(),ol=jo(),Mo=o((t,e)=>new RegExp(t,e),"defaultRegExp");Mo.code="new RegExp";var il=["removeAdditional","useDefaults","coerceTypes"],al=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),cl={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},ul={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},To=200;function ll(t){var e,r,s,n,i,a,c,u,d,l,h,_,g,m,p,y,$,S,P,A,N,ce,fe,cr,ur;let Ze=t.strict,lr=(e=t.code)===null||e===void 0?void 0:e.optimize,rn=lr===!0||lr===void 0?1:lr||0,sn=(s=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&s!==void 0?s:Mo,Li=(n=t.uriResolver)!==null&&n!==void 0?n:ol.default;return{strictSchema:(a=(i=t.strictSchema)!==null&&i!==void 0?i:Ze)!==null&&a!==void 0?a:!0,strictNumbers:(u=(c=t.strictNumbers)!==null&&c!==void 0?c:Ze)!==null&&u!==void 0?u:!0,strictTypes:(l=(d=t.strictTypes)!==null&&d!==void 0?d:Ze)!==null&&l!==void 0?l:"log",strictTuples:(_=(h=t.strictTuples)!==null&&h!==void 0?h:Ze)!==null&&_!==void 0?_:"log",strictRequired:(m=(g=t.strictRequired)!==null&&g!==void 0?g:Ze)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:rn,regExp:sn}:{optimize:rn,regExp:sn},loopRequired:(p=t.loopRequired)!==null&&p!==void 0?p:To,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:To,meta:($=t.meta)!==null&&$!==void 0?$:!0,messages:(S=t.messages)!==null&&S!==void 0?S:!0,inlineRefs:(P=t.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(A=t.schemaId)!==null&&A!==void 0?A:"$id",addUsedSchema:(N=t.addUsedSchema)!==null&&N!==void 0?N:!0,validateSchema:(ce=t.validateSchema)!==null&&ce!==void 0?ce:!0,validateFormats:(fe=t.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(cr=t.unicodeRegExp)!==null&&cr!==void 0?cr:!0,int32range:(ur=t.int32range)!==null&&ur!==void 0?ur:!0,uriResolver:Li}}o(ll,"requiredOptions");var gt=class{static{o(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...ll(e)};let{es5:r,lines:s}=this.opts.code;this.scope=new nl.ValueScope({scope:{},prefixes:al,es5:r,lines:s}),this.logger=yl(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,sl.getRules)(),Co.call(this,cl,e,"NOT SUPPORTED"),Co.call(this,ul,e,"DEPRECATED","warn"),this._metaOpts=pl.call(this),e.formats&&fl.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&hl.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),dl.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:s}=this.opts,n=Ro;s==="id"&&(n={...Ro},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[s],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let s;if(typeof e=="string"){if(s=this.getSchema(e),!s)throw new Error(`no schema with key or ref "${e}"`)}else s=this.compile(e);let n=s(r);return"$async"in s||(this.errors=s.errors),n}compile(e,r){let s=this._addSchema(e,r);return s.validate||this._compileSchemaEnv(s)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:s}=this.opts;return n.call(this,e,r);async function n(l,h){await i.call(this,l.$schema);let _=this._addSchema(l,h);return _.validate||a.call(this,_)}async function i(l){l&&!this.getSchema(l)&&await n.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(h){if(!(h instanceof Do.default))throw h;return c.call(this,h),await u.call(this,h.missingSchema),a.call(this,l)}}function c({missingSchema:l,missingRef:h}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${h} cannot be resolved`)}async function u(l){let h=await d.call(this,l);this.refs[l]||await i.call(this,h.$schema),this.refs[l]||this.addSchema(h,l,r)}async function d(l){let h=this._loading[l];if(h)return h;try{return await(this._loading[l]=s(l))}finally{delete this._loading[l]}}}addSchema(e,r,s,n=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,s,n);return this}let i;if(typeof e=="object"){let{schemaId:a}=this.opts;if(i=e[a],i!==void 0&&typeof i!="string")throw new Error(`schema ${a} must be string`)}return r=(0,yt.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,s,r,n,!0),this}addMetaSchema(e,r,s=this.opts.validateSchema){return this.addSchema(e,r,!0,s),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let s;if(s=e.$schema,s!==void 0&&typeof s!="string")throw new Error("$schema must be a string");if(s=s||this.opts.defaultMeta||this.defaultMeta(),!s)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(s,e);if(!n&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return n}getSchema(e){let r;for(;typeof(r=Ao.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:s}=this.opts,n=new mt.SchemaEnv({schema:{},schemaId:s});if(r=mt.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Ao.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let s=e[this.opts.schemaId];return s&&(s=(0,yt.normalizeId)(s),delete this.schemas[s],delete this.refs[s]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let s;if(typeof e=="string")s=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=s);else if(typeof e=="object"&&r===void 0){if(r=e,s=r.keyword,Array.isArray(s)&&!s.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(_l.call(this,s,r),!r)return(0,fs.eachItem)(s,i=>ds.call(this,i)),this;vl.call(this,r);let n={...r,type:(0,Jt.getJSONTypes)(r.type),schemaType:(0,Jt.getJSONTypes)(r.schemaType)};return(0,fs.eachItem)(s,n.type.length===0?i=>ds.call(this,i,n):i=>n.type.forEach(a=>ds.call(this,i,n,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let s of r.rules){let n=s.rules.findIndex(i=>i.keyword===e);n>=0&&s.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:s="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${s}${n.instancePath} ${n.message}`).reduce((n,i)=>n+r+i)}$dataMetaSchema(e,r){let s=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let i=n.split("/").slice(1),a=e;for(let c of i)a=a[c];for(let c in s){let u=s[c];if(typeof u!="object")continue;let{$data:d}=u.definition,l=a[c];d&&l&&(a[c]=xo(l))}}return e}_removeAllSchemas(e,r){for(let s in e){let n=e[s];(!r||r.test(s))&&(typeof n=="string"?delete e[s]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[s]))}}_addSchema(e,r,s,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:c}=this.opts;if(typeof e=="object")a=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;s=(0,yt.normalizeId)(a||s);let d=yt.getSchemaRefs.call(this,e,s);return u=new mt.SchemaEnv({schema:e,schemaId:c,meta:r,baseId:s,localRefs:d}),this._cache.set(u.schema,u),i&&!s.startsWith("#")&&(s&&this._checkUnique(s),this.refs[s]=u),n&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):mt.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{mt.compileSchema.call(this,e)}finally{this.opts=r}}};gt.ValidationError=rl.default;gt.MissingRefError=Do.default;z.default=gt;function Co(t,e,r,s="error"){for(let n in t){let i=n;i in e&&this.logger[s](`${r}: option ${n}. ${t[i]}`)}}o(Co,"checkOptions");function Ao(t){return t=(0,yt.normalizeId)(t),this.schemas[t]||this.refs[t]}o(Ao,"getSchEnv");function dl(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}o(dl,"addInitialSchemas");function fl(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}o(fl,"addInitialFormats");function hl(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}o(hl,"addInitialKeywords");function pl(){let t={...this.opts};for(let e of il)delete t[e];return t}o(pl,"getMetaSchemaOptions");var ml={log(){},warn(){},error(){}};function yl(t){if(t===!1)return ml;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}o(yl,"getLogger");var gl=/^[a-z_$][a-z0-9_$:-]*$/i;function _l(t,e){let{RULES:r}=this;if((0,fs.eachItem)(t,s=>{if(r.keywords[s])throw new Error(`Keyword ${s} is already defined`);if(!gl.test(s))throw new Error(`Keyword ${s} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}o(_l,"checkKeyword");function ds(t,e,r){var s;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=n?i.post:i.rules.find(({type:u})=>u===r);if(a||(a={type:r,rules:[]},i.rules.push(a)),i.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,Jt.getJSONTypes)(e.type),schemaType:(0,Jt.getJSONTypes)(e.schemaType)}};e.before?$l.call(this,a,c,e.before):a.rules.push(c),i.all[t]=c,(s=e.implements)===null||s===void 0||s.forEach(u=>this.addKeyword(u))}o(ds,"addRule");function $l(t,e,r){let s=t.rules.findIndex(n=>n.keyword===r);s>=0?t.rules.splice(s,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}o($l,"addBeforeRule");function vl(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=xo(e)),t.validateSchema=this.compile(e,!0))}o(vl,"keywordMetaschema");var wl={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function xo(t){return{anyOf:[t,wl]}}o(xo,"schemaOrData")});var Vo=v(hs=>{"use strict";f();Object.defineProperty(hs,"__esModule",{value:!0});var bl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};hs.default=bl});var Ho=v(Te=>{"use strict";f();Object.defineProperty(Te,"__esModule",{value:!0});Te.callRef=Te.getValidate=void 0;var El=ft(),zo=te(),Y=q(),Le=me(),Uo=zt(),Bt=R(),Sl={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:s}=t,{baseId:n,schemaEnv:i,validateName:a,opts:c,self:u}=s,{root:d}=i;if((r==="#"||r==="#/")&&n===d.baseId)return h();let l=Uo.resolveRef.call(u,d,n,r);if(l===void 0)throw new El.default(s.opts.uriResolver,n,r);if(l instanceof Uo.SchemaEnv)return _(l);return g(l);function h(){if(i===d)return Wt(t,a,i,i.$async);let m=e.scopeValue("root",{ref:d});return Wt(t,(0,Y._)`${m}.validate`,d,d.$async)}function _(m){let p=Ko(t,m);Wt(t,p,m,m.$async)}function g(m){let p=e.scopeValue("schema",c.code.source===!0?{ref:m,code:(0,Y.stringify)(m)}:{ref:m}),y=e.name("valid"),$=t.subschema({schema:m,dataTypes:[],schemaPath:Y.nil,topSchemaRef:p,errSchemaPath:r},y);t.mergeEvaluated($),t.ok(y)}}};function Ko(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Y._)`${r.scopeValue("wrapper",{ref:e})}.validate`}o(Ko,"getValidate");Te.getValidate=Ko;function Wt(t,e,r,s){let{gen:n,it:i}=t,{allErrors:a,schemaEnv:c,opts:u}=i,d=u.passContext?Le.default.this:Y.nil;s?l():h();function l(){if(!c.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,Y._)`await ${(0,zo.callValidateCode)(t,e,d)}`),g(e),a||n.assign(m,!0)},p=>{n.if((0,Y._)`!(${p} instanceof ${i.ValidationError})`,()=>n.throw(p)),_(p),a||n.assign(m,!1)}),t.ok(m)}o(l,"callAsyncRef");function h(){t.result((0,zo.callValidateCode)(t,e,d),()=>g(e),()=>_(e))}o(h,"callSyncRef");function _(m){let p=(0,Y._)`${m}.errors`;n.assign(Le.default.vErrors,(0,Y._)`${Le.default.vErrors} === null ? ${p} : ${Le.default.vErrors}.concat(${p})`),n.assign(Le.default.errors,(0,Y._)`${Le.default.vErrors}.length`)}o(_,"addErrorsFrom");function g(m){var p;if(!i.opts.unevaluated)return;let y=(p=r?.validate)===null||p===void 0?void 0:p.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(i.props=Bt.mergeEvaluated.props(n,y.props,i.props));else{let $=n.var("props",(0,Y._)`${m}.evaluated.props`);i.props=Bt.mergeEvaluated.props(n,$,i.props,Y.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=Bt.mergeEvaluated.items(n,y.items,i.items));else{let $=n.var("items",(0,Y._)`${m}.evaluated.items`);i.items=Bt.mergeEvaluated.items(n,$,i.items,Y.Name)}}o(g,"addEvaluatedFrom")}o(Wt,"callRef");Te.callRef=Wt;Te.default=Sl});var Lo=v(ps=>{"use strict";f();Object.defineProperty(ps,"__esModule",{value:!0});var Pl=Vo(),Nl=Ho(),Ol=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Pl.default,Nl.default];ps.default=Ol});var Go=v(ms=>{"use strict";f();Object.defineProperty(ms,"__esModule",{value:!0});var Qt=q(),Ee=Qt.operators,Zt={maximum:{okStr:"<=",ok:Ee.LTE,fail:Ee.GT},minimum:{okStr:">=",ok:Ee.GTE,fail:Ee.LT},exclusiveMaximum:{okStr:"<",ok:Ee.LT,fail:Ee.GTE},exclusiveMinimum:{okStr:">",ok:Ee.GT,fail:Ee.LTE}},kl={message:o(({keyword:t,schemaCode:e})=>(0,Qt.str)`must be ${Zt[t].okStr} ${e}`,"message"),params:o(({keyword:t,schemaCode:e})=>(0,Qt._)`{comparison: ${Zt[t].okStr}, limit: ${e}}`,"params")},ql={keyword:Object.keys(Zt),type:"number",schemaType:"number",$data:!0,error:kl,code(t){let{keyword:e,data:r,schemaCode:s}=t;t.fail$data((0,Qt._)`${r} ${Zt[e].fail} ${s} || isNaN(${r})`)}};ms.default=ql});var Jo=v(ys=>{"use strict";f();Object.defineProperty(ys,"__esModule",{value:!0});var _t=q(),Il={message:o(({schemaCode:t})=>(0,_t.str)`must be multiple of ${t}`,"message"),params:o(({schemaCode:t})=>(0,_t._)`{multipleOf: ${t}}`,"params")},jl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Il,code(t){let{gen:e,data:r,schemaCode:s,it:n}=t,i=n.opts.multipleOfPrecision,a=e.let("res"),c=i?(0,_t._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,_t._)`${a} !== parseInt(${a})`;t.fail$data((0,_t._)`(${s} === 0 || (${a} = ${r}/${s}, ${c}))`)}};ys.default=jl});var Wo=v(gs=>{"use strict";f();Object.defineProperty(gs,"__esModule",{value:!0});function Bo(t){let e=t.length,r=0,s=0,n;for(;s<e;)r++,n=t.charCodeAt(s++),n>=55296&&n<=56319&&s<e&&(n=t.charCodeAt(s),(n&64512)===56320&&s++);return r}o(Bo,"ucs2length");gs.default=Bo;Bo.code='require("ajv/dist/runtime/ucs2length").default'});var Qo=v(_s=>{"use strict";f();Object.defineProperty(_s,"__esModule",{value:!0});var Ce=q(),Rl=R(),Tl=Wo(),Cl={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Ce.str)`must NOT have ${r} than ${e} characters`},params:o(({schemaCode:t})=>(0,Ce._)`{limit: ${t}}`,"params")},Al={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Cl,code(t){let{keyword:e,data:r,schemaCode:s,it:n}=t,i=e==="maxLength"?Ce.operators.GT:Ce.operators.LT,a=n.opts.unicode===!1?(0,Ce._)`${r}.length`:(0,Ce._)`${(0,Rl.useFunc)(t.gen,Tl.default)}(${r})`;t.fail$data((0,Ce._)`${a} ${i} ${s}`)}};_s.default=Al});var Zo=v($s=>{"use strict";f();Object.defineProperty($s,"__esModule",{value:!0});var Dl=te(),Ml=R(),Ge=q(),xl={message:o(({schemaCode:t})=>(0,Ge.str)`must match pattern "${t}"`,"message"),params:o(({schemaCode:t})=>(0,Ge._)`{pattern: ${t}}`,"params")},Fl={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:xl,code(t){let{gen:e,data:r,$data:s,schema:n,schemaCode:i,it:a}=t,c=a.opts.unicodeRegExp?"u":"";if(s){let{regExp:u}=a.opts.code,d=u.code==="new RegExp"?(0,Ge._)`new RegExp`:(0,Ml.useFunc)(e,u),l=e.let("valid");e.try(()=>e.assign(l,(0,Ge._)`${d}(${i}, ${c}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Ge._)`!${l}`)}else{let u=(0,Dl.usePattern)(t,n);t.fail$data((0,Ge._)`!${u}.test(${r})`)}}};$s.default=Fl});var Xo=v(vs=>{"use strict";f();Object.defineProperty(vs,"__esModule",{value:!0});var $t=q(),Vl={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,$t.str)`must NOT have ${r} than ${e} properties`},params:o(({schemaCode:t})=>(0,$t._)`{limit: ${t}}`,"params")},zl={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Vl,code(t){let{keyword:e,data:r,schemaCode:s}=t,n=e==="maxProperties"?$t.operators.GT:$t.operators.LT;t.fail$data((0,$t._)`Object.keys(${r}).length ${n} ${s}`)}};vs.default=zl});var Yo=v(ws=>{"use strict";f();Object.defineProperty(ws,"__esModule",{value:!0});var vt=te(),wt=q(),Ul=R(),Kl={message:o(({params:{missingProperty:t}})=>(0,wt.str)`must have required property '${t}'`,"message"),params:o(({params:{missingProperty:t}})=>(0,wt._)`{missingProperty: ${t}}`,"params")},Hl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Kl,code(t){let{gen:e,schema:r,schemaCode:s,data:n,$data:i,it:a}=t,{opts:c}=a;if(!i&&r.length===0)return;let u=r.length>=c.loopRequired;if(a.allErrors?d():l(),c.strictRequired){let g=t.parentSchema.properties,{definedProperties:m}=t.it;for(let p of r)if(g?.[p]===void 0&&!m.has(p)){let y=a.schemaEnv.baseId+a.errSchemaPath,$=`required property "${p}" is not defined at "${y}" (strictRequired)`;(0,Ul.checkStrictMode)(a,$,a.opts.strictRequired)}}function d(){if(u||i)t.block$data(wt.nil,h);else for(let g of r)(0,vt.checkReportMissingProp)(t,g)}o(d,"allErrorsMode");function l(){let g=e.let("missing");if(u||i){let m=e.let("valid",!0);t.block$data(m,()=>_(g,m)),t.ok(m)}else e.if((0,vt.checkMissingProp)(t,r,g)),(0,vt.reportMissingProp)(t,g),e.else()}o(l,"exitOnErrorMode");function h(){e.forOf("prop",s,g=>{t.setParams({missingProperty:g}),e.if((0,vt.noPropertyInData)(e,n,g,c.ownProperties),()=>t.error())})}o(h,"loopAllRequired");function _(g,m){t.setParams({missingProperty:g}),e.forOf(g,s,()=>{e.assign(m,(0,vt.propertyInData)(e,n,g,c.ownProperties)),e.if((0,wt.not)(m),()=>{t.error(),e.break()})},wt.nil)}o(_,"loopUntilMissing")}};ws.default=Hl});var ei=v(bs=>{"use strict";f();Object.defineProperty(bs,"__esModule",{value:!0});var bt=q(),Ll={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,bt.str)`must NOT have ${r} than ${e} items`},params:o(({schemaCode:t})=>(0,bt._)`{limit: ${t}}`,"params")},Gl={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Ll,code(t){let{keyword:e,data:r,schemaCode:s}=t,n=e==="maxItems"?bt.operators.GT:bt.operators.LT;t.fail$data((0,bt._)`${r}.length ${n} ${s}`)}};bs.default=Gl});var Xt=v(Es=>{"use strict";f();Object.defineProperty(Es,"__esModule",{value:!0});var ti=Vr();ti.code='require("ajv/dist/runtime/equal").default';Es.default=ti});var ri=v(Ps=>{"use strict";f();Object.defineProperty(Ps,"__esModule",{value:!0});var Ss=at(),U=q(),Jl=R(),Bl=Xt(),Wl={message:o(({params:{i:t,j:e}})=>(0,U.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:o(({params:{i:t,j:e}})=>(0,U._)`{i: ${t}, j: ${e}}`,"params")},Ql={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Wl,code(t){let{gen:e,data:r,$data:s,schema:n,parentSchema:i,schemaCode:a,it:c}=t;if(!s&&!n)return;let u=e.let("valid"),d=i.items?(0,Ss.getSchemaTypes)(i.items):[];t.block$data(u,l,(0,U._)`${a} === false`),t.ok(u);function l(){let m=e.let("i",(0,U._)`${r}.length`),p=e.let("j");t.setParams({i:m,j:p}),e.assign(u,!0),e.if((0,U._)`${m} > 1`,()=>(h()?_:g)(m,p))}o(l,"validateUniqueItems");function h(){return d.length>0&&!d.some(m=>m==="object"||m==="array")}o(h,"canOptimize");function _(m,p){let y=e.name("item"),$=(0,Ss.checkDataTypes)(d,y,c.opts.strictNumbers,Ss.DataType.Wrong),S=e.const("indices",(0,U._)`{}`);e.for((0,U._)`;${m}--;`,()=>{e.let(y,(0,U._)`${r}[${m}]`),e.if($,(0,U._)`continue`),d.length>1&&e.if((0,U._)`typeof ${y} == "string"`,(0,U._)`${y} += "_"`),e.if((0,U._)`typeof ${S}[${y}] == "number"`,()=>{e.assign(p,(0,U._)`${S}[${y}]`),t.error(),e.assign(u,!1).break()}).code((0,U._)`${S}[${y}] = ${m}`)})}o(_,"loopN");function g(m,p){let y=(0,Jl.useFunc)(e,Bl.default),$=e.name("outer");e.label($).for((0,U._)`;${m}--;`,()=>e.for((0,U._)`${p} = ${m}; ${p}--;`,()=>e.if((0,U._)`${y}(${r}[${m}], ${r}[${p}])`,()=>{t.error(),e.assign(u,!1).break($)})))}o(g,"loopN2")}};Ps.default=Ql});var si=v(Os=>{"use strict";f();Object.defineProperty(Os,"__esModule",{value:!0});var Ns=q(),Zl=R(),Xl=Xt(),Yl={message:"must be equal to constant",params:o(({schemaCode:t})=>(0,Ns._)`{allowedValue: ${t}}`,"params")},ed={keyword:"const",$data:!0,error:Yl,code(t){let{gen:e,data:r,$data:s,schemaCode:n,schema:i}=t;s||i&&typeof i=="object"?t.fail$data((0,Ns._)`!${(0,Zl.useFunc)(e,Xl.default)}(${r}, ${n})`):t.fail((0,Ns._)`${i} !== ${r}`)}};Os.default=ed});var ni=v(ks=>{"use strict";f();Object.defineProperty(ks,"__esModule",{value:!0});var Et=q(),td=R(),rd=Xt(),sd={message:"must be equal to one of the allowed values",params:o(({schemaCode:t})=>(0,Et._)`{allowedValues: ${t}}`,"params")},nd={keyword:"enum",schemaType:"array",$data:!0,error:sd,code(t){let{gen:e,data:r,$data:s,schema:n,schemaCode:i,it:a}=t;if(!s&&n.length===0)throw new Error("enum must have non-empty array");let c=n.length>=a.opts.loopEnum,u,d=o(()=>u??(u=(0,td.useFunc)(e,rd.default)),"getEql"),l;if(c||s)l=e.let("valid"),t.block$data(l,h);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let g=e.const("vSchema",i);l=(0,Et.or)(...n.map((m,p)=>_(g,p)))}t.pass(l);function h(){e.assign(l,!1),e.forOf("v",i,g=>e.if((0,Et._)`${d()}(${r}, ${g})`,()=>e.assign(l,!0).break()))}o(h,"loopEnum");function _(g,m){let p=n[m];return typeof p=="object"&&p!==null?(0,Et._)`${d()}(${r}, ${g}[${m}])`:(0,Et._)`${r} === ${p}`}o(_,"equalCode")}};ks.default=nd});var oi=v(qs=>{"use strict";f();Object.defineProperty(qs,"__esModule",{value:!0});var od=Go(),id=Jo(),ad=Qo(),cd=Zo(),ud=Xo(),ld=Yo(),dd=ei(),fd=ri(),hd=si(),pd=ni(),md=[od.default,id.default,ad.default,cd.default,ud.default,ld.default,dd.default,fd.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},hd.default,pd.default];qs.default=md});var js=v(St=>{"use strict";f();Object.defineProperty(St,"__esModule",{value:!0});St.validateAdditionalItems=void 0;var Ae=q(),Is=R(),yd={message:o(({params:{len:t}})=>(0,Ae.str)`must NOT have more than ${t} items`,"message"),params:o(({params:{len:t}})=>(0,Ae._)`{limit: ${t}}`,"params")},gd={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:yd,code(t){let{parentSchema:e,it:r}=t,{items:s}=e;if(!Array.isArray(s)){(0,Is.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ii(t,s)}};function ii(t,e){let{gen:r,schema:s,data:n,keyword:i,it:a}=t;a.items=!0;let c=r.const("len",(0,Ae._)`${n}.length`);if(s===!1)t.setParams({len:e.length}),t.pass((0,Ae._)`${c} <= ${e.length}`);else if(typeof s=="object"&&!(0,Is.alwaysValidSchema)(a,s)){let d=r.var("valid",(0,Ae._)`${c} <= ${e.length}`);r.if((0,Ae.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,c,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:Is.Type.Num},d),a.allErrors||r.if((0,Ae.not)(d),()=>r.break())})}o(u,"validateItems")}o(ii,"validateAdditionalItems");St.validateAdditionalItems=ii;St.default=gd});var Rs=v(Pt=>{"use strict";f();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.validateTuple=void 0;var ai=q(),Yt=R(),_d=te(),$d={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return ci(t,"additionalItems",e);r.items=!0,!(0,Yt.alwaysValidSchema)(r,e)&&t.ok((0,_d.validateArray)(t))}};function ci(t,e,r=t.schema){let{gen:s,parentSchema:n,data:i,keyword:a,it:c}=t;l(n),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=Yt.mergeEvaluated.items(s,r.length,c.items));let u=s.name("valid"),d=s.const("len",(0,ai._)`${i}.length`);r.forEach((h,_)=>{(0,Yt.alwaysValidSchema)(c,h)||(s.if((0,ai._)`${d} > ${_}`,()=>t.subschema({keyword:a,schemaProp:_,dataProp:_},u)),t.ok(u))});function l(h){let{opts:_,errSchemaPath:g}=c,m=r.length,p=m===h.minItems&&(m===h.maxItems||h[e]===!1);if(_.strictTuples&&!p){let y=`"${a}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,Yt.checkStrictMode)(c,y,_.strictTuples)}}o(l,"checkStrictTuple")}o(ci,"validateTuple");Pt.validateTuple=ci;Pt.default=$d});var ui=v(Ts=>{"use strict";f();Object.defineProperty(Ts,"__esModule",{value:!0});var vd=Rs(),wd={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(t=>(0,vd.validateTuple)(t,"items"),"code")};Ts.default=wd});var di=v(Cs=>{"use strict";f();Object.defineProperty(Cs,"__esModule",{value:!0});var li=q(),bd=R(),Ed=te(),Sd=js(),Pd={message:o(({params:{len:t}})=>(0,li.str)`must NOT have more than ${t} items`,"message"),params:o(({params:{len:t}})=>(0,li._)`{limit: ${t}}`,"params")},Nd={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Pd,code(t){let{schema:e,parentSchema:r,it:s}=t,{prefixItems:n}=r;s.items=!0,!(0,bd.alwaysValidSchema)(s,e)&&(n?(0,Sd.validateAdditionalItems)(t,n):t.ok((0,Ed.validateArray)(t)))}};Cs.default=Nd});var fi=v(As=>{"use strict";f();Object.defineProperty(As,"__esModule",{value:!0});var se=q(),er=R(),Od={message:o(({params:{min:t,max:e}})=>e===void 0?(0,se.str)`must contain at least ${t} valid item(s)`:(0,se.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:o(({params:{min:t,max:e}})=>e===void 0?(0,se._)`{minContains: ${t}}`:(0,se._)`{minContains: ${t}, maxContains: ${e}}`,"params")},kd={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Od,code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:i}=t,a,c,{minContains:u,maxContains:d}=s;i.opts.next?(a=u===void 0?1:u,c=d):a=1;let l=e.const("len",(0,se._)`${n}.length`);if(t.setParams({min:a,max:c}),c===void 0&&a===0){(0,er.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&a>c){(0,er.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,er.alwaysValidSchema)(i,r)){let p=(0,se._)`${l} >= ${a}`;c!==void 0&&(p=(0,se._)`${p} && ${l} <= ${c}`),t.pass(p);return}i.items=!0;let h=e.name("valid");c===void 0&&a===1?g(h,()=>e.if(h,()=>e.break())):a===0?(e.let(h,!0),c!==void 0&&e.if((0,se._)`${n}.length > 0`,_)):(e.let(h,!1),_()),t.result(h,()=>t.reset());function _(){let p=e.name("_valid"),y=e.let("count",0);g(p,()=>e.if(p,()=>m(y)))}o(_,"validateItemsWithCount");function g(p,y){e.forRange("i",0,l,$=>{t.subschema({keyword:"contains",dataProp:$,dataPropType:er.Type.Num,compositeRule:!0},p),y()})}o(g,"validateItems");function m(p){e.code((0,se._)`${p}++`),c===void 0?e.if((0,se._)`${p} >= ${a}`,()=>e.assign(h,!0).break()):(e.if((0,se._)`${p} > ${c}`,()=>e.assign(h,!1).break()),a===1?e.assign(h,!0):e.if((0,se._)`${p} >= ${a}`,()=>e.assign(h,!0)))}o(m,"checkLimits")}};As.default=kd});var mi=v(de=>{"use strict";f();Object.defineProperty(de,"__esModule",{value:!0});de.validateSchemaDeps=de.validatePropertyDeps=de.error=void 0;var Ds=q(),qd=R(),Nt=te();de.error={message:o(({params:{property:t,depsCount:e,deps:r}})=>{let s=e===1?"property":"properties";return(0,Ds.str)`must have ${s} ${r} when property ${t} is present`},"message"),params:o(({params:{property:t,depsCount:e,deps:r,missingProperty:s}})=>(0,Ds._)`{property: ${t},
|
|
8
|
+
missingProperty: ${s},
|
|
9
|
+
depsCount: ${e},
|
|
10
|
+
deps: ${r}}`,"params")};var Id={keyword:"dependencies",type:"object",schemaType:"object",error:de.error,code(t){let[e,r]=jd(t);hi(t,e),pi(t,r)}};function jd({schema:t}){let e={},r={};for(let s in t){if(s==="__proto__")continue;let n=Array.isArray(t[s])?e:r;n[s]=t[s]}return[e,r]}o(jd,"splitDependencies");function hi(t,e=t.schema){let{gen:r,data:s,it:n}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let a in e){let c=e[a];if(c.length===0)continue;let u=(0,Nt.propertyInData)(r,s,a,n.opts.ownProperties);t.setParams({property:a,depsCount:c.length,deps:c.join(", ")}),n.allErrors?r.if(u,()=>{for(let d of c)(0,Nt.checkReportMissingProp)(t,d)}):(r.if((0,Ds._)`${u} && (${(0,Nt.checkMissingProp)(t,c,i)})`),(0,Nt.reportMissingProp)(t,i),r.else())}}o(hi,"validatePropertyDeps");de.validatePropertyDeps=hi;function pi(t,e=t.schema){let{gen:r,data:s,keyword:n,it:i}=t,a=r.name("valid");for(let c in e)(0,qd.alwaysValidSchema)(i,e[c])||(r.if((0,Nt.propertyInData)(r,s,c,i.opts.ownProperties),()=>{let u=t.subschema({keyword:n,schemaProp:c},a);t.mergeValidEvaluated(u,a)},()=>r.var(a,!0)),t.ok(a))}o(pi,"validateSchemaDeps");de.validateSchemaDeps=pi;de.default=Id});var gi=v(Ms=>{"use strict";f();Object.defineProperty(Ms,"__esModule",{value:!0});var yi=q(),Rd=R(),Td={message:"property name must be valid",params:o(({params:t})=>(0,yi._)`{propertyName: ${t.propertyName}}`,"params")},Cd={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Td,code(t){let{gen:e,schema:r,data:s,it:n}=t;if((0,Rd.alwaysValidSchema)(n,r))return;let i=e.name("valid");e.forIn("key",s,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),e.if((0,yi.not)(i),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(i)}};Ms.default=Cd});var Fs=v(xs=>{"use strict";f();Object.defineProperty(xs,"__esModule",{value:!0});var tr=te(),ae=q(),Ad=me(),rr=R(),Dd={message:"must NOT have additional properties",params:o(({params:t})=>(0,ae._)`{additionalProperty: ${t.additionalProperty}}`,"params")},Md={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Dd,code(t){let{gen:e,schema:r,parentSchema:s,data:n,errsCount:i,it:a}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,rr.alwaysValidSchema)(a,r))return;let d=(0,tr.allSchemaProperties)(s.properties),l=(0,tr.allSchemaProperties)(s.patternProperties);h(),t.ok((0,ae._)`${i} === ${Ad.default.errors}`);function h(){e.forIn("key",n,y=>{!d.length&&!l.length?m(y):e.if(_(y),()=>m(y))})}o(h,"checkAdditionalProperties");function _(y){let $;if(d.length>8){let S=(0,rr.schemaRefOrVal)(a,s.properties,"properties");$=(0,tr.isOwnProperty)(e,S,y)}else d.length?$=(0,ae.or)(...d.map(S=>(0,ae._)`${y} === ${S}`)):$=ae.nil;return l.length&&($=(0,ae.or)($,...l.map(S=>(0,ae._)`${(0,tr.usePattern)(t,S)}.test(${y})`))),(0,ae.not)($)}o(_,"isAdditional");function g(y){e.code((0,ae._)`delete ${n}[${y}]`)}o(g,"deleteAdditional");function m(y){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),c||e.break();return}if(typeof r=="object"&&!(0,rr.alwaysValidSchema)(a,r)){let $=e.name("valid");u.removeAdditional==="failing"?(p(y,$,!1),e.if((0,ae.not)($),()=>{t.reset(),g(y)})):(p(y,$),c||e.if((0,ae.not)($),()=>e.break()))}}o(m,"additionalPropertyCode");function p(y,$,S){let P={keyword:"additionalProperties",dataProp:y,dataPropType:rr.Type.Str};S===!1&&Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(P,$)}o(p,"applyAdditionalSchema")}};xs.default=Md});var vi=v(zs=>{"use strict";f();Object.defineProperty(zs,"__esModule",{value:!0});var xd=dt(),_i=te(),Vs=R(),$i=Fs(),Fd={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:s,data:n,it:i}=t;i.opts.removeAdditional==="all"&&s.additionalProperties===void 0&&$i.default.code(new xd.KeywordCxt(i,$i.default,"additionalProperties"));let a=(0,_i.allSchemaProperties)(r);for(let h of a)i.definedProperties.add(h);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=Vs.mergeEvaluated.props(e,(0,Vs.toHash)(a),i.props));let c=a.filter(h=>!(0,Vs.alwaysValidSchema)(i,r[h]));if(c.length===0)return;let u=e.name("valid");for(let h of c)d(h)?l(h):(e.if((0,_i.propertyInData)(e,n,h,i.opts.ownProperties)),l(h),i.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(u);function d(h){return i.opts.useDefaults&&!i.compositeRule&&r[h].default!==void 0}o(d,"hasDefault");function l(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}o(l,"applyPropertySchema")}};zs.default=Fd});var Si=v(Us=>{"use strict";f();Object.defineProperty(Us,"__esModule",{value:!0});var wi=te(),sr=q(),bi=R(),Ei=R(),Vd={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:s,parentSchema:n,it:i}=t,{opts:a}=i,c=(0,wi.allSchemaProperties)(r),u=c.filter(p=>(0,bi.alwaysValidSchema)(i,r[p]));if(c.length===0||u.length===c.length&&(!i.opts.unevaluated||i.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&n.properties,l=e.name("valid");i.props!==!0&&!(i.props instanceof sr.Name)&&(i.props=(0,Ei.evaluatedPropsToName)(e,i.props));let{props:h}=i;_();function _(){for(let p of c)d&&g(p),i.allErrors?m(p):(e.var(l,!0),m(p),e.if(l))}o(_,"validatePatternProperties");function g(p){for(let y in d)new RegExp(p).test(y)&&(0,bi.checkStrictMode)(i,`property ${y} matches pattern ${p} (use allowMatchingProperties)`)}o(g,"checkMatchingProperties");function m(p){e.forIn("key",s,y=>{e.if((0,sr._)`${(0,wi.usePattern)(t,p)}.test(${y})`,()=>{let $=u.includes(p);$||t.subschema({keyword:"patternProperties",schemaProp:p,dataProp:y,dataPropType:Ei.Type.Str},l),i.opts.unevaluated&&h!==!0?e.assign((0,sr._)`${h}[${y}]`,!0):!$&&!i.allErrors&&e.if((0,sr.not)(l),()=>e.break())})})}o(m,"validateProperties")}};Us.default=Vd});var Pi=v(Ks=>{"use strict";f();Object.defineProperty(Ks,"__esModule",{value:!0});var zd=R(),Ud={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:s}=t;if((0,zd.alwaysValidSchema)(s,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Ks.default=Ud});var Ni=v(Hs=>{"use strict";f();Object.defineProperty(Hs,"__esModule",{value:!0});var Kd=te(),Hd={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Kd.validateUnion,error:{message:"must match a schema in anyOf"}};Hs.default=Hd});var Oi=v(Ls=>{"use strict";f();Object.defineProperty(Ls,"__esModule",{value:!0});var nr=q(),Ld=R(),Gd={message:"must match exactly one schema in oneOf",params:o(({params:t})=>(0,nr._)`{passingSchemas: ${t.passing}}`,"params")},Jd={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Gd,code(t){let{gen:e,schema:r,parentSchema:s,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&s.discriminator)return;let i=r,a=e.let("valid",!1),c=e.let("passing",null),u=e.name("_valid");t.setParams({passing:c}),e.block(d),t.result(a,()=>t.reset(),()=>t.error(!0));function d(){i.forEach((l,h)=>{let _;(0,Ld.alwaysValidSchema)(n,l)?e.var(u,!0):_=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,nr._)`${u} && ${a}`).assign(a,!1).assign(c,(0,nr._)`[${c}, ${h}]`).else(),e.if(u,()=>{e.assign(a,!0),e.assign(c,h),_&&t.mergeEvaluated(_,nr.Name)})})}o(d,"validateOneOf")}};Ls.default=Jd});var ki=v(Gs=>{"use strict";f();Object.defineProperty(Gs,"__esModule",{value:!0});var Bd=R(),Wd={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((i,a)=>{if((0,Bd.alwaysValidSchema)(s,i))return;let c=t.subschema({keyword:"allOf",schemaProp:a},n);t.ok(n),t.mergeEvaluated(c)})}};Gs.default=Wd});var ji=v(Js=>{"use strict";f();Object.defineProperty(Js,"__esModule",{value:!0});var or=q(),Ii=R(),Qd={message:o(({params:t})=>(0,or.str)`must match "${t.ifClause}" schema`,"message"),params:o(({params:t})=>(0,or._)`{failingKeyword: ${t.ifClause}}`,"params")},Zd={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Qd,code(t){let{gen:e,parentSchema:r,it:s}=t;r.then===void 0&&r.else===void 0&&(0,Ii.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let n=qi(s,"then"),i=qi(s,"else");if(!n&&!i)return;let a=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),n&&i){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(c,d("then",l),d("else",l))}else n?e.if(c,d("then")):e.if((0,or.not)(c),d("else"));t.pass(a,()=>t.error(!0));function u(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(l)}o(u,"validateIf");function d(l,h){return()=>{let _=t.subschema({keyword:l},c);e.assign(a,c),t.mergeValidEvaluated(_,a),h?e.assign(h,(0,or._)`${l}`):t.setParams({ifClause:l})}}o(d,"validateClause")}};function qi(t,e){let r=t.schema[e];return r!==void 0&&!(0,Ii.alwaysValidSchema)(t,r)}o(qi,"hasSchema");Js.default=Zd});var Ri=v(Bs=>{"use strict";f();Object.defineProperty(Bs,"__esModule",{value:!0});var Xd=R(),Yd={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Xd.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Bs.default=Yd});var Ti=v(Ws=>{"use strict";f();Object.defineProperty(Ws,"__esModule",{value:!0});var ef=js(),tf=ui(),rf=Rs(),sf=di(),nf=fi(),of=mi(),af=gi(),cf=Fs(),uf=vi(),lf=Si(),df=Pi(),ff=Ni(),hf=Oi(),pf=ki(),mf=ji(),yf=Ri();function gf(t=!1){let e=[df.default,ff.default,hf.default,pf.default,mf.default,yf.default,af.default,cf.default,of.default,uf.default,lf.default];return t?e.push(tf.default,sf.default):e.push(ef.default,rf.default),e.push(nf.default),e}o(gf,"getApplicator");Ws.default=gf});var Ci=v(Qs=>{"use strict";f();Object.defineProperty(Qs,"__esModule",{value:!0});var V=q(),_f={message:o(({schemaCode:t})=>(0,V.str)`must match format "${t}"`,"message"),params:o(({schemaCode:t})=>(0,V._)`{format: ${t}}`,"params")},$f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:_f,code(t,e){let{gen:r,data:s,$data:n,schema:i,schemaCode:a,it:c}=t,{opts:u,errSchemaPath:d,schemaEnv:l,self:h}=c;if(!u.validateFormats)return;n?_():g();function _(){let m=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),p=r.const("fDef",(0,V._)`${m}[${a}]`),y=r.let("fType"),$=r.let("format");r.if((0,V._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>r.assign(y,(0,V._)`${p}.type || "string"`).assign($,(0,V._)`${p}.validate`),()=>r.assign(y,(0,V._)`"string"`).assign($,p)),t.fail$data((0,V.or)(S(),P()));function S(){return u.strictSchema===!1?V.nil:(0,V._)`${a} && !${$}`}o(S,"unknownFmt");function P(){let A=l.$async?(0,V._)`(${p}.async ? await ${$}(${s}) : ${$}(${s}))`:(0,V._)`${$}(${s})`,N=(0,V._)`(typeof ${$} == "function" ? ${A} : ${$}.test(${s}))`;return(0,V._)`${$} && ${$} !== true && ${y} === ${e} && !${N}`}o(P,"invalidFmt")}o(_,"validate$DataFormat");function g(){let m=h.formats[i];if(!m){S();return}if(m===!0)return;let[p,y,$]=P(m);p===e&&t.pass(A());function S(){if(u.strictSchema===!1){h.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${i}" ignored in schema at path "${d}"`}}o(S,"unknownFormat");function P(N){let ce=N instanceof RegExp?(0,V.regexpCode)(N):u.code.formats?(0,V._)`${u.code.formats}${(0,V.getProperty)(i)}`:void 0,fe=r.scopeValue("formats",{key:i,ref:N,code:ce});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,V._)`${fe}.validate`]:["string",N,fe]}o(P,"getFormat");function A(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,V._)`await ${$}(${s})`}return typeof y=="function"?(0,V._)`${$}(${s})`:(0,V._)`${$}.test(${s})`}o(A,"validCondition")}o(g,"validateFormat")}};Qs.default=$f});var Ai=v(Zs=>{"use strict";f();Object.defineProperty(Zs,"__esModule",{value:!0});var vf=Ci(),wf=[vf.default];Zs.default=wf});var Di=v(Je=>{"use strict";f();Object.defineProperty(Je,"__esModule",{value:!0});Je.contentVocabulary=Je.metadataVocabulary=void 0;Je.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Je.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var xi=v(Xs=>{"use strict";f();Object.defineProperty(Xs,"__esModule",{value:!0});var bf=Lo(),Ef=oi(),Sf=Ti(),Pf=Ai(),Mi=Di(),Nf=[bf.default,Ef.default,(0,Sf.default)(),Pf.default,Mi.metadataVocabulary,Mi.contentVocabulary];Xs.default=Nf});var Vi=v(ir=>{"use strict";f();Object.defineProperty(ir,"__esModule",{value:!0});ir.DiscrError=void 0;var Fi;(function(t){t.Tag="tag",t.Mapping="mapping"})(Fi||(ir.DiscrError=Fi={}))});var Ui=v(en=>{"use strict";f();Object.defineProperty(en,"__esModule",{value:!0});var Be=q(),Ys=Vi(),zi=zt(),Of=ft(),kf=R(),qf={message:o(({params:{discrError:t,tagName:e}})=>t===Ys.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:o(({params:{discrError:t,tag:e,tagName:r}})=>(0,Be._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},If={keyword:"discriminator",type:"object",schemaType:"object",error:qf,code(t){let{gen:e,data:r,schema:s,parentSchema:n,it:i}=t,{oneOf:a}=n;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=s.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(s.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,Be._)`${r}${(0,Be.getProperty)(c)}`);e.if((0,Be._)`typeof ${d} == "string"`,()=>l(),()=>t.error(!1,{discrError:Ys.DiscrError.Tag,tag:d,tagName:c})),t.ok(u);function l(){let g=_();e.if(!1);for(let m in g)e.elseIf((0,Be._)`${d} === ${m}`),e.assign(u,h(g[m]));e.else(),t.error(!1,{discrError:Ys.DiscrError.Mapping,tag:d,tagName:c}),e.endIf()}o(l,"validateMapping");function h(g){let m=e.name("valid"),p=t.subschema({keyword:"oneOf",schemaProp:g},m);return t.mergeEvaluated(p,Be.Name),m}o(h,"applyTagSchema");function _(){var g;let m={},p=$(n),y=!0;for(let A=0;A<a.length;A++){let N=a[A];if(N?.$ref&&!(0,kf.schemaHasRulesButRef)(N,i.self.RULES)){let fe=N.$ref;if(N=zi.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,fe),N instanceof zi.SchemaEnv&&(N=N.schema),N===void 0)throw new Of.default(i.opts.uriResolver,i.baseId,fe)}let ce=(g=N?.properties)===null||g===void 0?void 0:g[c];if(typeof ce!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);y=y&&(p||$(N)),S(ce,A)}if(!y)throw new Error(`discriminator: "${c}" must be required`);return m;function $({required:A}){return Array.isArray(A)&&A.includes(c)}function S(A,N){if(A.const)P(A.const,N);else if(A.enum)for(let ce of A.enum)P(ce,N);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function P(A,N){if(typeof A!="string"||A in m)throw new Error(`discriminator: "${c}" values must be unique strings`);m[A]=N}}o(_,"getMapping")}};en.default=If});var Ki=v((iy,jf)=>{jf.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$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},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:"boolean",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:"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:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Ff=v((F,tn)=>{"use strict";f();Object.defineProperty(F,"__esModule",{value:!0});F.MissingRefError=F.ValidationError=F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=F.Ajv=void 0;var Rf=Fo(),Tf=xi(),Cf=Ui(),Hi=Ki(),Af=["/properties"],ar="http://json-schema.org/draft-07/schema",We=class extends Rf.default{static{o(this,"Ajv")}_addVocabularies(){super._addVocabularies(),Tf.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Cf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Hi,Af):Hi;this.addMetaSchema(e,ar,!1),this.refs["http://json-schema.org/schema"]=ar}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ar)?ar:void 0)}};F.Ajv=We;tn.exports=F=We;tn.exports.Ajv=We;Object.defineProperty(F,"__esModule",{value:!0});F.default=We;var Df=dt();Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:o(function(){return Df.KeywordCxt},"get")});var Qe=q();Object.defineProperty(F,"_",{enumerable:!0,get:o(function(){return Qe._},"get")});Object.defineProperty(F,"str",{enumerable:!0,get:o(function(){return Qe.str},"get")});Object.defineProperty(F,"stringify",{enumerable:!0,get:o(function(){return Qe.stringify},"get")});Object.defineProperty(F,"nil",{enumerable:!0,get:o(function(){return Qe.nil},"get")});Object.defineProperty(F,"Name",{enumerable:!0,get:o(function(){return Qe.Name},"get")});Object.defineProperty(F,"CodeGen",{enumerable:!0,get:o(function(){return Qe.CodeGen},"get")});var Mf=Ft();Object.defineProperty(F,"ValidationError",{enumerable:!0,get:o(function(){return Mf.default},"get")});var xf=ft();Object.defineProperty(F,"MissingRefError",{enumerable:!0,get:o(function(){return xf.default},"get")})});export{q as a,Ff as b};
|
|
11
|
+
//# sourceMappingURL=chunk-HKKHKLTS.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{a as s,f as c}from"./chunk-K6GRVJQO.js";c();function t(e=process.env){let r=e.WERKMEISTER_LAUNCHER;return r==="vscode"||r==="terminal"?r:e.CLAUDE_CODE_ENTRYPOINT==="claude-vscode"||e.TERM_PROGRAM==="vscode"?"vscode":"terminal"}s(t,"claudeLauncher");var n="vscode://jbbz.werkmeister-vscode";function i(e){let r=new URLSearchParams({workspace:e.workspace,mode:e.sessionId?"resume":"new"});return e.sessionId&&r.set("session",e.sessionId),e.prompt&&r.set("prompt",e.prompt),`${n}/claude?${r}`}s(i,"claudeLaunchUri");function a(e){return`${n}/reconcile?${new URLSearchParams({slug:e})}`}s(a,"reconcileLaunchUri");export{t as a,i as b,a as c};
|
|
4
|
+
//# sourceMappingURL=chunk-I3QYJM3C.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{j as a}from"./chunk-7I5GWJOR.js";import{m as n}from"./chunk-OC7PYYEG.js";import{b as m}from"./chunk-RO5NEK3B.js";import{a as s,f as p}from"./chunk-K6GRVJQO.js";p();import*as f from"node:fs";import*as o from"node:path";function c(i){let t=o.resolve(i??"."),r=t;for(;!f.existsSync(o.join(m(r),"workspace.yml"));){let e=o.dirname(r);e===r&&(n(`No .werkmeister/workspace.yml found from ${t}`),process.exit(1)),r=e}return r}s(c,"findWorkspaceDir");function h(i){let t=c(i.start),r=a(t).starting_prompt;(typeof r!="string"||!r.trim())&&(n(`${t} has no starting_prompt`),process.exit(2)),console.log(r.trim())}s(h,"run");export{c as a,h as b};
|
|
4
|
+
//# sourceMappingURL=chunk-I7X6WZIM.js.map
|