@jxsuite/compiler 6.0.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +122 -122
  2. package/package.json +7 -7
package/dist/cli.js CHANGED
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as hC}from"node:module";var lC=Object.create;var{getPrototypeOf:uC,defineProperty:$g,getOwnPropertyNames:fC}=Object;var vg=Object.prototype.hasOwnProperty;function dC(e){return this[e]}var pC,mC,Bt=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?pC??=new WeakMap:mC??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?lC(uC(e)):{};let o=t||!e||!e.__esModule||!vg.call(e,"default")?$g(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of fC(e))if(!vg.call(o,a))$g(o,a,{get:dC.bind(e,a),enumerable:!0})}if(n)i.set(e,o);return o};var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var De=hC(import.meta.url);function T(e){return typeof e==="string"}function Ir(e){return typeof e==="number"}function Rt(e){return typeof e==="boolean"}function Ot(e){return typeof e==="function"}function J(e){return typeof e==="object"&&e!==null}function ee(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Je(e){return ee(e)&&typeof e.$ref==="string"}function xr(e){return ee(e)&&e.$prototype==="Function"}function $r(e){return ee(e)&&ee(e.$expression)}function Ni(e){return $r(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Zn(e){return xr(e)&&Array.isArray(e.body)}function un(e){return ee(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function sf(e){return ee(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function wg(e){return ee(e)&&!e.$prototype&&!e.$expression&&"default"in e}function ei(e){if(!ee(e))return!1;for(let t of Object.keys(e))if(!Sg.has(t))return!1;return!0}function lt(e){return ee(e)&&e.$prototype==="Array"}function of(e){return(Array.isArray(e)?e:[e]).some((r)=>lt(r))}function Eg(e){return ee(e)&&e.$prototype==="Class"}function ir(e){return ee(e)}function he(e){return typeof e==="string"&&e.includes("${")}function Mi(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function Li(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Rn(e){if(!e)return[];return e.map((t)=>T(t)?t:t.name)}function gC(e){return typeof e==="string"}function fn(e){if(typeof e!=="object"||e===null||Array.isArray(e)||!ee(e.$expression))return!1;let t=e.$expression;if(t.operator==="?:")return typeof t.value==="string"&&typeof t.initial==="string";if(t.operator==="switch")return ee(t.cases)&&Object.values(t.cases).every((r)=>T(r))&&typeof t.default==="string";return!1}function $s(e){if(gC(e))return[e];if(!fn(e))return[];let t=e.$expression;if(t.operator==="?:")return[...new Set([t.value,t.initial])];return[...new Set([...Object.values(t.cases),t.default])]}var Sg;var Ee=L(()=>{Sg=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function Pg(e){let t=[],r=[],n=null,i=0,s=()=>r.at(-1)?.path??"",o=()=>n===null?s():xC(s(),n),a=()=>{i+=1;let c="";while(i<e.length){let l=e[i];if(l==="\\"){let u=e[i+1]??"";if(u==="u")c+=String.fromCodePoint(Number.parseInt(e.slice(i+2,i+6),16)),i+=6;else c+=yC.get(u)??u,i+=2;continue}if(l==='"')return i+=1,c;c+=l,i+=1}return c};while(i<e.length){let c=e[i];if(_g.has(c)||c===","||c===":"){i+=1;continue}if(c==="{"||c==="["){r.push(c==="{"?{keys:new Set,kind:"object",path:o()}:{kind:"array",path:o()}),n=null,i+=1;continue}if(c==="}"||c==="]"){r.pop(),n=null,i+=1;continue}if(c==='"'){let u=a(),d=r.at(-1);if(d?.kind==="object"&&bC(e,i)===":"){if(d.keys.has(u))t.push({detail:u,kind:"duplicate-key",path:d.path});d.keys.add(u),n=u}else n=null;continue}if(c==="-"||c>="0"&&c<="9"){let u=i;while(i<e.length&&/[\d+.eE-]/.test(e[i]))i+=1;let d=e.slice(u,i);if(!$C(d))t.push({detail:d,kind:"unsafe-number",path:o()});n=null;continue}let l=i;while(i<e.length&&/[A-Za-z]/.test(e[i]))i+=1;if(i===l)i+=1;n=null}return t}function bC(e,t){let r=t;while(r<e.length&&_g.has(e[r]))r+=1;return e[r]??""}function xC(e,t){return e===""?t:`${e}.${t}`}function $C(e){if(/[.eE]/.test(e))return!0;let t=Number(e);if(!Number.isFinite(t))return!1;return String(t)===e.replace(/^\+/,"")}function kg(e){let t=e.path===""?"the document root":`"${e.path}"`;return e.kind==="duplicate-key"?`duplicate key "${e.detail}" in ${t} — JSON.parse keeps the last one and `+"silently discards the first (RFC 7493 §2.3)":`number ${e.detail} in ${t} cannot be represented exactly and will change when `+"the document is written back (RFC 7493 §2.2)"}var _g,yC;var Ag=L(()=>{_g=new Set([" ","\t",`
3
- `,"\r"]);yC=new Map([["b","\b"],["f","\f"],["n",`
4
- `],["r","\r"],["t","\t"]])});function Pe(e){return e instanceof Error?e.message:String(e)}function Rg(e){if(T(e))return jg.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((t)=>Rg(t));if(ee(e))return Og(e);return e}function Og(e){let t={};for(let[r,n]of Object.entries(e))t[jg.test(r)?r.normalize("NFC"):r]=Rg(n);return t}function af(e,t,r){let n;try{n=JSON.parse(e)}catch(s){throw Error(`Failed to parse ${r} at ${t}: ${Pe(s)}`,{cause:s})}if(!ee(n))throw Error(`Invalid ${r} at ${t}: expected a JSON object`);let i=Pg(e);if(i.length>0){let s=i.map((o)=>kg(o)).join("; ");throw Error(`Invalid ${r} at ${t}: ${s}`)}return Og(n)}function ti(e,t){return af(e,t,"Jx document")}function Cg(e,t){return af(e,t,"project config")}function Ig(e,t){return af(e,t,"class definition")}var jg;var vr=L(()=>{Ee();Ag();jg=/[^\p{ASCII}]/u});function vC(e){return JSON.parse(e)}function vs(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function wC(e){return vs(e)&&typeof e.binding==="string"}function SC(e){try{let t=vC(e);return vs(t)?t:void 0}catch{return}}function Tg(e,t){if(t.length===0)return{content:e??"",patched:!1};let r={};if(e){let n=SC(e);if(n===void 0)return{content:e,patched:!1};r=n}for(let n of t)Ng(r,n);return{content:`${JSON.stringify(r,null,"\t")}
5
- `,patched:!0}}function Ng(e,t){for(let[r,n]of Object.entries(t)){let i=r in e?e[r]:void 0;if(Array.isArray(n)){e[r]=EC(Array.isArray(i)?i:[],n);continue}if(vs(n)){if(vs(i))Ng(i,n);else if(i===void 0)e[r]=structuredClone(n);continue}if(i===void 0)e[r]=n}}function EC(e,t){let r=[...e];for(let n of t){if(!wC(n)){if(!r.some((a)=>JSON.stringify(a)===JSON.stringify(n)))r.push(structuredClone(n));continue}let i=r.findIndex((o)=>vs(o)&&o.binding===n.binding),s=r[i];if(vs(s))r[i]={...s,...n};else r.push(structuredClone(n))}return r}var Mg=()=>{};function Fg(e){if(!T(e))return null;let[t,...r]=e.split(";"),n=(t??"").indexOf("/");if(n===-1)return null;let i=(t??"").slice(0,n).trim().toLowerCase(),s=(t??"").slice(n+1).trim().toLowerCase();if(!Lg.test(i)||!Lg.test(s))return null;let o=s.lastIndexOf("+"),a=o===-1?null:s.slice(o+1),c=o===-1?s:s.slice(0,o);if(a==="")return null;let l=c.indexOf("."),u=l===-1?null:c.slice(0,l),d=u!==null&&_C.has(u)?u:null,h=d===null?c:c.slice(d.length+1);if(h==="")return null;let m={};for(let y of r){let g=y.indexOf("=");if(g===-1)return null;let b=y.slice(0,g).trim().toLowerCase(),x=y.slice(g+1).trim();if(b==="")return null;if(x.startsWith('"')&&x.endsWith('"')&&x.length>=2)x=x.slice(1,-1);m[b]=x}return{parameters:m,subtype:h,suffix:a,tree:d,type:i}}function qg(e){if(!T(e)||e.trim()==="")return"expected a media type string";if(!e.includes("/"))return`"${e}" has no "/" — a media type is type/subtype (RFC 6838 §4.2)`;if(Fg(e)===null)return`"${e}" is not a well-formed media type (RFC 6838 §4.2)`;return null}function Bg(e){let t=Fg(e);if(t===null)return null;let r=t.tree===null?"":`${t.tree}.`,n=t.suffix===null?"":`+${t.suffix}`;return`${t.type}/${r}${t.subtype}${n}`}var Lg,_C,Dg="text/markdown; variant=GFM",Jg="application/yaml",Hg;var cf=L(()=>{Ee();Lg=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,_C=new Set(["vnd","prs","x"]);Hg={".markdown":`${Dg}; charset=utf-8`,".md":`${Dg}; charset=utf-8`,".yaml":`${Jg}; charset=utf-8`,".yml":`${Jg}; charset=utf-8`}});function zg(e){if(e===null)throw TypeError("A class descriptor cannot be null");return ee(e)?e:{}}class wc{name;classPath;classDef;extensions;mediaType;mediaTypeEssence;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#t;#e=null;constructor(e,t,r,n){this.name=e,this.classPath=t,this.classDef=r,this.#t=n;let{format:i}=r;this.extensions=(i?.extensions??[]).map((s)=>s.toLowerCase()),this.mediaType=i?.mediaType??null,this.mediaTypeEssence=Bg(this.mediaType),this.documentKinds=i?.documentKinds??[],this.exportTarget=i?.exportTarget===!0,this.remote=i?.remote===!0,this.studio=r.$studio??null,this.project=r.project??null,this.server=r.server??null,this.connector=r.connector??null,this.capabilities=kC(r)}implementation(){if(!this.#e){let e=this.classDef.$implementation;if(!e)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#e=this.#t.importModule(this.#t.resolvePath(this.classPath,e))}return this.#e}async implementationExport(){return this.#r(await this.implementation())}#r(e){let t=this.classDef.title??this.name;return e[t]??e.default?.[t]??e.default}async call(e,...t){let r=this.capabilities[e];if(!r)throw Error(`Format class "${this.name}" does not declare a "${e}" capability`);let n=this.#r(await this.implementation()),i=n?.[r.identifier];if(!Ot(i)){let o=this.classDef.title??this.name;throw TypeError(`Format class "${this.name}": implementation export "${o}" has no static "${r.identifier}" method`)}return await i.call(n,...t)}async parseDocument(e,t){return await this.call("parse",e,t)}}class Sc{#t;constructor(e){this.#t=e;for(let t of e){if(t.mediaType===null)continue;let r=qg(t.mediaType);if(r!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${r}`)}for(let t of Vg){let r=new Map;for(let n of e){if(!n.capabilities[t])continue;for(let i of n.extensions){let s=r.get(i);if(s)throw Error(`Format conflict: "${s.name}" and "${n.name}" both claim "${i}" with the "${t}" capability`);r.set(i,n)}}}}get entries(){return this.#t}byExtension(e,t){let r=Ug(e);return this.#t.find((n)=>n.extensions.includes(r)&&(!t||n.capabilities[t]))}byName(e){return this.#t.find((t)=>t.name===e)}withCapability(e){return this.#t.filter((t)=>t.capabilities[e])}documentExtensions(e){let t=new Set;for(let r of this.#t){if(e&&!r.documentKinds.includes(e))continue;for(let n of r.extensions)t.add(n)}return t.delete(".json"),[...t]}has(e){let t=Ug(e);return this.#t.some((r)=>r.extensions.includes(t))}}function kC(e){let t={},r=e.$defs?.methods??{};for(let[n,i]of Object.entries(r)){let{role:s}=i;if(!jC(s))continue;let o={identifier:i.identifier??n,timing:i.timing??PC};if(T(i.discriminator))o.discriminator=i.discriminator;t[s]=o}return t}function jC(e){return e!==void 0&&AC.has(e)}function Ug(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var Vg,Wg,PC,AC;var lf=L(()=>{Ee();cf();Vg=["parse","serialize","rewrite","discover","load"],Wg=[...Vg,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];PC=["compiler","server"];AC=new Set(Wg)});class Kg{#t;#e;#r;constructor(e){this.#t=e,this.#e=e.flatMap((i)=>i.classes);let t=new Map;for(let i of e)for(let s of i.classes){let o=t.get(s.name);if(o&&o!==i.specifier)throw Error(`Extension conflict: "${o}" and "${i.specifier}" both provide a class named "${s.name}"`);t.set(s.name,i.specifier)}let r=new Map;for(let i of this.#e){if(!i.project)continue;let s=r.get(i.project.key);if(s)throw Error(`Extension conflict: "${s.name}" and "${i.name}" both claim the project section "${i.project.key}"`);r.set(i.project.key,i)}let n=new Map;for(let i of this.#e){if(!i.server)continue;let{basePath:s}=i.server;if(!s.startsWith("/_jx/"))throw Error(`Extension "${i.name}": server basePath "${s}" must be under /_jx/`);let o=n.get(s);if(o)throw Error(`Extension conflict: "${o.name}" and "${i.name}" both mount "${s}"`);n.set(s,i)}this.#r=new Sc(this.#e.filter((i)=>i.extensions.length>0))}get extensions(){return this.#t}get classes(){return this.#e}get formats(){return this.#r}byName(e){return this.#e.find((t)=>t.name===e)}projectContributions(){return this.#e.filter((e)=>e.project!==null)}byProjectKey(e){return this.#e.find((t)=>t.project?.key===e)}byPathsDiscriminator(e){return this.#e.find((t)=>t.capabilities.resolvePaths?.discriminator===e)}emitters(){return this.#e.filter((e)=>e.capabilities.emit!==void 0)}headProviders(){return this.#e.filter((e)=>e.capabilities.head!==void 0)}assetProviders(){return this.#e.filter((e)=>e.capabilities.assets!==void 0)}serverMounts(){return this.#e.filter((e)=>e.server!==null).toSorted((e,t)=>(e.server?.order??100)-(t.server?.order??100)||e.name.localeCompare(t.name))}connectors(){return this.#e.filter((e)=>e.connector!==null)}schemaFragments(e){return this.#t.map((t)=>t.schemas[e]).filter((t)=>typeof t==="string")}}async function Gg(e,t,r){let n=[];for(let i of e??[])n.push(await RC(i,t,r));return new Kg(n)}async function RC(e,t,r){let n;if(e.startsWith("./")||e.startsWith("../")){let c=t.resolvePath(r,e);n=t.resolvePath(`${c}/package.json`,`./${qo}`)}else try{n=t.resolvePath(r,`${e}/${qo}`)}catch(c){throw Error(`Extension "${e}" is not resolvable: it must export ${qo} (is the package installed, and does its exports map include it?): ${uf(c)}`,{cause:c})}let i;try{i=await t.loadJson(n)}catch(c){throw Error(`Extension "${e}": cannot read manifest ${n}: ${uf(c)}`,{cause:c})}if(!ee(i)||!T(i.name))throw Error(`Extension "${e}": ${qo} must declare a "name"`);let s=i;if(!e.startsWith(".")&&s.name!==e)throw Error(`Extension "${e}": manifest name "${s.name}" does not match the specifier`);let o=[];for(let[c,l]of Object.entries(s.classes??{})){let u=t.resolvePath(n,l),d;try{d=await t.loadJson(u)}catch(h){throw Error(`Extension "${e}": cannot read class "${c}" at ${u}: ${uf(h)}`,{cause:h})}o.push(new wc(c,u,zg(d),t))}let a={};if(s.schemas?.project)a.project=t.resolvePath(n,s.schemas.project);if(s.schemas?.document)a.document=t.resolvePath(n,s.schemas.document);if(s.schemas?.fields)a.fields=t.resolvePath(n,s.schemas.fields);return{specifier:e,manifestPath:n,manifest:s,classes:o,schemas:a}}function uf(e){return e instanceof Error?e.message:String(e)}var qo="jx-extension.json";var Yg=L(()=>{lf();Ee();lf()});import{readFileSync as OC}from"node:fs";import{dirname as CC,isAbsolute as IC,resolve as ff,sep as Ec}from"node:path";import{pathToFileURL as TC}from"node:url";import{createRequire as Xg}from"node:module";async function df(e){let t=[e],r=`${Ec}src${Ec}`,n=`${Ec}dist${Ec}`;if(e.includes(r)){let s=e.replace(r,n);if(t.push(s),s.endsWith(".ts"))t.push(`${s.slice(0,-3)}.js`)}if(e.endsWith(".js"))t.push(`${e.slice(0,-3)}.ts`);let i;for(let s of t)try{return await import(TC(s).href)}catch(o){i=o}throw i instanceof Error?i:Error(String(i))}function pf(e){return{importModule:(t)=>df(t),loadJson:async(t)=>JSON.parse(OC(t,"utf8")),resolvePath:(t,r)=>{if(r.startsWith("./")||r.startsWith("../"))return ff(CC(t),r);if(IC(r))return r;let n=Xg(ff(e,"package.json"));try{return n.resolve(r)}catch{return Xg(import.meta.url).resolve(r)}}}}async function ri(e,t){return Gg(t?.extensions,pf(e),ff(e,"project.json"))}function _c(e,t){return Error(`No format class registered for "${t}" (${e}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var On=L(()=>{Yg();Ee()});import{existsSync as NC,readFileSync as MC}from"node:fs";import{resolve as Qg}from"node:path";function ni(e){let t=Qg(e,"project.json");if(!NC(t))throw Error(`project.json not found in ${e}`);let r;try{r=Cg(MC(t,"utf8"),t)}catch(o){throw Error(`Invalid project.json: ${Pe(o)}`,{cause:o})}let n={...Bo,...r,build:{...Bo.build,...r.build},defaults:{...Bo.defaults,...r.defaults},images:{...Bo.images,...r.images},url:r.url??Bo.url};if(r.$head)n.$head=r.$head;if(r.$media)n.$media=r.$media;if(r.style)n.style=r.style;if(r.state)n.state=r.state;if(r.redirects)n.redirects=r.redirects;if(r.imports)n.imports=r.imports;let i=["cloudflare-workers","cloudflare-pages","node","bun"];if(n.build.adapter==="static")delete n.build.adapter;if(n.build.adapter&&!i.includes(n.build.adapter))throw Error(`Unknown build adapter "${n.build.adapter}" in project.json. Valid adapters: ${i.join(", ")}`);let s=["build","cloudflare"];if(!s.includes(n.images.service))throw Error(`Unknown images.service "${n.images.service}" in project.json. Valid services: ${s.join(", ")}`);return{config:n,configPath:t,projectRoot:Qg(e)}}var Bo;var Ho=L(()=>{vr();Bo={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,picture:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{existsSync as mf,readFileSync as Zg,writeFileSync as LC}from"node:fs";import{resolve as ey}from"node:path";async function ty(e,t={}){let{dryRun:r=!1,connection:n}=t,{config:i}=ni(e),s=await ri(e,i),o=ee(i.connections)?i.connections:{},a=ee(i.data)?i.data:{},c=Object.keys(o).filter((y)=>!n||y===n);if(n&&c.length===0)throw Error(`Unknown connection "${n}" (no such connections entry in project.json)`);if(c.length===0)throw Error('project.json has no "connections" section — nothing to push. Declare a connection and '+'its tables in the "data" section first.');let l={...process.env,...JC(e),JX_PROJECT_ROOT:e},u=[],d=[];for(let y of c){let g=o[y],b=ee(g)?{...g,$name:y}:{$name:y},x=String(b.provider??""),_=DC(s.connectors(),x);if(!_)throw Error(`Connection "${y}" names provider "${x}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let k={};for(let[w,P]of Object.entries(a))if(ee(P)&&P.connection===y)k[w]=P;let E=await _.call("deploySchema",k,b,{dryRun:r,env:l});if(u.push({applied:E.applied??!r,connection:y,provider:x,statements:E.statements??[],tables:Object.keys(k),warnings:E.warnings??[]}),_.capabilities.bindings){let w=await _.call("bindings",b);if(ee(w)&&Object.keys(w).length>0)d.push(w)}}let h=ey(e,"wrangler.jsonc"),m=!1;if(!r&&d.length>0&&mf(h)){let y=Zg(h,"utf8"),{content:g,patched:b}=Tg(y,d);if(b&&g!==y)LC(h,g,"utf8"),m=!0}return{bindingsPatched:m,results:u,wranglerPath:mf(h)?h:null}}function DC(e,t){return e.find((r)=>r.connector?.provider===t)}function JC(e){let t=ey(e,".dev.vars");if(!mf(t))return{};let r=new Map;for(let n of Zg(t,"utf8").split(`
6
- `)){let i=n.trim();if(i===""||i.startsWith("#"))continue;let s=i.indexOf("=");if(s===-1)continue;let o=i.slice(0,s).trim(),a=i.slice(s+1).trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))a=a.slice(1,-1);if(o!=="")r.set(o,a)}return Object.fromEntries(r)}var ry=L(()=>{Mg();On();Ho();Ee()});function Di(e){return e.startsWith(Pc)}function ny(e){let t=e;if(Di(t))t=t.slice(Pc.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${hf}${t}.js`}function iy(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",r=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${hf}${r}`:`${hf}${r}.${t}`}function sy(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function kc(e){let t=sy(e);return t.startsWith("/")?t:`/${t}`}function FC(e,t){return[...e].toSorted((r,n)=>n[t].length-r[t].length)}function Ac(e,t){let r=t.split("#")[0].split("?")[0];if(!r.startsWith("/"))return null;let n;try{n=decodeURIComponent(r)}catch{return null}if(/%2e|%2f/i.test(n))return null;for(let i of FC(e,"urlPrefix")){let s=kc(i.urlPrefix);if(!n.startsWith(`${s}/`))continue;let a=n.slice(s.length+1).split("/");if(a.some((l)=>l===""||l==="."||l===".."))return null;let{filter:c}=i;if(c&&!c(a.join("/")))return null;return`${sy(i.dir)}/${a.join("/")}`}return null}function oy(e,t){let r=new Set;for(let n of t){let i=kc(n.urlPrefix),s=new RegExp(`${i.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${qC}]+`,"g");for(let o of e.matchAll(s)){let a=o[0].split("#")[0].split("?")[0];if(!a.endsWith("/"))r.add(a)}}return[...r].filter(Boolean)}function gf(e){let t=[],r=0;while(r<e.length){while(r<e.length&&(/\s/.test(e[r])||e[r]===","))r+=1;if(r>=e.length)break;let n=r;while(r<e.length&&!/\s/.test(e[r]))r+=1;let i=e.slice(n,r);if(i.endsWith(",")){t.push({descriptor:"",url:i.replace(/,+$/,"")});continue}while(r<e.length&&/\s/.test(e[r]))r+=1;let s=r;while(r<e.length&&e[r]!==",")r+=1;let o=e.slice(s,r).trim();if(r+=1,i=i.replace(/,+$/,""),i!=="")t.push({descriptor:o,url:i})}return t}function yf(e){return e.map(({url:t,descriptor:r})=>r?`${t} ${r}`:t).join(", ")}function Ji(e){if(!T(e)||e==="")return"";let t;try{({pathname:t}=new URL(e))}catch{return""}let r=t.replace(/\/+$/,"");if(r===""||r==="/")return"";return r.startsWith("/")?r:`/${r}`}function ze(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function ii(e,t){let r=new URL(t);if(!r.pathname.endsWith("/"))r.pathname+="/";return new URL(e.replace(/^\/+/,""),r).href}var Pc="npm:",hf="/assets/",qC;var wr=L(()=>{Ee();qC=String.raw`"'\s<>()\\`});function ay(e,t){return e.replaceAll(WC,(r,n,i)=>{let s=i.trim(),o=XC.exec(s),a=o?o[2]:s,c=ze(t,a);if(c===a)return r;return`url(${n}${o?`${o[1]}${c}${o[1]}`:c}${n})`})}function QC(e,t,r,n,i){let s=r.toLowerCase();if(BC.has(s))return ze(i,n);if(HC.has(s)){let o=gf(n);return o.length===0?n:yf(o.map((a)=>({descriptor:a.descriptor,url:ze(i,a.url)})))}if(s==="style")return ay(n,i);if(s==="content"&&e==="meta"&&YC.test(t))return ze(i,n);return n}function cy(e,t){if(t==="")return e;let r=e.replaceAll(KC,(n,i,s,o)=>{let a=s.replaceAll(zC,(c,l)=>`"${ze(t,l)}"`);return i+a+o});return r=r.replaceAll(GC,(n,i,s,o)=>i+ay(s,t)+o),r.replaceAll(UC,(n,i,s)=>{if(s==="")return n;let o=i.toLowerCase(),a=s.replaceAll(VC,(c,l,u,d,h)=>{let m=d===void 0?"'":'"',y=d??h??"",g=QC(o,s,l,y,t);return g===y?c:`${l}=${m}${g}${m}`});return a===s?n:`<${i}${a}>`})}var BC,HC,UC,VC,WC,zC,KC,GC,YC,XC;var ly=L(()=>{wr();BC=new Set(["href","src","poster","action","formaction","data"]),HC=new Set(["srcset","imagesrcset"]),UC=/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,VC=/([a-zA-Z_:][\w:.-]*)\s*=\s*("([^"]*)"|'([^']*)')/g,WC=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g,zC=/"(\/[^"/][^"]*)"/g,KC=/(<script\b[^>]*\btype\s*=\s*["']importmap["'][^>]*>)([\s\S]*?)(<\/script>)/gi,GC=/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/gi,YC=/\b(?:property|name)\s*=\s*["'](?:og:|twitter:)[\w:.-]*(?:image|url|video|audio|player)[\w:.-]*["']/i,XC=/^(&quot;|&#34;|&apos;|&#39;)([\s\S]*)\1$/});var Go=C(function(LX,Ty){var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",{defineProperty:wf,getOwnPropertyDescriptor:ZC,getOwnPropertyNames:eI}=Object,tI=Object.prototype.hasOwnProperty,rI=(e,t)=>{for(var r in t)wf(e,r,{get:t[r],enumerable:!0})},nI=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of eI(t))if(!tI.call(e,i)&&i!==r)wf(e,i,{get:()=>t[i],enumerable:!(n=ZC(t,i))||n.enumerable})}return e},iI=(e)=>nI(wf({},"__esModule",{value:!0}),e),zo={};rI(zo,{analyzeMetafile:()=>NI,analyzeMetafileSync:()=>JI,build:()=>OI,buildSync:()=>MI,context:()=>CI,default:()=>HI,formatMessages:()=>TI,formatMessagesSync:()=>DI,initialize:()=>qI,stop:()=>FI,transform:()=>II,transformSync:()=>LI,version:()=>RI});Ty.exports=iI(zo);function uy(e){let t=(n)=>{if(n===null)r.write8(0);else if(typeof n==="boolean")r.write8(1),r.write8(+n);else if(typeof n==="number")r.write8(2),r.write32(n|0);else if(typeof n==="string")r.write8(3),r.write(Ur(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let i of n)t(i)}else{let i=Object.keys(n);r.write8(6),r.write32(i.length);for(let s of i)r.write(Ur(s)),t(n[s])}},r=new $y;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),xf(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function sI(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return Ui(r.read());case 4:return r.read();case 5:{let o=r.read32(),a=[];for(let c=0;c<o;c++)a.push(t());return a}case 6:{let o=r.read32(),a={};for(let c=0;c<o;c++)a[Ui(r.read())]=t();return a}default:throw Error("Invalid packet")}},r=new $y(e),n=r.read32(),i=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw Error("Invalid packet");return{id:n,isRequest:i,value:s}}var $y=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);xf(this.buf,e,t)}write(e){let t=this._write(4+e.length);xf(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return vy(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},Ur,Ui,bf;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;Ur=(r)=>e.encode(r),Ui=(r)=>t.decode(r),bf='new TextEncoder().encode("")'}else if(typeof Buffer<"u")Ur=(e)=>Buffer.from(e),Ui=(e)=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},bf='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!(Ur("")instanceof Uint8Array))throw Error(`Invariant violation: "${bf} instanceof Uint8Array" is incorrectly false
2
+ import{createRequire as bC}from"node:module";var dC=Object.create;var{getPrototypeOf:pC,defineProperty:$g,getOwnPropertyNames:mC}=Object;var vg=Object.prototype.hasOwnProperty;function hC(e){return this[e]}var gC,yC,Bt=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?gC??=new WeakMap:yC??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?dC(pC(e)):{};let o=t||!e||!e.__esModule||!vg.call(e,"default")?$g(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of mC(e))if(!vg.call(o,a))$g(o,a,{get:hC.bind(e,a),enumerable:!0})}if(n)i.set(e,o);return o};var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var De=bC(import.meta.url);function T(e){return typeof e==="string"}function Ir(e){return typeof e==="number"}function Rt(e){return typeof e==="boolean"}function Ot(e){return typeof e==="function"}function J(e){return typeof e==="object"&&e!==null}function ee(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Je(e){return ee(e)&&typeof e.$ref==="string"}function xr(e){return ee(e)&&e.$prototype==="Function"}function $r(e){return ee(e)&&ee(e.$expression)}function Ni(e){return $r(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Zn(e){return xr(e)&&Array.isArray(e.body)}function un(e){return ee(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function of(e){return ee(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function wg(e){return ee(e)&&!e.$prototype&&!e.$expression&&"default"in e}function ei(e){if(!ee(e))return!1;for(let t of Object.keys(e))if(!Sg.has(t))return!1;return!0}function lt(e){return ee(e)&&e.$prototype==="Array"}function af(e){return(Array.isArray(e)?e:[e]).some((r)=>lt(r))}function Eg(e){return ee(e)&&e.$prototype==="Class"}function ir(e){return ee(e)}function he(e){return typeof e==="string"&&e.includes("${")}function Mi(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function Li(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Rn(e){if(!e)return[];return e.map((t)=>T(t)?t:t.name)}function xC(e){return typeof e==="string"}function fn(e){if(typeof e!=="object"||e===null||Array.isArray(e)||!ee(e.$expression))return!1;let t=e.$expression;if(t.operator==="?:")return typeof t.value==="string"&&typeof t.initial==="string";if(t.operator==="switch")return ee(t.cases)&&Object.values(t.cases).every((r)=>T(r))&&typeof t.default==="string";return!1}function $s(e){if(xC(e))return[e];if(!fn(e))return[];let t=e.$expression;if(t.operator==="?:")return[...new Set([t.value,t.initial])];return[...new Set([...Object.values(t.cases),t.default])]}var Sg;var Ee=L(()=>{Sg=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function Pg(e){let t=[],r=[],n=null,i=0,s=()=>r.at(-1)?.path??"",o=()=>n===null?s():wC(s(),n),a=()=>{i+=1;let c="";while(i<e.length){let l=e[i];if(l==="\\"){let u=e[i+1]??"";if(u==="u")c+=String.fromCodePoint(Number.parseInt(e.slice(i+2,i+6),16)),i+=6;else c+=$C.get(u)??u,i+=2;continue}if(l==='"')return i+=1,c;c+=l,i+=1}return c};while(i<e.length){let c=e[i];if(_g.has(c)||c===","||c===":"){i+=1;continue}if(c==="{"||c==="["){r.push(c==="{"?{keys:new Set,kind:"object",path:o()}:{kind:"array",path:o()}),n=null,i+=1;continue}if(c==="}"||c==="]"){r.pop(),n=null,i+=1;continue}if(c==='"'){let u=a(),d=r.at(-1);if(d?.kind==="object"&&vC(e,i)===":"){if(d.keys.has(u))t.push({detail:u,kind:"duplicate-key",path:d.path});d.keys.add(u),n=u}else n=null;continue}if(c==="-"||c>="0"&&c<="9"){let u=i;while(i<e.length&&/[\d+.eE-]/.test(e[i]))i+=1;let d=e.slice(u,i);if(!SC(d))t.push({detail:d,kind:"unsafe-number",path:o()});n=null;continue}let l=i;while(i<e.length&&/[A-Za-z]/.test(e[i]))i+=1;if(i===l)i+=1;n=null}return t}function vC(e,t){let r=t;while(r<e.length&&_g.has(e[r]))r+=1;return e[r]??""}function wC(e,t){return e===""?t:`${e}.${t}`}function SC(e){if(/[.eE]/.test(e))return!0;let t=Number(e);if(!Number.isFinite(t))return!1;return String(t)===e.replace(/^\+/,"")}function kg(e){let t=e.path===""?"the document root":`"${e.path}"`;return e.kind==="duplicate-key"?`duplicate key "${e.detail}" in ${t} — JSON.parse keeps the last one and `+"silently discards the first (RFC 7493 §2.3)":`number ${e.detail} in ${t} cannot be represented exactly and will change when `+"the document is written back (RFC 7493 §2.2)"}var _g,$C;var Ag=L(()=>{_g=new Set([" ","\t",`
3
+ `,"\r"]);$C=new Map([["b","\b"],["f","\f"],["n",`
4
+ `],["r","\r"],["t","\t"]])});function Pe(e){return e instanceof Error?e.message:String(e)}function Rg(e){if(T(e))return jg.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((t)=>Rg(t));if(ee(e))return Og(e);return e}function Og(e){let t={};for(let[r,n]of Object.entries(e))t[jg.test(r)?r.normalize("NFC"):r]=Rg(n);return t}function cf(e,t,r){let n;try{n=JSON.parse(e)}catch(s){throw Error(`Failed to parse ${r} at ${t}: ${Pe(s)}`,{cause:s})}if(!ee(n))throw Error(`Invalid ${r} at ${t}: expected a JSON object`);let i=Pg(e);if(i.length>0){let s=i.map((o)=>kg(o)).join("; ");throw Error(`Invalid ${r} at ${t}: ${s}`)}return Og(n)}function ti(e,t){return cf(e,t,"Jx document")}function Cg(e,t){return cf(e,t,"project config")}function Ig(e,t){return cf(e,t,"class definition")}var jg;var vr=L(()=>{Ee();Ag();jg=/[^\p{ASCII}]/u});function EC(e){return JSON.parse(e)}function vs(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function _C(e){return vs(e)&&typeof e.binding==="string"}function PC(e){try{let t=EC(e);return vs(t)?t:void 0}catch{return}}function Tg(e,t){if(t.length===0)return{content:e??"",patched:!1};let r={};if(e){let n=PC(e);if(n===void 0)return{content:e,patched:!1};r=n}for(let n of t)Ng(r,n);return{content:`${JSON.stringify(r,null,"\t")}
5
+ `,patched:!0}}function Ng(e,t){for(let[r,n]of Object.entries(t)){let i=r in e?e[r]:void 0;if(Array.isArray(n)){e[r]=kC(Array.isArray(i)?i:[],n);continue}if(vs(n)){if(vs(i))Ng(i,n);else if(i===void 0)e[r]=structuredClone(n);continue}if(i===void 0)e[r]=n}}function kC(e,t){let r=[...e];for(let n of t){if(!_C(n)){if(!r.some((a)=>JSON.stringify(a)===JSON.stringify(n)))r.push(structuredClone(n));continue}let i=r.findIndex((o)=>vs(o)&&o.binding===n.binding),s=r[i];if(vs(s))r[i]={...s,...n};else r.push(structuredClone(n))}return r}var Mg=()=>{};function Fg(e){if(!T(e))return null;let[t,...r]=e.split(";"),n=(t??"").indexOf("/");if(n===-1)return null;let i=(t??"").slice(0,n).trim().toLowerCase(),s=(t??"").slice(n+1).trim().toLowerCase();if(!Lg.test(i)||!Lg.test(s))return null;let o=s.lastIndexOf("+"),a=o===-1?null:s.slice(o+1),c=o===-1?s:s.slice(0,o);if(a==="")return null;let l=c.indexOf("."),u=l===-1?null:c.slice(0,l),d=u!==null&&AC.has(u)?u:null,h=d===null?c:c.slice(d.length+1);if(h==="")return null;let m={};for(let y of r){let g=y.indexOf("=");if(g===-1)return null;let b=y.slice(0,g).trim().toLowerCase(),x=y.slice(g+1).trim();if(b==="")return null;if(x.startsWith('"')&&x.endsWith('"')&&x.length>=2)x=x.slice(1,-1);m[b]=x}return{parameters:m,subtype:h,suffix:a,tree:d,type:i}}function qg(e){if(!T(e)||e.trim()==="")return"expected a media type string";if(!e.includes("/"))return`"${e}" has no "/" — a media type is type/subtype (RFC 6838 §4.2)`;if(Fg(e)===null)return`"${e}" is not a well-formed media type (RFC 6838 §4.2)`;return null}function Bg(e){let t=Fg(e);if(t===null)return null;let r=t.tree===null?"":`${t.tree}.`,n=t.suffix===null?"":`+${t.suffix}`;return`${t.type}/${r}${t.subtype}${n}`}var Lg,AC,Dg="text/markdown; variant=GFM",Jg="application/yaml",Hg;var lf=L(()=>{Ee();Lg=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,AC=new Set(["vnd","prs","x"]);Hg={".markdown":`${Dg}; charset=utf-8`,".md":`${Dg}; charset=utf-8`,".yaml":`${Jg}; charset=utf-8`,".yml":`${Jg}; charset=utf-8`}});function zg(e){if(e===null)throw TypeError("A class descriptor cannot be null");return ee(e)?e:{}}class wc{name;classPath;classDef;extensions;mediaType;mediaTypeEssence;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#t;#e=null;constructor(e,t,r,n){this.name=e,this.classPath=t,this.classDef=r,this.#t=n;let{format:i}=r;this.extensions=(i?.extensions??[]).map((s)=>s.toLowerCase()),this.mediaType=i?.mediaType??null,this.mediaTypeEssence=Bg(this.mediaType),this.documentKinds=i?.documentKinds??[],this.exportTarget=i?.exportTarget===!0,this.remote=i?.remote===!0,this.studio=r.$studio??null,this.project=r.project??null,this.server=r.server??null,this.connector=r.connector??null,this.capabilities=RC(r)}implementation(){if(!this.#e){let e=this.classDef.$implementation;if(!e)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#e=this.#t.importModule(this.#t.resolvePath(this.classPath,e))}return this.#e}async implementationExport(){return this.#r(await this.implementation())}#r(e){let t=this.classDef.title??this.name;return e[t]??e.default?.[t]??e.default}async call(e,...t){let r=this.capabilities[e];if(!r)throw Error(`Format class "${this.name}" does not declare a "${e}" capability`);let n=this.#r(await this.implementation()),i=n?.[r.identifier];if(!Ot(i)){let o=this.classDef.title??this.name;throw TypeError(`Format class "${this.name}": implementation export "${o}" has no static "${r.identifier}" method`)}return await i.call(n,...t)}async parseDocument(e,t){return await this.call("parse",e,t)}}class Sc{#t;constructor(e){this.#t=e;for(let t of e){if(t.mediaType===null)continue;let r=qg(t.mediaType);if(r!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${r}`)}for(let t of Vg){let r=new Map;for(let n of e){if(!n.capabilities[t])continue;for(let i of n.extensions){let s=r.get(i);if(s)throw Error(`Format conflict: "${s.name}" and "${n.name}" both claim "${i}" with the "${t}" capability`);r.set(i,n)}}}}get entries(){return this.#t}byExtension(e,t){let r=Ug(e);return this.#t.find((n)=>n.extensions.includes(r)&&(!t||n.capabilities[t]))}byName(e){return this.#t.find((t)=>t.name===e)}withCapability(e){return this.#t.filter((t)=>t.capabilities[e])}documentExtensions(e){let t=new Set;for(let r of this.#t){if(e&&!r.documentKinds.includes(e))continue;for(let n of r.extensions)t.add(n)}return t.delete(".json"),[...t]}has(e){let t=Ug(e);return this.#t.some((r)=>r.extensions.includes(t))}}function RC(e){let t={},r=e.$defs?.methods??{};for(let[n,i]of Object.entries(r)){let{role:s}=i;if(!CC(s))continue;let o={identifier:i.identifier??n,timing:i.timing??jC};if(T(i.discriminator))o.discriminator=i.discriminator;t[s]=o}return t}function CC(e){return e!==void 0&&OC.has(e)}function Ug(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var Vg,Wg,jC,OC;var uf=L(()=>{Ee();lf();Vg=["parse","serialize","rewrite","discover","load"],Wg=[...Vg,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];jC=["compiler","server"];OC=new Set(Wg)});class Kg{#t;#e;#r;constructor(e){this.#t=e,this.#e=e.flatMap((i)=>i.classes);let t=new Map;for(let i of e)for(let s of i.classes){let o=t.get(s.name);if(o&&o!==i.specifier)throw Error(`Extension conflict: "${o}" and "${i.specifier}" both provide a class named "${s.name}"`);t.set(s.name,i.specifier)}let r=new Map;for(let i of this.#e){if(!i.project)continue;let s=r.get(i.project.key);if(s)throw Error(`Extension conflict: "${s.name}" and "${i.name}" both claim the project section "${i.project.key}"`);r.set(i.project.key,i)}let n=new Map;for(let i of this.#e){if(!i.server)continue;let{basePath:s}=i.server;if(!s.startsWith("/_jx/"))throw Error(`Extension "${i.name}": server basePath "${s}" must be under /_jx/`);let o=n.get(s);if(o)throw Error(`Extension conflict: "${o.name}" and "${i.name}" both mount "${s}"`);n.set(s,i)}this.#r=new Sc(this.#e.filter((i)=>i.extensions.length>0))}get extensions(){return this.#t}get classes(){return this.#e}get formats(){return this.#r}byName(e){return this.#e.find((t)=>t.name===e)}projectContributions(){return this.#e.filter((e)=>e.project!==null)}byProjectKey(e){return this.#e.find((t)=>t.project?.key===e)}byPathsDiscriminator(e){return this.#e.find((t)=>t.capabilities.resolvePaths?.discriminator===e)}emitters(){return this.#e.filter((e)=>e.capabilities.emit!==void 0)}headProviders(){return this.#e.filter((e)=>e.capabilities.head!==void 0)}assetProviders(){return this.#e.filter((e)=>e.capabilities.assets!==void 0)}serverMounts(){return this.#e.filter((e)=>e.server!==null).toSorted((e,t)=>(e.server?.order??100)-(t.server?.order??100)||e.name.localeCompare(t.name))}connectors(){return this.#e.filter((e)=>e.connector!==null)}schemaFragments(e){return this.#t.map((t)=>t.schemas[e]).filter((t)=>typeof t==="string")}}async function Gg(e,t,r){let n=[];for(let i of e??[])n.push(await IC(i,t,r));return new Kg(n)}async function IC(e,t,r){let n;if(e.startsWith("./")||e.startsWith("../")){let c=t.resolvePath(r,e);n=t.resolvePath(`${c}/package.json`,`./${qo}`)}else try{n=t.resolvePath(r,`${e}/${qo}`)}catch(c){throw Error(`Extension "${e}" is not resolvable: it must export ${qo} (is the package installed, and does its exports map include it?): ${ff(c)}`,{cause:c})}let i;try{i=await t.loadJson(n)}catch(c){throw Error(`Extension "${e}": cannot read manifest ${n}: ${ff(c)}`,{cause:c})}if(!ee(i)||!T(i.name))throw Error(`Extension "${e}": ${qo} must declare a "name"`);let s=i;if(!e.startsWith(".")&&s.name!==e)throw Error(`Extension "${e}": manifest name "${s.name}" does not match the specifier`);let o=[];for(let[c,l]of Object.entries(s.classes??{})){let u=t.resolvePath(n,l),d;try{d=await t.loadJson(u)}catch(h){throw Error(`Extension "${e}": cannot read class "${c}" at ${u}: ${ff(h)}`,{cause:h})}o.push(new wc(c,u,zg(d),t))}let a={};if(s.schemas?.project)a.project=t.resolvePath(n,s.schemas.project);if(s.schemas?.document)a.document=t.resolvePath(n,s.schemas.document);if(s.schemas?.fields)a.fields=t.resolvePath(n,s.schemas.fields);return{specifier:e,manifestPath:n,manifest:s,classes:o,schemas:a}}function ff(e){return e instanceof Error?e.message:String(e)}var qo="jx-extension.json";var Yg=L(()=>{uf();Ee();uf()});import{readFileSync as TC}from"node:fs";import{dirname as NC,isAbsolute as MC,resolve as df,sep as Ec}from"node:path";import{pathToFileURL as LC}from"node:url";import{createRequire as Xg}from"node:module";async function pf(e){let t=[e],r=`${Ec}src${Ec}`,n=`${Ec}dist${Ec}`;if(e.includes(r)){let s=e.replace(r,n);if(t.push(s),s.endsWith(".ts"))t.push(`${s.slice(0,-3)}.js`)}if(e.endsWith(".js"))t.push(`${e.slice(0,-3)}.ts`);let i;for(let s of t)try{return await import(LC(s).href)}catch(o){i=o}throw i instanceof Error?i:Error(String(i))}function mf(e){return{importModule:(t)=>pf(t),loadJson:async(t)=>JSON.parse(TC(t,"utf8")),resolvePath:(t,r)=>{if(r.startsWith("./")||r.startsWith("../"))return df(NC(t),r);if(MC(r))return r;let n=Xg(df(e,"package.json"));try{return n.resolve(r)}catch{return Xg(import.meta.url).resolve(r)}}}}async function ri(e,t){return Gg(t?.extensions,mf(e),df(e,"project.json"))}function _c(e,t){return Error(`No format class registered for "${t}" (${e}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var On=L(()=>{Yg();Ee()});import{existsSync as DC,readFileSync as JC}from"node:fs";import{resolve as Qg}from"node:path";function ni(e){let t=Qg(e,"project.json");if(!DC(t))throw Error(`project.json not found in ${e}`);let r;try{r=Cg(JC(t,"utf8"),t)}catch(o){throw Error(`Invalid project.json: ${Pe(o)}`,{cause:o})}let n={...Bo,...r,build:{...Bo.build,...r.build},defaults:{...Bo.defaults,...r.defaults},images:{...Bo.images,...r.images},url:r.url??Bo.url};if(r.$head)n.$head=r.$head;if(r.$media)n.$media=r.$media;if(r.style)n.style=r.style;if(r.state)n.state=r.state;if(r.redirects)n.redirects=r.redirects;if(r.imports)n.imports=r.imports;let i=["cloudflare-workers","cloudflare-pages","node","bun"];if(n.build.adapter==="static")delete n.build.adapter;if(n.build.adapter&&!i.includes(n.build.adapter))throw Error(`Unknown build adapter "${n.build.adapter}" in project.json. Valid adapters: ${i.join(", ")}`);let s=["build","cloudflare"];if(!s.includes(n.images.service))throw Error(`Unknown images.service "${n.images.service}" in project.json. Valid services: ${s.join(", ")}`);return{config:n,configPath:t,projectRoot:Qg(e)}}var Bo;var Ho=L(()=>{vr();Bo={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,picture:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{existsSync as hf,readFileSync as Zg,writeFileSync as FC}from"node:fs";import{resolve as ey}from"node:path";async function ty(e,t={}){let{dryRun:r=!1,connection:n}=t,{config:i}=ni(e),s=await ri(e,i),o=ee(i.connections)?i.connections:{},a=ee(i.data)?i.data:{},c=Object.keys(o).filter((y)=>!n||y===n);if(n&&c.length===0)throw Error(`Unknown connection "${n}" (no such connections entry in project.json)`);if(c.length===0)throw Error('project.json has no "connections" section — nothing to push. Declare a connection and '+'its tables in the "data" section first.');let l={...process.env,...BC(e),JX_PROJECT_ROOT:e},u=[],d=[];for(let y of c){let g=o[y],b=ee(g)?{...g,$name:y}:{$name:y},x=String(b.provider??""),_=qC(s.connectors(),x);if(!_)throw Error(`Connection "${y}" names provider "${x}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let P={};for(let[w,k]of Object.entries(a))if(ee(k)&&k.connection===y)P[w]=k;let E=await _.call("deploySchema",P,b,{dryRun:r,env:l});if(u.push({applied:E.applied??!r,connection:y,provider:x,statements:E.statements??[],tables:Object.keys(P),warnings:E.warnings??[]}),_.capabilities.bindings){let w=await _.call("bindings",b);if(ee(w)&&Object.keys(w).length>0)d.push(w)}}let h=ey(e,"wrangler.jsonc"),m=!1;if(!r&&d.length>0&&hf(h)){let y=Zg(h,"utf8"),{content:g,patched:b}=Tg(y,d);if(b&&g!==y)FC(h,g,"utf8"),m=!0}return{bindingsPatched:m,results:u,wranglerPath:hf(h)?h:null}}function qC(e,t){return e.find((r)=>r.connector?.provider===t)}function BC(e){let t=ey(e,".dev.vars");if(!hf(t))return{};let r=new Map;for(let n of Zg(t,"utf8").split(`
6
+ `)){let i=n.trim();if(i===""||i.startsWith("#"))continue;let s=i.indexOf("=");if(s===-1)continue;let o=i.slice(0,s).trim(),a=i.slice(s+1).trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))a=a.slice(1,-1);if(o!=="")r.set(o,a)}return Object.fromEntries(r)}var ry=L(()=>{Mg();On();Ho();Ee()});function Di(e){return e.startsWith(Pc)}function ny(e){let t=e;if(Di(t))t=t.slice(Pc.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${gf}${t}.js`}function iy(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",r=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${gf}${r}`:`${gf}${r}.${t}`}function sy(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function kc(e){let t=sy(e);return t.startsWith("/")?t:`/${t}`}function HC(e,t){return[...e].toSorted((r,n)=>n[t].length-r[t].length)}function Ac(e,t){let r=t.split("#")[0].split("?")[0];if(!r.startsWith("/"))return null;let n;try{n=decodeURIComponent(r)}catch{return null}if(/%2e|%2f/i.test(n))return null;for(let i of HC(e,"urlPrefix")){let s=kc(i.urlPrefix);if(!n.startsWith(`${s}/`))continue;let a=n.slice(s.length+1).split("/");if(a.some((l)=>l===""||l==="."||l===".."))return null;let{filter:c}=i;if(c&&!c(a.join("/")))return null;return`${sy(i.dir)}/${a.join("/")}`}return null}function oy(e,t){let r=new Set;for(let n of t){let i=kc(n.urlPrefix),s=new RegExp(`${i.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${UC}]+`,"g");for(let o of e.matchAll(s)){let a=o[0].split("#")[0].split("?")[0];if(!a.endsWith("/"))r.add(a)}}return[...r].filter(Boolean)}function yf(e){let t=[],r=0;while(r<e.length){while(r<e.length&&(/\s/.test(e[r])||e[r]===","))r+=1;if(r>=e.length)break;let n=r;while(r<e.length&&!/\s/.test(e[r]))r+=1;let i=e.slice(n,r);if(i.endsWith(",")){t.push({descriptor:"",url:i.replace(/,+$/,"")});continue}while(r<e.length&&/\s/.test(e[r]))r+=1;let s=r;while(r<e.length&&e[r]!==",")r+=1;let o=e.slice(s,r).trim();if(r+=1,i=i.replace(/,+$/,""),i!=="")t.push({descriptor:o,url:i})}return t}function bf(e){return e.map(({url:t,descriptor:r})=>r?`${t} ${r}`:t).join(", ")}function Ji(e){if(!T(e)||e==="")return"";let t;try{({pathname:t}=new URL(e))}catch{return""}let r=t.replace(/\/+$/,"");if(r===""||r==="/")return"";return r.startsWith("/")?r:`/${r}`}function ze(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function ii(e,t){let r=new URL(t);if(!r.pathname.endsWith("/"))r.pathname+="/";return new URL(e.replace(/^\/+/,""),r).href}var Pc="npm:",gf="/assets/",UC;var wr=L(()=>{Ee();UC=String.raw`"'\s<>()\\`});function ay(e,t){return e.replaceAll(GC,(r,n,i)=>{let s=i.trim(),o=eI.exec(s),a=o?o[2]:s,c=ze(t,a);if(c===a)return r;return`url(${n}${o?`${o[1]}${c}${o[1]}`:c}${n})`})}function tI(e,t,r,n,i){let s=r.toLowerCase();if(VC.has(s))return ze(i,n);if(WC.has(s)){let o=yf(n);return o.length===0?n:bf(o.map((a)=>({descriptor:a.descriptor,url:ze(i,a.url)})))}if(s==="style")return ay(n,i);if(s==="content"&&e==="meta"&&ZC.test(t))return ze(i,n);return n}function cy(e,t){if(t==="")return e;let r=e.replaceAll(XC,(n,i,s,o)=>{let a=s.replaceAll(YC,(c,l)=>`"${ze(t,l)}"`);return i+a+o});return r=r.replaceAll(QC,(n,i,s,o)=>i+ay(s,t)+o),r.replaceAll(zC,(n,i,s)=>{if(s==="")return n;let o=i.toLowerCase(),a=s.replaceAll(KC,(c,l,u,d,h)=>{let m=d===void 0?"'":'"',y=d??h??"",g=tI(o,s,l,y,t);return g===y?c:`${l}=${m}${g}${m}`});return a===s?n:`<${i}${a}>`})}var VC,WC,zC,KC,GC,YC,XC,QC,ZC,eI;var ly=L(()=>{wr();VC=new Set(["href","src","poster","action","formaction","data"]),WC=new Set(["srcset","imagesrcset"]),zC=/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,KC=/([a-zA-Z_:][\w:.-]*)\s*=\s*("([^"]*)"|'([^']*)')/g,GC=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g,YC=/"(\/[^"/][^"]*)"/g,XC=/(<script\b[^>]*\btype\s*=\s*["']importmap["'][^>]*>)([\s\S]*?)(<\/script>)/gi,QC=/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/gi,ZC=/\b(?:property|name)\s*=\s*["'](?:og:|twitter:)[\w:.-]*(?:image|url|video|audio|player)[\w:.-]*["']/i,eI=/^(&quot;|&#34;|&apos;|&#39;)([\s\S]*)\1$/});var Go=C(function(BX,Ty){var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",{defineProperty:Sf,getOwnPropertyDescriptor:rI,getOwnPropertyNames:nI}=Object,iI=Object.prototype.hasOwnProperty,sI=(e,t)=>{for(var r in t)Sf(e,r,{get:t[r],enumerable:!0})},oI=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of nI(t))if(!iI.call(e,i)&&i!==r)Sf(e,i,{get:()=>t[i],enumerable:!(n=rI(t,i))||n.enumerable})}return e},aI=(e)=>oI(Sf({},"__esModule",{value:!0}),e),zo={};sI(zo,{analyzeMetafile:()=>DI,analyzeMetafileSync:()=>BI,build:()=>TI,buildSync:()=>JI,context:()=>NI,default:()=>WI,formatMessages:()=>LI,formatMessagesSync:()=>qI,initialize:()=>UI,stop:()=>HI,transform:()=>MI,transformSync:()=>FI,version:()=>II});Ty.exports=aI(zo);function uy(e){let t=(n)=>{if(n===null)r.write8(0);else if(typeof n==="boolean")r.write8(1),r.write8(+n);else if(typeof n==="number")r.write8(2),r.write32(n|0);else if(typeof n==="string")r.write8(3),r.write(Ur(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let i of n)t(i)}else{let i=Object.keys(n);r.write8(6),r.write32(i.length);for(let s of i)r.write(Ur(s)),t(n[s])}},r=new $y;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),$f(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function cI(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return Ui(r.read());case 4:return r.read();case 5:{let o=r.read32(),a=[];for(let c=0;c<o;c++)a.push(t());return a}case 6:{let o=r.read32(),a={};for(let c=0;c<o;c++)a[Ui(r.read())]=t();return a}default:throw Error("Invalid packet")}},r=new $y(e),n=r.read32(),i=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw Error("Invalid packet");return{id:n,isRequest:i,value:s}}var $y=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);$f(this.buf,e,t)}write(e){let t=this._write(4+e.length);$f(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return vy(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},Ur,Ui,xf;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;Ur=(r)=>e.encode(r),Ui=(r)=>t.decode(r),xf='new TextEncoder().encode("")'}else if(typeof Buffer<"u")Ur=(e)=>Buffer.from(e),Ui=(e)=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},xf='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!(Ur("")instanceof Uint8Array))throw Error(`Invariant violation: "${xf} instanceof Uint8Array" is incorrectly false
7
7
 
8
8
  This indicates that your JavaScript environment is broken. You cannot use
9
9
  esbuild in this environment because esbuild relies on this invariant. This
10
10
  is not a problem with esbuild. You need to fix your environment instead.
11
- `);function vy(e,t){return(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0}function xf(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var Cn=String.fromCharCode;function Tr(e,t,r){let n=e[t],i=1,s=0;for(let o=0;o<t;o++)if(e[o]===10)i++,s=0;else s++;throw SyntaxError(r?r:t===e.length?"Unexpected end of input while parsing JSON":n>=32&&n<=126?`Unexpected character ${Cn(n)} in JSON at position ${t} (line ${i}, column ${s})`:`Unexpected byte 0x${n.toString(16)} in JSON at position ${t} (line ${i}, column ${s})`)}function oI(e){if(!(e instanceof Uint8Array))throw Error("JSON input must be a Uint8Array");let t=[],r=[],n=[],i=e.length,s=null,o=0,a,c=0;while(c<i){let l=e[c++];if(l<=32)continue;let u;if(o===2&&s===null&&l!==34&&l!==125)Tr(e,--c);switch(l){case 116:{if(e[c++]!==114||e[c++]!==117||e[c++]!==101)Tr(e,--c);u=!0;break}case 102:{if(e[c++]!==97||e[c++]!==108||e[c++]!==115||e[c++]!==101)Tr(e,--c);u=!1;break}case 110:{if(e[c++]!==117||e[c++]!==108||e[c++]!==108)Tr(e,--c);u=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let d=c;u=Cn(l),l=e[c];while(!0){switch(l){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{u+=Cn(l),l=e[++c];continue}}break}if(u=+u,isNaN(u))Tr(e,--d,"Invalid number");break}case 34:{u="";while(!0){if(c>=i)Tr(e,i);if(l=e[c++],l===34)break;else if(l===92)switch(e[c++]){case 34:u+='"';break;case 47:u+="/";break;case 92:u+="\\";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
12
- `;break;case 114:u+="\r";break;case 116:u+="\t";break;case 117:{let d=0;for(let h=0;h<4;h++)if(l=e[c++],d<<=4,l>=48&&l<=57)d|=l-48;else if(l>=97&&l<=102)d|=l+-87;else if(l>=65&&l<=70)d|=l+-55;else Tr(e,--c);u+=Cn(d);break}default:Tr(e,--c);break}else if(l<=127)u+=Cn(l);else if((l&224)===192)u+=Cn((l&31)<<6|e[c++]&63);else if((l&240)===224)u+=Cn((l&15)<<12|(e[c++]&63)<<6|e[c++]&63);else if((l&248)==240){let d=(l&7)<<18|(e[c++]&63)<<12|(e[c++]&63)<<6|e[c++]&63;if(d>65535)d-=65536,u+=Cn(d>>10&1023|55296),d=56320|d&1023;u+=Cn(d)}}u[0];break}case 91:{u=[],t.push(s),r.push(a),n.push(o),s=null,a=u,o=1;continue}case 123:{u={},t.push(s),r.push(a),n.push(o),s=null,a=u,o=2;continue}case 93:{if(o!==1)Tr(e,--c);u=a,s=t.pop(),a=r.pop(),o=n.pop();break}case 125:{if(o!==2)Tr(e,--c);u=a,s=t.pop(),a=r.pop(),o=n.pop();break}default:Tr(e,--c)}l=e[c];while(l<=32)l=e[++c];switch(o){case 0:{if(c===i)return u;break}case 1:{if(a.push(u),l===44){c++;continue}if(l===93)continue;break}case 2:{if(s===null){if(s=u,l===58){c++;continue}}else{if(a[s]=u,s=null,l===44){c++;continue}if(l===125)continue}break}}break}Tr(e,c)}var yt=JSON.stringify,fy="warning",dy="silent";function Ss(e,t){let r=[];for(let n of e){if(sr(n,t),n.indexOf(",")>=0)throw Error(`Invalid ${t}: ${n}`);r.push(n)}return r.join(",")}var Oc=()=>null,et=(e)=>typeof e==="boolean"?null:"a boolean",re=(e)=>typeof e==="string"?null:"a string",Cc=(e)=>e instanceof RegExp?null:"a RegExp object",qi=(e)=>typeof e==="number"&&e===(e|0)?null:"an integer",aI=(e)=>typeof e==="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",wy=(e)=>typeof e==="function"?null:"a function",In=(e)=>Array.isArray(e)?null:"an array",or=(e)=>Array.isArray(e)&&e.every((t)=>typeof t==="string")?null:"an array of strings",Sr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)?null:"an object",cI=(e)=>typeof e==="object"&&e!==null?null:"an array or an object",lI=(e)=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",py=(e)=>typeof e==="object"&&!Array.isArray(e)?null:"an object or null",Sy=(e)=>typeof e==="string"||typeof e==="boolean"?null:"a string or a boolean",uI=(e)=>typeof e==="string"||typeof e==="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ey=(e)=>typeof e==="string"||Array.isArray(e)&&e.every((t)=>typeof t==="string")?null:"a string or an array of strings",_y=(e)=>typeof e==="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",fI=(e)=>typeof e==="string"||e instanceof URL?null:"a string or a URL";function I(e,t,r,n){let i=e[r];if(t[r+""]=!0,i===void 0)return;let s=n(i);if(s!==null)throw Error(`${yt(r)} must be ${s}`);return i}function pt(e,t,r){for(let n in e)if(!(n in t))throw Error(`Invalid option ${r}: ${yt(n)}`)}function dI(e){let t=Object.create(null),r=I(e,t,"wasmURL",fI),n=I(e,t,"wasmModule",lI),i=I(e,t,"worker",et);return pt(e,t,"in initialize() call"),{wasmURL:r,wasmModule:n,worker:i}}function Py(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let n=e[r];if(typeof n==="string"||n===!1)t[r]=n;else throw Error(`Expected ${yt(r)} in mangle cache to map to either a string or false`)}}return t}function Lc(e,t,r,n,i){let s=I(t,r,"color",et),o=I(t,r,"logLevel",re),a=I(t,r,"logLimit",qi),c=I(t,r,"logStyle",re);if(s!==void 0)e.push(`--color=${s}`);else if(n)e.push("--color=true");if(e.push(`--log-level=${o||i}`),e.push(`--log-limit=${a||0}`),c)e.push(`--log-style=${c}`)}function sr(e,t,r){if(typeof e!=="string")throw Error(`Expected value for ${t}${r!==void 0?" "+yt(r):""} to be a string, got ${typeof e} instead`);return e}function ky(e,t,r){let n=I(t,r,"legalComments",re),i=I(t,r,"sourceRoot",re),s=I(t,r,"sourcesContent",et),o=I(t,r,"target",Ey),a=I(t,r,"format",re),c=I(t,r,"globalName",re),l=I(t,r,"mangleProps",Cc),u=I(t,r,"reserveProps",Cc),d=I(t,r,"mangleQuoted",et),h=I(t,r,"minify",et),m=I(t,r,"minifySyntax",et),y=I(t,r,"minifyWhitespace",et),g=I(t,r,"minifyIdentifiers",et),b=I(t,r,"lineLimit",qi),x=I(t,r,"drop",or),_=I(t,r,"dropLabels",or),k=I(t,r,"charset",re),E=I(t,r,"treeShaking",et),w=I(t,r,"ignoreAnnotations",et),P=I(t,r,"jsx",re),R=I(t,r,"jsxFactory",re),j=I(t,r,"jsxFragment",re),D=I(t,r,"jsxImportSource",re),F=I(t,r,"jsxDev",et),N=I(t,r,"jsxSideEffects",et),q=I(t,r,"define",Sr),U=I(t,r,"logOverride",Sr),ne=I(t,r,"supported",Sr),ue=I(t,r,"pure",or),ie=I(t,r,"keepNames",et),te=I(t,r,"platform",re),le=I(t,r,"tsconfigRaw",uI),Ce=I(t,r,"absPaths",or);if(n)e.push(`--legal-comments=${n}`);if(i!==void 0)e.push(`--source-root=${i}`);if(s!==void 0)e.push(`--sources-content=${s}`);if(o)e.push(`--target=${Ss(Array.isArray(o)?o:[o],"target")}`);if(a)e.push(`--format=${a}`);if(c)e.push(`--global-name=${c}`);if(te)e.push(`--platform=${te}`);if(le)e.push(`--tsconfig-raw=${typeof le==="string"?le:JSON.stringify(le)}`);if(h)e.push("--minify");if(m)e.push("--minify-syntax");if(y)e.push("--minify-whitespace");if(g)e.push("--minify-identifiers");if(b)e.push(`--line-limit=${b}`);if(k)e.push(`--charset=${k}`);if(E!==void 0)e.push(`--tree-shaking=${E}`);if(w)e.push("--ignore-annotations");if(x)for(let W of x)e.push(`--drop:${sr(W,"drop")}`);if(_)e.push(`--drop-labels=${Ss(_,"drop label")}`);if(Ce)e.push(`--abs-paths=${Ss(Ce,"abs paths")}`);if(l)e.push(`--mangle-props=${Ic(l)}`);if(u)e.push(`--reserve-props=${Ic(u)}`);if(d!==void 0)e.push(`--mangle-quoted=${d}`);if(P)e.push(`--jsx=${P}`);if(R)e.push(`--jsx-factory=${R}`);if(j)e.push(`--jsx-fragment=${j}`);if(D)e.push(`--jsx-import-source=${D}`);if(F)e.push("--jsx-dev");if(N)e.push("--jsx-side-effects");if(q)for(let W in q){if(W.indexOf("=")>=0)throw Error(`Invalid define: ${W}`);e.push(`--define:${W}=${sr(q[W],"define",W)}`)}if(U)for(let W in U){if(W.indexOf("=")>=0)throw Error(`Invalid log override: ${W}`);e.push(`--log-override:${W}=${sr(U[W],"log override",W)}`)}if(ne)for(let W in ne){if(W.indexOf("=")>=0)throw Error(`Invalid supported: ${W}`);let oe=ne[W];if(typeof oe!=="boolean")throw Error(`Expected value for supported ${yt(W)} to be a boolean, got ${typeof oe} instead`);e.push(`--supported:${W}=${oe}`)}if(ue)for(let W of ue)e.push(`--pure:${sr(W,"pure")}`);if(ie)e.push("--keep-names")}function pI(e,t,r,n,i){var s;let o=[],a=[],c=Object.create(null),l=null,u=null;Lc(o,t,c,r,n),ky(o,t,c);let d=I(t,c,"sourcemap",Sy),h=I(t,c,"bundle",et),m=I(t,c,"splitting",et),y=I(t,c,"preserveSymlinks",et),g=I(t,c,"metafile",et),b=I(t,c,"outfile",re),x=I(t,c,"outdir",re),_=I(t,c,"outbase",re),k=I(t,c,"tsconfig",re),E=I(t,c,"resolveExtensions",or),w=I(t,c,"nodePaths",or),P=I(t,c,"mainFields",or),R=I(t,c,"conditions",or),j=I(t,c,"external",or),D=I(t,c,"packages",re),F=I(t,c,"alias",Sr),N=I(t,c,"loader",Sr),q=I(t,c,"outExtension",Sr),U=I(t,c,"publicPath",re),ne=I(t,c,"entryNames",re),ue=I(t,c,"chunkNames",re),ie=I(t,c,"assetNames",re),te=I(t,c,"inject",or),le=I(t,c,"banner",Sr),Ce=I(t,c,"footer",Sr),W=I(t,c,"entryPoints",cI),oe=I(t,c,"absWorkingDir",re),Q=I(t,c,"stdin",Sr),Z=(s=I(t,c,"write",et))!=null?s:i,Ve=I(t,c,"allowOverwrite",et),pe=I(t,c,"mangleCache",Sr);if(c.plugins=!0,pt(t,c,`in ${e}() call`),d)o.push(`--sourcemap${d===!0?"":`=${d}`}`);if(h)o.push("--bundle");if(Ve)o.push("--allow-overwrite");if(m)o.push("--splitting");if(y)o.push("--preserve-symlinks");if(g)o.push("--metafile");if(b)o.push(`--outfile=${b}`);if(x)o.push(`--outdir=${x}`);if(_)o.push(`--outbase=${_}`);if(k)o.push(`--tsconfig=${k}`);if(D)o.push(`--packages=${D}`);if(E)o.push(`--resolve-extensions=${Ss(E,"resolve extension")}`);if(U)o.push(`--public-path=${U}`);if(ne)o.push(`--entry-names=${ne}`);if(ue)o.push(`--chunk-names=${ue}`);if(ie)o.push(`--asset-names=${ie}`);if(P)o.push(`--main-fields=${Ss(P,"main field")}`);if(R)o.push(`--conditions=${Ss(R,"condition")}`);if(j)for(let z of j)o.push(`--external:${sr(z,"external")}`);if(F)for(let z in F){if(z.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${z}`);o.push(`--alias:${z}=${sr(F[z],"alias",z)}`)}if(le)for(let z in le){if(z.indexOf("=")>=0)throw Error(`Invalid banner file type: ${z}`);o.push(`--banner:${z}=${sr(le[z],"banner",z)}`)}if(Ce)for(let z in Ce){if(z.indexOf("=")>=0)throw Error(`Invalid footer file type: ${z}`);o.push(`--footer:${z}=${sr(Ce[z],"footer",z)}`)}if(te)for(let z of te)o.push(`--inject:${sr(z,"inject")}`);if(N)for(let z in N){if(z.indexOf("=")>=0)throw Error(`Invalid loader extension: ${z}`);o.push(`--loader:${z}=${sr(N[z],"loader",z)}`)}if(q)for(let z in q){if(z.indexOf("=")>=0)throw Error(`Invalid out extension: ${z}`);o.push(`--out-extension:${z}=${sr(q[z],"out extension",z)}`)}if(W)if(Array.isArray(W))for(let z=0,dt=W.length;z<dt;z++){let Ze=W[z];if(typeof Ze==="object"&&Ze!==null){let er=Object.create(null),nt=I(Ze,er,"in",re),it=I(Ze,er,"out",re);if(pt(Ze,er,"in entry point at index "+z),nt===void 0)throw Error('Missing property "in" for entry point at index '+z);if(it===void 0)throw Error('Missing property "out" for entry point at index '+z);a.push([it,nt])}else a.push(["",sr(Ze,"entry point at index "+z)])}else for(let z in W)a.push([z,sr(W[z],"entry point",z)]);if(Q){let z=Object.create(null),dt=I(Q,z,"contents",_y),Ze=I(Q,z,"resolveDir",re),er=I(Q,z,"sourcefile",re),nt=I(Q,z,"loader",re);if(pt(Q,z,'in "stdin" object'),er)o.push(`--sourcefile=${er}`);if(nt)o.push(`--loader=${nt}`);if(Ze)u=Ze;if(typeof dt==="string")l=Ur(dt);else if(dt instanceof Uint8Array)l=dt}let Qe=[];if(w)for(let z of w)z+="",Qe.push(z);return{entries:a,flags:o,write:Z,stdinContents:l,stdinResolveDir:u,absWorkingDir:oe,nodePaths:Qe,mangleCache:Py(pe)}}function mI(e,t,r,n){let i=[],s=Object.create(null);Lc(i,t,s,r,n),ky(i,t,s);let o=I(t,s,"sourcemap",Sy),a=I(t,s,"sourcefile",re),c=I(t,s,"loader",re),l=I(t,s,"banner",re),u=I(t,s,"footer",re),d=I(t,s,"mangleCache",Sr);if(pt(t,s,`in ${e}() call`),o)i.push(`--sourcemap=${o===!0?"external":o}`);if(a)i.push(`--sourcefile=${a}`);if(c)i.push(`--loader=${c}`);if(l)i.push(`--banner=${l}`);if(u)i.push(`--footer=${u}`);return{flags:i,mangleCache:Py(d)}}function Ay(e){let t={},r={didClose:!1,reason:""},n={},i=0,s=0,o=new Uint8Array(16384),a=0,c=(k)=>{let E=a+k.length;if(E>o.length){let P=new Uint8Array(E*2);P.set(o),o=P}o.set(k,a),a+=k.length;let w=0;while(w+4<=a){let P=vy(o,w);if(w+4+P>a)break;w+=4,y(o.subarray(w,w+P)),w+=P}if(w>0)o.copyWithin(0,w,a),a-=w},l=(k)=>{if(r.didClose=!0,k)r.reason=": "+(k.message||k);let E="The service was stopped"+r.reason;for(let w in n)n[w](E,null);n={}},u=(k,E,w)=>{if(r.didClose)return w("The service is no longer running"+r.reason,null);let P=i++;if(n[P]=(R,j)=>{try{w(R,j)}finally{if(k)k.unref()}},k)k.ref();e.writeToStdin(uy({id:P,isRequest:!0,value:E}))},d=(k,E)=>{if(r.didClose)throw Error("The service is no longer running"+r.reason);e.writeToStdin(uy({id:k,isRequest:!1,value:E}))},h=async(k,E)=>{try{if(E.command==="ping"){d(k,{});return}if(typeof E.key==="number"){let w=t[E.key];if(!w)return;let P=w[E.command];if(P){await P(k,E);return}}throw Error("Invalid command: "+E.command)}catch(w){let P=[Fi(w,e,null,void 0,"")];try{d(k,{errors:P})}catch{}}},m=!0,y=(k)=>{if(m){m=!1;let w=String.fromCharCode(...k);if(w!=="0.28.2")throw Error(`Cannot start service: Host version "0.28.2" does not match binary version ${yt(w)}`);return}let E=sI(k);if(E.isRequest)h(E.id,E.value);else{let w=n[E.id];if(delete n[E.id],E.value.error)w(E.value.error,{});else w(null,E.value)}};return{readFromStdout:c,afterClose:l,service:{buildOrContext:({callName:k,refs:E,options:w,isTTY:P,defaultWD:R,callback:j})=>{let D=0,F=s++,N={},q={ref(){if(++D===1){if(E)E.ref()}},unref(){if(--D===0){if(delete t[F],E)E.unref()}}};t[F]=N,q.ref(),hI(k,F,u,d,q,e,N,w,P,R,(U,ne)=>{try{j(U,ne)}finally{q.unref()}})},transform:({callName:k,refs:E,input:w,options:P,isTTY:R,fs:j,callback:D})=>{let F=jy(),N=(q)=>{try{if(typeof w!=="string"&&!(w instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:U,mangleCache:ne}=mI(k,P,R,dy),ue={command:"transform",flags:U,inputFS:q!==null,input:q!==null?Ur(q):typeof w==="string"?Ur(w):w};if(ne)ue.mangleCache=ne;u(E,ue,(ie,te)=>{if(ie)return D(Error(ie),null);let le=Es(te.errors,F),Ce=Es(te.warnings,F),W=1,oe=()=>{if(--W===0){let Q={warnings:Ce,code:te.code,map:te.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in te)Q.legalComments=te==null?void 0:te.legalComments;if(te.mangleCache)Q.mangleCache=te==null?void 0:te.mangleCache;D(null,Q)}};if(le.length>0)return D(Vo("Transform failed",le,Ce),null);if(te.codeFS)W++,j.readFile(te.code,(Q,Z)=>{if(Q!==null)D(Q,null);else te.code=Z,oe()});if(te.mapFS)W++,j.readFile(te.map,(Q,Z)=>{if(Q!==null)D(Q,null);else te.map=Z,oe()});oe()})}catch(U){let ne=[];try{Lc(ne,P,{},R,dy)}catch{}let ue=Fi(U,e,F,void 0,"");u(E,{command:"error",flags:ne,error:ue},()=>{ue.detail=F.load(ue.detail),D(Vo("Transform failed",[ue],[]),null)})}};if((typeof w==="string"||w instanceof Uint8Array)&&w.length>1048576){let q=N;N=()=>j.writeFile(w,q)}N(null)},formatMessages:({callName:k,refs:E,messages:w,options:P,callback:R})=>{if(!P)throw Error(`Missing second argument in ${k}() call`);let j={},D=I(P,j,"kind",re),F=I(P,j,"color",et),N=I(P,j,"terminalWidth",qi),q=I(P,j,"logStyle",re);if(pt(P,j,`in ${k}() call`),D===void 0)throw Error(`Missing "kind" in ${k}() call`);if(D!=="error"&&D!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${k}() call`);let U={command:"format-msgs",messages:Tn(w,"messages",null,"",N),isWarning:D==="warning"};if(F!==void 0)U.color=F;if(N!==void 0)U.terminalWidth=N;if(q!==void 0)U.logStyle=q;u(E,U,(ne,ue)=>{if(ne)return R(Error(ne),null);R(null,ue.messages)})},analyzeMetafile:({callName:k,refs:E,metafile:w,options:P,callback:R})=>{if(P===void 0)P={};let j={},D=I(P,j,"color",et),F=I(P,j,"verbose",et);pt(P,j,`in ${k}() call`);let N={command:"analyze-metafile",metafile:w};if(D!==void 0)N.color=D;if(F!==void 0)N.verbose=F;u(E,N,(q,U)=>{if(q)return R(Error(q),null);R(null,U.result)})}}}}function hI(e,t,r,n,i,s,o,a,c,l,u){let d=jy(),h=e==="context",m=(b,x)=>{let _=[];try{Lc(_,a,{},c,fy)}catch{}let k=Fi(b,s,d,void 0,x);r(i,{command:"error",flags:_,error:k},()=>{k.detail=d.load(k.detail),u(Vo(h?"Context failed":"Build failed",[k],[]),null)})},y;if(typeof a==="object"){let b=a.plugins;if(b!==void 0){if(!Array.isArray(b))return m(Error('"plugins" must be an array'),"");y=b}}if(y&&y.length>0){if(s.isSync)return m(Error("Cannot use plugins in synchronous API calls"),"");gI(t,r,n,i,s,o,a,y,d).then((b)=>{if(!b.ok)return m(b.error,b.pluginName);try{g(b.requestPlugins,b.runOnEndCallbacks,b.scheduleOnDisposeCallbacks)}catch(x){m(x,"")}},(b)=>m(b,""));return}try{g(null,(b,x)=>x([],[]),()=>{})}catch(b){m(b,"")}function g(b,x,_){let k=s.hasFS,{entries:E,flags:w,write:P,stdinContents:R,stdinResolveDir:j,absWorkingDir:D,nodePaths:F,mangleCache:N}=pI(e,a,c,fy,k);if(P&&!s.hasFS)throw Error('The "write" option is unavailable in this environment');let q={command:"build",key:t,entries:E,flags:w,write:P,stdinContents:R,stdinResolveDir:j,absWorkingDir:D||l,nodePaths:F,context:h};if(b)q.plugins=b;if(N)q.mangleCache=N;let U=(ie,te)=>{let le={errors:Es(ie.errors,d),warnings:Es(ie.warnings,d),outputFiles:void 0,metafile:void 0,mangleCache:void 0},Ce=le.errors.slice(),W=le.warnings.slice();if(ie.outputFiles)le.outputFiles=ie.outputFiles.map(bI);if(ie.metafile&&ie.metafile.length)le.metafile=xI(ie.metafile);if(ie.mangleCache)le.mangleCache=ie.mangleCache;if(ie.writeToStdout!==void 0)console.log(Ui(ie.writeToStdout).replace(/\n$/,""));x(le,(oe,Q)=>{if(Ce.length>0||oe.length>0){let Z=Vo("Build failed",Ce.concat(oe),W.concat(Q));return te(Z,null,oe,Q)}te(null,le,oe,Q)})},ne,ue;if(h)o["on-end"]=(ie,te)=>new Promise((le)=>{U(te,(Ce,W,oe,Q)=>{let Z={errors:oe,warnings:Q};if(ue)ue(Ce,W);ne=void 0,ue=void 0,n(ie,Z),le()})});r(i,q,(ie,te)=>{if(ie)return u(Error(ie),null);if(!h)return U(te,(W,oe)=>(_(),u(W,oe)));if(te.errors.length>0)return u(Vo("Context failed",te.errors,te.warnings),null);let le=!1,Ce={rebuild:()=>{if(!ne)ne=new Promise((W,oe)=>{let Q;ue=(Ve,pe)=>{if(!Q)Q=()=>Ve?oe(Ve):W(pe)};let Z=()=>{r(i,{command:"rebuild",key:t},(pe,Qe)=>{if(pe)oe(Error(pe));else if(Q)Q();else Z()})};Z()});return ne},watch:(W={})=>new Promise((oe,Q)=>{if(!s.hasFS)throw Error('Cannot use the "watch" API in this environment');let Z={},Ve=I(W,Z,"delay",qi);pt(W,Z,"in watch() call");let pe={command:"watch",key:t};if(Ve)pe.delay=Ve;r(i,pe,(Qe)=>{if(Qe)Q(Error(Qe));else oe(void 0)})}),serve:(W={})=>new Promise((oe,Q)=>{if(!s.hasFS)throw Error('Cannot use the "serve" API in this environment');let Z={},Ve=I(W,Z,"port",aI),pe=I(W,Z,"host",re),Qe=I(W,Z,"servedir",re),z=I(W,Z,"keyfile",re),dt=I(W,Z,"certfile",re),Ze=I(W,Z,"fallback",re),er=I(W,Z,"cors",Sr),nt=I(W,Z,"onRequest",wy);pt(W,Z,"in serve() call");let it={command:"serve",key:t,onRequest:!!nt};if(Ve!==void 0)it.port=Ve;if(pe!==void 0)it.host=pe;if(Qe!==void 0)it.servedir=Qe;if(z!==void 0)it.keyfile=z;if(dt!==void 0)it.certfile=dt;if(Ze!==void 0)it.fallback=Ze;if(er){let yr={},tr=I(er,yr,"origin",Ey);if(pt(er,yr,'on "cors" object'),Array.isArray(tr))it.corsOrigin=tr;else if(tr!==void 0)it.corsOrigin=[tr]}r(i,it,(yr,tr)=>{if(yr)return Q(Error(yr));if(nt)o["serve-request"]=(Xn,Ii)=>{nt(Ii.args),n(Xn,{})};oe(tr)})}),cancel:()=>new Promise((W)=>{if(le)return W();r(i,{command:"cancel",key:t},()=>{W()})}),dispose:()=>new Promise((W)=>{if(le)return W();le=!0,r(i,{command:"dispose",key:t},()=>{W(),_(),i.unref()})})};i.ref(),u(null,Ce)})}}var gI=async(e,t,r,n,i,s,o,a,c)=>{let l=[],u=[],d={},h={},m=[],y=0,g=0,b=[],x=!1;a=[...a];for(let E of a){let w={};if(typeof E!=="object")throw Error(`Plugin at index ${g} must be an object`);let P=I(E,w,"name",re);if(typeof P!=="string"||P==="")throw Error(`Plugin at index ${g} is missing a name`);try{let R=I(E,w,"setup",wy);if(typeof R!=="function")throw Error("Plugin is missing a setup function");pt(E,w,`on plugin ${yt(P)}`);let j={name:P,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};g++;let F=R({initialOptions:o,resolve:(N,q={})=>{if(!x)throw Error('Cannot call "resolve" before plugin setup has completed');if(typeof N!=="string")throw Error("The path to resolve must be a string");let U=Object.create(null),ne=I(q,U,"pluginName",re),ue=I(q,U,"importer",re),ie=I(q,U,"namespace",re),te=I(q,U,"resolveDir",re),le=I(q,U,"kind",re),Ce=I(q,U,"pluginData",Oc),W=I(q,U,"with",Sr);return pt(q,U,"in resolve() call"),new Promise((oe,Q)=>{let Z={command:"resolve",path:N,key:e,pluginName:P};if(ne!=null)Z.pluginName=ne;if(ue!=null)Z.importer=ue;if(ie!=null)Z.namespace=ie;if(te!=null)Z.resolveDir=te;if(le!=null)Z.kind=le;else throw Error('Must specify "kind" when calling "resolve"');if(Ce!=null)Z.pluginData=c.store(Ce);if(W!=null)Z.with=yI(W,"with");t(n,Z,(Ve,pe)=>{if(Ve!==null)Q(Error(Ve));else oe({errors:Es(pe.errors,c),warnings:Es(pe.warnings,c),path:pe.path,external:pe.external,sideEffects:pe.sideEffects,namespace:pe.namespace,suffix:pe.suffix,pluginData:c.load(pe.pluginData)})})})},onStart(N){let U=jc(Error('This error came from the "onStart" callback registered here:'),i,"onStart");l.push({name:P,callback:N,note:U}),j.onStart=!0},onEnd(N){let U=jc(Error('This error came from the "onEnd" callback registered here:'),i,"onEnd");u.push({name:P,callback:N,note:U}),j.onEnd=!0},onResolve(N,q){let ne=jc(Error('This error came from the "onResolve" callback registered here:'),i,"onResolve"),ue={},ie=I(N,ue,"filter",Cc),te=I(N,ue,"namespace",re);if(pt(N,ue,`in onResolve() call for plugin ${yt(P)}`),ie==null)throw Error("onResolve() call is missing a filter");let le=y++;d[le]={name:P,callback:q,note:ne},j.onResolve.push({id:le,filter:Ic(ie),namespace:te||""})},onLoad(N,q){let ne=jc(Error('This error came from the "onLoad" callback registered here:'),i,"onLoad"),ue={},ie=I(N,ue,"filter",Cc),te=I(N,ue,"namespace",re);if(pt(N,ue,`in onLoad() call for plugin ${yt(P)}`),ie==null)throw Error("onLoad() call is missing a filter");let le=y++;h[le]={name:P,callback:q,note:ne},j.onLoad.push({id:le,filter:Ic(ie),namespace:te||""})},onDispose(N){m.push(N)},esbuild:i.esbuild});if(F)await F;b.push(j)}catch(R){return{ok:!1,error:R,pluginName:P}}}s["on-start"]=async(E,w)=>{c.clear();let P={errors:[],warnings:[]};await Promise.all(l.map(async({name:R,callback:j,note:D})=>{try{let F=await j();if(F!=null){if(typeof F!=="object")throw Error(`Expected onStart() callback in plugin ${yt(R)} to return an object`);let N={},q=I(F,N,"errors",In),U=I(F,N,"warnings",In);if(pt(F,N,`from onStart() callback in plugin ${yt(R)}`),q!=null)P.errors.push(...Tn(q,"errors",c,R,void 0));if(U!=null)P.warnings.push(...Tn(U,"warnings",c,R,void 0))}}catch(F){P.errors.push(Fi(F,i,c,D&&D(),R))}})),r(E,P)},s["on-resolve"]=async(E,w)=>{let P={},R="",j,D;for(let F of w.ids)try{({name:R,callback:j,note:D}=d[F]);let N=await j({path:w.path,importer:w.importer,namespace:w.namespace,resolveDir:w.resolveDir,kind:w.kind,pluginData:c.load(w.pluginData),with:w.with});if(N!=null){if(typeof N!=="object")throw Error(`Expected onResolve() callback in plugin ${yt(R)} to return an object`);let q={},U=I(N,q,"pluginName",re),ne=I(N,q,"path",re),ue=I(N,q,"namespace",re),ie=I(N,q,"suffix",re),te=I(N,q,"external",et),le=I(N,q,"sideEffects",et),Ce=I(N,q,"pluginData",Oc),W=I(N,q,"errors",In),oe=I(N,q,"warnings",In),Q=I(N,q,"watchFiles",or),Z=I(N,q,"watchDirs",or);if(pt(N,q,`from onResolve() callback in plugin ${yt(R)}`),P.id=F,U!=null)P.pluginName=U;if(ne!=null)P.path=ne;if(ue!=null)P.namespace=ue;if(ie!=null)P.suffix=ie;if(te!=null)P.external=te;if(le!=null)P.sideEffects=le;if(Ce!=null)P.pluginData=c.store(Ce);if(W!=null)P.errors=Tn(W,"errors",c,R,void 0);if(oe!=null)P.warnings=Tn(oe,"warnings",c,R,void 0);if(Q!=null)P.watchFiles=Rc(Q,"watchFiles");if(Z!=null)P.watchDirs=Rc(Z,"watchDirs");break}}catch(N){P={id:F,errors:[Fi(N,i,c,D&&D(),R)]};break}r(E,P)},s["on-load"]=async(E,w)=>{let P={},R="",j,D;for(let F of w.ids)try{({name:R,callback:j,note:D}=h[F]);let N=await j({path:w.path,namespace:w.namespace,suffix:w.suffix,pluginData:c.load(w.pluginData),with:w.with});if(N!=null){if(typeof N!=="object")throw Error(`Expected onLoad() callback in plugin ${yt(R)} to return an object`);let q={},U=I(N,q,"pluginName",re),ne=I(N,q,"contents",_y),ue=I(N,q,"resolveDir",re),ie=I(N,q,"pluginData",Oc),te=I(N,q,"loader",re),le=I(N,q,"errors",In),Ce=I(N,q,"warnings",In),W=I(N,q,"watchFiles",or),oe=I(N,q,"watchDirs",or);if(pt(N,q,`from onLoad() callback in plugin ${yt(R)}`),P.id=F,U!=null)P.pluginName=U;if(ne instanceof Uint8Array)P.contents=ne;else if(ne!=null)P.contents=Ur(ne);if(ue!=null)P.resolveDir=ue;if(ie!=null)P.pluginData=c.store(ie);if(te!=null)P.loader=te;if(le!=null)P.errors=Tn(le,"errors",c,R,void 0);if(Ce!=null)P.warnings=Tn(Ce,"warnings",c,R,void 0);if(W!=null)P.watchFiles=Rc(W,"watchFiles");if(oe!=null)P.watchDirs=Rc(oe,"watchDirs");break}}catch(N){P={id:F,errors:[Fi(N,i,c,D&&D(),R)]};break}r(E,P)};let _=(E,w)=>w([],[]);if(u.length>0)_=(E,w)=>{(async()=>{let P=[],R=[];for(let{name:j,callback:D,note:F}of u){let N,q;try{let U=await D(E);if(U!=null){if(typeof U!=="object")throw Error(`Expected onEnd() callback in plugin ${yt(j)} to return an object`);let ne={},ue=I(U,ne,"errors",In),ie=I(U,ne,"warnings",In);if(pt(U,ne,`from onEnd() callback in plugin ${yt(j)}`),ue!=null)N=Tn(ue,"errors",c,j,void 0);if(ie!=null)q=Tn(ie,"warnings",c,j,void 0)}}catch(U){N=[Fi(U,i,c,F&&F(),j)]}if(N){P.push(...N);try{E.errors.push(...N)}catch{}}if(q){R.push(...q);try{E.warnings.push(...q)}catch{}}}w(P,R)})()};let k=()=>{for(let E of m)setTimeout(()=>E(),0)};return x=!0,{ok:!0,requestPlugins:b,runOnEndCallbacks:_,scheduleOnDisposeCallbacks:k}};function jy(){let e=new Map,t=0;return{clear(){e.clear()},load(r){return e.get(r)},store(r){if(r===void 0)return-1;let n=t++;return e.set(n,r),n}}}function jc(e,t,r){let n,i=!1;return()=>{if(i)return n;i=!0;try{let s=(e.stack+"").split(`
11
+ `);function vy(e,t){return(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0}function $f(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var Cn=String.fromCharCode;function Tr(e,t,r){let n=e[t],i=1,s=0;for(let o=0;o<t;o++)if(e[o]===10)i++,s=0;else s++;throw SyntaxError(r?r:t===e.length?"Unexpected end of input while parsing JSON":n>=32&&n<=126?`Unexpected character ${Cn(n)} in JSON at position ${t} (line ${i}, column ${s})`:`Unexpected byte 0x${n.toString(16)} in JSON at position ${t} (line ${i}, column ${s})`)}function lI(e){if(!(e instanceof Uint8Array))throw Error("JSON input must be a Uint8Array");let t=[],r=[],n=[],i=e.length,s=null,o=0,a,c=0;while(c<i){let l=e[c++];if(l<=32)continue;let u;if(o===2&&s===null&&l!==34&&l!==125)Tr(e,--c);switch(l){case 116:{if(e[c++]!==114||e[c++]!==117||e[c++]!==101)Tr(e,--c);u=!0;break}case 102:{if(e[c++]!==97||e[c++]!==108||e[c++]!==115||e[c++]!==101)Tr(e,--c);u=!1;break}case 110:{if(e[c++]!==117||e[c++]!==108||e[c++]!==108)Tr(e,--c);u=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let d=c;u=Cn(l),l=e[c];while(!0){switch(l){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{u+=Cn(l),l=e[++c];continue}}break}if(u=+u,isNaN(u))Tr(e,--d,"Invalid number");break}case 34:{u="";while(!0){if(c>=i)Tr(e,i);if(l=e[c++],l===34)break;else if(l===92)switch(e[c++]){case 34:u+='"';break;case 47:u+="/";break;case 92:u+="\\";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
12
+ `;break;case 114:u+="\r";break;case 116:u+="\t";break;case 117:{let d=0;for(let h=0;h<4;h++)if(l=e[c++],d<<=4,l>=48&&l<=57)d|=l-48;else if(l>=97&&l<=102)d|=l+-87;else if(l>=65&&l<=70)d|=l+-55;else Tr(e,--c);u+=Cn(d);break}default:Tr(e,--c);break}else if(l<=127)u+=Cn(l);else if((l&224)===192)u+=Cn((l&31)<<6|e[c++]&63);else if((l&240)===224)u+=Cn((l&15)<<12|(e[c++]&63)<<6|e[c++]&63);else if((l&248)==240){let d=(l&7)<<18|(e[c++]&63)<<12|(e[c++]&63)<<6|e[c++]&63;if(d>65535)d-=65536,u+=Cn(d>>10&1023|55296),d=56320|d&1023;u+=Cn(d)}}u[0];break}case 91:{u=[],t.push(s),r.push(a),n.push(o),s=null,a=u,o=1;continue}case 123:{u={},t.push(s),r.push(a),n.push(o),s=null,a=u,o=2;continue}case 93:{if(o!==1)Tr(e,--c);u=a,s=t.pop(),a=r.pop(),o=n.pop();break}case 125:{if(o!==2)Tr(e,--c);u=a,s=t.pop(),a=r.pop(),o=n.pop();break}default:Tr(e,--c)}l=e[c];while(l<=32)l=e[++c];switch(o){case 0:{if(c===i)return u;break}case 1:{if(a.push(u),l===44){c++;continue}if(l===93)continue;break}case 2:{if(s===null){if(s=u,l===58){c++;continue}}else{if(a[s]=u,s=null,l===44){c++;continue}if(l===125)continue}break}}break}Tr(e,c)}var yt=JSON.stringify,fy="warning",dy="silent";function Ss(e,t){let r=[];for(let n of e){if(sr(n,t),n.indexOf(",")>=0)throw Error(`Invalid ${t}: ${n}`);r.push(n)}return r.join(",")}var Oc=()=>null,et=(e)=>typeof e==="boolean"?null:"a boolean",re=(e)=>typeof e==="string"?null:"a string",Cc=(e)=>e instanceof RegExp?null:"a RegExp object",qi=(e)=>typeof e==="number"&&e===(e|0)?null:"an integer",uI=(e)=>typeof e==="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",wy=(e)=>typeof e==="function"?null:"a function",In=(e)=>Array.isArray(e)?null:"an array",or=(e)=>Array.isArray(e)&&e.every((t)=>typeof t==="string")?null:"an array of strings",Sr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)?null:"an object",fI=(e)=>typeof e==="object"&&e!==null?null:"an array or an object",dI=(e)=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",py=(e)=>typeof e==="object"&&!Array.isArray(e)?null:"an object or null",Sy=(e)=>typeof e==="string"||typeof e==="boolean"?null:"a string or a boolean",pI=(e)=>typeof e==="string"||typeof e==="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ey=(e)=>typeof e==="string"||Array.isArray(e)&&e.every((t)=>typeof t==="string")?null:"a string or an array of strings",_y=(e)=>typeof e==="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",mI=(e)=>typeof e==="string"||e instanceof URL?null:"a string or a URL";function I(e,t,r,n){let i=e[r];if(t[r+""]=!0,i===void 0)return;let s=n(i);if(s!==null)throw Error(`${yt(r)} must be ${s}`);return i}function pt(e,t,r){for(let n in e)if(!(n in t))throw Error(`Invalid option ${r}: ${yt(n)}`)}function hI(e){let t=Object.create(null),r=I(e,t,"wasmURL",mI),n=I(e,t,"wasmModule",dI),i=I(e,t,"worker",et);return pt(e,t,"in initialize() call"),{wasmURL:r,wasmModule:n,worker:i}}function Py(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let n=e[r];if(typeof n==="string"||n===!1)t[r]=n;else throw Error(`Expected ${yt(r)} in mangle cache to map to either a string or false`)}}return t}function Lc(e,t,r,n,i){let s=I(t,r,"color",et),o=I(t,r,"logLevel",re),a=I(t,r,"logLimit",qi),c=I(t,r,"logStyle",re);if(s!==void 0)e.push(`--color=${s}`);else if(n)e.push("--color=true");if(e.push(`--log-level=${o||i}`),e.push(`--log-limit=${a||0}`),c)e.push(`--log-style=${c}`)}function sr(e,t,r){if(typeof e!=="string")throw Error(`Expected value for ${t}${r!==void 0?" "+yt(r):""} to be a string, got ${typeof e} instead`);return e}function ky(e,t,r){let n=I(t,r,"legalComments",re),i=I(t,r,"sourceRoot",re),s=I(t,r,"sourcesContent",et),o=I(t,r,"target",Ey),a=I(t,r,"format",re),c=I(t,r,"globalName",re),l=I(t,r,"mangleProps",Cc),u=I(t,r,"reserveProps",Cc),d=I(t,r,"mangleQuoted",et),h=I(t,r,"minify",et),m=I(t,r,"minifySyntax",et),y=I(t,r,"minifyWhitespace",et),g=I(t,r,"minifyIdentifiers",et),b=I(t,r,"lineLimit",qi),x=I(t,r,"drop",or),_=I(t,r,"dropLabels",or),P=I(t,r,"charset",re),E=I(t,r,"treeShaking",et),w=I(t,r,"ignoreAnnotations",et),k=I(t,r,"jsx",re),R=I(t,r,"jsxFactory",re),j=I(t,r,"jsxFragment",re),D=I(t,r,"jsxImportSource",re),F=I(t,r,"jsxDev",et),N=I(t,r,"jsxSideEffects",et),q=I(t,r,"define",Sr),U=I(t,r,"logOverride",Sr),ne=I(t,r,"supported",Sr),ue=I(t,r,"pure",or),ie=I(t,r,"keepNames",et),te=I(t,r,"platform",re),le=I(t,r,"tsconfigRaw",pI),Ce=I(t,r,"absPaths",or);if(n)e.push(`--legal-comments=${n}`);if(i!==void 0)e.push(`--source-root=${i}`);if(s!==void 0)e.push(`--sources-content=${s}`);if(o)e.push(`--target=${Ss(Array.isArray(o)?o:[o],"target")}`);if(a)e.push(`--format=${a}`);if(c)e.push(`--global-name=${c}`);if(te)e.push(`--platform=${te}`);if(le)e.push(`--tsconfig-raw=${typeof le==="string"?le:JSON.stringify(le)}`);if(h)e.push("--minify");if(m)e.push("--minify-syntax");if(y)e.push("--minify-whitespace");if(g)e.push("--minify-identifiers");if(b)e.push(`--line-limit=${b}`);if(P)e.push(`--charset=${P}`);if(E!==void 0)e.push(`--tree-shaking=${E}`);if(w)e.push("--ignore-annotations");if(x)for(let W of x)e.push(`--drop:${sr(W,"drop")}`);if(_)e.push(`--drop-labels=${Ss(_,"drop label")}`);if(Ce)e.push(`--abs-paths=${Ss(Ce,"abs paths")}`);if(l)e.push(`--mangle-props=${Ic(l)}`);if(u)e.push(`--reserve-props=${Ic(u)}`);if(d!==void 0)e.push(`--mangle-quoted=${d}`);if(k)e.push(`--jsx=${k}`);if(R)e.push(`--jsx-factory=${R}`);if(j)e.push(`--jsx-fragment=${j}`);if(D)e.push(`--jsx-import-source=${D}`);if(F)e.push("--jsx-dev");if(N)e.push("--jsx-side-effects");if(q)for(let W in q){if(W.indexOf("=")>=0)throw Error(`Invalid define: ${W}`);e.push(`--define:${W}=${sr(q[W],"define",W)}`)}if(U)for(let W in U){if(W.indexOf("=")>=0)throw Error(`Invalid log override: ${W}`);e.push(`--log-override:${W}=${sr(U[W],"log override",W)}`)}if(ne)for(let W in ne){if(W.indexOf("=")>=0)throw Error(`Invalid supported: ${W}`);let oe=ne[W];if(typeof oe!=="boolean")throw Error(`Expected value for supported ${yt(W)} to be a boolean, got ${typeof oe} instead`);e.push(`--supported:${W}=${oe}`)}if(ue)for(let W of ue)e.push(`--pure:${sr(W,"pure")}`);if(ie)e.push("--keep-names")}function gI(e,t,r,n,i){var s;let o=[],a=[],c=Object.create(null),l=null,u=null;Lc(o,t,c,r,n),ky(o,t,c);let d=I(t,c,"sourcemap",Sy),h=I(t,c,"bundle",et),m=I(t,c,"splitting",et),y=I(t,c,"preserveSymlinks",et),g=I(t,c,"metafile",et),b=I(t,c,"outfile",re),x=I(t,c,"outdir",re),_=I(t,c,"outbase",re),P=I(t,c,"tsconfig",re),E=I(t,c,"resolveExtensions",or),w=I(t,c,"nodePaths",or),k=I(t,c,"mainFields",or),R=I(t,c,"conditions",or),j=I(t,c,"external",or),D=I(t,c,"packages",re),F=I(t,c,"alias",Sr),N=I(t,c,"loader",Sr),q=I(t,c,"outExtension",Sr),U=I(t,c,"publicPath",re),ne=I(t,c,"entryNames",re),ue=I(t,c,"chunkNames",re),ie=I(t,c,"assetNames",re),te=I(t,c,"inject",or),le=I(t,c,"banner",Sr),Ce=I(t,c,"footer",Sr),W=I(t,c,"entryPoints",fI),oe=I(t,c,"absWorkingDir",re),Q=I(t,c,"stdin",Sr),Z=(s=I(t,c,"write",et))!=null?s:i,Ve=I(t,c,"allowOverwrite",et),pe=I(t,c,"mangleCache",Sr);if(c.plugins=!0,pt(t,c,`in ${e}() call`),d)o.push(`--sourcemap${d===!0?"":`=${d}`}`);if(h)o.push("--bundle");if(Ve)o.push("--allow-overwrite");if(m)o.push("--splitting");if(y)o.push("--preserve-symlinks");if(g)o.push("--metafile");if(b)o.push(`--outfile=${b}`);if(x)o.push(`--outdir=${x}`);if(_)o.push(`--outbase=${_}`);if(P)o.push(`--tsconfig=${P}`);if(D)o.push(`--packages=${D}`);if(E)o.push(`--resolve-extensions=${Ss(E,"resolve extension")}`);if(U)o.push(`--public-path=${U}`);if(ne)o.push(`--entry-names=${ne}`);if(ue)o.push(`--chunk-names=${ue}`);if(ie)o.push(`--asset-names=${ie}`);if(k)o.push(`--main-fields=${Ss(k,"main field")}`);if(R)o.push(`--conditions=${Ss(R,"condition")}`);if(j)for(let z of j)o.push(`--external:${sr(z,"external")}`);if(F)for(let z in F){if(z.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${z}`);o.push(`--alias:${z}=${sr(F[z],"alias",z)}`)}if(le)for(let z in le){if(z.indexOf("=")>=0)throw Error(`Invalid banner file type: ${z}`);o.push(`--banner:${z}=${sr(le[z],"banner",z)}`)}if(Ce)for(let z in Ce){if(z.indexOf("=")>=0)throw Error(`Invalid footer file type: ${z}`);o.push(`--footer:${z}=${sr(Ce[z],"footer",z)}`)}if(te)for(let z of te)o.push(`--inject:${sr(z,"inject")}`);if(N)for(let z in N){if(z.indexOf("=")>=0)throw Error(`Invalid loader extension: ${z}`);o.push(`--loader:${z}=${sr(N[z],"loader",z)}`)}if(q)for(let z in q){if(z.indexOf("=")>=0)throw Error(`Invalid out extension: ${z}`);o.push(`--out-extension:${z}=${sr(q[z],"out extension",z)}`)}if(W)if(Array.isArray(W))for(let z=0,dt=W.length;z<dt;z++){let Ze=W[z];if(typeof Ze==="object"&&Ze!==null){let er=Object.create(null),nt=I(Ze,er,"in",re),it=I(Ze,er,"out",re);if(pt(Ze,er,"in entry point at index "+z),nt===void 0)throw Error('Missing property "in" for entry point at index '+z);if(it===void 0)throw Error('Missing property "out" for entry point at index '+z);a.push([it,nt])}else a.push(["",sr(Ze,"entry point at index "+z)])}else for(let z in W)a.push([z,sr(W[z],"entry point",z)]);if(Q){let z=Object.create(null),dt=I(Q,z,"contents",_y),Ze=I(Q,z,"resolveDir",re),er=I(Q,z,"sourcefile",re),nt=I(Q,z,"loader",re);if(pt(Q,z,'in "stdin" object'),er)o.push(`--sourcefile=${er}`);if(nt)o.push(`--loader=${nt}`);if(Ze)u=Ze;if(typeof dt==="string")l=Ur(dt);else if(dt instanceof Uint8Array)l=dt}let Qe=[];if(w)for(let z of w)z+="",Qe.push(z);return{entries:a,flags:o,write:Z,stdinContents:l,stdinResolveDir:u,absWorkingDir:oe,nodePaths:Qe,mangleCache:Py(pe)}}function yI(e,t,r,n){let i=[],s=Object.create(null);Lc(i,t,s,r,n),ky(i,t,s);let o=I(t,s,"sourcemap",Sy),a=I(t,s,"sourcefile",re),c=I(t,s,"loader",re),l=I(t,s,"banner",re),u=I(t,s,"footer",re),d=I(t,s,"mangleCache",Sr);if(pt(t,s,`in ${e}() call`),o)i.push(`--sourcemap=${o===!0?"external":o}`);if(a)i.push(`--sourcefile=${a}`);if(c)i.push(`--loader=${c}`);if(l)i.push(`--banner=${l}`);if(u)i.push(`--footer=${u}`);return{flags:i,mangleCache:Py(d)}}function Ay(e){let t={},r={didClose:!1,reason:""},n={},i=0,s=0,o=new Uint8Array(16384),a=0,c=(P)=>{let E=a+P.length;if(E>o.length){let k=new Uint8Array(E*2);k.set(o),o=k}o.set(P,a),a+=P.length;let w=0;while(w+4<=a){let k=vy(o,w);if(w+4+k>a)break;w+=4,y(o.subarray(w,w+k)),w+=k}if(w>0)o.copyWithin(0,w,a),a-=w},l=(P)=>{if(r.didClose=!0,P)r.reason=": "+(P.message||P);let E="The service was stopped"+r.reason;for(let w in n)n[w](E,null);n={}},u=(P,E,w)=>{if(r.didClose)return w("The service is no longer running"+r.reason,null);let k=i++;if(n[k]=(R,j)=>{try{w(R,j)}finally{if(P)P.unref()}},P)P.ref();e.writeToStdin(uy({id:k,isRequest:!0,value:E}))},d=(P,E)=>{if(r.didClose)throw Error("The service is no longer running"+r.reason);e.writeToStdin(uy({id:P,isRequest:!1,value:E}))},h=async(P,E)=>{try{if(E.command==="ping"){d(P,{});return}if(typeof E.key==="number"){let w=t[E.key];if(!w)return;let k=w[E.command];if(k){await k(P,E);return}}throw Error("Invalid command: "+E.command)}catch(w){let k=[Fi(w,e,null,void 0,"")];try{d(P,{errors:k})}catch{}}},m=!0,y=(P)=>{if(m){m=!1;let w=String.fromCharCode(...P);if(w!=="0.28.2")throw Error(`Cannot start service: Host version "0.28.2" does not match binary version ${yt(w)}`);return}let E=cI(P);if(E.isRequest)h(E.id,E.value);else{let w=n[E.id];if(delete n[E.id],E.value.error)w(E.value.error,{});else w(null,E.value)}};return{readFromStdout:c,afterClose:l,service:{buildOrContext:({callName:P,refs:E,options:w,isTTY:k,defaultWD:R,callback:j})=>{let D=0,F=s++,N={},q={ref(){if(++D===1){if(E)E.ref()}},unref(){if(--D===0){if(delete t[F],E)E.unref()}}};t[F]=N,q.ref(),bI(P,F,u,d,q,e,N,w,k,R,(U,ne)=>{try{j(U,ne)}finally{q.unref()}})},transform:({callName:P,refs:E,input:w,options:k,isTTY:R,fs:j,callback:D})=>{let F=jy(),N=(q)=>{try{if(typeof w!=="string"&&!(w instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:U,mangleCache:ne}=yI(P,k,R,dy),ue={command:"transform",flags:U,inputFS:q!==null,input:q!==null?Ur(q):typeof w==="string"?Ur(w):w};if(ne)ue.mangleCache=ne;u(E,ue,(ie,te)=>{if(ie)return D(Error(ie),null);let le=Es(te.errors,F),Ce=Es(te.warnings,F),W=1,oe=()=>{if(--W===0){let Q={warnings:Ce,code:te.code,map:te.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in te)Q.legalComments=te==null?void 0:te.legalComments;if(te.mangleCache)Q.mangleCache=te==null?void 0:te.mangleCache;D(null,Q)}};if(le.length>0)return D(Vo("Transform failed",le,Ce),null);if(te.codeFS)W++,j.readFile(te.code,(Q,Z)=>{if(Q!==null)D(Q,null);else te.code=Z,oe()});if(te.mapFS)W++,j.readFile(te.map,(Q,Z)=>{if(Q!==null)D(Q,null);else te.map=Z,oe()});oe()})}catch(U){let ne=[];try{Lc(ne,k,{},R,dy)}catch{}let ue=Fi(U,e,F,void 0,"");u(E,{command:"error",flags:ne,error:ue},()=>{ue.detail=F.load(ue.detail),D(Vo("Transform failed",[ue],[]),null)})}};if((typeof w==="string"||w instanceof Uint8Array)&&w.length>1048576){let q=N;N=()=>j.writeFile(w,q)}N(null)},formatMessages:({callName:P,refs:E,messages:w,options:k,callback:R})=>{if(!k)throw Error(`Missing second argument in ${P}() call`);let j={},D=I(k,j,"kind",re),F=I(k,j,"color",et),N=I(k,j,"terminalWidth",qi),q=I(k,j,"logStyle",re);if(pt(k,j,`in ${P}() call`),D===void 0)throw Error(`Missing "kind" in ${P}() call`);if(D!=="error"&&D!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${P}() call`);let U={command:"format-msgs",messages:Tn(w,"messages",null,"",N),isWarning:D==="warning"};if(F!==void 0)U.color=F;if(N!==void 0)U.terminalWidth=N;if(q!==void 0)U.logStyle=q;u(E,U,(ne,ue)=>{if(ne)return R(Error(ne),null);R(null,ue.messages)})},analyzeMetafile:({callName:P,refs:E,metafile:w,options:k,callback:R})=>{if(k===void 0)k={};let j={},D=I(k,j,"color",et),F=I(k,j,"verbose",et);pt(k,j,`in ${P}() call`);let N={command:"analyze-metafile",metafile:w};if(D!==void 0)N.color=D;if(F!==void 0)N.verbose=F;u(E,N,(q,U)=>{if(q)return R(Error(q),null);R(null,U.result)})}}}}function bI(e,t,r,n,i,s,o,a,c,l,u){let d=jy(),h=e==="context",m=(b,x)=>{let _=[];try{Lc(_,a,{},c,fy)}catch{}let P=Fi(b,s,d,void 0,x);r(i,{command:"error",flags:_,error:P},()=>{P.detail=d.load(P.detail),u(Vo(h?"Context failed":"Build failed",[P],[]),null)})},y;if(typeof a==="object"){let b=a.plugins;if(b!==void 0){if(!Array.isArray(b))return m(Error('"plugins" must be an array'),"");y=b}}if(y&&y.length>0){if(s.isSync)return m(Error("Cannot use plugins in synchronous API calls"),"");xI(t,r,n,i,s,o,a,y,d).then((b)=>{if(!b.ok)return m(b.error,b.pluginName);try{g(b.requestPlugins,b.runOnEndCallbacks,b.scheduleOnDisposeCallbacks)}catch(x){m(x,"")}},(b)=>m(b,""));return}try{g(null,(b,x)=>x([],[]),()=>{})}catch(b){m(b,"")}function g(b,x,_){let P=s.hasFS,{entries:E,flags:w,write:k,stdinContents:R,stdinResolveDir:j,absWorkingDir:D,nodePaths:F,mangleCache:N}=gI(e,a,c,fy,P);if(k&&!s.hasFS)throw Error('The "write" option is unavailable in this environment');let q={command:"build",key:t,entries:E,flags:w,write:k,stdinContents:R,stdinResolveDir:j,absWorkingDir:D||l,nodePaths:F,context:h};if(b)q.plugins=b;if(N)q.mangleCache=N;let U=(ie,te)=>{let le={errors:Es(ie.errors,d),warnings:Es(ie.warnings,d),outputFiles:void 0,metafile:void 0,mangleCache:void 0},Ce=le.errors.slice(),W=le.warnings.slice();if(ie.outputFiles)le.outputFiles=ie.outputFiles.map(vI);if(ie.metafile&&ie.metafile.length)le.metafile=wI(ie.metafile);if(ie.mangleCache)le.mangleCache=ie.mangleCache;if(ie.writeToStdout!==void 0)console.log(Ui(ie.writeToStdout).replace(/\n$/,""));x(le,(oe,Q)=>{if(Ce.length>0||oe.length>0){let Z=Vo("Build failed",Ce.concat(oe),W.concat(Q));return te(Z,null,oe,Q)}te(null,le,oe,Q)})},ne,ue;if(h)o["on-end"]=(ie,te)=>new Promise((le)=>{U(te,(Ce,W,oe,Q)=>{let Z={errors:oe,warnings:Q};if(ue)ue(Ce,W);ne=void 0,ue=void 0,n(ie,Z),le()})});r(i,q,(ie,te)=>{if(ie)return u(Error(ie),null);if(!h)return U(te,(W,oe)=>(_(),u(W,oe)));if(te.errors.length>0)return u(Vo("Context failed",te.errors,te.warnings),null);let le=!1,Ce={rebuild:()=>{if(!ne)ne=new Promise((W,oe)=>{let Q;ue=(Ve,pe)=>{if(!Q)Q=()=>Ve?oe(Ve):W(pe)};let Z=()=>{r(i,{command:"rebuild",key:t},(pe,Qe)=>{if(pe)oe(Error(pe));else if(Q)Q();else Z()})};Z()});return ne},watch:(W={})=>new Promise((oe,Q)=>{if(!s.hasFS)throw Error('Cannot use the "watch" API in this environment');let Z={},Ve=I(W,Z,"delay",qi);pt(W,Z,"in watch() call");let pe={command:"watch",key:t};if(Ve)pe.delay=Ve;r(i,pe,(Qe)=>{if(Qe)Q(Error(Qe));else oe(void 0)})}),serve:(W={})=>new Promise((oe,Q)=>{if(!s.hasFS)throw Error('Cannot use the "serve" API in this environment');let Z={},Ve=I(W,Z,"port",uI),pe=I(W,Z,"host",re),Qe=I(W,Z,"servedir",re),z=I(W,Z,"keyfile",re),dt=I(W,Z,"certfile",re),Ze=I(W,Z,"fallback",re),er=I(W,Z,"cors",Sr),nt=I(W,Z,"onRequest",wy);pt(W,Z,"in serve() call");let it={command:"serve",key:t,onRequest:!!nt};if(Ve!==void 0)it.port=Ve;if(pe!==void 0)it.host=pe;if(Qe!==void 0)it.servedir=Qe;if(z!==void 0)it.keyfile=z;if(dt!==void 0)it.certfile=dt;if(Ze!==void 0)it.fallback=Ze;if(er){let yr={},tr=I(er,yr,"origin",Ey);if(pt(er,yr,'on "cors" object'),Array.isArray(tr))it.corsOrigin=tr;else if(tr!==void 0)it.corsOrigin=[tr]}r(i,it,(yr,tr)=>{if(yr)return Q(Error(yr));if(nt)o["serve-request"]=(Xn,Ii)=>{nt(Ii.args),n(Xn,{})};oe(tr)})}),cancel:()=>new Promise((W)=>{if(le)return W();r(i,{command:"cancel",key:t},()=>{W()})}),dispose:()=>new Promise((W)=>{if(le)return W();le=!0,r(i,{command:"dispose",key:t},()=>{W(),_(),i.unref()})})};i.ref(),u(null,Ce)})}}var xI=async(e,t,r,n,i,s,o,a,c)=>{let l=[],u=[],d={},h={},m=[],y=0,g=0,b=[],x=!1;a=[...a];for(let E of a){let w={};if(typeof E!=="object")throw Error(`Plugin at index ${g} must be an object`);let k=I(E,w,"name",re);if(typeof k!=="string"||k==="")throw Error(`Plugin at index ${g} is missing a name`);try{let R=I(E,w,"setup",wy);if(typeof R!=="function")throw Error("Plugin is missing a setup function");pt(E,w,`on plugin ${yt(k)}`);let j={name:k,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};g++;let F=R({initialOptions:o,resolve:(N,q={})=>{if(!x)throw Error('Cannot call "resolve" before plugin setup has completed');if(typeof N!=="string")throw Error("The path to resolve must be a string");let U=Object.create(null),ne=I(q,U,"pluginName",re),ue=I(q,U,"importer",re),ie=I(q,U,"namespace",re),te=I(q,U,"resolveDir",re),le=I(q,U,"kind",re),Ce=I(q,U,"pluginData",Oc),W=I(q,U,"with",Sr);return pt(q,U,"in resolve() call"),new Promise((oe,Q)=>{let Z={command:"resolve",path:N,key:e,pluginName:k};if(ne!=null)Z.pluginName=ne;if(ue!=null)Z.importer=ue;if(ie!=null)Z.namespace=ie;if(te!=null)Z.resolveDir=te;if(le!=null)Z.kind=le;else throw Error('Must specify "kind" when calling "resolve"');if(Ce!=null)Z.pluginData=c.store(Ce);if(W!=null)Z.with=$I(W,"with");t(n,Z,(Ve,pe)=>{if(Ve!==null)Q(Error(Ve));else oe({errors:Es(pe.errors,c),warnings:Es(pe.warnings,c),path:pe.path,external:pe.external,sideEffects:pe.sideEffects,namespace:pe.namespace,suffix:pe.suffix,pluginData:c.load(pe.pluginData)})})})},onStart(N){let U=jc(Error('This error came from the "onStart" callback registered here:'),i,"onStart");l.push({name:k,callback:N,note:U}),j.onStart=!0},onEnd(N){let U=jc(Error('This error came from the "onEnd" callback registered here:'),i,"onEnd");u.push({name:k,callback:N,note:U}),j.onEnd=!0},onResolve(N,q){let ne=jc(Error('This error came from the "onResolve" callback registered here:'),i,"onResolve"),ue={},ie=I(N,ue,"filter",Cc),te=I(N,ue,"namespace",re);if(pt(N,ue,`in onResolve() call for plugin ${yt(k)}`),ie==null)throw Error("onResolve() call is missing a filter");let le=y++;d[le]={name:k,callback:q,note:ne},j.onResolve.push({id:le,filter:Ic(ie),namespace:te||""})},onLoad(N,q){let ne=jc(Error('This error came from the "onLoad" callback registered here:'),i,"onLoad"),ue={},ie=I(N,ue,"filter",Cc),te=I(N,ue,"namespace",re);if(pt(N,ue,`in onLoad() call for plugin ${yt(k)}`),ie==null)throw Error("onLoad() call is missing a filter");let le=y++;h[le]={name:k,callback:q,note:ne},j.onLoad.push({id:le,filter:Ic(ie),namespace:te||""})},onDispose(N){m.push(N)},esbuild:i.esbuild});if(F)await F;b.push(j)}catch(R){return{ok:!1,error:R,pluginName:k}}}s["on-start"]=async(E,w)=>{c.clear();let k={errors:[],warnings:[]};await Promise.all(l.map(async({name:R,callback:j,note:D})=>{try{let F=await j();if(F!=null){if(typeof F!=="object")throw Error(`Expected onStart() callback in plugin ${yt(R)} to return an object`);let N={},q=I(F,N,"errors",In),U=I(F,N,"warnings",In);if(pt(F,N,`from onStart() callback in plugin ${yt(R)}`),q!=null)k.errors.push(...Tn(q,"errors",c,R,void 0));if(U!=null)k.warnings.push(...Tn(U,"warnings",c,R,void 0))}}catch(F){k.errors.push(Fi(F,i,c,D&&D(),R))}})),r(E,k)},s["on-resolve"]=async(E,w)=>{let k={},R="",j,D;for(let F of w.ids)try{({name:R,callback:j,note:D}=d[F]);let N=await j({path:w.path,importer:w.importer,namespace:w.namespace,resolveDir:w.resolveDir,kind:w.kind,pluginData:c.load(w.pluginData),with:w.with});if(N!=null){if(typeof N!=="object")throw Error(`Expected onResolve() callback in plugin ${yt(R)} to return an object`);let q={},U=I(N,q,"pluginName",re),ne=I(N,q,"path",re),ue=I(N,q,"namespace",re),ie=I(N,q,"suffix",re),te=I(N,q,"external",et),le=I(N,q,"sideEffects",et),Ce=I(N,q,"pluginData",Oc),W=I(N,q,"errors",In),oe=I(N,q,"warnings",In),Q=I(N,q,"watchFiles",or),Z=I(N,q,"watchDirs",or);if(pt(N,q,`from onResolve() callback in plugin ${yt(R)}`),k.id=F,U!=null)k.pluginName=U;if(ne!=null)k.path=ne;if(ue!=null)k.namespace=ue;if(ie!=null)k.suffix=ie;if(te!=null)k.external=te;if(le!=null)k.sideEffects=le;if(Ce!=null)k.pluginData=c.store(Ce);if(W!=null)k.errors=Tn(W,"errors",c,R,void 0);if(oe!=null)k.warnings=Tn(oe,"warnings",c,R,void 0);if(Q!=null)k.watchFiles=Rc(Q,"watchFiles");if(Z!=null)k.watchDirs=Rc(Z,"watchDirs");break}}catch(N){k={id:F,errors:[Fi(N,i,c,D&&D(),R)]};break}r(E,k)},s["on-load"]=async(E,w)=>{let k={},R="",j,D;for(let F of w.ids)try{({name:R,callback:j,note:D}=h[F]);let N=await j({path:w.path,namespace:w.namespace,suffix:w.suffix,pluginData:c.load(w.pluginData),with:w.with});if(N!=null){if(typeof N!=="object")throw Error(`Expected onLoad() callback in plugin ${yt(R)} to return an object`);let q={},U=I(N,q,"pluginName",re),ne=I(N,q,"contents",_y),ue=I(N,q,"resolveDir",re),ie=I(N,q,"pluginData",Oc),te=I(N,q,"loader",re),le=I(N,q,"errors",In),Ce=I(N,q,"warnings",In),W=I(N,q,"watchFiles",or),oe=I(N,q,"watchDirs",or);if(pt(N,q,`from onLoad() callback in plugin ${yt(R)}`),k.id=F,U!=null)k.pluginName=U;if(ne instanceof Uint8Array)k.contents=ne;else if(ne!=null)k.contents=Ur(ne);if(ue!=null)k.resolveDir=ue;if(ie!=null)k.pluginData=c.store(ie);if(te!=null)k.loader=te;if(le!=null)k.errors=Tn(le,"errors",c,R,void 0);if(Ce!=null)k.warnings=Tn(Ce,"warnings",c,R,void 0);if(W!=null)k.watchFiles=Rc(W,"watchFiles");if(oe!=null)k.watchDirs=Rc(oe,"watchDirs");break}}catch(N){k={id:F,errors:[Fi(N,i,c,D&&D(),R)]};break}r(E,k)};let _=(E,w)=>w([],[]);if(u.length>0)_=(E,w)=>{(async()=>{let k=[],R=[];for(let{name:j,callback:D,note:F}of u){let N,q;try{let U=await D(E);if(U!=null){if(typeof U!=="object")throw Error(`Expected onEnd() callback in plugin ${yt(j)} to return an object`);let ne={},ue=I(U,ne,"errors",In),ie=I(U,ne,"warnings",In);if(pt(U,ne,`from onEnd() callback in plugin ${yt(j)}`),ue!=null)N=Tn(ue,"errors",c,j,void 0);if(ie!=null)q=Tn(ie,"warnings",c,j,void 0)}}catch(U){N=[Fi(U,i,c,F&&F(),j)]}if(N){k.push(...N);try{E.errors.push(...N)}catch{}}if(q){R.push(...q);try{E.warnings.push(...q)}catch{}}}w(k,R)})()};let P=()=>{for(let E of m)setTimeout(()=>E(),0)};return x=!0,{ok:!0,requestPlugins:b,runOnEndCallbacks:_,scheduleOnDisposeCallbacks:P}};function jy(){let e=new Map,t=0;return{clear(){e.clear()},load(r){return e.get(r)},store(r){if(r===void 0)return-1;let n=t++;return e.set(n,r),n}}}function jc(e,t,r){let n,i=!1;return()=>{if(i)return n;i=!0;try{let s=(e.stack+"").split(`
13
13
  `);s.splice(1,1);let o=Ry(t,s,r);if(o)return n={text:e.message,location:o},n}catch{}}}function Fi(e,t,r,n,i){let s="Internal error",o=null;try{s=(e&&e.message||e)+""}catch{}try{o=Ry(t,(e.stack+"").split(`
14
14
  `),"")}catch{}return{id:"",pluginName:i,text:s,location:o,notes:n?[n]:[],detail:r?r.store(e):-1}}function Ry(e,t,r){let n=" at ";if(e.readFileSync&&!t[0].startsWith(n)&&t[1].startsWith(n))for(let i=1;i<t.length;i++){let s=t[i];if(!s.startsWith(n))continue;s=s.slice(n.length);while(!0){let o=/^(?:new |async )?\S+ \((.*)\)$/.exec(s);if(o){s=o[1];continue}if(o=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(s),o){s=o[1];continue}if(o=/^(\S+):(\d+):(\d+)$/.exec(s),o){let a;try{a=e.readFileSync(o[1],"utf8")}catch{break}let c=a.split(/\r\n|\r|\n|\u2028|\u2029/)[+o[2]-1]||"",l=+o[3]-1,u=c.slice(l,l+r.length)===r?r.length:0;return{file:o[1],namespace:"file",line:+o[2],column:Ur(c.slice(0,l)).length,length:Ur(c.slice(l,l+u)).length,lineText:c+`
15
15
  `+t.slice(1).join(`
16
16
  `),suggestion:""}}break}}return null}function Vo(e,t,r){let n=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,n+1).map((s,o)=>{if(o===n)return`
17
17
  ...`;if(!s.location)return`
18
18
  error: ${s.text}`;let{file:a,line:c,column:l}=s.location,u=s.pluginName?`[plugin: ${s.pluginName}] `:"";return`
19
- ${a}:${c}:${l}: ERROR: ${u}${s.text}`}).join("");let i=Error(e);for(let[s,o]of[["errors",t],["warnings",r]])Object.defineProperty(i,s,{configurable:!0,enumerable:!0,get:()=>o,set:(a)=>Object.defineProperty(i,s,{configurable:!0,enumerable:!0,value:a})});return i}function Es(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function my(e,t,r){if(e==null)return null;let n={},i=I(e,n,"file",re),s=I(e,n,"namespace",re),o=I(e,n,"line",qi),a=I(e,n,"column",qi),c=I(e,n,"length",qi),l=I(e,n,"lineText",re),u=I(e,n,"suggestion",re);if(pt(e,n,t),l){let d=l.slice(0,(a&&a>0?a:0)+(c&&c>0?c:0)+(r&&r>0?r:80));if(!/[\x7F-\uFFFF]/.test(d)&&!/\n/.test(l))l=d}return{file:i||"",namespace:s||"",line:o||0,column:a||0,length:c||0,lineText:l||"",suggestion:u||""}}function Tn(e,t,r,n,i){let s=[],o=0;for(let a of e){let c={},l=I(a,c,"id",re),u=I(a,c,"pluginName",re),d=I(a,c,"text",re),h=I(a,c,"location",py),m=I(a,c,"notes",In),y=I(a,c,"detail",Oc),g=`in element ${o} of "${t}"`;pt(a,c,g);let b=[];if(m)for(let x of m){let _={},k=I(x,_,"text",re),E=I(x,_,"location",py);pt(x,_,g),b.push({text:k||"",location:my(E,g,i)})}s.push({id:l||"",pluginName:u||n,text:d||"",location:my(h,g,i),notes:b,detail:r?r.store(y):-1}),o++}return s}function Rc(e,t){let r=[];for(let n of e){if(typeof n!=="string")throw Error(`${yt(t)} must be an array of strings`);r.push(n)}return r}function yI(e,t){let r=Object.create(null);for(let n in e){let i=e[n];if(typeof i!=="string")throw Error(`key ${yt(n)} in object ${yt(t)} must be a string`);r[n]=i}return r}function bI({path:e,contents:t,hash:r}){let n=null;return{path:e,contents:t,hash:r,get text(){let i=this.contents;if(n===null||i!==t)t=i,n=Ui(i);return n}}}function Ic(e){let t=e.source;if(e.flags)t=`(?${e.flags})${t}`;return t}function xI(e){let t;try{t=Ui(e)}catch{return oI(e)}return JSON.parse(t)}var si=De("fs"),hy=De("os"),Nr=De("path"),ws=process.env.ESBUILD_BINARY_PATH||ws,$I=(e)=>!!e&&e!=="/usr/bin/esbuild",gy="@esbuild/darwin-arm64",yy="@esbuild/darwin-x64",Tc={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Nc={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},by={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function vI(){let e,t,r=!1,n=`${process.platform} ${hy.arch()} ${hy.endianness()}`;if(n in Tc)e=Tc[n],t="esbuild.exe";else if(n in Nc)e=Nc[n],t="bin/esbuild";else if(n in by)e=by[n],t="bin/esbuild",r=!0;else throw Error(`Unsupported platform: ${n}`);return{pkg:e,subpath:t,isWASM:r}}function wI(){let e=De.resolve("esbuild"),t=Nr.dirname(Nr.dirname(Nr.dirname(e)));if(Nr.basename(t)==="node_modules"){for(let r in Nc)try{let n=Nc[r];if(si.existsSync(Nr.join(t,n)))return n}catch{}for(let r in Tc)try{let n=Tc[r];if(si.existsSync(Nr.join(t,n)))return n}catch{}}return null}function SI(e,t){let r=Nr.dirname(De.resolve("esbuild"));return Nr.join(r,`downloaded-${e.replace("/","-")}-${Nr.basename(t)}`)}function EI(){if($I(ws))if(!si.existsSync(ws))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ws}`);else return{binPath:ws,isWASM:!1};let{pkg:e,subpath:t,isWASM:r}=vI(),n;try{n=De.resolve(`${e}/${t}`)}catch(i){if(n=SI(e,t),!si.existsSync(n)){try{De.resolve(e)}catch{let s=wI();if(s){let o=`
19
+ ${a}:${c}:${l}: ERROR: ${u}${s.text}`}).join("");let i=Error(e);for(let[s,o]of[["errors",t],["warnings",r]])Object.defineProperty(i,s,{configurable:!0,enumerable:!0,get:()=>o,set:(a)=>Object.defineProperty(i,s,{configurable:!0,enumerable:!0,value:a})});return i}function Es(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function my(e,t,r){if(e==null)return null;let n={},i=I(e,n,"file",re),s=I(e,n,"namespace",re),o=I(e,n,"line",qi),a=I(e,n,"column",qi),c=I(e,n,"length",qi),l=I(e,n,"lineText",re),u=I(e,n,"suggestion",re);if(pt(e,n,t),l){let d=l.slice(0,(a&&a>0?a:0)+(c&&c>0?c:0)+(r&&r>0?r:80));if(!/[\x7F-\uFFFF]/.test(d)&&!/\n/.test(l))l=d}return{file:i||"",namespace:s||"",line:o||0,column:a||0,length:c||0,lineText:l||"",suggestion:u||""}}function Tn(e,t,r,n,i){let s=[],o=0;for(let a of e){let c={},l=I(a,c,"id",re),u=I(a,c,"pluginName",re),d=I(a,c,"text",re),h=I(a,c,"location",py),m=I(a,c,"notes",In),y=I(a,c,"detail",Oc),g=`in element ${o} of "${t}"`;pt(a,c,g);let b=[];if(m)for(let x of m){let _={},P=I(x,_,"text",re),E=I(x,_,"location",py);pt(x,_,g),b.push({text:P||"",location:my(E,g,i)})}s.push({id:l||"",pluginName:u||n,text:d||"",location:my(h,g,i),notes:b,detail:r?r.store(y):-1}),o++}return s}function Rc(e,t){let r=[];for(let n of e){if(typeof n!=="string")throw Error(`${yt(t)} must be an array of strings`);r.push(n)}return r}function $I(e,t){let r=Object.create(null);for(let n in e){let i=e[n];if(typeof i!=="string")throw Error(`key ${yt(n)} in object ${yt(t)} must be a string`);r[n]=i}return r}function vI({path:e,contents:t,hash:r}){let n=null;return{path:e,contents:t,hash:r,get text(){let i=this.contents;if(n===null||i!==t)t=i,n=Ui(i);return n}}}function Ic(e){let t=e.source;if(e.flags)t=`(?${e.flags})${t}`;return t}function wI(e){let t;try{t=Ui(e)}catch{return lI(e)}return JSON.parse(t)}var si=De("fs"),hy=De("os"),Nr=De("path"),ws=process.env.ESBUILD_BINARY_PATH||ws,SI=(e)=>!!e&&e!=="/usr/bin/esbuild",gy="@esbuild/darwin-arm64",yy="@esbuild/darwin-x64",Tc={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Nc={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},by={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function EI(){let e,t,r=!1,n=`${process.platform} ${hy.arch()} ${hy.endianness()}`;if(n in Tc)e=Tc[n],t="esbuild.exe";else if(n in Nc)e=Nc[n],t="bin/esbuild";else if(n in by)e=by[n],t="bin/esbuild",r=!0;else throw Error(`Unsupported platform: ${n}`);return{pkg:e,subpath:t,isWASM:r}}function _I(){let e=De.resolve("esbuild"),t=Nr.dirname(Nr.dirname(Nr.dirname(e)));if(Nr.basename(t)==="node_modules"){for(let r in Nc)try{let n=Nc[r];if(si.existsSync(Nr.join(t,n)))return n}catch{}for(let r in Tc)try{let n=Tc[r];if(si.existsSync(Nr.join(t,n)))return n}catch{}}return null}function PI(e,t){let r=Nr.dirname(De.resolve("esbuild"));return Nr.join(r,`downloaded-${e.replace("/","-")}-${Nr.basename(t)}`)}function kI(){if(SI(ws))if(!si.existsSync(ws))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ws}`);else return{binPath:ws,isWASM:!1};let{pkg:e,subpath:t,isWASM:r}=EI(),n;try{n=De.resolve(`${e}/${t}`)}catch(i){if(n=PI(e,t),!si.existsSync(n)){try{De.resolve(e)}catch{let s=_I();if(s){let o=`
20
20
  Specifically the "${s}" package is present but this platform
21
21
  needs the "${e}" package instead. People often get into this
22
22
  situation by installing esbuild on Windows or macOS and copying "node_modules"
@@ -65,55 +65,55 @@ want to do that.
65
65
  If you are installing esbuild with npm, make sure that you don't specify the
66
66
  "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
67
67
  of "package.json" is used by esbuild to install the correct binary executable
68
- for your current platform.`)}throw i}}if(/\.zip\//.test(n)){let i;try{i=(()=>{throw new Error("Cannot require module "+"pnpapi");})()}catch(s){}if(i){let s=i.getPackageInformation(i.topLevel).packageLocation,o=Nr.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.28.2-${Nr.basename(t)}`);if(!si.existsSync(o))si.mkdirSync(Nr.dirname(o),{recursive:!0}),si.copyFileSync(n,o),si.chmodSync(o,493);return{binPath:o,isWASM:r}}}return{binPath:n,isWASM:r}}var Oy=De("child_process"),_I=De("crypto"),$f=De("path"),Bi=De("fs"),PI=De("os"),kI=De("tty"),Ht;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{Ht=De("worker_threads")}catch{}let[e,t]=process.versions.node.split(".");if(+e<12||+e===12&&+t<17||+e===13&&+t<13)Ht=void 0}var xy,Ko=((xy=Ht==null?void 0:Ht.workerData)==null?void 0:xy.esbuildVersion)==="0.28.2",Cy=()=>{if((!ws||!1)&&($f.basename(__filename)!=="main.js"||$f.basename(__dirname)!=="lib"))throw Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
68
+ for your current platform.`)}throw i}}if(/\.zip\//.test(n)){let i;try{i=(()=>{throw new Error("Cannot require module "+"pnpapi");})()}catch(s){}if(i){let s=i.getPackageInformation(i.topLevel).packageLocation,o=Nr.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.28.2-${Nr.basename(t)}`);if(!si.existsSync(o))si.mkdirSync(Nr.dirname(o),{recursive:!0}),si.copyFileSync(n,o),si.chmodSync(o,493);return{binPath:o,isWASM:r}}}return{binPath:n,isWASM:r}}var Oy=De("child_process"),AI=De("crypto"),vf=De("path"),Bi=De("fs"),jI=De("os"),RI=De("tty"),Ht;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{Ht=De("worker_threads")}catch{}let[e,t]=process.versions.node.split(".");if(+e<12||+e===12&&+t<17||+e===13&&+t<13)Ht=void 0}var xy,Ko=((xy=Ht==null?void 0:Ht.workerData)==null?void 0:xy.esbuildVersion)==="0.28.2",Cy=()=>{if((!ws||!1)&&(vf.basename(__filename)!=="main.js"||vf.basename(__dirname)!=="lib"))throw Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
69
69
 
70
- More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:e,isWASM:t}=EI();if(t)return["node",[e]];else return[e,[]]}},Wo=()=>kI.isatty(2),AI={readFile(e,t){try{let r=Bi.readFileSync(e,"utf8");try{Bi.unlinkSync(e)}catch{}t(null,r)}catch(r){t(r,null)}},writeFile(e,t){try{let r=Iy();Bi.writeFileSync(r,e),t(r)}catch{t(null)}}},jI={readFile(e,t){try{Bi.readFile(e,"utf8",(r,n)=>{try{Bi.unlink(e,()=>t(r,n))}catch{t(r,n)}})}catch(r){t(r,null)}},writeFile(e,t){try{let r=Iy();Bi.writeFile(r,e,(n)=>n!==null?t(null):t(r))}catch{t(null)}}},RI="0.28.2",OI=(e)=>Vi().build(e),CI=(e)=>Vi().context(e),II=(e,t)=>Vi().transform(e,t),TI=(e,t)=>Vi().formatMessages(e,t),NI=(e,t)=>Vi().analyzeMetafile(e,t),MI=(e)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.buildSync(e)}let t;return Dc((r)=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Wo(),defaultWD:Hi,callback:(n,i)=>{if(n)throw n;t=i}})),t},LI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.transformSync(e,t)}let r;return Dc((n)=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Wo(),fs:AI,callback:(i,s)=>{if(i)throw i;r=s}})),r},DI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.formatMessagesSync(e,t)}let r;return Dc((n)=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(i,s)=>{if(i)throw i;r=s}})),r},JI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.analyzeMetafileSync(e,t)}let r;return Dc((n)=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e==="string"?e:JSON.stringify(e),options:t,callback:(i,s)=>{if(i)throw i;r=s}})),r},FI=()=>{if(Mc)Mc();if(Ut)Ut.stop();return Promise.resolve()},vf=!1,qI=(e)=>{if(e=dI(e||{}),e.wasmURL)throw Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw Error('The "wasmModule" option only works in the browser');if(e.worker)throw Error('The "worker" option only works in the browser');if(vf)throw Error('Cannot call "initialize" more than once');return Vi(),vf=!0,Promise.resolve()},Hi=process.cwd(),Uo,Mc,Vi=()=>{if(Uo)return Uo;let[e,t]=Cy(),r=Oy.spawn(e,t.concat("--service=0.28.2","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:Hi}),{readFromStdout:n,afterClose:i,service:s}=Ay({writeToStdin(u){r.stdin.write(u,(d)=>{if(d)i(d)})},readFileSync:Bi.readFileSync,isSync:!1,hasFS:!0,esbuild:zo});r.stdin.on("error",i),r.on("error",i);let{stdin:o,stdout:a}=r;a.on("data",n),a.on("end",i),Mc=()=>{o.destroy(),a.destroy(),r.kill(),vf=!1,Uo=void 0,Mc=void 0};let c=0;if(r.unref(),o.unref)o.unref();if(a.unref)a.unref();let l={ref(){if(++c===1)r.ref()},unref(){if(--c===0)r.unref()}};return Uo={build:(u)=>new Promise((d,h)=>{s.buildOrContext({callName:"build",refs:l,options:u,isTTY:Wo(),defaultWD:Hi,callback:(m,y)=>m?h(m):d(y)})}),context:(u)=>new Promise((d,h)=>s.buildOrContext({callName:"context",refs:l,options:u,isTTY:Wo(),defaultWD:Hi,callback:(m,y)=>m?h(m):d(y)})),transform:(u,d)=>new Promise((h,m)=>s.transform({callName:"transform",refs:l,input:u,options:d||{},isTTY:Wo(),fs:jI,callback:(y,g)=>y?m(y):h(g)})),formatMessages:(u,d)=>new Promise((h,m)=>s.formatMessages({callName:"formatMessages",refs:l,messages:u,options:d,callback:(y,g)=>y?m(y):h(g)})),analyzeMetafile:(u,d)=>new Promise((h,m)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:l,metafile:typeof u==="string"?u:JSON.stringify(u),options:d,callback:(y,g)=>y?m(y):h(g)}))},Uo},Dc=(e)=>{let[t,r]=Cy(),n=new Uint8Array,{readFromStdout:i,afterClose:s,service:o}=Ay({writeToStdin(c){if(n.length!==0)throw Error("Must run at most one command");n=c},isSync:!0,hasFS:!0,esbuild:zo});e(o);let a=Oy.execFileSync(t,r.concat("--service=0.28.2"),{cwd:Hi,windowsHide:!0,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});i(a),s(null)},Iy=()=>$f.join(PI.tmpdir(),`esbuild-${_I.randomBytes(32).toString("hex")}`),Ut=null,Jc=(e)=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:Hi,esbuildVersion:"0.28.2"},transferList:[r],execArgv:[]}),i=0,s=(l)=>{let u=Error(`Build failed with 1 error:
71
- error: ${l}`),d=[{id:"",pluginName:"",text:l,location:null,notes:[],detail:void 0}];return u.errors=d,u.warnings=[],u},o=(l)=>{if(!l)return;let u=l.plugins;if(u&&u.length>0)throw s("Cannot use plugins in synchronous API calls")},a=(l,u)=>{for(let d in u)l[d]=u[d]},c=(l,u)=>{let d=i++,h=new SharedArrayBuffer(8),m=new Int32Array(h),y={sharedBuffer:h,id:d,command:l,args:u};n.postMessage(y);let g=Atomics.wait(m,0,0);if(g!=="ok"&&g!=="not-equal")throw Error("Internal error: Atomics.wait() failed: "+g);let{message:{id:b,resolve:x,reject:_,properties:k}}=e.receiveMessageOnPort(t);if(d!==b)throw Error(`Internal error: Expected id ${d} but got id ${b}`);if(_)throw a(_,k),_;return x};return n.unref(),{buildSync(l){return o(l),c("build",[l])},transformSync(l,u){return c("transform",[l,u])},formatMessagesSync(l,u){return c("formatMessages",[l,u])},analyzeMetafileSync(l,u){return c("analyzeMetafile",[l,u])},stop(){n.terminate(),Ut=null}}},BI=()=>{let e=Ht.workerData.workerPort,t=Ht.parentPort,r=(n)=>{let i={};if(n&&typeof n==="object")for(let s in n)i[s]=n[s];return i};try{let n=Vi();Hi=Ht.workerData.defaultWD,t.on("message",(i)=>{(async()=>{let{sharedBuffer:s,id:o,command:a,args:c}=i,l=new Int32Array(s);try{switch(a){case"build":e.postMessage({id:o,resolve:await n.build(c[0])});break;case"transform":e.postMessage({id:o,resolve:await n.transform(c[0],c[1])});break;case"formatMessages":e.postMessage({id:o,resolve:await n.formatMessages(c[0],c[1])});break;case"analyzeMetafile":e.postMessage({id:o,resolve:await n.analyzeMetafile(c[0],c[1])});break;default:throw Error(`Invalid command: ${a}`)}}catch(u){e.postMessage({id:o,reject:u,properties:r(u)})}Atomics.add(l,0,1),Atomics.notify(l,0,1/0)})()})}catch(n){t.on("message",(i)=>{let{sharedBuffer:s,id:o}=i,a=new Int32Array(s);e.postMessage({id:o,reject:n,properties:r(n)}),Atomics.add(a,0,1),Atomics.notify(a,0,1/0)})}};if(Ko)BI();var HI=zo});import{rmSync as Ny,writeFileSync as My}from"node:fs";import{createRequire as UI}from"node:module";import{tmpdir as VI}from"node:os";import{basename as WI,join as _f,resolve as zI}from"node:path";function Dy(e){return Di(e)||e.startsWith("./")||e.startsWith("../")}function Yo(){return typeof Bun>"u"||process.env.JX_BUNDLER==="esbuild"}function Pf(e,t,r){if(Di(e)){let n=e.slice(Pc.length);if(Yo())return UI(_f(r,"package.json")).resolve(n);return Bun.resolveSync(n,r)}return zI(t,e)}function KI(e){let{onFileLoaded:t,resolver:r}=e;if(r===void 0&&t===void 0)return[];return[{name:"jx-bundle-hooks",setup:(i)=>{if(r!==void 0)i.onResolve({filter:r.filter},(s)=>r.resolve(s));if(t!==void 0)i.onLoad({filter:/.*/},(s)=>{t(s.path)})}}]}function GI(e){if(e==="cloudflare-workers"||e==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:e==="bun"?"bun":"node"}}function Sf(e){return e.minify??e.target==="browser"}function Ef(e){let t={};if(e.conditions)t.conditions=e.conditions;if(e.target==="browser")t.define={...YI};return t}function Jy(e){return e==="node"||e==="bun"?"node":"browser"}function XI(e){if(e==="workerd")return"browser";return e}async function kf(e,t){let r=t.external??[],n=KI(t);if(Yo()){let s=await Promise.resolve().then(() => Bt(Go(),1));await s.build({bundle:!0,...Ef(t),entryPoints:[e.entryPath],external:r,format:"esm",logLevel:"silent",minify:Sf(t),outfile:e.outfile,platform:Jy(t.target),plugins:n});return}let i=await Bun.build({...Ef(t),entrypoints:[e.entryPath],external:r,format:"esm",minify:Sf(t),plugins:n,target:XI(t.target),throw:!1});if(!i.success||i.outputs.length===0){let s=i.logs.map(String).join(`
70
+ More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:e,isWASM:t}=kI();if(t)return["node",[e]];else return[e,[]]}},Wo=()=>RI.isatty(2),OI={readFile(e,t){try{let r=Bi.readFileSync(e,"utf8");try{Bi.unlinkSync(e)}catch{}t(null,r)}catch(r){t(r,null)}},writeFile(e,t){try{let r=Iy();Bi.writeFileSync(r,e),t(r)}catch{t(null)}}},CI={readFile(e,t){try{Bi.readFile(e,"utf8",(r,n)=>{try{Bi.unlink(e,()=>t(r,n))}catch{t(r,n)}})}catch(r){t(r,null)}},writeFile(e,t){try{let r=Iy();Bi.writeFile(r,e,(n)=>n!==null?t(null):t(r))}catch{t(null)}}},II="0.28.2",TI=(e)=>Vi().build(e),NI=(e)=>Vi().context(e),MI=(e,t)=>Vi().transform(e,t),LI=(e,t)=>Vi().formatMessages(e,t),DI=(e,t)=>Vi().analyzeMetafile(e,t),JI=(e)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.buildSync(e)}let t;return Dc((r)=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Wo(),defaultWD:Hi,callback:(n,i)=>{if(n)throw n;t=i}})),t},FI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.transformSync(e,t)}let r;return Dc((n)=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Wo(),fs:OI,callback:(i,s)=>{if(i)throw i;r=s}})),r},qI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.formatMessagesSync(e,t)}let r;return Dc((n)=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(i,s)=>{if(i)throw i;r=s}})),r},BI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.analyzeMetafileSync(e,t)}let r;return Dc((n)=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e==="string"?e:JSON.stringify(e),options:t,callback:(i,s)=>{if(i)throw i;r=s}})),r},HI=()=>{if(Mc)Mc();if(Ut)Ut.stop();return Promise.resolve()},wf=!1,UI=(e)=>{if(e=hI(e||{}),e.wasmURL)throw Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw Error('The "wasmModule" option only works in the browser');if(e.worker)throw Error('The "worker" option only works in the browser');if(wf)throw Error('Cannot call "initialize" more than once');return Vi(),wf=!0,Promise.resolve()},Hi=process.cwd(),Uo,Mc,Vi=()=>{if(Uo)return Uo;let[e,t]=Cy(),r=Oy.spawn(e,t.concat("--service=0.28.2","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:Hi}),{readFromStdout:n,afterClose:i,service:s}=Ay({writeToStdin(u){r.stdin.write(u,(d)=>{if(d)i(d)})},readFileSync:Bi.readFileSync,isSync:!1,hasFS:!0,esbuild:zo});r.stdin.on("error",i),r.on("error",i);let{stdin:o,stdout:a}=r;a.on("data",n),a.on("end",i),Mc=()=>{o.destroy(),a.destroy(),r.kill(),wf=!1,Uo=void 0,Mc=void 0};let c=0;if(r.unref(),o.unref)o.unref();if(a.unref)a.unref();let l={ref(){if(++c===1)r.ref()},unref(){if(--c===0)r.unref()}};return Uo={build:(u)=>new Promise((d,h)=>{s.buildOrContext({callName:"build",refs:l,options:u,isTTY:Wo(),defaultWD:Hi,callback:(m,y)=>m?h(m):d(y)})}),context:(u)=>new Promise((d,h)=>s.buildOrContext({callName:"context",refs:l,options:u,isTTY:Wo(),defaultWD:Hi,callback:(m,y)=>m?h(m):d(y)})),transform:(u,d)=>new Promise((h,m)=>s.transform({callName:"transform",refs:l,input:u,options:d||{},isTTY:Wo(),fs:CI,callback:(y,g)=>y?m(y):h(g)})),formatMessages:(u,d)=>new Promise((h,m)=>s.formatMessages({callName:"formatMessages",refs:l,messages:u,options:d,callback:(y,g)=>y?m(y):h(g)})),analyzeMetafile:(u,d)=>new Promise((h,m)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:l,metafile:typeof u==="string"?u:JSON.stringify(u),options:d,callback:(y,g)=>y?m(y):h(g)}))},Uo},Dc=(e)=>{let[t,r]=Cy(),n=new Uint8Array,{readFromStdout:i,afterClose:s,service:o}=Ay({writeToStdin(c){if(n.length!==0)throw Error("Must run at most one command");n=c},isSync:!0,hasFS:!0,esbuild:zo});e(o);let a=Oy.execFileSync(t,r.concat("--service=0.28.2"),{cwd:Hi,windowsHide:!0,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});i(a),s(null)},Iy=()=>vf.join(jI.tmpdir(),`esbuild-${AI.randomBytes(32).toString("hex")}`),Ut=null,Jc=(e)=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:Hi,esbuildVersion:"0.28.2"},transferList:[r],execArgv:[]}),i=0,s=(l)=>{let u=Error(`Build failed with 1 error:
71
+ error: ${l}`),d=[{id:"",pluginName:"",text:l,location:null,notes:[],detail:void 0}];return u.errors=d,u.warnings=[],u},o=(l)=>{if(!l)return;let u=l.plugins;if(u&&u.length>0)throw s("Cannot use plugins in synchronous API calls")},a=(l,u)=>{for(let d in u)l[d]=u[d]},c=(l,u)=>{let d=i++,h=new SharedArrayBuffer(8),m=new Int32Array(h),y={sharedBuffer:h,id:d,command:l,args:u};n.postMessage(y);let g=Atomics.wait(m,0,0);if(g!=="ok"&&g!=="not-equal")throw Error("Internal error: Atomics.wait() failed: "+g);let{message:{id:b,resolve:x,reject:_,properties:P}}=e.receiveMessageOnPort(t);if(d!==b)throw Error(`Internal error: Expected id ${d} but got id ${b}`);if(_)throw a(_,P),_;return x};return n.unref(),{buildSync(l){return o(l),c("build",[l])},transformSync(l,u){return c("transform",[l,u])},formatMessagesSync(l,u){return c("formatMessages",[l,u])},analyzeMetafileSync(l,u){return c("analyzeMetafile",[l,u])},stop(){n.terminate(),Ut=null}}},VI=()=>{let e=Ht.workerData.workerPort,t=Ht.parentPort,r=(n)=>{let i={};if(n&&typeof n==="object")for(let s in n)i[s]=n[s];return i};try{let n=Vi();Hi=Ht.workerData.defaultWD,t.on("message",(i)=>{(async()=>{let{sharedBuffer:s,id:o,command:a,args:c}=i,l=new Int32Array(s);try{switch(a){case"build":e.postMessage({id:o,resolve:await n.build(c[0])});break;case"transform":e.postMessage({id:o,resolve:await n.transform(c[0],c[1])});break;case"formatMessages":e.postMessage({id:o,resolve:await n.formatMessages(c[0],c[1])});break;case"analyzeMetafile":e.postMessage({id:o,resolve:await n.analyzeMetafile(c[0],c[1])});break;default:throw Error(`Invalid command: ${a}`)}}catch(u){e.postMessage({id:o,reject:u,properties:r(u)})}Atomics.add(l,0,1),Atomics.notify(l,0,1/0)})()})}catch(n){t.on("message",(i)=>{let{sharedBuffer:s,id:o}=i,a=new Int32Array(s);e.postMessage({id:o,reject:n,properties:r(n)}),Atomics.add(a,0,1),Atomics.notify(a,0,1/0)})}};if(Ko)VI();var WI=zo});import{rmSync as Ny,writeFileSync as My}from"node:fs";import{createRequire as zI}from"node:module";import{tmpdir as KI}from"node:os";import{basename as GI,join as Pf,resolve as YI}from"node:path";function Dy(e){return Di(e)||e.startsWith("./")||e.startsWith("../")}function Yo(){return typeof Bun>"u"||process.env.JX_BUNDLER==="esbuild"}function kf(e,t,r){if(Di(e)){let n=e.slice(Pc.length);if(Yo())return zI(Pf(r,"package.json")).resolve(n);return Bun.resolveSync(n,r)}return YI(t,e)}function XI(e){let{onFileLoaded:t,resolver:r}=e;if(r===void 0&&t===void 0)return[];return[{name:"jx-bundle-hooks",setup:(i)=>{if(r!==void 0)i.onResolve({filter:r.filter},(s)=>r.resolve(s));if(t!==void 0)i.onLoad({filter:/.*/},(s)=>{t(s.path)})}}]}function QI(e){if(e==="cloudflare-workers"||e==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:e==="bun"?"bun":"node"}}function Ef(e){return e.minify??e.target==="browser"}function _f(e){let t={};if(e.conditions)t.conditions=e.conditions;if(e.target==="browser")t.define={...ZI};return t}function Jy(e){return e==="node"||e==="bun"?"node":"browser"}function eT(e){if(e==="workerd")return"browser";return e}async function Af(e,t){let r=t.external??[],n=XI(t);if(Yo()){let s=await Promise.resolve().then(() => Bt(Go(),1));await s.build({bundle:!0,..._f(t),entryPoints:[e.entryPath],external:r,format:"esm",logLevel:"silent",minify:Ef(t),outfile:e.outfile,platform:Jy(t.target),plugins:n});return}let i=await Bun.build({..._f(t),entrypoints:[e.entryPath],external:r,format:"esm",minify:Ef(t),plugins:n,target:eT(t.target),throw:!1});if(!i.success||i.outputs.length===0){let s=i.logs.map(String).join(`
72
72
  `);throw Error(`Bun.build failed for ${e.entryPath}:
73
- ${s}`)}My(e.outfile,await i.outputs[0].text(),"utf8")}function Af(e){return e==="<stdin>"||WI(e).startsWith(Fy)}async function qy(e,t,r){let n=[],i=_f(VI(),`jx-resolve-${process.pid}.js`);try{await Wi(`export * from ${JSON.stringify(e)};
74
- `,{outfile:i,resolveDir:t},{...r,minify:!1,onFileLoaded:(s)=>n.push(s)})}catch{return}finally{Ny(i,{force:!0})}return n.find((s)=>!Af(s))}async function Wi(e,{resolveDir:t,outfile:r},n){if(Yo()){let s=await Promise.resolve().then(() => Bt(Go(),1));await s.build({bundle:!0,...Ef(n),external:n.external??[],format:"esm",logLevel:"silent",minify:Sf(n),outfile:r,platform:Jy(n.target),stdin:{contents:e,loader:"js",resolveDir:t,sourcefile:"jx-entry.js"}});return}let i=_f(t,`${Fy}${process.pid}.mjs`);My(i,e,"utf8");try{await kf({entryPath:i,outfile:r},n)}finally{Ny(i,{force:!0})}}async function By(e,{projectRoot:t,outfile:r,adapter:n}){await Wi(e,{outfile:r,resolveDir:t},GI(n))}var Ly,YI,Fy=".jx-entry-";var jf=L(()=>{wr();Ly=["@vue/reactivity","lit-html"];YI={"process.env.NODE_ENV":'"production"'}});function ZI(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function Hy(e){let t=ZI(e),r=t.slice(t.lastIndexOf("/")+1),n=r.lastIndexOf(".");if(n>0)t=t.slice(0,t.length-(r.length-n));if(t.endsWith("/index"))t=t.slice(0,-6)||"/";else if(t==="index")t="/";if(!t.startsWith("/"))t=`/${t}`;let i=[],s=!1,o=!1,a=t.replaceAll(QI,(c,l,u)=>{if(s=!0,l)return o=!0,i.push(l),"*";return i.push(u),`:${u}`});return{isCatchAll:o,isDynamic:s,params:i,urlPattern:a}}function Uy(e,t){if(e.isDynamic!==t.isDynamic)return e.isDynamic?1:-1;if(e.isCatchAll!==t.isCatchAll)return e.isCatchAll?1:-1;return e.urlPattern.localeCompare(t.urlPattern)}var QI;var Vy=L(()=>{QI=/\[\.\.\.(\w+)\]|\[(\w+)\]/g});function Mr(e){if(!T(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function Xo(e){let t=Mr(e);if(t===null)return"ltr";let r=new Intl.Locale(t),n=r.script??r.maximize().script;return n!==void 0&&eT.has(n)?"rtl":"ltr"}function Wy(e){let t=Mr(e);if(t===null)return T(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Rf(e){let t=e.i18n,r=[];if(!J(t))return{errors:r,i18n:null};let n=Array.isArray(t.locales)?t.locales:[],i=[];for(let a of n){let c=Mr(a);if(c===null){r.push(`i18n.locales: "${String(a)}" is not a well-formed BCP 47 language tag.`);continue}if(!i.includes(c))i.push(c)}let s=Mr(t.defaultLocale)??i[0]??null;if(t.defaultLocale!==void 0&&Mr(t.defaultLocale)===null)r.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(s===null)return r.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:r,i18n:null};if(!i.includes(s))i.unshift(s);let o=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:tT;return{errors:r,i18n:{defaultLocale:s,locales:i,routing:o}}}function dn(e,t){if(t===null)return null;let r=e.split("/").find(Boolean);if(r===void 0)return t.defaultLocale;let n=Mr(r);return n!==null&&t.locales.includes(n)?n:t.defaultLocale}var eT,Fc="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",tT="prefix-except-default";var zi=L(()=>{Ee();eT=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"])});function ar(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}function zy(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let r=e.slice(2,-1).trim();return rT.has(r.toLowerCase())?r:e.slice(1)}return null}function Qo(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function ea(e){return e.startsWith("@keyframes")}function Ky(e,t){let r=[];for(let n of Zo(e))for(let i of Zo(t))r.push(nT(n,i));return r.join(", ")}function nT(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Zo(e){let t=[],r=0,n=null,i=0;for(let o=0;o<e.length;o+=1){let a=e[o];if(n){if(a==="\\")o+=1;else if(a===n)n=null;continue}if(a==='"'||a==="'")n=a;else if(a==="("||a==="[")r+=1;else if(a===")"||a==="]")r=Math.max(0,r-1);else if(a===","&&r===0)t.push(e.slice(i,o)),i=o+1}t.push(e.slice(i));let s=t.flatMap((o)=>{let a=o.trim();return a===""?[]:[a]});return s.length>0?s:[e]}function Wr(e){let t=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1];return t==="light"||t==="dark"?t:null}function Of(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${Vr}]))`,forced:`${e}:where([${Vr}="${t}"])`};return{auto:`:where(:root:not([${Vr}])) ${e}`,forced:`:where(:root[${Vr}="${t}"]) ${e}`}}function oi(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function Cf(e){return e.startsWith("--")?e:ar(e)}function qc(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Gy(e,t,r){let n=r.map(([s,o])=>`${s}: ${o}`).join("; "),i=t===null?n:`${t} { ${n} }`;for(let s=e.length-1;s>=0;s-=1)i=`${e[s]} { ${i} }`;return i}function iT(e,t,r){let n=r.map(({selector:s,declarations:o})=>`${s} { ${o.map(([a,c])=>`${a}: ${c}`).join("; ")} }`).join(" "),i=`@keyframes ${t} { ${n} }`;for(let s=e.length-1;s>=0;s-=1)i=`${e[s]} { ${i} }`;return i}function sT(e){let t=Object.keys(e).filter((n)=>ea(n));if(t.length===0)return e;let r={...e};for(let n of t)delete r[n];return r}function oT(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function _s(e,t={}){let{scope:r=null,mediaQueries:n={},transposeValue:i=(b)=>b,transposeSelector:s=(b)=>b,resolveValue:o}=t,a=[],c=(b)=>b!==null&&typeof b==="object"&&!Array.isArray(b)&&!Je(b),l=(b,x)=>{if(c(x))return[x];if(!Qo(b)||!Array.isArray(x)||x.length===0)return[];return x.every((_)=>c(_))?x:[]},u=(b,x,_,k)=>{if(x===void 0||x===null)return null;if(Je(x))return _?o?.(b,x,k)??null:null;if(J(x))return null;let E=String(x);if(he(E))return _?o?.(b,E,k)??null:null;return i(E)},d=(b,x,_=!0,k="self")=>{let E=[];for(let[w,P]of Object.entries(b)){if(l(w,P).length>0)continue;if(x&&(w.startsWith("@")||oi(w)))continue;if(w.startsWith("$"))continue;let R=u(w,P,_,k);if(R!==null)E.push([Cf(w),R])}return E},h=(b,x,_,k,E)=>{if(_.length===0)return;let w=x;if(w!==null){let j=s(w);if(j===null)return;w=j}let P=Gy(b,w,_),R={text:P,conditions:[...b],selector:w,declarations:_,target:k,key:qc(P)};if(T(E)&&E!=="")R.description=E;a.push(R)},m=(b,x,_)=>{let k=b.slice(10).trim();if(k==="")return;let E=[];for(let[P,R]of Object.entries(x)){if(!c(R))continue;let j=d(R,!0,!1,"unscoped");if(j.length>0)E.push({declarations:j,selector:P.trim()})}if(E.length===0)return;let w=iT(_,k,E);a.push({blocks:E,conditions:[..._],declarations:[],key:qc(w),selector:null,target:"unscoped",text:w})},y=(b,x,_,k,E)=>{if(b==="@--")return;if(Qo(b)){h([...k,b],null,d(x,!1,!0,"unscoped"),"unscoped",x.$description);return}if(ea(b)){m(b,x,k);return}let w=zy(b,n),P=w===null?b:`@media ${w}`,R=w===null?null:Wr(w);if(R!==null&&_!==null){let{auto:j,forced:D}=Of(_,R);g(x,j,[...k,P],E),g(sT(x),D,k,E);return}g(x,_,[...k,P],E)};function g(b,x,_,k){h(_,x,d(b,!0,!0,k),k,b.$description);for(let[E,w]of Object.entries(b))for(let P of l(E,w))if(E.startsWith("@"))y(E,P,x,_,k);else if(x!==null)g(P,Ky(x,E),_,oT(E)?k:"descendant")}return g(e,r,[],"self"),a}var rT,Vr="data-color-scheme",Bc="jx-color-scheme";var Hc=L(()=>{Ee();rT=new Set(["all","print","screen","speech"])});function Qy(){return`the Intl helpers ${Tf.join(", ")}`}var pn="en-US",If="UTC",Yy,Tf,Xy;var Nf=L(()=>{Yy=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Tf=Yy.map((e)=>e.path),Xy=Object.fromEntries(Yy.map((e)=>[e.path,e.params.indexOf("locale")]))});function aT(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Ct(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function ai(e){if(e==="")return[];return e.split("/").map((t)=>aT(t))}function Et(e,t){let r=e;for(let n of ai(t))r=r?.[n];return r}function Ie(e,t){let r=e;for(let n of ai(t))r+=Zy.test(n)?`.${n}`:`[${JSON.stringify(n)}]`;return r}function Ps(e){return Zy.test(e)?e:JSON.stringify(e)}function eb(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var Zy;var ks=L(()=>{Zy=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function Mf(e){let t=e.$map;return J(t)?t:void 0}function ib(e){return J(e)&&!Array.isArray(e)&&"operator"in e}function ta(e){return J(e)&&!Array.isArray(e)&&"$ref"in e}function fT(e,t,r){let n=Xy[e];if(n===void 0||n<0||t[n]!=null)return t;let i=Et(r.$page,"locale");if(!T(i)||i==="")return t;let s=[...t];return s[n]=i,s}function cb(e){return e.startsWith("window#/")&&lT.has(e.slice(8))}function Nn(e){return sb.has(e)}function tt(e,t){if(!e)return;let r=(e.depth??0)+1;if(r>dT)return;return{depth:r,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function Ke(e,t,r,n,i){if(e===null||e===void 0)return e;if(ib(e))return Er(e,t,r,n,i);if(ta(e)){let s=Uc(e.$ref,t,r,n);return i?.report(i.path??[],s),s}if(Array.isArray(e))return lb(e,t,r,n,i);return i?.report(i.path??[],e),e}function lb(e,t,r,n,i){return e.map((s,o)=>Ke(s,t,r,n,tt(i,o)))}function pT(e,t,r,n){let i=(s)=>{if(!e.slice(s.length).includes("/"))return t;return Uc(e.slice(0,e.lastIndexOf("/")),t,r,n)};if(e.startsWith("#/state/"))return i("#/state/");if(e.startsWith("parent#/"))return i("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?Uc(e.slice(0,e.lastIndexOf("/")),t,r,n):void 0;return}function Uc(e,t,r,n){if(e==="$reduce/acc")return n?.acc;if(e.startsWith("$reduce/"))return n?.acc;if(e.startsWith("$args/")){let i=e.slice(6).split("/"),s=n?.args?.[i[0]];return i.length>1?Et(s,i.slice(1).join("/")):s}if(e.startsWith("event#/")){let i=e.slice(7);return Et(r,i)}if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=Mf(t);if(s==="item")o=n?.item??a?.item??t["$map/item"];else if(s==="index")o=n?.index??a?.index??t["$map/index"];else o=a?.[s]??t[`$map/${s}`];return i.length>2?Et(o,i.slice(2).join("/")):o}if(e.startsWith("#/state/"))return Et(t,e.slice(8));if(e.startsWith("parent#/"))return Et(t,e.slice(8));if(e.startsWith("window#/"))return Et(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return Et(globalThis.document,e.slice(10));return Et(t,e)??null}function mT(e,t,r,n){if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=Mf(t);if(s==="item")o=n?.item??a?.item??t["$map/item"];else if(s==="index")o=n?.index??a?.index??t["$map/index"];else o=a?.[s]??t[`$map/${s}`];if(i.length>2){let c=i.slice(2),l=c.pop(),u=c.length>0?Et(o,c.join("/")):o;return{key:l,obj:u}}return{key:s==="item"?"$map/item":"$map/index",obj:Mf(t)??t}}if(e.startsWith("#/state/")){let i=e.slice(8);if(i.indexOf("/")===-1)return{key:i,obj:t};let o=ai(i),a=o.pop(),c=t;for(let l of o)c=c[l];return{key:a,obj:c}}return{key:e,obj:t}}function Er(e,t,r,n,i){let s=hT(e,t,r,n,i);return i?.report(i.path??[],s),s}function rb(e,t,r){switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"/":return t/r;case"%":return t%r;case"<":return t<r;case"<=":return t<=r;case">":return t>r;default:return t>=r}}function hT(e,t,r,n,i){let{operator:s,target:o,value:a,initial:c}=e;if(!cT.has(s))throw Error(`$expression: unknown operator "${s}"`);if(Lf.has(s)&&!("value"in e)){let l=Ke(o,t,r,n,tt(i,"target"));if(s==="!")return!l;if(s==="-")return-l}if(s==="call"){let l=ta(o)?o.$ref:void 0;if(!T(l))throw TypeError("$expression: call target must be a $ref pointer");let u=(n?.callDepth??0)+1;if(u>tb)throw Error(`$expression: call depth exceeded (${tb})`);let d=Array.isArray(a)?a.map((m,y)=>Ke(m,t,r,n,tt(i,["value",y]))):[];if(l.startsWith("window#/")){if(!cb(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let m=l.slice(8),y=uT.get(m);if(y)return y(...fT(m,d,t));let g=Et(globalThis.window,m),b=m.lastIndexOf("/"),x=b===-1?globalThis.window:Et(globalThis.window,m.slice(0,b));return g.apply(x,d)}let h=Uc(l,t,r,n);if(Ot(h))return h.apply(pT(l,t,r,n),d);if(J(h)&&"$expression"in h){let m=h,y={};for(let[g,b]of(m.parameters??[]).entries()){let x=T(b)?b:b?.name??"";if(!x)continue;y[x]=d[g]===void 0&&J(b)&&"default"in b?b.default:d[g]}return Er(m.$expression,t,r,{args:y,callDepth:u})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(Ff.has(s)){if(s==="?:"){let m=Ke(o,t,r,n,tt(i,"target"));if(i){let y=Ke(a,t,r,n,tt(i,"value")),g=Ke(c,t,r,n,tt(i,"initial"));return m?y:g}return m?Ke(a,t,r,n):Ke(c,t,r,n)}let l=Ke(o,t,r,n,tt(i,"target")),u=String(l),d=e.cases??{},h=Object.hasOwn(d,u);if(i){let m;for(let[g,b]of Object.entries(d)){let x=Ke(b,t,r,n,tt(i,["cases",g]));if(g===u)m=x}let y=Ke(e.default,t,r,n,tt(i,"default"));return h?m:y}return h?Ke(d[u],t,r,n):Ke(e.default,t,r,n)}if(Df.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=Ke(a,t,r,n,tt(i,"value"));switch(s){case"===":return l===u;case"!==":return l!==u;case"&&":return l&&u;case"||":return l||u;case"??":return l??u;default:return rb(s,l,u)}}if(ob.has(s)){let l=Ke(a,t,r,n,tt(i,"value")),{obj:u,key:d}=mT(o.$ref,t,r,n);u[d]=s==="="?l:rb(s.slice(0,-1),u[d],l);return}if(ab.has(s)){let l=Ke(o,t,r,n,tt(i,"target"));switch(s){case"push":return l.push(Ke(a,t,r,n,tt(i,"value")));case"unshift":return l.unshift(Ke(a,t,r,n,tt(i,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let u=Ke(a,t,r,n,tt(i,"value"));return l.splice(...u)}default:break}}if(qf.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=a===void 0?[]:Array.isArray(a)?lb(a,t,r,n,tt(i,"value")):[Ke(a,t,r,n,tt(i,"value"))],d=Et(l,s);if(!Ot(d))return;return d.apply(l,u)}if(Jf.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=a;if(s==="reduce"){let d=Ke(c,t,r,n,tt(i,"initial"));for(let[h,m]of l.entries())d=Er(u,t,r,{acc:d,index:h,item:m},h===0?tt(i,"value"):void 0);return d}if(s==="map")return l.map((d,h)=>Er(u,t,r,{...n,index:h,item:d},h===0?tt(i,"value"):void 0));if(s==="filter")return l.filter((d,h)=>Er(u,t,r,{...n,index:h,item:d},h===0?tt(i,"value"):void 0))}return}function at(e,t){if(e===null)return"null";if(e===void 0)return"undefined";if(ib(e))return Vt(e,t);if(ta(e))return Bf(e.$ref,t);if(Array.isArray(e))return e.map((r)=>at(r,t)).join(", ");return JSON.stringify(e)}function gT(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function Bf(e,t){let r=t.statePrefix??"state",n=t.eventParam??"event";if(e==="$reduce/acc")return"_acc";if(e.startsWith("$reduce/"))return"_acc";if(e.startsWith("$args/"))return Ie("_args",e.slice(6));if(e.startsWith("event#/"))return Ie(n,e.slice(7));if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i;if(s==="item")return i.length>2?Ie("_item",i.slice(2).join("/")):"_item";if(s==="index")return"_index";return`_${s}`}if(e.startsWith("#/state/"))return Ie(r,e.slice(8));if(e.startsWith("parent#/"))return Ie(r,e.slice(8));if(e.startsWith("window#/"))return Ie("window",e.slice(8));if(e.startsWith("document#/"))return Ie("document",e.slice(10));return Ie(r,e)}function nb(e,t){if(ta(e))return Bf(e.$ref,t);return at(e,t)}function yT(e,t,r){let n=(o)=>t[o]??"undefined",i=`(${r.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(pn)})`,s=JSON.stringify(If);switch(e){case"Intl/formatNumber":return`new Intl.NumberFormat(${n(1)} ?? ${i}, ${n(2)}).format(${n(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${n(1)} ?? ${i}, {timeZone: ${s}, ...${n(2)}}).format(new Date(${n(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${n(2)} ?? ${i}, ${n(3)}).format(${n(0)}, ${n(1)})`;case"Intl/formatList":return`new Intl.ListFormat(${n(1)} ?? ${i}, ${n(2)}).format(${n(0)})`;case"Intl/plural":return`new Intl.PluralRules(${n(1)} ?? ${i}, ${n(2)}).select(${n(0)})`;case"Intl/compare":return`new Intl.Collator(${n(2)} ?? ${i}, ${n(3)}).compare(${n(0)}, ${n(1)})`;case"Intl/displayName":return`new Intl.DisplayNames(${n(2)} ?? ${i}, {...${n(3)}, type: ${n(1)} ?? 'language'}).of(${n(0)})`;case"Intl/segment":return`[...new Intl.Segmenter(${n(2)} ?? ${i}, {granularity: ${n(1)} ?? 'grapheme'}).segment(${n(0)})].map((p) => p.segment)`;default:return null}}function Vt(e,t={}){let{operator:r,target:n,value:i,initial:s}=e;if(Lf.has(r)&&!("value"in e)){let o=at(n,t);if(r==="!")return`!(${o})`;if(r==="-")return`-(${o})`}if(r==="call"){let o=(ta(n)?n.$ref:void 0)??"",a=Array.isArray(i)?i.map((c)=>at(c,t)):[];if(o.startsWith("window#/")){if(!cb(o))throw Error(`$expression: "${o}" is not a blessed pure global`);let c=yT(o.slice(8),a,t);if(c)return c;return`window.${o.slice(8).replaceAll("/",".")}(${a.join(", ")})`}if(o.startsWith("#/state/")){let c=o.slice(8),l=t.formulaParams?.[c];if(l){let u=l.map((d,h)=>`${JSON.stringify(d)}: ${a[h]??"undefined"}`).join(", ");return`${gT(c)}(${t.statePrefix??"state"}, { ${u} })`}}return`${Bf(o,t)}(${a.join(", ")})`}if(Ff.has(r)){if(r==="?:"){let l=at(n,t),u=at(i,t),d=at(s,t);return`(${l} ? ${u} : ${d})`}let o=at(n,t),a=Object.entries(e.cases??{}).map(([l,u])=>`_d === ${JSON.stringify(l)} ? ${at(u,t)} : `).join(""),c="default"in e?at(e.default,t):"undefined";return`((_d) => ${a}${c})(String(${o}))`}if(Df.has(r)){let o=at(n,t),a=at(i,t);return`(${o} ${r} ${a})`}if(ob.has(r)){let o=nb(n,t),a=at(i,t);return`${o} ${r} ${a}`}if(ab.has(r)){let o=nb(n,t);switch(r){case"push":return`${o}.push(${at(i,t)})`;case"unshift":return`${o}.unshift(${at(i,t)})`;case"pop":return`${o}.pop()`;case"shift":return`${o}.shift()`;case"splice":{let a=Array.isArray(i)?i.map((c)=>at(c,t)).join(", "):at(i,t);return`${o}.splice(${a})`}default:break}}if(qf.has(r)){let o=at(n,t),a=i===void 0?"":Array.isArray(i)?i.map((c)=>at(c,t)).join(", "):at(i,t);return`(${o})?.${r}?.(${a})`}if(Jf.has(r)){let o=at(n,t),a=Vt(i,t);if(r==="reduce"){let c=at(s,t);return`${o}.reduce((_acc, _item, _index) => ${a}, ${c})`}if(r==="map")return`${o}.map((_item, _index) => ${a})`;if(r==="filter")return`${o}.filter((_item, _index) => ${a})`}return"undefined"}function As(e,t,r,n){return Ke(e,t,r,n)}function Ki(e,t={}){return at(e,t)}var sb,Lf,Df,ob,ab,Jf,Ff,qf,cT,lT,uT,tb=64,dT=64;var ra=L(()=>{Nf();Ee();ks();sb=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Lf=new Set(["!","-"]),Df=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),ob=new Set(["=","+=","-=","*=","/="]),ab=new Set(["push","pop","shift","unshift","splice"]),Jf=new Set(["reduce","map","filter"]),Ff=new Set(["?:","switch"]),qf=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),cT=new Set([...sb,...Lf,...Df,...Jf,...Ff,...qf,"call"]),lT=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Tf]),uT=new Map([["Intl/compare",(e,t,r,n)=>new Intl.Collator(r??pn,n).compare(e,t)],["Intl/displayName",(e,t,r,n)=>new Intl.DisplayNames(r??pn,{...n,type:t??"language"}).of(e)],["Intl/formatDate",(e,t,r)=>new Intl.DateTimeFormat(t??pn,{timeZone:If,...r}).format(new Date(e))],["Intl/formatList",(e,t,r)=>new Intl.ListFormat(t??pn,r).format(e)],["Intl/formatNumber",(e,t,r)=>new Intl.NumberFormat(t??pn,r).format(e)],["Intl/formatRelativeTime",(e,t,r,n)=>new Intl.RelativeTimeFormat(r??pn,n).format(e,t)],["Intl/plural",(e,t,r)=>new Intl.PluralRules(t??pn,r).select(e)],["Intl/segment",(e,t,r)=>[...new Intl.Segmenter(r??pn,{granularity:t??"grapheme"}).segment(e)].map((n)=>n.segment)]])});function ub(e){if("operator"in e)return{kind:"expression",node:e};if("if"in e)return{kind:"if",node:e};if("$switch"in e)return{kind:"switch",node:e};if("stopPropagation"in e)return{kind:"stopPropagation"};if("preventDefault"in e)return{kind:"preventDefault"};return{kind:"dispatch",node:e}}function bT(e){return(J(e)||Ot(e))&&"then"in e&&Ot(e.then)}async function js(e,t,r,n={}){let i=n.args?{args:n.args}:void 0;for(let s of e){let o=ub(s);switch(o.kind){case"expression":{let a=Er(o.node,t,r,i);if(bT(a))await a;break}case"if":{let a=o.node,c=As(a.if,t,r,i)?a.then:a.else;if(Array.isArray(c))await js(c,t,r,n);break}case"switch":{let a=o.node,c=String(As(a.$switch,t,r,i)),l=a.cases??{},u=Object.hasOwn(l,c)?l[c]:a.default;if(Array.isArray(u))await js(u,t,r,n);break}case"dispatch":{let a=o.node,c=Ot(n.target)?n.target():n.target,l=r?.currentTarget??c;if(!l)break;let u={};if("detail"in a)u.detail=As(a.detail,t,r,i);if(a.bubbles!==void 0)u.bubbles=a.bubbles;if(a.composed!==void 0)u.composed=a.composed;l.dispatchEvent(new CustomEvent(a.dispatchEvent,u));break}case"stopPropagation":{r?.stopPropagation();break}case"preventDefault":{r?.preventDefault();break}default:break}}}function Lr(e,t={}){let r=t.indent??"",n=[];for(let i of e){let s=ub(i);switch(s.kind){case"expression":{n.push(`${r}${Vt(s.node,t)};`);break}case"if":{let o=s.node,a=Ki(o.if,t),c={...t,indent:`${r} `};if(n.push(`${r}if (${a}) {`,Lr(o.then??[],c)),o.else)n.push(`${r}} else {`,Lr(o.else,c));n.push(`${r}}`);break}case"switch":{let o=s.node,a=Ki(o.$switch,t),c={...t,indent:`${r} `};n.push(`${r}switch (String(${a})) {`);for(let[l,u]of Object.entries(o.cases??{}))n.push(`${r} case ${JSON.stringify(l)}: {`,Lr(u,c),`${r} break;`,`${r} }`);if(o.default)n.push(`${r} default: {`,Lr(o.default,c),`${r} }`);n.push(`${r}}`);break}case"dispatch":{let o=s.node,a=t.eventParam??"event",c=t.dispatchTarget??`(${a} && ${a}.currentTarget)`,l=[];if("detail"in o)l.push(`detail: ${Ki(o.detail,t)}`);if(o.bubbles!==void 0)l.push(`bubbles: ${JSON.stringify(o.bubbles)}`);if(o.composed!==void 0)l.push(`composed: ${JSON.stringify(o.composed)}`);let u=l.length>0?`, { ${l.join(", ")} }`:"";n.push(`${r}${c}?.dispatchEvent(new CustomEvent(${JSON.stringify(o.dispatchEvent)}${u}));`);break}case"stopPropagation":{n.push(`${r}${t.eventParam??"event"}?.stopPropagation();`);break}case"preventDefault":{n.push(`${r}${t.eventParam??"event"}?.preventDefault();`);break}default:break}}return n.join(`
75
- `)}var Vc=L(()=>{Ee();ra()});function Rs(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let r=1;r<e.length;r+=1){let n=e[r];if(n==="{")t+=1;else if(n==="}"){if(t-=1,t===0)return r===e.length-1}}return!1}function db(){return[...fb].toSorted()}function Gi(e,t){let r=e.toLowerCase();if(r.startsWith("aria-")||fb.has(r))return String(t);return t?"":null}var Mn,fb,Hf=32,Wc,zc="jx-slot",na="data-jx-slots",Uf="jx.slot.group",bQ;var Os=L(()=>{Hc();ra();ks();Ee();wr();Vc();Hc();Mn=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),fb=new Set(["contenteditable","draggable","spellcheck"]);Wc=/^[\t\n\f\r ]+$/u,bQ=(()=>{let e=Symbol.for(Uf),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function pb(e,t,r,n,i=$T){let s=[],o=(d,h)=>{let m={mediaQueries:t,scope:h,transposeValue:r};if(n)m.resolveValue=(y,g)=>n(y,g,h);for(let y of _s(d,m))s.push(y.text)},a={},c={},l=[],u=[];for(let[d,h]of Object.entries(e)){if(J(h)&&!Array.isArray(h)){if(d.startsWith("@"))l.push([d,h]);else if(!d.startsWith("--"))u.push([d,h]);continue}if(oi(d)||d.startsWith("@"))continue;if(d.startsWith("--")||d==="colorScheme"||d==="color-scheme")a[d]=h;else c[d]=h}o(a,i.root),o(c,i.body);for(let[d,h]of u)if(d.startsWith("&"))o({[d]:h},i.root);else o(h,d);for(let[d,h]of l){if(Qo(d)||ea(d)){o({[d]:h},null);continue}let m={},y={},g=[];for(let[b,x]of Object.entries(h)){if(J(x)&&!Array.isArray(x)){if(!b.startsWith("@"))g.push([b,x]);continue}if(b.startsWith("--"))m[b]=x;else y[b]=x}o({[d]:m},i.root),o({[d]:y},i.body);for(let[b,x]of g)o({[d]:x},b)}if(Object.values(t).some((d)=>Wr(d)!==null)&&!("colorScheme"in e))s.push(`${i.root} { color-scheme: light dark }`,`${i.root}:where([${Vr}="light"]) { color-scheme: light }`,`${i.root}:where([${Vr}="dark"]) { color-scheme: dark }`);return s.join(`
76
- `)}var $T;var mb=L(()=>{Hc();Ee();$T={body:"body",root:":root"}});function hb(e){return e===!1||e==="open"||e==="closed"}function Yi(e,t){let r=e?.$shadow;if(hb(r))return r===!1?null:r;let n=t?.shadow;return hb(n)&&n!==!1?n:null}function gb(e,t){return t===null?e:":host"}function sa(e,t){let r=[];for(let[n,i]of(e.parameters??[]).entries()){let s=yb(i);if(!s)continue;let o=bb(i)?`_a[${n}] === undefined ? ${JSON.stringify(i.default)} : _a[${n}]`:`_a[${n}]`;r.push(`${JSON.stringify(s)}: ${o}`)}return`(..._a) => { const _args = { ${r.join(", ")} }; return ${t}; }`}function yb(e){return T(e)?e:e?.name??""}function bb(e){return J(e)&&"default"in e}function Yc(e,t){let r=Gf(e,t);return r===e?e:`${r} as ${e}`}function Gf(e,t){let r=t?.$export;return T(r)&&r!==""?r:e}function Xc(e,t,r={}){let{statePrefix:n="state",indent:i="",collect:s}=r,{url:o}=t,a=he(o),c=t.method??"GET";if(t.manual)return`${i}// ${e}: manual Request — fetch triggered by user action`;let l=[`// ${e}: auto-fetch from ${a?"(dynamic URL)":o}`,s?`${s}.push(effect(() => {`:"effect(() => {"];if(a)l.push(` const url = \`${vT(o,n)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else l.push(` const url = ${JSON.stringify(o)};`);let u=[];if(c!=="GET")u.push(`method: ${JSON.stringify(c)}`);if(t.headers)u.push(`headers: ${JSON.stringify(t.headers)}`);if(t.body){let h=J(t.body)?JSON.stringify(JSON.stringify(t.body)):JSON.stringify(t.body);u.push(`body: ${h}`)}let d=u.length>0?`, { ${u.join(", ")} }`:"";return l.push(` fetch(url${d})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${n}.${e} = d; })`,` .catch(e => { ${n}.${e} = { error: String(e) }; });`,s?"}));":"});"),l.map((h)=>`${i}${h}`).join(`
77
- `)}function vT(e,t){if(t==="state")return e;return e.replaceAll(/\$\{([^}]*)\}/g,(r,n)=>`\${${n.replaceAll(/(?<!this\.)\bstate\./g,`${t}.`)}}`)}function Qc(e){if(!J(e))return!1;if(e.state)for(let[t,r]of Object.entries(e.state)){if(t==="$site"||t==="$page")continue;if(!J(r)||Array.isArray(r))return!0;if(r.timing==="compiler")continue;if(r.$prototype)return!0;if("default"in r)return!0;if(ei(r))continue;return!0}if(e.$switch)return!0;if(lt(e)||of(e.children))return!0;if(Array.isArray(e.children)&&e.children.some((t)=>Qc(t)))return!0;for(let[t,r]of Object.entries(e)){if(Mn.has(t))continue;if(Je(r))return!0;if(he(r))return!0}if(J(e.style)){for(let t of Object.values(e.style))if(he(t))return!0}if(J(e.attributes)){for(let t of Object.values(e.attributes))if(he(t))return!0}return!1}function $b(e){if(!J(e))return!1;if(e.$switch)return!0;if(lt(e)||of(e.children))return!0;for(let[t,r]of Object.entries(e)){if(Mn.has(t))continue;if(Je(r))return!0;if(he(r))return!0}if(J(e.style)){for(let t of Object.values(e.style))if(he(t))return!0}if(J(e.attributes)){for(let t of Object.values(e.attributes))if(he(t))return!0}return!1}function Ms(e,t=null,r={},n={}){let i=e?.state?Cs(e.state,t):t??vb();return{media:n,scope:i,scopeDefs:r}}function vb(e=null){return Object.create(e)}function wb(e){return e[xb]}function zf(e,t){if(T(e)){for(let s of e.matchAll(wT))t.add(s[1]);for(let s of e.matchAll(ST))t.add(s[1]);return}if(Array.isArray(e)){for(let s of e)zf(s,t);return}if(!J(e))return;let r=e,{operator:n,target:i}=r;if(T(n)&&Nn(n)&&Je(i)&&i.$ref.startsWith("#/state/"))t.add(i.$ref.slice(8).split("/")[0]);for(let s of Object.values(r))zf(s,t)}function Cs(e={},t=null){let r=vb(t),n=t?wb(t):void 0,i=new Set(n);Object.defineProperty(r,xb,{configurable:!0,enumerable:!1,value:i,writable:!0});let s=new Set;for(let l of Object.values(e))if(xr(l)||$r(l))zf(l.body??l.$expression,s);for(let l of s)if(l in e)i.add(l);for(let[l,u]of Object.entries(e)){if(!J(u)||Array.isArray(u)){Ln(r,l,Kc(u));continue}if("default"in u){Ln(r,l,Kc(u.default));continue}if(!u.$prototype&&!("$expression"in u)&&!ei(u))Ln(r,l,Kc(u))}let o=[],a=[];for(let[l,u]of Object.entries(e)){if(he(u)){o.push([l,u]);continue}if(!J(u))continue;if($r(u)){let d=u.$expression;if(Ni(u)){let h=u.parameters;Ln(r,l,(...m)=>{let y={};for(let[g,b]of h.entries()){let x=yb(b);if(!x)continue;y[x]=m[g]===void 0&&bb(b)?b.default:m[g]}return Er(d,r,null,{args:y})})}else if(Nn(d.operator))Ln(r,l,(h,m)=>Er(d,h,m));else Vf(r,l,()=>Er(d,r,null));continue}if(xr(u)){if(Zn(u)){let{body:d}=u;Ln(r,l,(h,m)=>{js(d,h??r,m??null)})}else if(T(u.body)){let d=u.parameters?Rn(u.parameters):u.arguments??[],{body:h}=u,m=d.includes("state")?d:["state",...d],y=Function(...m,h),g=(b,x)=>y(...m.map((_)=>_==="state"?b:x));if(Mi(h))Vf(r,l,()=>g(r)),a.push([l,h]);else Ln(r,l,g)}else Ln(r,l,()=>{}),i.add(l);continue}if(un(u)&&(u.$prototype==="LocalStorage"||u.$prototype==="SessionStorage")){Ln(r,l,Kc(u.default??null));continue}if(un(u)&&u.$prototype==="Request")i.add(l)}let c=!0;while(c){c=!1;for(let[l,u]of[...a,...o])if(!i.has(l)&&Sb(u,r))i.add(l),c=!0}for(let[l,u]of o)Vf(r,l,()=>It(u,r));return r}function Ln(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}function Vf(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:r})}function Be(e,t){if(Je(e))return Yf(e.$ref,t);if(he(e))return It(e,t);return e}function cr(e){return Je(e)}function Yf(e,t){if(!T(e))return e;if(e.startsWith("$map/")){let r=e.split("/"),n=r[1],s=t.$map?.[n]??t[`$map/${n}`];return r.length>2?Wf(s,r.slice(2).join("/")):s}if(e.startsWith("#/state/"))return Wf(t,e.slice(8));return Wf(t,e)??null}function Sb(e,t){if(!t)return!1;let r=wb(t);for(let n of e.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(n[2])continue;let i=n[1];if(r?.has(i))return!0;let s;try{s=t[i]}catch{continue}if(Ot(s))return!0}return!1}function Zc(e){return Rs(e)?`(${e.slice(2,-1)})`:`\`${e}\``}function It(e,t){if(Sb(e,t))return null;let r=["state","$map","$site","$page"],n=[t,t?.$map,t?.$site,t?.$page];try{let i=Rs(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function(...r,i)(...n)}catch{return null}}function Wf(e,t){return Et(e,t)}function Kc(e){if(!J(e))return e;return structuredClone(e)}function ET(e,t){if(!e||!t)return"";return Object.entries(e).filter(([r,n])=>!r.startsWith(":")&&!r.startsWith(".")&&!r.startsWith("&")&&!r.startsWith("[")&&!r.startsWith("@")&&he(n)).map(([r,n])=>{let i=Be(n,t);return i==null?null:`${ar(r)}: ${i}`}).filter(Boolean).join("; ")}function Xi(e,t,r=""){let n="",i=Be(e.id,t),s=Be(e.className,t),o=Be(e.hidden,t),a=Be(e.tabIndex,t),c=Be(e.title,t),l=Be(e.lang,t),u=Be(e.dir,t);if(i)n+=` id="${Se(String(i))}"`;if(s)n+=` class="${Se(String(s))}"`;if(o)n+=" hidden";if(a!==void 0&&a!==null)n+=` tabindex="${Se(String(a))}"`;if(c)n+=` title="${Se(String(c))}"`;if(l)n+=` lang="${Se(String(l))}"`;if(u)n+=` dir="${Se(String(u))}"`;let d=[ET(e.style,t),r].filter(Boolean).join("; ");if(d)n+=` style="${Se(d)}"`;if(e.attributes)for(let[h,m]of Object.entries(e.attributes)){let y=Be(m,t);if(Rt(y)){let g=Gi(h,y);if(g!==null)n+=g===""?` ${h}`:` ${h}="${Se(g)}"`;continue}if(T(y)||Ir(y))n+=` ${h}="${Se(String(y))}"`}if(e.$static)n+=" data-jx-static";else if(e.$prerendered)n+=" data-jx-prerendered";return n}function oa(e,t=" "){return e?"":`
78
- ${t}`}function Ls(){let e=JSON.stringify(Bc),t=JSON.stringify(Vr);return`(function(){try{var s=localStorage.getItem(${e});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${t},s)}}catch(e){}})()`}function Gc(e,t,r,n){for(let i of _s(t,{mediaQueries:n,resolveValue:(s,o)=>Eb(s,o,r),scope:r}))e.push(i.text)}function Eb(e,t,r){let n=T(t)?t:t.$ref;return _T.push({property:e,selector:r,source:n}),null}function el(){return`const __jxEnumAttrs = new Set(${JSON.stringify(db())});
73
+ ${s}`)}My(e.outfile,await i.outputs[0].text(),"utf8")}function jf(e){return e==="<stdin>"||GI(e).startsWith(Fy)}async function qy(e,t,r){let n=[],i=Pf(KI(),`jx-resolve-${process.pid}.js`);try{await Wi(`export * from ${JSON.stringify(e)};
74
+ `,{outfile:i,resolveDir:t},{...r,minify:!1,onFileLoaded:(s)=>n.push(s)})}catch{return}finally{Ny(i,{force:!0})}return n.find((s)=>!jf(s))}async function Wi(e,{resolveDir:t,outfile:r},n){if(Yo()){let s=await Promise.resolve().then(() => Bt(Go(),1));await s.build({bundle:!0,..._f(n),external:n.external??[],format:"esm",logLevel:"silent",minify:Ef(n),outfile:r,platform:Jy(n.target),stdin:{contents:e,loader:"js",resolveDir:t,sourcefile:"jx-entry.js"}});return}let i=Pf(t,`${Fy}${process.pid}.mjs`);My(i,e,"utf8");try{await Af({entryPath:i,outfile:r},n)}finally{Ny(i,{force:!0})}}async function By(e,{projectRoot:t,outfile:r,adapter:n}){await Wi(e,{outfile:r,resolveDir:t},QI(n))}var Ly,ZI,Fy=".jx-entry-";var Rf=L(()=>{wr();Ly=["@vue/reactivity","lit-html"];ZI={"process.env.NODE_ENV":'"production"'}});function rT(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function Hy(e){let t=rT(e),r=t.slice(t.lastIndexOf("/")+1),n=r.lastIndexOf(".");if(n>0)t=t.slice(0,t.length-(r.length-n));if(t.endsWith("/index"))t=t.slice(0,-6)||"/";else if(t==="index")t="/";if(!t.startsWith("/"))t=`/${t}`;let i=[],s=!1,o=!1,a=t.replaceAll(tT,(c,l,u)=>{if(s=!0,l)return o=!0,i.push(l),"*";return i.push(u),`:${u}`});return{isCatchAll:o,isDynamic:s,params:i,urlPattern:a}}function Uy(e,t){if(e.isDynamic!==t.isDynamic)return e.isDynamic?1:-1;if(e.isCatchAll!==t.isCatchAll)return e.isCatchAll?1:-1;return e.urlPattern.localeCompare(t.urlPattern)}var tT;var Vy=L(()=>{tT=/\[\.\.\.(\w+)\]|\[(\w+)\]/g});function Mr(e){if(!T(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function Xo(e){let t=Mr(e);if(t===null)return"ltr";let r=new Intl.Locale(t),n=r.script??r.maximize().script;return n!==void 0&&nT.has(n)?"rtl":"ltr"}function Wy(e){let t=Mr(e);if(t===null)return T(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Of(e){let t=e.i18n,r=[];if(!J(t))return{errors:r,i18n:null};let n=Array.isArray(t.locales)?t.locales:[],i=[];for(let a of n){let c=Mr(a);if(c===null){r.push(`i18n.locales: "${String(a)}" is not a well-formed BCP 47 language tag.`);continue}if(!i.includes(c))i.push(c)}let s=Mr(t.defaultLocale)??i[0]??null;if(t.defaultLocale!==void 0&&Mr(t.defaultLocale)===null)r.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(s===null)return r.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:r,i18n:null};if(!i.includes(s))i.unshift(s);let o=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:iT;return{errors:r,i18n:{defaultLocale:s,locales:i,routing:o}}}function dn(e,t){if(t===null)return null;let r=e.split("/").find(Boolean);if(r===void 0)return t.defaultLocale;let n=Mr(r);return n!==null&&t.locales.includes(n)?n:t.defaultLocale}var nT,Fc="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",iT="prefix-except-default";var zi=L(()=>{Ee();nT=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"])});function ar(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}function zy(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let r=e.slice(2,-1).trim();return sT.has(r.toLowerCase())?r:e.slice(1)}return null}function Qo(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function ea(e){return e.startsWith("@keyframes")}function Ky(e,t){let r=[];for(let n of Zo(e))for(let i of Zo(t))r.push(oT(n,i));return r.join(", ")}function oT(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Zo(e){let t=[],r=0,n=null,i=0;for(let o=0;o<e.length;o+=1){let a=e[o];if(n){if(a==="\\")o+=1;else if(a===n)n=null;continue}if(a==='"'||a==="'")n=a;else if(a==="("||a==="[")r+=1;else if(a===")"||a==="]")r=Math.max(0,r-1);else if(a===","&&r===0)t.push(e.slice(i,o)),i=o+1}t.push(e.slice(i));let s=t.flatMap((o)=>{let a=o.trim();return a===""?[]:[a]});return s.length>0?s:[e]}function Wr(e){let t=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1];return t==="light"||t==="dark"?t:null}function Cf(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${Vr}]))`,forced:`${e}:where([${Vr}="${t}"])`};return{auto:`:where(:root:not([${Vr}])) ${e}`,forced:`:where(:root[${Vr}="${t}"]) ${e}`}}function oi(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function If(e){return e.startsWith("--")?e:ar(e)}function qc(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Gy(e,t,r){let n=r.map(([s,o])=>`${s}: ${o}`).join("; "),i=t===null?n:`${t} { ${n} }`;for(let s=e.length-1;s>=0;s-=1)i=`${e[s]} { ${i} }`;return i}function aT(e,t,r){let n=r.map(({selector:s,declarations:o})=>`${s} { ${o.map(([a,c])=>`${a}: ${c}`).join("; ")} }`).join(" "),i=`@keyframes ${t} { ${n} }`;for(let s=e.length-1;s>=0;s-=1)i=`${e[s]} { ${i} }`;return i}function cT(e){let t=Object.keys(e).filter((n)=>ea(n));if(t.length===0)return e;let r={...e};for(let n of t)delete r[n];return r}function lT(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function _s(e,t={}){let{scope:r=null,mediaQueries:n={},transposeValue:i=(b)=>b,transposeSelector:s=(b)=>b,resolveValue:o}=t,a=[],c=(b)=>b!==null&&typeof b==="object"&&!Array.isArray(b)&&!Je(b),l=(b,x)=>{if(c(x))return[x];if(!Qo(b)||!Array.isArray(x)||x.length===0)return[];return x.every((_)=>c(_))?x:[]},u=(b,x,_,P)=>{if(x===void 0||x===null)return null;if(Je(x))return _?o?.(b,x,P)??null:null;if(J(x))return null;let E=String(x);if(he(E))return _?o?.(b,E,P)??null:null;return i(E)},d=(b,x,_=!0,P="self")=>{let E=[];for(let[w,k]of Object.entries(b)){if(l(w,k).length>0)continue;if(x&&(w.startsWith("@")||oi(w)))continue;if(w.startsWith("$"))continue;let R=u(w,k,_,P);if(R!==null)E.push([If(w),R])}return E},h=(b,x,_,P,E)=>{if(_.length===0)return;let w=x;if(w!==null){let j=s(w);if(j===null)return;w=j}let k=Gy(b,w,_),R={text:k,conditions:[...b],selector:w,declarations:_,target:P,key:qc(k)};if(T(E)&&E!=="")R.description=E;a.push(R)},m=(b,x,_)=>{let P=b.slice(10).trim();if(P==="")return;let E=[];for(let[k,R]of Object.entries(x)){if(!c(R))continue;let j=d(R,!0,!1,"unscoped");if(j.length>0)E.push({declarations:j,selector:k.trim()})}if(E.length===0)return;let w=aT(_,P,E);a.push({blocks:E,conditions:[..._],declarations:[],key:qc(w),selector:null,target:"unscoped",text:w})},y=(b,x,_,P,E)=>{if(b==="@--")return;if(Qo(b)){h([...P,b],null,d(x,!1,!0,"unscoped"),"unscoped",x.$description);return}if(ea(b)){m(b,x,P);return}let w=zy(b,n),k=w===null?b:`@media ${w}`,R=w===null?null:Wr(w);if(R!==null&&_!==null){let{auto:j,forced:D}=Cf(_,R);g(x,j,[...P,k],E),g(cT(x),D,P,E);return}g(x,_,[...P,k],E)};function g(b,x,_,P){h(_,x,d(b,!0,!0,P),P,b.$description);for(let[E,w]of Object.entries(b))for(let k of l(E,w))if(E.startsWith("@"))y(E,k,x,_,P);else if(x!==null)g(k,Ky(x,E),_,lT(E)?P:"descendant")}return g(e,r,[],"self"),a}var sT,Vr="data-color-scheme",Bc="jx-color-scheme";var Hc=L(()=>{Ee();sT=new Set(["all","print","screen","speech"])});function Qy(){return`the Intl helpers ${Nf.join(", ")}`}var pn="en-US",Tf="UTC",Yy,Nf,Xy;var Mf=L(()=>{Yy=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Nf=Yy.map((e)=>e.path),Xy=Object.fromEntries(Yy.map((e)=>[e.path,e.params.indexOf("locale")]))});function uT(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Ct(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function ai(e){if(e==="")return[];return e.split("/").map((t)=>uT(t))}function Et(e,t){let r=e;for(let n of ai(t))r=r?.[n];return r}function Ie(e,t){let r=e;for(let n of ai(t))r+=Zy.test(n)?`.${n}`:`[${JSON.stringify(n)}]`;return r}function Ps(e){return Zy.test(e)?e:JSON.stringify(e)}function eb(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var Zy;var ks=L(()=>{Zy=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function Lf(e){let t=e.$map;return J(t)?t:void 0}function ib(e){return J(e)&&!Array.isArray(e)&&"operator"in e}function ta(e){return J(e)&&!Array.isArray(e)&&"$ref"in e}function mT(e,t,r){let n=Xy[e];if(n===void 0||n<0||t[n]!=null)return t;let i=Et(r.$page,"locale");if(!T(i)||i==="")return t;let s=[...t];return s[n]=i,s}function cb(e){return e.startsWith("window#/")&&dT.has(e.slice(8))}function Nn(e){return sb.has(e)}function tt(e,t){if(!e)return;let r=(e.depth??0)+1;if(r>hT)return;return{depth:r,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function Ke(e,t,r,n,i){if(e===null||e===void 0)return e;if(ib(e))return Er(e,t,r,n,i);if(ta(e)){let s=Uc(e.$ref,t,r,n);return i?.report(i.path??[],s),s}if(Array.isArray(e))return lb(e,t,r,n,i);return i?.report(i.path??[],e),e}function lb(e,t,r,n,i){return e.map((s,o)=>Ke(s,t,r,n,tt(i,o)))}function gT(e,t,r,n){let i=(s)=>{if(!e.slice(s.length).includes("/"))return t;return Uc(e.slice(0,e.lastIndexOf("/")),t,r,n)};if(e.startsWith("#/state/"))return i("#/state/");if(e.startsWith("parent#/"))return i("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?Uc(e.slice(0,e.lastIndexOf("/")),t,r,n):void 0;return}function Uc(e,t,r,n){if(e==="$reduce/acc")return n?.acc;if(e.startsWith("$reduce/"))return n?.acc;if(e.startsWith("$args/")){let i=e.slice(6).split("/"),s=n?.args?.[i[0]];return i.length>1?Et(s,i.slice(1).join("/")):s}if(e.startsWith("event#/")){let i=e.slice(7);return Et(r,i)}if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=Lf(t);if(s==="item")o=n?.item??a?.item??t["$map/item"];else if(s==="index")o=n?.index??a?.index??t["$map/index"];else o=a?.[s]??t[`$map/${s}`];return i.length>2?Et(o,i.slice(2).join("/")):o}if(e.startsWith("#/state/"))return Et(t,e.slice(8));if(e.startsWith("parent#/"))return Et(t,e.slice(8));if(e.startsWith("window#/"))return Et(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return Et(globalThis.document,e.slice(10));return Et(t,e)??null}function yT(e,t,r,n){if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=Lf(t);if(s==="item")o=n?.item??a?.item??t["$map/item"];else if(s==="index")o=n?.index??a?.index??t["$map/index"];else o=a?.[s]??t[`$map/${s}`];if(i.length>2){let c=i.slice(2),l=c.pop(),u=c.length>0?Et(o,c.join("/")):o;return{key:l,obj:u}}return{key:s==="item"?"$map/item":"$map/index",obj:Lf(t)??t}}if(e.startsWith("#/state/")){let i=e.slice(8);if(i.indexOf("/")===-1)return{key:i,obj:t};let o=ai(i),a=o.pop(),c=t;for(let l of o)c=c[l];return{key:a,obj:c}}return{key:e,obj:t}}function Er(e,t,r,n,i){let s=bT(e,t,r,n,i);return i?.report(i.path??[],s),s}function rb(e,t,r){switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"/":return t/r;case"%":return t%r;case"<":return t<r;case"<=":return t<=r;case">":return t>r;default:return t>=r}}function bT(e,t,r,n,i){let{operator:s,target:o,value:a,initial:c}=e;if(!fT.has(s))throw Error(`$expression: unknown operator "${s}"`);if(Df.has(s)&&!("value"in e)){let l=Ke(o,t,r,n,tt(i,"target"));if(s==="!")return!l;if(s==="-")return-l}if(s==="call"){let l=ta(o)?o.$ref:void 0;if(!T(l))throw TypeError("$expression: call target must be a $ref pointer");let u=(n?.callDepth??0)+1;if(u>tb)throw Error(`$expression: call depth exceeded (${tb})`);let d=Array.isArray(a)?a.map((m,y)=>Ke(m,t,r,n,tt(i,["value",y]))):[];if(l.startsWith("window#/")){if(!cb(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let m=l.slice(8),y=pT.get(m);if(y)return y(...mT(m,d,t));let g=Et(globalThis.window,m),b=m.lastIndexOf("/"),x=b===-1?globalThis.window:Et(globalThis.window,m.slice(0,b));return g.apply(x,d)}let h=Uc(l,t,r,n);if(Ot(h))return h.apply(gT(l,t,r,n),d);if(J(h)&&"$expression"in h){let m=h,y={};for(let[g,b]of(m.parameters??[]).entries()){let x=T(b)?b:b?.name??"";if(!x)continue;y[x]=d[g]===void 0&&J(b)&&"default"in b?b.default:d[g]}return Er(m.$expression,t,r,{args:y,callDepth:u})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(qf.has(s)){if(s==="?:"){let m=Ke(o,t,r,n,tt(i,"target"));if(i){let y=Ke(a,t,r,n,tt(i,"value")),g=Ke(c,t,r,n,tt(i,"initial"));return m?y:g}return m?Ke(a,t,r,n):Ke(c,t,r,n)}let l=Ke(o,t,r,n,tt(i,"target")),u=String(l),d=e.cases??{},h=Object.hasOwn(d,u);if(i){let m;for(let[g,b]of Object.entries(d)){let x=Ke(b,t,r,n,tt(i,["cases",g]));if(g===u)m=x}let y=Ke(e.default,t,r,n,tt(i,"default"));return h?m:y}return h?Ke(d[u],t,r,n):Ke(e.default,t,r,n)}if(Jf.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=Ke(a,t,r,n,tt(i,"value"));switch(s){case"===":return l===u;case"!==":return l!==u;case"&&":return l&&u;case"||":return l||u;case"??":return l??u;default:return rb(s,l,u)}}if(ob.has(s)){let l=Ke(a,t,r,n,tt(i,"value")),{obj:u,key:d}=yT(o.$ref,t,r,n);u[d]=s==="="?l:rb(s.slice(0,-1),u[d],l);return}if(ab.has(s)){let l=Ke(o,t,r,n,tt(i,"target"));switch(s){case"push":return l.push(Ke(a,t,r,n,tt(i,"value")));case"unshift":return l.unshift(Ke(a,t,r,n,tt(i,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let u=Ke(a,t,r,n,tt(i,"value"));return l.splice(...u)}default:break}}if(Bf.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=a===void 0?[]:Array.isArray(a)?lb(a,t,r,n,tt(i,"value")):[Ke(a,t,r,n,tt(i,"value"))],d=Et(l,s);if(!Ot(d))return;return d.apply(l,u)}if(Ff.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=a;if(s==="reduce"){let d=Ke(c,t,r,n,tt(i,"initial"));for(let[h,m]of l.entries())d=Er(u,t,r,{acc:d,index:h,item:m},h===0?tt(i,"value"):void 0);return d}if(s==="map")return l.map((d,h)=>Er(u,t,r,{...n,index:h,item:d},h===0?tt(i,"value"):void 0));if(s==="filter")return l.filter((d,h)=>Er(u,t,r,{...n,index:h,item:d},h===0?tt(i,"value"):void 0))}return}function at(e,t){if(e===null)return"null";if(e===void 0)return"undefined";if(ib(e))return Vt(e,t);if(ta(e))return Hf(e.$ref,t);if(Array.isArray(e))return e.map((r)=>at(r,t)).join(", ");return JSON.stringify(e)}function xT(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function Hf(e,t){let r=t.statePrefix??"state",n=t.eventParam??"event";if(e==="$reduce/acc")return"_acc";if(e.startsWith("$reduce/"))return"_acc";if(e.startsWith("$args/"))return Ie("_args",e.slice(6));if(e.startsWith("event#/"))return Ie(n,e.slice(7));if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i;if(s==="item")return i.length>2?Ie("_item",i.slice(2).join("/")):"_item";if(s==="index")return"_index";return`_${s}`}if(e.startsWith("#/state/"))return Ie(r,e.slice(8));if(e.startsWith("parent#/"))return Ie(r,e.slice(8));if(e.startsWith("window#/"))return Ie("window",e.slice(8));if(e.startsWith("document#/"))return Ie("document",e.slice(10));return Ie(r,e)}function nb(e,t){if(ta(e))return Hf(e.$ref,t);return at(e,t)}function $T(e,t,r){let n=(o)=>t[o]??"undefined",i=`(${r.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(pn)})`,s=JSON.stringify(Tf);switch(e){case"Intl/formatNumber":return`new Intl.NumberFormat(${n(1)} ?? ${i}, ${n(2)}).format(${n(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${n(1)} ?? ${i}, {timeZone: ${s}, ...${n(2)}}).format(new Date(${n(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${n(2)} ?? ${i}, ${n(3)}).format(${n(0)}, ${n(1)})`;case"Intl/formatList":return`new Intl.ListFormat(${n(1)} ?? ${i}, ${n(2)}).format(${n(0)})`;case"Intl/plural":return`new Intl.PluralRules(${n(1)} ?? ${i}, ${n(2)}).select(${n(0)})`;case"Intl/compare":return`new Intl.Collator(${n(2)} ?? ${i}, ${n(3)}).compare(${n(0)}, ${n(1)})`;case"Intl/displayName":return`new Intl.DisplayNames(${n(2)} ?? ${i}, {...${n(3)}, type: ${n(1)} ?? 'language'}).of(${n(0)})`;case"Intl/segment":return`[...new Intl.Segmenter(${n(2)} ?? ${i}, {granularity: ${n(1)} ?? 'grapheme'}).segment(${n(0)})].map((p) => p.segment)`;default:return null}}function Vt(e,t={}){let{operator:r,target:n,value:i,initial:s}=e;if(Df.has(r)&&!("value"in e)){let o=at(n,t);if(r==="!")return`!(${o})`;if(r==="-")return`-(${o})`}if(r==="call"){let o=(ta(n)?n.$ref:void 0)??"",a=Array.isArray(i)?i.map((c)=>at(c,t)):[];if(o.startsWith("window#/")){if(!cb(o))throw Error(`$expression: "${o}" is not a blessed pure global`);let c=$T(o.slice(8),a,t);if(c)return c;return`window.${o.slice(8).replaceAll("/",".")}(${a.join(", ")})`}if(o.startsWith("#/state/")){let c=o.slice(8),l=t.formulaParams?.[c];if(l){let u=l.map((d,h)=>`${JSON.stringify(d)}: ${a[h]??"undefined"}`).join(", ");return`${xT(c)}(${t.statePrefix??"state"}, { ${u} })`}}return`${Hf(o,t)}(${a.join(", ")})`}if(qf.has(r)){if(r==="?:"){let l=at(n,t),u=at(i,t),d=at(s,t);return`(${l} ? ${u} : ${d})`}let o=at(n,t),a=Object.entries(e.cases??{}).map(([l,u])=>`_d === ${JSON.stringify(l)} ? ${at(u,t)} : `).join(""),c="default"in e?at(e.default,t):"undefined";return`((_d) => ${a}${c})(String(${o}))`}if(Jf.has(r)){let o=at(n,t),a=at(i,t);return`(${o} ${r} ${a})`}if(ob.has(r)){let o=nb(n,t),a=at(i,t);return`${o} ${r} ${a}`}if(ab.has(r)){let o=nb(n,t);switch(r){case"push":return`${o}.push(${at(i,t)})`;case"unshift":return`${o}.unshift(${at(i,t)})`;case"pop":return`${o}.pop()`;case"shift":return`${o}.shift()`;case"splice":{let a=Array.isArray(i)?i.map((c)=>at(c,t)).join(", "):at(i,t);return`${o}.splice(${a})`}default:break}}if(Bf.has(r)){let o=at(n,t),a=i===void 0?"":Array.isArray(i)?i.map((c)=>at(c,t)).join(", "):at(i,t);return`(${o})?.${r}?.(${a})`}if(Ff.has(r)){let o=at(n,t),a=Vt(i,t);if(r==="reduce"){let c=at(s,t);return`${o}.reduce((_acc, _item, _index) => ${a}, ${c})`}if(r==="map")return`${o}.map((_item, _index) => ${a})`;if(r==="filter")return`${o}.filter((_item, _index) => ${a})`}return"undefined"}function As(e,t,r,n){return Ke(e,t,r,n)}function Ki(e,t={}){return at(e,t)}var sb,Df,Jf,ob,ab,Ff,qf,Bf,fT,dT,pT,tb=64,hT=64;var ra=L(()=>{Mf();Ee();ks();sb=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Df=new Set(["!","-"]),Jf=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),ob=new Set(["=","+=","-=","*=","/="]),ab=new Set(["push","pop","shift","unshift","splice"]),Ff=new Set(["reduce","map","filter"]),qf=new Set(["?:","switch"]),Bf=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),fT=new Set([...sb,...Df,...Jf,...Ff,...qf,...Bf,"call"]),dT=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Nf]),pT=new Map([["Intl/compare",(e,t,r,n)=>new Intl.Collator(r??pn,n).compare(e,t)],["Intl/displayName",(e,t,r,n)=>new Intl.DisplayNames(r??pn,{...n,type:t??"language"}).of(e)],["Intl/formatDate",(e,t,r)=>new Intl.DateTimeFormat(t??pn,{timeZone:Tf,...r}).format(new Date(e))],["Intl/formatList",(e,t,r)=>new Intl.ListFormat(t??pn,r).format(e)],["Intl/formatNumber",(e,t,r)=>new Intl.NumberFormat(t??pn,r).format(e)],["Intl/formatRelativeTime",(e,t,r,n)=>new Intl.RelativeTimeFormat(r??pn,n).format(e,t)],["Intl/plural",(e,t,r)=>new Intl.PluralRules(t??pn,r).select(e)],["Intl/segment",(e,t,r)=>[...new Intl.Segmenter(r??pn,{granularity:t??"grapheme"}).segment(e)].map((n)=>n.segment)]])});function ub(e){if("operator"in e)return{kind:"expression",node:e};if("if"in e)return{kind:"if",node:e};if("$switch"in e)return{kind:"switch",node:e};if("stopPropagation"in e)return{kind:"stopPropagation"};if("preventDefault"in e)return{kind:"preventDefault"};return{kind:"dispatch",node:e}}function vT(e){return(J(e)||Ot(e))&&"then"in e&&Ot(e.then)}async function js(e,t,r,n={}){let i=n.args?{args:n.args}:void 0;for(let s of e){let o=ub(s);switch(o.kind){case"expression":{let a=Er(o.node,t,r,i);if(vT(a))await a;break}case"if":{let a=o.node,c=As(a.if,t,r,i)?a.then:a.else;if(Array.isArray(c))await js(c,t,r,n);break}case"switch":{let a=o.node,c=String(As(a.$switch,t,r,i)),l=a.cases??{},u=Object.hasOwn(l,c)?l[c]:a.default;if(Array.isArray(u))await js(u,t,r,n);break}case"dispatch":{let a=o.node,c=Ot(n.target)?n.target():n.target,l=r?.currentTarget??c;if(!l)break;let u={};if("detail"in a)u.detail=As(a.detail,t,r,i);if(a.bubbles!==void 0)u.bubbles=a.bubbles;if(a.composed!==void 0)u.composed=a.composed;l.dispatchEvent(new CustomEvent(a.dispatchEvent,u));break}case"stopPropagation":{r?.stopPropagation();break}case"preventDefault":{r?.preventDefault();break}default:break}}}function Lr(e,t={}){let r=t.indent??"",n=[];for(let i of e){let s=ub(i);switch(s.kind){case"expression":{n.push(`${r}${Vt(s.node,t)};`);break}case"if":{let o=s.node,a=Ki(o.if,t),c={...t,indent:`${r} `};if(n.push(`${r}if (${a}) {`,Lr(o.then??[],c)),o.else)n.push(`${r}} else {`,Lr(o.else,c));n.push(`${r}}`);break}case"switch":{let o=s.node,a=Ki(o.$switch,t),c={...t,indent:`${r} `};n.push(`${r}switch (String(${a})) {`);for(let[l,u]of Object.entries(o.cases??{}))n.push(`${r} case ${JSON.stringify(l)}: {`,Lr(u,c),`${r} break;`,`${r} }`);if(o.default)n.push(`${r} default: {`,Lr(o.default,c),`${r} }`);n.push(`${r}}`);break}case"dispatch":{let o=s.node,a=t.eventParam??"event",c=t.dispatchTarget??`(${a} && ${a}.currentTarget)`,l=[];if("detail"in o)l.push(`detail: ${Ki(o.detail,t)}`);if(o.bubbles!==void 0)l.push(`bubbles: ${JSON.stringify(o.bubbles)}`);if(o.composed!==void 0)l.push(`composed: ${JSON.stringify(o.composed)}`);let u=l.length>0?`, { ${l.join(", ")} }`:"";n.push(`${r}${c}?.dispatchEvent(new CustomEvent(${JSON.stringify(o.dispatchEvent)}${u}));`);break}case"stopPropagation":{n.push(`${r}${t.eventParam??"event"}?.stopPropagation();`);break}case"preventDefault":{n.push(`${r}${t.eventParam??"event"}?.preventDefault();`);break}default:break}}return n.join(`
75
+ `)}var Vc=L(()=>{Ee();ra()});function Rs(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let r=1;r<e.length;r+=1){let n=e[r];if(n==="{")t+=1;else if(n==="}"){if(t-=1,t===0)return r===e.length-1}}return!1}function db(){return[...fb].toSorted()}function Gi(e,t){let r=e.toLowerCase();if(r.startsWith("aria-")||fb.has(r))return String(t);return t?"":null}var Mn,fb,Uf=32,Wc,zc="jx-slot",na="data-jx-slots",Vf="jx.slot.group",SQ;var Os=L(()=>{Hc();ra();ks();Ee();wr();Vc();Hc();Mn=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),fb=new Set(["contenteditable","draggable","spellcheck"]);Wc=/^[\t\n\f\r ]+$/u,SQ=(()=>{let e=Symbol.for(Vf),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function pb(e,t,r,n,i=ST){let s=[],o=(d,h)=>{let m={mediaQueries:t,scope:h,transposeValue:r};if(n)m.resolveValue=(y,g)=>n(y,g,h);for(let y of _s(d,m))s.push(y.text)},a={},c={},l=[],u=[];for(let[d,h]of Object.entries(e)){if(J(h)&&!Array.isArray(h)){if(d.startsWith("@"))l.push([d,h]);else if(!d.startsWith("--"))u.push([d,h]);continue}if(oi(d)||d.startsWith("@"))continue;if(d.startsWith("--")||d==="colorScheme"||d==="color-scheme")a[d]=h;else c[d]=h}o(a,i.root),o(c,i.body);for(let[d,h]of u)if(d.startsWith("&"))o({[d]:h},i.root);else o(h,d);for(let[d,h]of l){if(Qo(d)||ea(d)){o({[d]:h},null);continue}let m={},y={},g=[];for(let[b,x]of Object.entries(h)){if(J(x)&&!Array.isArray(x)){if(!b.startsWith("@"))g.push([b,x]);continue}if(b.startsWith("--"))m[b]=x;else y[b]=x}o({[d]:m},i.root),o({[d]:y},i.body);for(let[b,x]of g)o({[d]:x},b)}if(Object.values(t).some((d)=>Wr(d)!==null)&&!("colorScheme"in e))s.push(`${i.root} { color-scheme: light dark }`,`${i.root}:where([${Vr}="light"]) { color-scheme: light }`,`${i.root}:where([${Vr}="dark"]) { color-scheme: dark }`);return s.join(`
76
+ `)}var ST;var mb=L(()=>{Hc();Ee();ST={body:"body",root:":root"}});function hb(e){return e===!1||e==="open"||e==="closed"}function Yi(e,t){let r=e?.$shadow;if(hb(r))return r===!1?null:r;let n=t?.shadow;return hb(n)&&n!==!1?n:null}function gb(e,t){return t===null?e:":host"}function sa(e,t){let r=[];for(let[n,i]of(e.parameters??[]).entries()){let s=yb(i);if(!s)continue;let o=bb(i)?`_a[${n}] === undefined ? ${JSON.stringify(i.default)} : _a[${n}]`:`_a[${n}]`;r.push(`${JSON.stringify(s)}: ${o}`)}return`(..._a) => { const _args = { ${r.join(", ")} }; return ${t}; }`}function yb(e){return T(e)?e:e?.name??""}function bb(e){return J(e)&&"default"in e}function Yc(e,t){let r=Yf(e,t);return r===e?e:`${r} as ${e}`}function Yf(e,t){let r=t?.$export;return T(r)&&r!==""?r:e}function Xc(e,t,r={}){let{statePrefix:n="state",indent:i="",collect:s}=r,{url:o}=t,a=he(o),c=t.method??"GET";if(t.manual)return`${i}// ${e}: manual Request — fetch triggered by user action`;let l=[`// ${e}: auto-fetch from ${a?"(dynamic URL)":o}`,s?`${s}.push(effect(() => {`:"effect(() => {"];if(a)l.push(` const url = \`${ET(o,n)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else l.push(` const url = ${JSON.stringify(o)};`);let u=[];if(c!=="GET")u.push(`method: ${JSON.stringify(c)}`);if(t.headers)u.push(`headers: ${JSON.stringify(t.headers)}`);if(t.body){let h=J(t.body)?JSON.stringify(JSON.stringify(t.body)):JSON.stringify(t.body);u.push(`body: ${h}`)}let d=u.length>0?`, { ${u.join(", ")} }`:"";return l.push(` fetch(url${d})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${n}.${e} = d; })`,` .catch(e => { ${n}.${e} = { error: String(e) }; });`,s?"}));":"});"),l.map((h)=>`${i}${h}`).join(`
77
+ `)}function ET(e,t){if(t==="state")return e;return e.replaceAll(/\$\{([^}]*)\}/g,(r,n)=>`\${${n.replaceAll(/(?<!this\.)\bstate\./g,`${t}.`)}}`)}function Qc(e){if(!J(e))return!1;if(e.state)for(let[t,r]of Object.entries(e.state)){if(t==="$site"||t==="$page")continue;if(!J(r)||Array.isArray(r))return!0;if(r.timing==="compiler")continue;if(r.$prototype)return!0;if("default"in r)return!0;if(ei(r))continue;return!0}if(e.$switch)return!0;if(lt(e)||af(e.children))return!0;if(Array.isArray(e.children)&&e.children.some((t)=>Qc(t)))return!0;for(let[t,r]of Object.entries(e)){if(Mn.has(t))continue;if(Je(r))return!0;if(he(r))return!0}if(J(e.style)){for(let t of Object.values(e.style))if(he(t))return!0}if(J(e.attributes)){for(let t of Object.values(e.attributes))if(he(t))return!0}return!1}function $b(e){if(!J(e))return!1;if(e.$switch)return!0;if(lt(e)||af(e.children))return!0;for(let[t,r]of Object.entries(e)){if(Mn.has(t))continue;if(Je(r))return!0;if(he(r))return!0}if(J(e.style)){for(let t of Object.values(e.style))if(he(t))return!0}if(J(e.attributes)){for(let t of Object.values(e.attributes))if(he(t))return!0}return!1}function Ms(e,t=null,r={},n={}){let i=e?.state?Cs(e.state,t):t??vb();return{media:n,scope:i,scopeDefs:r}}function vb(e=null){return Object.create(e)}function wb(e){return e[xb]}function Kf(e,t){if(T(e)){for(let s of e.matchAll(_T))t.add(s[1]);for(let s of e.matchAll(PT))t.add(s[1]);return}if(Array.isArray(e)){for(let s of e)Kf(s,t);return}if(!J(e))return;let r=e,{operator:n,target:i}=r;if(T(n)&&Nn(n)&&Je(i)&&i.$ref.startsWith("#/state/"))t.add(i.$ref.slice(8).split("/")[0]);for(let s of Object.values(r))Kf(s,t)}function Cs(e={},t=null){let r=vb(t),n=t?wb(t):void 0,i=new Set(n);Object.defineProperty(r,xb,{configurable:!0,enumerable:!1,value:i,writable:!0});let s=new Set;for(let l of Object.values(e))if(xr(l)||$r(l))Kf(l.body??l.$expression,s);for(let l of s)if(l in e)i.add(l);for(let[l,u]of Object.entries(e)){if(!J(u)||Array.isArray(u)){Ln(r,l,Kc(u));continue}if("default"in u){Ln(r,l,Kc(u.default));continue}if(!u.$prototype&&!("$expression"in u)&&!ei(u))Ln(r,l,Kc(u))}let o=[],a=[];for(let[l,u]of Object.entries(e)){if(he(u)){o.push([l,u]);continue}if(!J(u))continue;if($r(u)){let d=u.$expression;if(Ni(u)){let h=u.parameters;Ln(r,l,(...m)=>{let y={};for(let[g,b]of h.entries()){let x=yb(b);if(!x)continue;y[x]=m[g]===void 0&&bb(b)?b.default:m[g]}return Er(d,r,null,{args:y})})}else if(Nn(d.operator))Ln(r,l,(h,m)=>Er(d,h,m));else Wf(r,l,()=>Er(d,r,null));continue}if(xr(u)){if(Zn(u)){let{body:d}=u;Ln(r,l,(h,m)=>{js(d,h??r,m??null)})}else if(T(u.body)){let d=u.parameters?Rn(u.parameters):u.arguments??[],{body:h}=u,m=d.includes("state")?d:["state",...d],y=Function(...m,h),g=(b,x)=>y(...m.map((_)=>_==="state"?b:x));if(Mi(h))Wf(r,l,()=>g(r)),a.push([l,h]);else Ln(r,l,g)}else Ln(r,l,()=>{}),i.add(l);continue}if(un(u)&&(u.$prototype==="LocalStorage"||u.$prototype==="SessionStorage")){Ln(r,l,Kc(u.default??null));continue}if(un(u)&&u.$prototype==="Request")i.add(l)}let c=!0;while(c){c=!1;for(let[l,u]of[...a,...o])if(!i.has(l)&&Sb(u,r))i.add(l),c=!0}for(let[l,u]of o)Wf(r,l,()=>It(u,r));return r}function Ln(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}function Wf(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:r})}function Be(e,t){if(Je(e))return Xf(e.$ref,t);if(he(e))return It(e,t);return e}function cr(e){return Je(e)}function Xf(e,t){if(!T(e))return e;if(e.startsWith("$map/")){let r=e.split("/"),n=r[1],s=t.$map?.[n]??t[`$map/${n}`];return r.length>2?zf(s,r.slice(2).join("/")):s}if(e.startsWith("#/state/"))return zf(t,e.slice(8));return zf(t,e)??null}function Sb(e,t){if(!t)return!1;let r=wb(t);for(let n of e.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(n[2])continue;let i=n[1];if(r?.has(i))return!0;let s;try{s=t[i]}catch{continue}if(Ot(s))return!0}return!1}function Zc(e){return Rs(e)?`(${e.slice(2,-1)})`:`\`${e}\``}function It(e,t){if(Sb(e,t))return null;let r=["state","$map","$site","$page"],n=[t,t?.$map,t?.$site,t?.$page];try{let i=Rs(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function(...r,i)(...n)}catch{return null}}function zf(e,t){return Et(e,t)}function Kc(e){if(!J(e))return e;return structuredClone(e)}function kT(e,t){if(!e||!t)return"";return Object.entries(e).filter(([r,n])=>!r.startsWith(":")&&!r.startsWith(".")&&!r.startsWith("&")&&!r.startsWith("[")&&!r.startsWith("@")&&he(n)).map(([r,n])=>{let i=Be(n,t);return i==null?null:`${ar(r)}: ${i}`}).filter(Boolean).join("; ")}function Xi(e,t,r=""){let n="",i=Be(e.id,t),s=Be(e.className,t),o=Be(e.hidden,t),a=Be(e.tabIndex,t),c=Be(e.title,t),l=Be(e.lang,t),u=Be(e.dir,t);if(i)n+=` id="${Se(String(i))}"`;if(s)n+=` class="${Se(String(s))}"`;if(o)n+=" hidden";if(a!==void 0&&a!==null)n+=` tabindex="${Se(String(a))}"`;if(c)n+=` title="${Se(String(c))}"`;if(l)n+=` lang="${Se(String(l))}"`;if(u)n+=` dir="${Se(String(u))}"`;let d=[kT(e.style,t),r].filter(Boolean).join("; ");if(d)n+=` style="${Se(d)}"`;if(e.attributes)for(let[h,m]of Object.entries(e.attributes)){let y=Be(m,t);if(Rt(y)){let g=Gi(h,y);if(g!==null)n+=g===""?` ${h}`:` ${h}="${Se(g)}"`;continue}if(T(y)||Ir(y))n+=` ${h}="${Se(String(y))}"`}if(e.$static)n+=" data-jx-static";else if(e.$prerendered)n+=" data-jx-prerendered";return n}function oa(e,t=" "){return e?"":`
78
+ ${t}`}function Ls(){let e=JSON.stringify(Bc),t=JSON.stringify(Vr);return`(function(){try{var s=localStorage.getItem(${e});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${t},s)}}catch(e){}})()`}function Gc(e,t,r,n){for(let i of _s(t,{mediaQueries:n,resolveValue:(s,o)=>Eb(s,o,r),scope:r}))e.push(i.text)}function Eb(e,t,r){let n=T(t)?t:t.$ref;return AT.push({property:e,selector:r,source:n}),null}function el(){return`const __jxEnumAttrs = new Set(${JSON.stringify(db())});
79
79
  function ${Ds}(n, v) {
80
80
  if (typeof v !== 'boolean') return v;
81
81
  const l = n.toLowerCase();
82
82
  if (l.startsWith('aria-') || __jxEnumAttrs.has(l)) return String(v);
83
83
  return v ? '' : null;
84
- }`}function _b(){let e=`new RegExp(${JSON.stringify(Wc.source)}, ${JSON.stringify(Wc.flags)})`,t=`Symbol.for(${JSON.stringify(Uf)})`,r=JSON.stringify(na),n=JSON.stringify(zc);return[`const __jxSlotWs = ${e};`,`const __jxSlotRec = globalThis[${t}] || (globalThis[${t}] = new WeakMap());`,`function ${Xf}(host) {`,` const id = host.getAttribute(${r});`," if (id === null) return Array.from(host.childNodes);",` host.removeAttribute(${r});`,` const open = ${n} + ' ' + id + ' ';`,` const close = '/' + ${n} + ' ' + id;`," const openers = [];"," const w = host.ownerDocument.createTreeWalker(host, 128);"," for (let n = w.nextNode(); n; n = w.nextNode()) if (n.data.startsWith(open)) openers.push(n);"," const out = [];"," for (const o of openers) {"," const name = decodeURIComponent(o.data.slice(open.length));"," for (let n = o.nextSibling; n; n = n.nextSibling) {"," if (n.nodeType === 8 && n.data === close) break;"," __jxSlotRec.set(n, name);"," out.push(n);"," }"," }"," return out;","}",`function ${Qf}(host, captured) {`," const slots = Array.from(host.querySelectorAll('slot'));"," if (slots.length === 0) return;"," const groups = new Map();"," for (const n of captured) {"," if (n.nodeType === 3 && __jxSlotWs.test(n.data)) continue;"," const r = __jxSlotRec.get(n);"," __jxSlotRec.delete(n);"," const name = r !== undefined ? r : n.nodeType === 1 ? n.getAttribute('slot') || '' : '';"," let g = groups.get(name);"," if (!g) { g = []; groups.set(name, g); }"," g.push(n);"," }"," const taken = new Set();"," for (const slot of slots) {"," const name = slot.getAttribute('name') || '';"," let g = [];"," if (!taken.has(name)) { taken.add(name); g = groups.get(name) || []; }"," const content = g.some((n) => n.nodeType === 1 || (n.nodeType === 3 && n.data !== ''));"," const placed = content ? g : g.concat(Array.from(slot.childNodes));"," const p = slot.parentElement;"," if (p && p !== host && p.localName.includes('-')) {"," const r = __jxSlotRec.get(slot);"," const f = r !== undefined ? r : slot.getAttribute('slot') || '';"," for (const n of placed) __jxSlotRec.set(n, f);"," }"," slot.replaceWith(...placed);"," }","}"].join(`
85
- `)}function ci(e){for(let t of Zf(e)){if(lt(t)){if(t.map&&ci([t.map]))return!0;continue}if(!ir(t))continue;if(t.tagName==="slot")return!0;let r=Object.values(t.cases??{}).filter((n)=>ir(n)&&!cr(n));if(ci(r)||ci(t.children))return!0}return!1}function Zf(e){if(lt(e))return[e];if(!Array.isArray(e))return[];return e}function Fs(e,t={},r=null){let n=[],i=pb(J(r)?r:{},t,(o)=>o,Eb);if(i!=="")n.push(i);if(li(e,n,t,"",{n:0}),n.length===0)return"";return`<style>
84
+ }`}function _b(){let e=`new RegExp(${JSON.stringify(Wc.source)}, ${JSON.stringify(Wc.flags)})`,t=`Symbol.for(${JSON.stringify(Vf)})`,r=JSON.stringify(na),n=JSON.stringify(zc);return[`const __jxSlotWs = ${e};`,`const __jxSlotRec = globalThis[${t}] || (globalThis[${t}] = new WeakMap());`,`function ${Qf}(host) {`,` const id = host.getAttribute(${r});`," if (id === null) return Array.from(host.childNodes);",` host.removeAttribute(${r});`,` const open = ${n} + ' ' + id + ' ';`,` const close = '/' + ${n} + ' ' + id;`," const openers = [];"," const w = host.ownerDocument.createTreeWalker(host, 128);"," for (let n = w.nextNode(); n; n = w.nextNode()) if (n.data.startsWith(open)) openers.push(n);"," const out = [];"," for (const o of openers) {"," const name = decodeURIComponent(o.data.slice(open.length));"," for (let n = o.nextSibling; n; n = n.nextSibling) {"," if (n.nodeType === 8 && n.data === close) break;"," __jxSlotRec.set(n, name);"," out.push(n);"," }"," }"," return out;","}",`function ${Zf}(host, captured) {`," const slots = Array.from(host.querySelectorAll('slot'));"," if (slots.length === 0) return;"," const groups = new Map();"," for (const n of captured) {"," if (n.nodeType === 3 && __jxSlotWs.test(n.data)) continue;"," const r = __jxSlotRec.get(n);"," __jxSlotRec.delete(n);"," const name = r !== undefined ? r : n.nodeType === 1 ? n.getAttribute('slot') || '' : '';"," let g = groups.get(name);"," if (!g) { g = []; groups.set(name, g); }"," g.push(n);"," }"," const taken = new Set();"," for (const slot of slots) {"," const name = slot.getAttribute('name') || '';"," let g = [];"," if (!taken.has(name)) { taken.add(name); g = groups.get(name) || []; }"," const content = g.some((n) => n.nodeType === 1 || (n.nodeType === 3 && n.data !== ''));"," const placed = content ? g : g.concat(Array.from(slot.childNodes));"," const p = slot.parentElement;"," if (p && p !== host && p.localName.includes('-')) {"," const r = __jxSlotRec.get(slot);"," const f = r !== undefined ? r : slot.getAttribute('slot') || '';"," for (const n of placed) __jxSlotRec.set(n, f);"," }"," slot.replaceWith(...placed);"," }","}"].join(`
85
+ `)}function ci(e){for(let t of ed(e)){if(lt(t)){if(t.map&&ci([t.map]))return!0;continue}if(!ir(t))continue;if(t.tagName==="slot")return!0;let r=Object.values(t.cases??{}).filter((n)=>ir(n)&&!cr(n));if(ci(r)||ci(t.children))return!0}return!1}function ed(e){if(lt(e))return[e];if(!Array.isArray(e))return[];return e}function Fs(e,t={},r=null){let n=[],i=pb(J(r)?r:{},t,(o)=>o,Eb);if(i!=="")n.push(i);if(li(e,n,t,"",{n:0}),n.length===0)return"";return`<style>
86
86
  ${tl(n.join(`
87
87
  `))}
88
- </style>`}function tl(e){return e.replaceAll(/<\/(?=style)/gi,String.raw`<\/`)}function li(e,t,r,n="",i,s="jx"){let o=i??{n:0};if(!J(e))return;if(e.style&&!e.id&&!e.className)e.className=`${s}-${o.n}`,o.n+=1;let a=$s(e.tagName).join(", ")||"*",c=e.id?`#${e.id}`:e.className?`.${e.className.split(" ")[0]}`:a;if(e.style)Gc(t,e.style,c,r);if(Array.isArray(e.children))for(let l of e.children)li(l,t,r,c,o,s);if(J(e.cases))for(let l of Object.values(e.cases))li(l,t,r,c,o,s)}function Se(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function rl(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function nl(e){let t=new Map;return Pb(e,t),[...t.values()]}function Pb(e,t){if(!J(e))return;if(e.state){for(let[r,n]of Object.entries(e.state))if(sf(n))t.set(n.$export,{exportName:n.$export,key:r,src:n.$src})}if(Array.isArray(e.children))for(let r of e.children)Pb(r,t)}function td(e,t){if(T(e))return e;let r=$s(e);if(r.length===0)return"div";if(!fn(e))return r[0];let n=e.$expression,i=n.target;if(n.operator==="?:")return Be(i,t)?n.value:n.initial;let s=Be(i,t);return n.cases[String(s)]??n.default}function rd(e){if(!e?.slotIds)return null;return e.slotIds.n+=1,e.slotIds.n}function nd(e,t,r,n=null){let i=new Map;for(let s of Zf(e)){let o="",a=!0,c;if(T(s)||Ir(s)||Rt(s)){if(c=r(s),Wc.test(c))continue;a=c!==""}else if(lt(s))c="";else if(!ir(s))c=r(s),a=c!=="";else{let u=Be(s.attributes?.slot,t),d=T(s.slot)?Be(s.slot,t):null;if(T(u)&&u!=="")o=u,c=r(s);else if(T(d)&&d!==""){o=d;let{slot:h,...m}=s;c=r({...m,attributes:{...m.attributes,slot:d}})}else c=r(s)}let l=i.get(o);if(l)l.html=l.html===""?c:`${l.html}
89
- ${c}`,l.content||=a;else i.set(o,{content:a,html:c})}return{groups:i,id:n,taken:new Set}}function kb(e,t,r){for(let n of Zf(e)){if(lt(n)||!ir(n))continue;if(n.tagName==="slot"){let i=Be(n.attributes?.name,t);r.taken.add(T(i)?i:"")}kb(n.children,t,r)}}function id(e){let t=null,r={};for(let[n,i]of Object.entries(e??{}))if(n.startsWith("props.")&&n.length>6)t??={},t[n.slice(6)]=i;else r[n]=i;return{lifted:t,rest:r}}function il(e,t){if(!t)return Cs(e.state??{},null);let r={...e.state};for(let[n,i]of Object.entries(t)){let s=r[n];r[n]=J(s)&&!Array.isArray(s)&&"default"in s?{...s,default:i}:i}return Cs(r,null)}function sd(e,t){return Object.fromEntries(Object.entries(e??{}).flatMap(([r,n])=>{if(!he(n))return[];let i=Be(n,t);return i==null?[]:[[r,i]]}))}function ia(e,t,r,n){if(e.textContent!==void 0){let i=Be(e.textContent,t);return i!=null?Se(String(i)):""}if(e.innerHTML){let i=Be(e.innerHTML,t);return i!=null?String(i):e.innerHTML}if(Array.isArray(e.children))return e.children.map((i)=>Is(i,t,r,n)).join(`
88
+ </style>`}function tl(e){return e.replaceAll(/<\/(?=style)/gi,String.raw`<\/`)}function li(e,t,r,n="",i,s="jx"){let o=i??{n:0};if(!J(e))return;if(e.style&&!e.id&&!e.className)e.className=`${s}-${o.n}`,o.n+=1;let a=$s(e.tagName).join(", ")||"*",c=e.id?`#${e.id}`:e.className?`.${e.className.split(" ")[0]}`:a;if(e.style)Gc(t,e.style,c,r);if(Array.isArray(e.children))for(let l of e.children)li(l,t,r,c,o,s);if(J(e.cases))for(let l of Object.values(e.cases))li(l,t,r,c,o,s)}function Se(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function rl(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function nl(e){let t=new Map;return Pb(e,t),[...t.values()]}function Pb(e,t){if(!J(e))return;if(e.state){for(let[r,n]of Object.entries(e.state))if(of(n))t.set(n.$export,{exportName:n.$export,key:r,src:n.$src})}if(Array.isArray(e.children))for(let r of e.children)Pb(r,t)}function rd(e,t){if(T(e))return e;let r=$s(e);if(r.length===0)return"div";if(!fn(e))return r[0];let n=e.$expression,i=n.target;if(n.operator==="?:")return Be(i,t)?n.value:n.initial;let s=Be(i,t);return n.cases[String(s)]??n.default}function nd(e){if(!e?.slotIds)return null;return e.slotIds.n+=1,e.slotIds.n}function id(e,t,r,n=null){let i=new Map;for(let s of ed(e)){let o="",a=!0,c;if(T(s)||Ir(s)||Rt(s)){if(c=r(s),Wc.test(c))continue;a=c!==""}else if(lt(s))c="";else if(!ir(s))c=r(s),a=c!=="";else{let u=Be(s.attributes?.slot,t),d=T(s.slot)?Be(s.slot,t):null;if(T(u)&&u!=="")o=u,c=r(s);else if(T(d)&&d!==""){o=d;let{slot:h,...m}=s;c=r({...m,attributes:{...m.attributes,slot:d}})}else c=r(s)}let l=i.get(o);if(l)l.html=l.html===""?c:`${l.html}
89
+ ${c}`,l.content||=a;else i.set(o,{content:a,html:c})}return{groups:i,id:n,taken:new Set}}function kb(e,t,r){for(let n of ed(e)){if(lt(n)||!ir(n))continue;if(n.tagName==="slot"){let i=Be(n.attributes?.name,t);r.taken.add(T(i)?i:"")}kb(n.children,t,r)}}function sd(e){let t=null,r={};for(let[n,i]of Object.entries(e??{}))if(n.startsWith("props.")&&n.length>6)t??={},t[n.slice(6)]=i;else r[n]=i;return{lifted:t,rest:r}}function il(e,t){if(!t)return Cs(e.state??{},null);let r={...e.state};for(let[n,i]of Object.entries(t)){let s=r[n];r[n]=J(s)&&!Array.isArray(s)&&"default"in s?{...s,default:i}:i}return Cs(r,null)}function od(e,t){return Object.fromEntries(Object.entries(e??{}).flatMap(([r,n])=>{if(!he(n))return[];let i=Be(n,t);return i==null?[]:[[r,i]]}))}function ia(e,t,r,n){if(e.textContent!==void 0){let i=Be(e.textContent,t);return i!=null?Se(String(i)):""}if(e.innerHTML){let i=Be(e.innerHTML,t);return i!=null?String(i):e.innerHTML}if(Array.isArray(e.children))return e.children.map((i)=>Is(i,t,r,n)).join(`
90
90
  `);return""}function Is(e,t,r=null,n=null){if(T(e)){if(he(e)&&t){let a=It(e,t);return a!=null?Se(String(a)):Se(e)}return Se(e)}if(Ir(e)||Rt(e))return Se(String(e));if(Array.isArray(e))return e.map((a)=>Is(a,t,r,n)).join(`
91
- `);if(!J(e))return"";if(e.$prototype==="Array")return"";if(e.$switch){let a=e.tagName??"div",c=Xi(e,t),l=Be(e.$switch,t),u=l==null?void 0:e.cases?.[String(l)],d=u!==void 0&&!cr(u)?Is(u,t,r,n):"";return`<${a}${c}>${d}</${a}>`}let i=td(e.tagName,t);if(i==="slot"&&r){let a=Be(e.attributes?.name,t),c=T(a)?a:"",l;if(!r.taken.has(c))r.taken.add(c),l=r.groups.get(c);let u=l?.html??"";if(u!==""&&r.id!==null)u=`<!--${zc} ${r.id} ${encodeURIComponent(c)}-->${u}<!--/${zc} ${r.id}-->`;if(l?.content)return kb(e.children,t,r),u;let d=ia(e,t,r,n);return u===""?d:d===""?u:`${u}
92
- ${d}`}let s=n?.componentDefs.get(i);if(s&&n)return PT(e,s,t,r,n);let o=Xi(e,t);if(ed.has(i))return`<${i}${o}>`;return`<${i}${o}>${ia(e,t,r,n)}</${i}>`}function PT(e,t,r,n,i){let s=t.tagName,{lifted:o,rest:a}=id(e.attributes),c={...o,...e.$props},l={};for(let[j,D]of Object.entries(c))l[j]=Be(D,r)??D;let u=Object.keys(l).length>0,d=i.path??[],h={key:JSON.stringify(l),tag:s},m=[...d.map((j)=>j.tag),s].join(" → ");if(d.some((j)=>j.tag===h.tag&&j.key===h.key))throw Error(`Component <${s}> renders itself: ${m}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(d.length>=Hf)throw Error(`Component nesting exceeds ${Hf} levels: ${m}. A component that renders itself with changing props needs a case that stops.`);let y={...i,path:[...d,h]},{children:g}=e,b=(j)=>Is(j,r,n,i),x=Yi(t,i.defaults),_=sl(t),k=il(t,u?l:null),E,w=null;if(x){let j=Array.isArray(g)?g.map((D)=>b(D)).join(`
93
- `):"";E=`<template shadowrootmode="${x}"><link rel="stylesheet" href="/components/${s}.css">${ia(t,k,null,y)}</template>${j}`}else{w=!_&&ci(t.children)?rd(i):null;let j=nd(g,r,b,w);E=ia(t,k,j,y)}let P=Object.entries(sd(t.style,k)).map(([j,D])=>`${ar(j)}: ${D}`).join("; "),R={...e};if(delete R.$props,delete R.children,R.attributes=!_&&u?{...a,"data-jx-props":JSON.stringify(l)}:a,w!==null)R.attributes={...R.attributes,[na]:String(w)};if(_)R.$static=!0;else R.$prerendered=!0;return`<${s}${Xi(R,r,P)}>${E}</${s}>`}function Ab(e,t=null,r=null,n=null){return ia(e,il(e,t),r,n)}function sl(e){return Kf(e)}function Kf(e){if(!J(e))return!0;if(Array.isArray(e))return e.every((t)=>Kf(t));if(e.$prototype)return!1;if(e.$ref)return!1;if(e.state)for(let t of Object.values(e.state)){if(!J(t)||Array.isArray(t))continue;if(t.$prototype)return!1;if(t.$ref)return!1}for(let t of Object.keys(e))if(t.startsWith("on")&&t!=="observedAttributes")return!1;if(Array.isArray(e.children))return e.children.every((t)=>Kf(t));if(lt(e.children))return!1;return!0}function AT(e,t){return Zo(e).map((r)=>jT(r,t)).join(", ")}function jT(e,t){if(e.startsWith("&"))return e.replaceAll("&",t);if(e.startsWith(":host")){let r=/^:host\((.*)\)$/.exec(e)?.[1];if(t===":host")return e;return r===void 0?t:`${t}${r}`}if(t===":host"&&kT.test(e))return e;return`${t}${e}`}function jb(e,t,r=null,n={},i=null){let s=[],o=gb(e,i);if(J(t)){let a={},c=[];for(let[l,u]of Object.entries(t))if(Je(u))a[l]=u;else if(J(u)&&!Array.isArray(u))c.push([l,u]);else if(!l.startsWith("@")&&!oi(l))a[l]=u;Gc(s,a,o,n);for(let[l,u]of c)if(l.startsWith("@"))Gc(s,{[l]:u},o,n);else if(oi(l))Gc(s,u,AT(l,o),n)}if(r&&Array.isArray(r.children)){let a={n:0};for(let c of r.children)li(c,s,n,"",a,e)}return s.length>0?`${s.join(`
91
+ `);if(!J(e))return"";if(e.$prototype==="Array")return"";if(e.$switch){let a=e.tagName??"div",c=Xi(e,t),l=Be(e.$switch,t),u=l==null?void 0:e.cases?.[String(l)],d=u!==void 0&&!cr(u)?Is(u,t,r,n):"";return`<${a}${c}>${d}</${a}>`}let i=rd(e.tagName,t);if(i==="slot"&&r){let a=Be(e.attributes?.name,t),c=T(a)?a:"",l;if(!r.taken.has(c))r.taken.add(c),l=r.groups.get(c);let u=l?.html??"";if(u!==""&&r.id!==null)u=`<!--${zc} ${r.id} ${encodeURIComponent(c)}-->${u}<!--/${zc} ${r.id}-->`;if(l?.content)return kb(e.children,t,r),u;let d=ia(e,t,r,n);return u===""?d:d===""?u:`${u}
92
+ ${d}`}let s=n?.componentDefs.get(i);if(s&&n)return jT(e,s,t,r,n);let o=Xi(e,t);if(td.has(i))return`<${i}${o}>`;return`<${i}${o}>${ia(e,t,r,n)}</${i}>`}function jT(e,t,r,n,i){let s=t.tagName,{lifted:o,rest:a}=sd(e.attributes),c={...o,...e.$props},l={};for(let[j,D]of Object.entries(c))l[j]=Be(D,r)??D;let u=Object.keys(l).length>0,d=i.path??[],h={key:JSON.stringify(l),tag:s},m=[...d.map((j)=>j.tag),s].join(" → ");if(d.some((j)=>j.tag===h.tag&&j.key===h.key))throw Error(`Component <${s}> renders itself: ${m}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(d.length>=Uf)throw Error(`Component nesting exceeds ${Uf} levels: ${m}. A component that renders itself with changing props needs a case that stops.`);let y={...i,path:[...d,h]},{children:g}=e,b=(j)=>Is(j,r,n,i),x=Yi(t,i.defaults),_=sl(t),P=il(t,u?l:null),E,w=null;if(x){let j=Array.isArray(g)?g.map((D)=>b(D)).join(`
93
+ `):"";E=`<template shadowrootmode="${x}"><link rel="stylesheet" href="/components/${s}.css">${ia(t,P,null,y)}</template>${j}`}else{w=!_&&ci(t.children)?nd(i):null;let j=id(g,r,b,w);E=ia(t,P,j,y)}let k=Object.entries(od(t.style,P)).map(([j,D])=>`${ar(j)}: ${D}`).join("; "),R={...e};if(delete R.$props,delete R.children,R.attributes=!_&&u?{...a,"data-jx-props":JSON.stringify(l)}:a,w!==null)R.attributes={...R.attributes,[na]:String(w)};if(_)R.$static=!0;else R.$prerendered=!0;return`<${s}${Xi(R,r,k)}>${E}</${s}>`}function Ab(e,t=null,r=null,n=null){return ia(e,il(e,t),r,n)}function sl(e){return Gf(e)}function Gf(e){if(!J(e))return!0;if(Array.isArray(e))return e.every((t)=>Gf(t));if(e.$prototype)return!1;if(e.$ref)return!1;if(e.state)for(let t of Object.values(e.state)){if(!J(t)||Array.isArray(t))continue;if(t.$prototype)return!1;if(t.$ref)return!1}for(let t of Object.keys(e))if(t.startsWith("on")&&t!=="observedAttributes")return!1;if(Array.isArray(e.children))return e.children.every((t)=>Gf(t));if(lt(e.children))return!1;return!0}function OT(e,t){return Zo(e).map((r)=>CT(r,t)).join(", ")}function CT(e,t){if(e.startsWith("&"))return e.replaceAll("&",t);if(e.startsWith(":host")){let r=/^:host\((.*)\)$/.exec(e)?.[1];if(t===":host")return e;return r===void 0?t:`${t}${r}`}if(t===":host"&&RT.test(e))return e;return`${t}${e}`}function jb(e,t,r=null,n={},i=null){let s=[],o=gb(e,i);if(J(t)){let a={},c=[];for(let[l,u]of Object.entries(t))if(Je(u))a[l]=u;else if(J(u)&&!Array.isArray(u))c.push([l,u]);else if(!l.startsWith("@")&&!oi(l))a[l]=u;Gc(s,a,o,n);for(let[l,u]of c)if(l.startsWith("@"))Gc(s,{[l]:u},o,n);else if(oi(l))Gc(s,u,OT(l,o),n)}if(r&&Array.isArray(r.children)){let a={n:0};for(let c of r.children)li(c,s,n,"",a,e)}return s.length>0?`${s.join(`
94
94
  `)}
95
- `:""}var xb,Ts="https://esm.sh/@vue/reactivity@3.5.40",Ns="https://esm.sh/lit-html@3.3.0",wT,ST,ui,_T,Ds="__jxAttrText",Xf="__jxCaptureSlotted",Qf="__jxDistributeSlots",Js="<!---->",ed,kT;var mn=L(()=>{Os();ra();Vc();mb();Ee();ks();Os();ra();Vc();Ee();xb=Symbol("jx.runtimeOnlyStateKeys");wT=/\bstate\.([A-Za-z_$][\w$]*)\s*(?:\+\+|--|(?:\*\*|\|\||&&|\?\?|<<|>>>|>>|[-+*/%&|^])?=(?!=))/g,ST=/\bstate\.([A-Za-z_$][\w$]*)\s*\.\s*(?:push|pop|shift|unshift|splice|sort|reverse|fill|copyWithin)\s*\(/g;ui=new Set(["pre","textarea","listing","plaintext","xmp"]);_T=[];ed=new Set(["input","br","hr","img","meta","link","area","col","source"]);kT=/^(?:::slotted\(|::part\()/});import{relative as RT,sep as OT}from"node:path";function aa(e){return e===CT}function qs(e,t){if(e==="/")return"/";if(t==="always")return e.endsWith("/")?e:`${e}/`;if(t==="never")return e.replace(/\/+$/,"")||"/";return e}function ol(e,t){let r=new RegExp(`\\s${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s"'>]+))`,"i").exec(e);return r===null?null:r[1]??r[2]??r[3]??""}function Rb(e){let t=e.search(/<\/head\s*>/i),r=t===-1?e:e.slice(0,t);for(let[n]of r.matchAll(/<meta\b[^>]*>/gi)){if(ol(n,"name")?.trim().toLowerCase()!=="robots")continue;let i=new Set((ol(n,"content")??"").toLowerCase().split(",").map((s)=>s.trim()));if(i.has("noindex")||i.has("none"))return!0}return!1}function Ob(e){let t=e.search(/<\/head\s*>/i);return{end:t,head:t===-1?e:e.slice(0,t)}}function IT(e,t){let r=t.trim().toLowerCase();for(let[n]of Ob(e).head.matchAll(/<link\b[^>]*>/gi)){let i=(ol(n,"rel")??"").toLowerCase().split(/\s+/),s=(ol(n,"type")??"").split(";")[0]?.trim().toLowerCase();if(i.includes("alternate")&&s===r)return!0}return!1}function Cb(e,t){let{end:r}=Ob(e);if(r===-1||IT(e,t.type))return e;let n=`<link href="${Se(t.href)}" rel="alternate" type="${Se(t.type)}">`;return`${e.slice(0,r)}${n}
96
- ${e.slice(r)}`}function Ib(e,t){return new URL(`/${RT(e,t).split(OT).join("/")}`,"http://localhost").pathname}var CT="/404";var od=L(()=>{mn()});function Tb(e,t){if(t===null||t.routing!=="prefix-always")return[];let r=[];for(let n of e){if(n.urlPattern==="/")continue;let i=n.urlPattern.split("/").find(Boolean),s=Mr(i);if(s===null||!t.locales.includes(s))r.push(n.urlPattern)}return r}function Nb(e,t){if(t===null)return null;let r=e.split("/").find(Boolean),n=Mr(r);if(r===void 0||n===null||t.locales.includes(n))return null;let i=t.locales.find((s)=>s!==n&&s.split("-")[0]===n.split("-")[0]);return i===void 0?null:{meant:i,segment:r}}function TT(e,t){let r=e.split("/").filter(Boolean),n=Mr(r[0]);if(t!==null&&n!==null&&t.locales.includes(n))return r.slice(1).join("/");return r.join("/")}function ad(e,t){let r=new Map,n=[];if(t===null)return{conflicts:n,sets:r};let i=new Map,s=new Set;for(let o of e){let a=o.translationKey===void 0?TT(o.urlPattern,t):o.translationKey.replaceAll(/^\/+|\/+$/g,"");if(o.translationKey!==void 0)s.add(o.urlPattern);let c=dn(o.urlPattern,t);if(c===null)continue;let l=i.get(a)??[],u=l.find((d)=>d.locale===c);if(u===void 0)l.push({locale:c,urlPattern:o.urlPattern});else n.push({declared:s.has(u.urlPattern)||o.translationKey!==void 0,key:a,locale:c,urlPatterns:[u.urlPattern,o.urlPattern]});i.set(a,l)}for(let o of i.values()){let a=o.toSorted((c,l)=>c.locale===l.locale?0:c.locale<l.locale?-1:1);for(let c of o)r.set(c.urlPattern,a)}return{conflicts:n,sets:r}}function Mb(e,t,r,n){let i=new Map;if(t===null||r==="")return i;let s=new Map;for(let[o,a]of ad(e,t).sets){if(a.length<2)continue;let c=s.get(a);if(c===void 0){c=a.map((u)=>({href:ii(qs(u.urlPattern,n),r),hreflang:u.locale}));let l=a.find((u)=>u.locale===t.defaultLocale);if(l!==void 0)c.push({href:ii(qs(l.urlPattern,n),r),hreflang:"x-default"});s.set(a,c)}i.set(o,c)}return i}function Lb({pageLang:e,pageDir:t,routeLocale:r,defaults:n}){let i=e??r??n?.lang??"en",s=t??n?.dir;if(s!==void 0)return{dir:s,lang:i};return Xo(i)==="rtl"?{dir:"rtl",lang:i}:{lang:i}}var cd=L(()=>{wr();zi();od();zi();zi()});import{readFileSync as ld,readdirSync as NT}from"node:fs";import{extname as Db,join as MT,relative as LT,resolve as DT}from"node:path";async function Qi(e,t){let r=ld(e,"utf8");if(e.endsWith(".json"))return ti(r,e);let n=Db(e).toLowerCase(),i=t?.byExtension(n,"parse");if(!i)throw Error(`No format class registered for "${n}" (${e}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await i.parseDocument(r)}async function Jb(e,t){let r=new Map,n=new Map;for(let i of e){if(!n.has(i.sourcePath))n.set(i.sourcePath,await FT(i.sourcePath,t));let s=n.get(i.sourcePath);if(s!==null&&s!==void 0)r.set(i.urlPattern,JT(s,i._pathParams))}return r}function JT(e,t){if(!e.includes("${"))return e;return e.replaceAll(/\$\{(\w+)\}/g,(r,n)=>t?.[n]??r)}async function FT(e,t){if(!ld(e,"utf8").includes("$translationKey"))return null;let r;try{r=await Qi(e,t)}catch{return null}return T(r.$translationKey)&&r.$translationKey!==""?r.$translationKey:null}async function Fb(e,t){let r=[],n=new Set([".json",...t?.documentExtensions("page")??[]]);return await qb(e,e,r,n,t),r.sort(Uy),r}async function qb(e,t,r,n,i){let s=NT(e,{withFileTypes:!0});for(let o of s){let a=MT(e,o.name);if(o.isDirectory()){if(o.name.startsWith("_"))continue;await qb(a,t,r,n,i);continue}let c=Db(o.name).toLowerCase();if(!n.has(c))continue;if(o.name.startsWith("_"))continue;let l=LT(t,a);r.push(await qT(l,a,i))}}async function qT(e,t,r){let{isCatchAll:n,isDynamic:i,params:s,urlPattern:o}=Hy(e),a=null;try{let l=(await Qi(t,r)).$layout;if(T(l))a=l}catch{}return{$layout:a,isCatchAll:n,isDynamic:i,params:s,relativePath:e,sourcePath:t,urlPattern:o}}function BT(e){let t=e[Bb];if(!ee(t))return null;let{mtime:r}=t;return T(r)&&r!==""?r:null}function HT(e){if(e.includes("\x00"))return"has a NUL character";for(let t of e.split("/")){if(t==="."||t==="..")return'has a "." or ".." segment';if(t.includes("\\"))return"has a backslash"}return null}async function Hb(e,t,r={},n,i,s){let o=[],a=e.flatMap((c)=>c.isDynamic?[c.urlPattern]:[]);for(let c of e){if(!c.isDynamic){o.push(c);continue}let l;try{l=await Qi(c.sourcePath,n?.formats)}catch{o.push(c);continue}if(!l.$paths){console.warn(`Warning: dynamic route ${c.urlPattern} has no $paths — skipping`);continue}let u=await UT(l.$paths,t,r,n,i,dn(c.urlPattern,s??null),c,a);for(let d of u){let h=c.urlPattern,m={};for(let[x,_]of Object.entries(d)){if(x===Bb)continue;m[x]=String(_),h=h.replace(`:${x}`,m[x]),h=h.replace("*",m[x])}let y=HT(h);if(y!==null){console.warn(`Warning: $paths for ${c.urlPattern} produced "${h}", which ${y}; skipping it`);continue}let g=BT(d),b={...c,_pathParams:m,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:h};if(g!==null)b.sourceMtime=g;o.push(b)}}return o}async function UT(e,t,r,n,i,s,o,a){if(Array.isArray(e))return e;if("values"in e&&Array.isArray(e.values)){let c=T(e.param)?e.param:"value";return e.values.map((l)=>({[c]:l}))}if("$ref"in e&&T(e.$ref)&&e.$ref){let c=e.$ref,l=DT(t,c),u;try{u=JSON.parse(ld(l,"utf8"))}catch(m){return console.warn(`Warning: $paths.$ref could not load "${c}": ${Pe(m)}`),[]}if(!Array.isArray(u))return console.warn(`Warning: $paths.$ref "${c}" must be a JSON array`),[];let d=T(e.param)?e.param:"id",h=T(e.field)?e.field:"id";return u.map((m)=>{if(m===null)throw TypeError(`$paths.$ref "${c}" contains a null entry`);return{[d]:(ee(m)?m[h]??m.id:void 0)??String(m)}})}for(let c of Object.keys(e)){let l=n?.byPathsDiscriminator(c);if(!l?.project)continue;let u={data:r[l.project.key],locale:s,projectConfig:i,root:t};if(o!==void 0)u.params=o.params,u.urlPattern=o.urlPattern;if(a!==void 0)u.patterns=a;return await l.call("resolvePaths",e,u)}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var Bb="_meta";var Ub=L(()=>{Ee();vr();Vy();cd()});import{createHash as VT}from"node:crypto";function Vb(){return{fontOrigins:new Set,frameOrigins:new Set,imgOrigins:new Set,scriptHashes:new Set,scriptOrigins:new Set,styleOrigins:new Set}}function Zi(e,t){let r=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return r?.[2]??r?.[3]}function ud(e){if(e===void 0||!/^https?:\/\//i.test(e))return null;try{return new URL(e).origin}catch{return null}}function ZT(e){return`'sha256-${VT("sha256").update(e,"utf8").digest("base64")}'`}function Wb(e,t){for(let r of e.matchAll(zT)){let n=r[1]??"",i=Zi(n,"src"),s=(Zi(n,"type")??"").trim().toLowerCase();if(i!==void 0){let o=ud(i);if(o)t.scriptOrigins.add(o);continue}if(WT.has(s))t.scriptHashes.add(ZT(r[2]??""))}for(let r of e.matchAll(KT)){let n=r[1]??"",i=(Zi(n,"rel")??"").toLowerCase(),s=Zi(n,"href"),o=ud(s);if(!o)continue;if(i.includes("stylesheet"))t.styleOrigins.add(o);if(QT.test(s??"")||(Zi(n,"as")??"")==="font")t.fontOrigins.add(o)}for(let[r,n]of[[GT,t.imgOrigins],[YT,t.imgOrigins],[XT,t.frameOrigins]])for(let i of e.matchAll(r)){let s=i[1]??"";for(let o of[Zi(s,"src"),...eN(Zi(s,"srcset"))]){let a=ud(o);if(a)n.add(a)}}}function eN(e){return e===void 0?[]:e.split(",").map((t)=>t.trim().split(/\s+/)[0]??"").filter(Boolean)}function zb(e){let t=e?.csp;if(t===void 0||t===!1)return null;if(t===!0)return{};if(t==="report-only")return{mode:"report-only"};return t}function Kb(e,t){let r=(o,a)=>[...o,...a].join(" "),n={"base-uri":"'self'","default-src":"'self'","font-src":r(["'self'"],e.fontOrigins),"form-action":"'self'","frame-ancestors":"'self'","frame-src":r(["'self'"],e.frameOrigins),"img-src":r(["'self'","data:"],e.imgOrigins),"object-src":"'none'","script-src":r(["'self'",...[...e.scriptHashes].toSorted()],e.scriptOrigins),"style-src":r(["'self'","'unsafe-inline'"],e.styleOrigins)};if(t.reportUri!==void 0&&t.reportUri!=="")n["report-to"]="csp-endpoint",n["report-uri"]=t.reportUri;for(let[o,a]of Object.entries(t.directives??{}))n[o]=a;let i=Object.entries(n).filter(([,o])=>o!==!1&&o!=="").toSorted(([o],[a])=>o<a?-1:1).map(([o,a])=>`${o} ${String(a)}`).join("; "),s=t.mode==="report-only"?{"Content-Security-Policy-Report-Only":i}:{"Content-Security-Policy":i};if(t.reportUri!==void 0&&t.reportUri!=="")s["Reporting-Endpoints"]=`csp-endpoint="${t.reportUri}"`;return s}var WT,zT,KT,GT,YT,XT,QT;var fd=L(()=>{WT=new Set(["","module","importmap","text/javascript","module-shim"]),zT=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,KT=/<link\b([^>]*)>/gi,GT=/<img\b([^>]*)>/gi,YT=/<source\b([^>]*)>/gi,XT=/<iframe\b([^>]*)>/gi,QT=/\.(woff2?|ttf|otf|eot)(\?|#|$)/i});import{existsSync as al,readFileSync as tN,writeFileSync as Yb}from"node:fs";import{join as cl}from"node:path";function Xb(e,t){let r=e?.headers??{},n=[];if(r.enabled===!1)return{errors:n,rules:[]};let i=r.security??{},s={};if(i.contentTypeOptions!==!1)s["X-Content-Type-Options"]="nosniff";if(i.referrerPolicy!==!1)s["Referrer-Policy"]=i.referrerPolicy??"strict-origin-when-cross-origin";if(i.permissionsPolicy!==!1)s["Permissions-Policy"]=i.permissionsPolicy??"camera=(), microphone=(), geolocation=()";if(i.frameOptions!==!1)s["X-Frame-Options"]=i.frameOptions??"SAMEORIGIN";let{hsts:o}=i;if(o){let u=o===!0?{}:o,d=u.maxAge??Gb,h=u.includeSubDomains??!0,m=u.preload??!1;if(m&&!h)n.push("build.headers.security.hsts: `preload` requires `includeSubDomains` — the preload list "+"will not accept the header without it.");else s["Strict-Transport-Security"]=[`max-age=${d}`,h?"includeSubDomains":null,m?"preload":null].filter(Boolean).join("; ")}let a=zb(i);if(a)if(t===void 0)n.push("build.headers.security.csp is set, but no page was scanned for inline scripts — the "+"policy would block every one of them.");else Object.assign(s,Kb(t,a));let c=r.cache??"auto";if(c==="auto")s["Cache-Control"]="public, max-age=0, must-revalidate";let l=[];if(Object.keys(s).length>0)l.push({headers:s,pattern:"/*"});if(c==="auto")l.push({headers:{"Cache-Control":`public, max-age=${Gb}, immutable`},pattern:rN});for(let[u,d]of Object.entries(r.rules??{}))l.push({headers:d,pattern:u});return{errors:n,rules:l}}function Qb(e){let t=[["feed.xml","application/atom+xml; charset=utf-8"],["feed.json","application/feed+json; charset=utf-8"],["manifest.webmanifest","application/manifest+json; charset=utf-8"],[".well-known/security.txt","text/plain; charset=utf-8"]],r=[];for(let[n,i]of t)if(al(cl(e,n)))r.push({headers:{"Content-Type":i},pattern:`/${n}`});if(al(cl(e,"feed","archive")))r.push({headers:{"Content-Type":"application/atom+xml; charset=utf-8"},pattern:"/feed/archive/*"});return r}function Zb(e,t){if(t==="")return[...e];return e.map((r)=>({headers:r.headers,pattern:ze(t,r.pattern)}))}function sN(e){let t=e.map((r)=>{let n=Object.entries(r.headers).map(([i,s])=>` ${i}: ${s}`);return[r.pattern,...n].join(`
97
- `)});return`${[nN,"",...t].join(`
95
+ `:""}var xb,Ts="https://esm.sh/@vue/reactivity@3.5.40",Ns="https://esm.sh/lit-html@3.3.0",_T,PT,ui,AT,Ds="__jxAttrText",Qf="__jxCaptureSlotted",Zf="__jxDistributeSlots",Js="<!---->",td,RT;var mn=L(()=>{Os();ra();Vc();mb();Ee();ks();Os();ra();Vc();Ee();xb=Symbol("jx.runtimeOnlyStateKeys");_T=/\bstate\.([A-Za-z_$][\w$]*)\s*(?:\+\+|--|(?:\*\*|\|\||&&|\?\?|<<|>>>|>>|[-+*/%&|^])?=(?!=))/g,PT=/\bstate\.([A-Za-z_$][\w$]*)\s*\.\s*(?:push|pop|shift|unshift|splice|sort|reverse|fill|copyWithin)\s*\(/g;ui=new Set(["pre","textarea","listing","plaintext","xmp"]);AT=[];td=new Set(["input","br","hr","img","meta","link","area","col","source"]);RT=/^(?:::slotted\(|::part\()/});import{relative as IT,sep as TT}from"node:path";function aa(e){return e===NT}function qs(e,t){if(e==="/")return"/";if(t==="always")return e.endsWith("/")?e:`${e}/`;if(t==="never")return e.replace(/\/+$/,"")||"/";return e}function ol(e,t){let r=new RegExp(`\\s${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s"'>]+))`,"i").exec(e);return r===null?null:r[1]??r[2]??r[3]??""}function Rb(e){let t=e.search(/<\/head\s*>/i),r=t===-1?e:e.slice(0,t);for(let[n]of r.matchAll(/<meta\b[^>]*>/gi)){if(ol(n,"name")?.trim().toLowerCase()!=="robots")continue;let i=new Set((ol(n,"content")??"").toLowerCase().split(",").map((s)=>s.trim()));if(i.has("noindex")||i.has("none"))return!0}return!1}function Ob(e){let t=e.search(/<\/head\s*>/i);return{end:t,head:t===-1?e:e.slice(0,t)}}function MT(e,t){let r=t.trim().toLowerCase();for(let[n]of Ob(e).head.matchAll(/<link\b[^>]*>/gi)){let i=(ol(n,"rel")??"").toLowerCase().split(/\s+/),s=(ol(n,"type")??"").split(";")[0]?.trim().toLowerCase();if(i.includes("alternate")&&s===r)return!0}return!1}function Cb(e,t){let{end:r}=Ob(e);if(r===-1||MT(e,t.type))return e;let n=`<link href="${Se(t.href)}" rel="alternate" type="${Se(t.type)}">`;return`${e.slice(0,r)}${n}
96
+ ${e.slice(r)}`}function Ib(e,t){return new URL(`/${IT(e,t).split(TT).join("/")}`,"http://localhost").pathname}var NT="/404";var ad=L(()=>{mn()});function Tb(e,t){if(t===null||t.routing!=="prefix-always")return[];let r=[];for(let n of e){if(n.urlPattern==="/")continue;let i=n.urlPattern.split("/").find(Boolean),s=Mr(i);if(s===null||!t.locales.includes(s))r.push(n.urlPattern)}return r}function Nb(e,t){if(t===null)return null;let r=e.split("/").find(Boolean),n=Mr(r);if(r===void 0||n===null||t.locales.includes(n))return null;let i=t.locales.find((s)=>s!==n&&s.split("-")[0]===n.split("-")[0]);return i===void 0?null:{meant:i,segment:r}}function LT(e,t){let r=e.split("/").filter(Boolean),n=Mr(r[0]);if(t!==null&&n!==null&&t.locales.includes(n))return r.slice(1).join("/");return r.join("/")}function cd(e,t){let r=new Map,n=[];if(t===null)return{conflicts:n,sets:r};let i=new Map,s=new Set;for(let o of e){let a=o.translationKey===void 0?LT(o.urlPattern,t):o.translationKey.replaceAll(/^\/+|\/+$/g,"");if(o.translationKey!==void 0)s.add(o.urlPattern);let c=dn(o.urlPattern,t);if(c===null)continue;let l=i.get(a)??[],u=l.find((d)=>d.locale===c);if(u===void 0)l.push({locale:c,urlPattern:o.urlPattern});else n.push({declared:s.has(u.urlPattern)||o.translationKey!==void 0,key:a,locale:c,urlPatterns:[u.urlPattern,o.urlPattern]});i.set(a,l)}for(let o of i.values()){let a=o.toSorted((c,l)=>c.locale===l.locale?0:c.locale<l.locale?-1:1);for(let c of o)r.set(c.urlPattern,a)}return{conflicts:n,sets:r}}function Mb(e,t,r,n){let i=new Map;if(t===null||r==="")return i;let s=new Map;for(let[o,a]of cd(e,t).sets){if(a.length<2)continue;let c=s.get(a);if(c===void 0){c=a.map((u)=>({href:ii(qs(u.urlPattern,n),r),hreflang:u.locale}));let l=a.find((u)=>u.locale===t.defaultLocale);if(l!==void 0)c.push({href:ii(qs(l.urlPattern,n),r),hreflang:"x-default"});s.set(a,c)}i.set(o,c)}return i}function Lb({pageLang:e,pageDir:t,routeLocale:r,defaults:n}){let i=e??r??n?.lang??"en",s=t??n?.dir;if(s!==void 0)return{dir:s,lang:i};return Xo(i)==="rtl"?{dir:"rtl",lang:i}:{lang:i}}var ld=L(()=>{wr();zi();ad();zi();zi()});import{readFileSync as ud,readdirSync as DT}from"node:fs";import{extname as Db,join as JT,relative as FT,resolve as qT}from"node:path";async function Qi(e,t){let r=ud(e,"utf8");if(e.endsWith(".json"))return ti(r,e);let n=Db(e).toLowerCase(),i=t?.byExtension(n,"parse");if(!i)throw Error(`No format class registered for "${n}" (${e}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await i.parseDocument(r)}async function Jb(e,t){let r=new Map,n=new Map;for(let i of e){if(!n.has(i.sourcePath))n.set(i.sourcePath,await HT(i.sourcePath,t));let s=n.get(i.sourcePath);if(s!==null&&s!==void 0)r.set(i.urlPattern,BT(s,i._pathParams))}return r}function BT(e,t){if(!e.includes("${"))return e;return e.replaceAll(/\$\{(\w+)\}/g,(r,n)=>t?.[n]??r)}async function HT(e,t){if(!ud(e,"utf8").includes("$translationKey"))return null;let r;try{r=await Qi(e,t)}catch{return null}return T(r.$translationKey)&&r.$translationKey!==""?r.$translationKey:null}async function Fb(e,t){let r=[],n=new Set([".json",...t?.documentExtensions("page")??[]]);return await qb(e,e,r,n,t),r.sort(Uy),r}async function qb(e,t,r,n,i){let s=DT(e,{withFileTypes:!0});for(let o of s){let a=JT(e,o.name);if(o.isDirectory()){if(o.name.startsWith("_"))continue;await qb(a,t,r,n,i);continue}let c=Db(o.name).toLowerCase();if(!n.has(c))continue;if(o.name.startsWith("_"))continue;let l=FT(t,a);r.push(await UT(l,a,i))}}async function UT(e,t,r){let{isCatchAll:n,isDynamic:i,params:s,urlPattern:o}=Hy(e),a=null;try{let l=(await Qi(t,r)).$layout;if(T(l))a=l}catch{}return{$layout:a,isCatchAll:n,isDynamic:i,params:s,relativePath:e,sourcePath:t,urlPattern:o}}function VT(e){let t=e[Bb];if(!ee(t))return null;let{mtime:r}=t;return T(r)&&r!==""?r:null}function WT(e){if(e.includes("\x00"))return"has a NUL character";for(let t of e.split("/")){if(t==="."||t==="..")return'has a "." or ".." segment';if(t.includes("\\"))return"has a backslash"}return null}async function Hb(e,t,r={},n,i,s){let o=[],a=e.flatMap((c)=>c.isDynamic?[c.urlPattern]:[]);for(let c of e){if(!c.isDynamic){o.push(c);continue}let l;try{l=await Qi(c.sourcePath,n?.formats)}catch{o.push(c);continue}if(!l.$paths){console.warn(`Warning: dynamic route ${c.urlPattern} has no $paths — skipping`);continue}let u=await zT(l.$paths,t,r,n,i,dn(c.urlPattern,s??null),c,a);for(let d of u){let h=c.urlPattern,m={};for(let[x,_]of Object.entries(d)){if(x===Bb)continue;m[x]=String(_),h=h.replace(`:${x}`,m[x]),h=h.replace("*",m[x])}let y=WT(h);if(y!==null){console.warn(`Warning: $paths for ${c.urlPattern} produced "${h}", which ${y}; skipping it`);continue}let g=VT(d),b={...c,_pathParams:m,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:h};if(g!==null)b.sourceMtime=g;o.push(b)}}return o}async function zT(e,t,r,n,i,s,o,a){if(Array.isArray(e))return e;if("values"in e&&Array.isArray(e.values)){let c=T(e.param)?e.param:"value";return e.values.map((l)=>({[c]:l}))}if("$ref"in e&&T(e.$ref)&&e.$ref){let c=e.$ref,l=qT(t,c),u;try{u=JSON.parse(ud(l,"utf8"))}catch(m){return console.warn(`Warning: $paths.$ref could not load "${c}": ${Pe(m)}`),[]}if(!Array.isArray(u))return console.warn(`Warning: $paths.$ref "${c}" must be a JSON array`),[];let d=T(e.param)?e.param:"id",h=T(e.field)?e.field:"id";return u.map((m)=>{if(m===null)throw TypeError(`$paths.$ref "${c}" contains a null entry`);return{[d]:(ee(m)?m[h]??m.id:void 0)??String(m)}})}for(let c of Object.keys(e)){let l=n?.byPathsDiscriminator(c);if(!l?.project)continue;let u={data:r[l.project.key],locale:s,projectConfig:i,root:t};if(o!==void 0)u.params=o.params,u.urlPattern=o.urlPattern;if(a!==void 0)u.patterns=a;return await l.call("resolvePaths",e,u)}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var Bb="_meta";var Ub=L(()=>{Ee();vr();Vy();ld()});import{createHash as KT}from"node:crypto";function Vb(){return{fontOrigins:new Set,frameOrigins:new Set,imgOrigins:new Set,scriptHashes:new Set,scriptOrigins:new Set,styleOrigins:new Set}}function Zi(e,t){let r=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return r?.[2]??r?.[3]}function fd(e){if(e===void 0||!/^https?:\/\//i.test(e))return null;try{return new URL(e).origin}catch{return null}}function rN(e){return`'sha256-${KT("sha256").update(e,"utf8").digest("base64")}'`}function Wb(e,t){for(let r of e.matchAll(YT)){let n=r[1]??"",i=Zi(n,"src"),s=(Zi(n,"type")??"").trim().toLowerCase();if(i!==void 0){let o=fd(i);if(o)t.scriptOrigins.add(o);continue}if(GT.has(s))t.scriptHashes.add(rN(r[2]??""))}for(let r of e.matchAll(XT)){let n=r[1]??"",i=(Zi(n,"rel")??"").toLowerCase(),s=Zi(n,"href"),o=fd(s);if(!o)continue;if(i.includes("stylesheet"))t.styleOrigins.add(o);if(tN.test(s??"")||(Zi(n,"as")??"")==="font")t.fontOrigins.add(o)}for(let[r,n]of[[QT,t.imgOrigins],[ZT,t.imgOrigins],[eN,t.frameOrigins]])for(let i of e.matchAll(r)){let s=i[1]??"";for(let o of[Zi(s,"src"),...nN(Zi(s,"srcset"))]){let a=fd(o);if(a)n.add(a)}}}function nN(e){return e===void 0?[]:e.split(",").map((t)=>t.trim().split(/\s+/)[0]??"").filter(Boolean)}function zb(e){let t=e?.csp;if(t===void 0||t===!1)return null;if(t===!0)return{};if(t==="report-only")return{mode:"report-only"};return t}function Kb(e,t){let r=(o,a)=>[...o,...a].join(" "),n={"base-uri":"'self'","default-src":"'self'","font-src":r(["'self'"],e.fontOrigins),"form-action":"'self'","frame-ancestors":"'self'","frame-src":r(["'self'"],e.frameOrigins),"img-src":r(["'self'","data:"],e.imgOrigins),"object-src":"'none'","script-src":r(["'self'",...[...e.scriptHashes].toSorted()],e.scriptOrigins),"style-src":r(["'self'","'unsafe-inline'"],e.styleOrigins)};if(t.reportUri!==void 0&&t.reportUri!=="")n["report-to"]="csp-endpoint",n["report-uri"]=t.reportUri;for(let[o,a]of Object.entries(t.directives??{}))n[o]=a;let i=Object.entries(n).filter(([,o])=>o!==!1&&o!=="").toSorted(([o],[a])=>o<a?-1:1).map(([o,a])=>`${o} ${String(a)}`).join("; "),s=t.mode==="report-only"?{"Content-Security-Policy-Report-Only":i}:{"Content-Security-Policy":i};if(t.reportUri!==void 0&&t.reportUri!=="")s["Reporting-Endpoints"]=`csp-endpoint="${t.reportUri}"`;return s}var GT,YT,XT,QT,ZT,eN,tN;var dd=L(()=>{GT=new Set(["","module","importmap","text/javascript","module-shim"]),YT=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,XT=/<link\b([^>]*)>/gi,QT=/<img\b([^>]*)>/gi,ZT=/<source\b([^>]*)>/gi,eN=/<iframe\b([^>]*)>/gi,tN=/\.(woff2?|ttf|otf|eot)(\?|#|$)/i});import{existsSync as al,readFileSync as iN,writeFileSync as Yb}from"node:fs";import{join as cl}from"node:path";function Xb(e,t){let r=e?.headers??{},n=[];if(r.enabled===!1)return{errors:n,rules:[]};let i=r.security??{},s={};if(i.contentTypeOptions!==!1)s["X-Content-Type-Options"]="nosniff";if(i.referrerPolicy!==!1)s["Referrer-Policy"]=i.referrerPolicy??"strict-origin-when-cross-origin";if(i.permissionsPolicy!==!1)s["Permissions-Policy"]=i.permissionsPolicy??"camera=(), microphone=(), geolocation=()";if(i.frameOptions!==!1)s["X-Frame-Options"]=i.frameOptions??"SAMEORIGIN";let{hsts:o}=i;if(o){let u=o===!0?{}:o,d=u.maxAge??Gb,h=u.includeSubDomains??!0,m=u.preload??!1;if(m&&!h)n.push("build.headers.security.hsts: `preload` requires `includeSubDomains` — the preload list "+"will not accept the header without it.");else s["Strict-Transport-Security"]=[`max-age=${d}`,h?"includeSubDomains":null,m?"preload":null].filter(Boolean).join("; ")}let a=zb(i);if(a)if(t===void 0)n.push("build.headers.security.csp is set, but no page was scanned for inline scripts — the "+"policy would block every one of them.");else Object.assign(s,Kb(t,a));let c=r.cache??"auto";if(c==="auto")s["Cache-Control"]="public, max-age=0, must-revalidate";let l=[];if(Object.keys(s).length>0)l.push({headers:s,pattern:"/*"});if(c==="auto")l.push({headers:{"Cache-Control":`public, max-age=${Gb}, immutable`},pattern:sN});for(let[u,d]of Object.entries(r.rules??{}))l.push({headers:d,pattern:u});return{errors:n,rules:l}}function Qb(e){let t=[["feed.xml","application/atom+xml; charset=utf-8"],["feed.json","application/feed+json; charset=utf-8"],["manifest.webmanifest","application/manifest+json; charset=utf-8"],[".well-known/security.txt","text/plain; charset=utf-8"]],r=[];for(let[n,i]of t)if(al(cl(e,n)))r.push({headers:{"Content-Type":i},pattern:`/${n}`});if(al(cl(e,"feed","archive")))r.push({headers:{"Content-Type":"application/atom+xml; charset=utf-8"},pattern:"/feed/archive/*"});return r}function Zb(e,t){if(t==="")return[...e];return e.map((r)=>({headers:r.headers,pattern:ze(t,r.pattern)}))}function cN(e){let t=e.map((r)=>{let n=Object.entries(r.headers).map(([i,s])=>` ${i}: ${s}`);return[r.pattern,...n].join(`
97
+ `)});return`${[oN,"",...t].join(`
98
98
  `)}
99
- `}function ex(e,t){if(t.length===0)return 0;let r=cl(e,"_headers"),n=al(r)?tN(r,"utf8").trim():"",i=sN(t),s=n===""?i:`${i}
100
- ${iN}
99
+ `}function ex(e,t){if(t.length===0)return 0;let r=cl(e,"_headers"),n=al(r)?iN(r,"utf8").trim():"",i=cN(t),s=n===""?i:`${i}
100
+ ${aN}
101
101
  ${n}
102
- `;return Yb(r,s,"utf8"),1}function tx(e){let t=cl(e,".nojekyll");if(al(t))return 0;return Yb(t,"","utf8"),1}var rN="/images/_optimized/*",Gb=31536000,nN="# Generated by @jxsuite/compiler — configure via build.headers in project.json.",iN="# ─── public/_headers (hand-authored; these rules override the block above) ───";var rx=L(()=>{wr();fd()});async function nx(e,t,r,n={}){let i={},s=pf(e);for(let o of r.projectContributions()){let a=o.project?.key;if(!a||!o.capabilities.projectData)continue;if(!t||!(a in t))continue;i[a]=await o.call("projectData",t[a],{io:s,projectConfig:t,registry:r,root:e,...n.lazy===!0&&{lazy:!0}})}return i}var ix=L(()=>{On()});import{cpSync as oN,existsSync as aN,mkdirSync as cN}from"node:fs";import{dirname as lN,resolve as uN}from"node:path";async function sx(e,t,r){let n=[],i=[],s=new Map;for(let o of e.assetProviders()){let a=o.project?.key,c=a?t[a]:void 0;if(a&&(c==null||J(c)&&Object.keys(c).length===0))continue;try{let l=await o.call("assets",c??null,{projectConfig:t,root:r});for(let u of l??[]){if(!J(u)||!u.urlPrefix||!u.dir)continue;let d={dir:u.dir,urlPrefix:kc(u.urlPrefix)};if(Ot(u.filter))d.filter=u.filter;let h=s.get(d.urlPrefix);if(h){if(h.dir!==d.dir)i.push(`Asset mount conflict: "${d.urlPrefix}" is claimed by both "${h.dir}" and "${d.dir}"`);continue}s.set(d.urlPrefix,d),n.push(d)}}catch(l){i.push(`Error in ${o.name}.assets: ${Pe(l)}`)}}return{errors:i,mounts:n}}function dd(e,t,r){if(t.length===0||!e)return;for(let n of oy(e,t))r.add(n)}function ox(e,t,r){let n=0,i=[];for(let s of e){let o=Ac(t,s);if(!o||!aN(o)){i.push(s);continue}let a=uN(r,decodeURIComponent(s).replace(/^\//,""));cN(lN(a),{recursive:!0}),oN(o,a),n+=1}return{copied:n,missing:i}}var ax=L(()=>{wr();Ee();vr()});async function pd(e,t,r){let n=e.$layout??t.defaults?.layout??null;if(!n)return e;let i=await r(n);if(i.$layout)i=await pd(i,t,r);let s=e.children??[],o=T(s)?[s]:Array.isArray(s)?s:[],a=dN(i);if(fN(a,o),e.state)a.state={...a.state,...e.state};if(e.$media)a.$media={...a.$media,...e.$media};if(e.style)a.style={...a.style,...e.style};if(e.attributes)a.attributes={...a.attributes,...e.attributes};if(e.$head)a._pageHead=e.$head;if(e.title)a._pageTitle=e.title;return delete a.$layout,a}function fN(e,t){let r=new Map,n=[];for(let i of t){let s=J(i)?i.attributes?.slot:void 0;if(s){let o=r.get(s);if(!o)o=[],r.set(s,o);o.push(i)}else n.push(i)}cx(e,r,n)}function cx(e,t,r){if(!J(e))return;if(!Array.isArray(e.children))return;let n=[];for(let i of e.children)if(J(i)&&i.tagName==="slot"){let s=i.attributes?.name,o=s?t.get(s):void 0;if(s&&o)n.push(...o),t.delete(s);else if(!s&&r.length>0)n.push(...r);else if(Array.isArray(i.children))n.push(...i.children)}else cx(i,t,r),n.push(i);e.children=n}function dN(e){return structuredClone(e)}var lx=L(()=>{Ee()});import{existsSync as pN,readFileSync as mN}from"node:fs";import{resolve as hN}from"node:path";function gN(e){return(t)=>{let r=hN(e,t);if(!pN(r))throw Error(`Layout not found: ${t} (resolved to ${r})`);try{return ti(mN(r,"utf8"),r)}catch(n){throw Error(`Invalid layout JSON at ${r}: ${Pe(n)}`,{cause:n})}}}function ux(e,t,r){return pd(e,t,gN(r))}var fx=L(()=>{vr();lx()});function dx(e,t){if(!T(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function px(e=[],t=[],r=[],n={}){let i=[{attributes:{charset:n.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],s=new Map;for(let a of[...i,...e,...t,...r]){let c=md(a);s.set(c,a)}let o=n.title??n.siteName??"Jx Site";if(s.set("title",{children:[o],tagName:"title"}),n.pageUrl&&n.siteUrl){let a=ii(n.pageUrl,n.siteUrl);if(![...s.values()].some((l)=>J(l)&&l.tagName==="link"&&l.attributes?.rel==="canonical")){let l={attributes:{href:a,rel:"canonical"},tagName:"link"};s.set(md(l),l)}if(!s.has("meta:og:url"))s.set("meta:og:url",{attributes:{content:a,property:"og:url"},tagName:"meta"})}if(n.siteName&&!s.has("meta:og:site_name"))s.set("meta:og:site_name",{attributes:{content:n.siteName,property:"og:site_name"},tagName:"meta"});for(let a of n.alternates??[]){let c={attributes:{href:a.href,hreflang:a.hreflang,rel:"alternate"},tagName:"link"},l=md(c);if(!s.has(l))s.set(l,c)}return[...s.values()]}function md(e){if(!J(e))return String(e);let t=e.tagName??"unknown",r=e.attributes??{};if(t==="title")return"title";if(r.charset)return"meta:charset";if(t==="meta"&&r.name)return`meta:${r.name}`;if(t==="meta"&&r.property)return`meta:${r.property}`;if(t==="link"&&r.rel){let n=r.hreflang??r.type??r.media??r.sizes??"";return`link:${r.rel}:${r.href??""}:${String(n)}`}if(t==="script"&&r.src)return`script:${r.src}`;if(t==="style"){let n=Array.isArray(e.children)?e.children.join(""):e.textContent,i=J(n)?JSON.stringify(n):n??"";return`style:${yN(i)}`}return`${t}:${JSON.stringify(e)}`}function yN(e){let t=0;for(let r=0;r<e.length;r++)t=Math.trunc((t<<5)-t+(e.codePointAt(r)??0));return t.toString(36)}function mx(e){return e.map((t)=>bN(t)).join(`
103
- `)}function bN(e){if(T(e))return e;if(!J(e))return"";let t=e.tagName,r=e.attributes??{},n=Object.entries(r).map(([c,l])=>l===!0?c:`${c}="${xN(l)}"`).join(" "),i=n?`<${t} ${n}>`:`<${t}>`;if(t!==void 0&&new Set(["meta","link","base","br","hr","img","input"]).has(t))return i;let o=Array.isArray(e.children)?e.children.join(""):e.textContent,a=J(o)?JSON.stringify(o,null,2):o??"";return`${i}${a}</${t}>`}function xN(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var hx=L(()=>{wr();Ee()});function wN(e){let t=e.indexOf(":");if(t===-1)return!1;if(t===e.length-1)return!1;try{return new URL(e).protocol!==""}catch{return!1}}function SN(e){if(!T(e))return[];return e.split(/\s+/).filter((t)=>{if(t==="")return!1;let r=t.toLowerCase();return!$N.has(r)&&!vN.has(r)&&!wN(t)})}function gx(e){let t=new Set;for(let r of e){if(!J(r)||r.tagName!=="link")continue;for(let n of SN(r.attributes?.rel))t.add(n)}return[...t]}var $N,vN;var yx=L(()=>{Ee();$N=new Set(["about","acl","alternate","amphtml","api-catalog","appendix","apple-touch-icon","apple-touch-startup-image","archives","author","blocked-by","bookmark","c2pa-manifest","canonical","chapter","cite-as","collection","compression-dictionary","contents","convertedfrom","copyright","create-form","current","deprecation","describedby","describes","disclosure","dns-prefetch","dpp","duplicate","edit","edit-form","edit-media","enclosure","external","first","geofeed","glossary","help","hosts","hub","ice-server","icon","index","intervalafter","intervalbefore","intervalcontains","intervaldisjoint","intervalduring","intervalequals","intervalfinishedby","intervalfinishes","intervalin","intervalmeets","intervalmetby","intervaloverlappedby","intervaloverlaps","intervalstartedby","intervalstarts","item","last","latest-version","license","linkset","lrdd","manifest","mask-icon","me","media-feed","memento","micropub","modulepreload","monitor","monitor-group","next","next-archive","nofollow","noopener","noreferrer","opener","openid2.local_id","openid2.provider","original","p3pv1","payment","pingback","preconnect","predecessor-version","prefetch","preload","prerender","prev","prev-archive","preview","previous","privacy-policy","profile","publication","rdap-active","rdap-bottom","rdap-down","rdap-top","rdap-up","related","replies","restconf","ruleinput","search","section","self","service","service-desc","service-doc","service-meta","sip-trunking-capability","sponsored","start","status","stylesheet","subsection","successor-version","sunset","tag","terms-of-service","timegate","timemap","type","ugc","up","version-history","via","webmention","working-copy","working-copy-of"]),vN=new Set(["shortcut"])});function bx(e,t,r,n=null,i=null,s=[]){if(!e.state)e.state={};let o={};if(i!==null)o.defaultLocale=i.defaultLocale,o.locales=i.locales;e.state.$site={name:t.name??"Jx Site",url:t.url??"",...o,...t.state};let a=(T(e.$lang)?e.$lang:void 0)??dn(r.urlPattern,i)??t.defaults?.lang,c=s.map((u)=>({code:u.locale,current:u.urlPattern===r.urlPattern,dir:Xo(u.locale),label:Wy(u.locale),url:u.urlPattern})),l={params:r._pathParams??{},title:e.title??e._pageTitle??t.name??"",url:r.urlPattern};if(c.length>0)l.alternates=c;if(a!==void 0)l.dir=Xo(a),l.locale=a;if(e.state.$page=l,t.state){for(let[u,d]of Object.entries(t.state))if(u!=="$site"&&u!=="$page"&&!(u in e.state))e.state[u]=d}if(t.$media)e.$media={...t.$media,...e.$media};if(t.imports&&Object.keys(t.imports).length>0){if(!e.imports)e.imports={};for(let[u,d]of Object.entries(t.imports))if(!(u in e.imports))e.imports[u]=n&&(d.startsWith("./")||d.startsWith("../"))?n(d,r):d}if(t.$elements?.length)if(!e.$elements?.length)e.$elements=[...t.$elements];else{let u=new Set,d=[];for(let h of[...t.$elements,...e.$elements]){let m=T(h)?h:J(h)?h.$ref:void 0;if(m&&!u.has(m))u.add(m),d.push(h)}e.$elements=d}return e}var xx=L(()=>{Ee();zi()});import{dirname as EN,relative as _N,resolve as PN}from"node:path";function kN(e){return(t,r)=>{if(!r.sourcePath)return t;return`./${_N(EN(r.sourcePath),PN(e,t))}`}}function $x(e,t,r,n=null,i=null,s=[]){return bx(e,t,r,n===null?null:kN(n),i,s)}var vx=L(()=>{xx()});function Dn(e){if(e.startsWith("\\\\?\\"))return e;return e.split("\\").join("/")}var AN,ca=()=>AN;var wx=L(()=>{AN=/^win/.test(globalThis.process?globalThis.process.platform:"")});function Fe(e,t){let r=new URL(Sx(e),"https://aaa.nonexistanturl.com"),n=new URL(Sx(t),r),i=t.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:a}=n;return s+o+a+i}return n.toString()+i}function Sx(e){let t=e.search(/[?#]/);return t<0?Dn(e):Dn(e.slice(0,t))+e.slice(t)}function ua(e){try{return decodeURIComponent(e)}catch{try{return decodeURIComponent(e.replace(/%(?![\dA-F]{2})/gi,"%25"))}catch{return e}}}function _r(){if(typeof window<"u"&&window.location&&window.location.href){let e=window.location.href;if(!e||!e.startsWith("http"))try{return new URL(e),e}catch{return"/"}return e}if(typeof process<"u"&&process.cwd){let e=process.cwd(),t=e.slice(-1);if(t==="/"||t==="\\")return e;else return e+"/"}return"/"}function _x(e){let t=RN.exec(e||"");if(t)return t[1].toLowerCase();return}function Px(e){let t=e.search(/[?#]/),r=t>=0?e.substring(0,t):e,n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),i=r.lastIndexOf(".");if(i>n)return r.substring(i).toLowerCase();return""}function Pr(e){if(!e)return"#";let t=e.indexOf("#");if(t>=0)return e.substring(t);return"#"}function $e(e){if(!e)return"";let t=e.indexOf("#");if(t>=0)e=e.substring(0,t);return e}function kx(e){let t=_x(e);if(t==="http"||t==="https")return!0;else if(t===void 0)return typeof window<"u";else return!1}function ll(e){if(!e||typeof e!=="string")return!0;let t=e.trim().toLowerCase();if(!t)return!0;if(t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:"))return!0;if(t.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let r=new URL(t.startsWith("//")?"http:"+t:t);if(gd(r.hostname))return!0;let n=r.port;if(n&&FN(parseInt(n)))return!0}catch{if(t.startsWith("/")&&!t.startsWith("//"))return!1;if(JN(t))return!0}return!1}async function Ax(e){if(ll(e))return{unsafe:!0};if(typeof e!=="string"||typeof process>"u"||!process.versions?.node||typeof window<"u")return{unsafe:!1};let t=new URL(e.startsWith("//")?`http:${e}`:e);if(t.protocol!=="http:"&&t.protocol!=="https:")return{unsafe:!1};let i=await(await import("node:dns/promises")).lookup(jx(t.hostname),{all:!0,verbatim:!0});if(i.length===0||i.some(({address:s})=>gd(s)))return{unsafe:!0};return{unsafe:!1,addresses:i}}function gd(e){let t=jx(e);if(!t)return!0;if(t==="localhost"||NN.some((i)=>t.endsWith(i)))return!0;let r=Rx(t);if(r)return Ox(r);let n=MN(t);if(n)return LN(n);return!1}function jx(e){let t=e.trim().toLowerCase();if(t.startsWith("[")&&t.endsWith("]"))t=t.slice(1,-1);while(t.endsWith("."))t=t.slice(0,-1);return t}function Rx(e){let t=e.split(".");if(t.length!==4)return;let r=t.map((n)=>{if(!/^\d+$/.test(n))return Number.NaN;return Number(n)});if(r.some((n)=>!Number.isInteger(n)||n<0||n>255))return;return r}function Ox([e,t,r,n]){return e===0||e===10||e===127||e===100&&t>=64&&t<=127||e===169&&t===254||e===172&&t>=16&&t<=31||e===192&&t===0&&r===0||e===192&&t===168||e===198&&(t===18||t===19)||e>=224||e===255&&t===255&&r===255&&n===255}function MN(e){if(!e.includes(":"))return;let t=e,r=t.lastIndexOf(":"),n=t.slice(r+1);if(n.includes(".")){let c=Rx(n);if(!c)return;let l=c[0]*256+c[1],u=c[2]*256+c[3];t=`${t.slice(0,r+1)}${l.toString(16)}:${u.toString(16)}`}let i=t.split("::");if(i.length>2)return;let s=Ex(i[0]),o=i.length===2?Ex(i[1]):[];if(!s||!o)return;if(i.length===1)return s.length===8?s:void 0;let a=8-s.length-o.length;if(a<1)return;return[...s,...Array(a).fill(0),...o]}function Ex(e){if(!e)return[];let t=e.split(":").map((r)=>{if(!/^[\da-f]{1,4}$/i.test(r))return Number.NaN;return Number.parseInt(r,16)});if(t.some((r)=>!Number.isInteger(r)||r<0||r>65535))return;return t}function LN(e){if(e.length!==8)return!1;let t=e.every((a)=>a===0),r=e.slice(0,7).every((a)=>a===0)&&e[7]===1,n=(e[0]&65024)===64512,i=(e[0]&65472)===65152,s=(e[0]&65280)===65280;if(t||r||n||i||s)return!0;let o=DN(e);return o?Ox(o):!1}function DN(e){let t=e.slice(0,5).every((i)=>i===0),r=t&&e[5]===0,n=t&&e[5]===65535;if(!r&&!n)return;return[Math.floor(e[6]/256),e[6]%256,Math.floor(e[7]/256),e[7]%256]}function JN(e){return e.split(/[\s/?#]+/).map((r)=>r.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((r)=>gd(r))}function FN(e){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(e)}function ul(e){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let t=_x(e);return t===void 0||t==="file"}function Cx(e){if(ca()){let t=_r(),r=e.toUpperCase(),i=Dn(t).toUpperCase(),s=r.includes(i),o=r.includes(i),a=IN.test(e)||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://");if(!(s||o||a)&&!t.startsWith("http"))e=((l,u)=>{if(l.endsWith("/")||l.endsWith("\\"))return l+u;else return l+"/"+u})(t,e);e=Dn(e)}e=encodeURI(e);for(let t of TN)e=e.replace(t[0],t[1]);return e}function Bs(e,t){e=e.replace(/%(?![0-9A-Fa-f]{2})/g,"%25");for(let n=0;n<hd.length;n+=2)e=e.replace(new RegExp(hd[n].source,"gi"),hd[n+1]);e=decodeURI(e);let r=e.toLowerCase().startsWith("file://");if(r){if(e=e.replace(/^file:\/\//i,"").replace(/^\//,""),ca()&&e[1]==="/")e=`${e[0]}:${e.substring(1)}`;if(t)e="file:///"+e;else r=!1,e=ca()?e:"/"+e}if(ca()&&!r){if(e=e.replace(jN,"\\"),e.match(/^[a-z]:\\/i))e=e[0].toUpperCase()+e.substring(1)}return e}function Hs(e){if(e=ua(e),e.length<=1||e[0]!=="#"||e[1]!=="/")return[];return e.slice(2).split("/").map((t)=>t.replace(ON,"/").replace(CN,"~"))}var jN,RN,ON,CN,IN,TN,hd,NN,la=(e)=>new URL(e);var Wt=L(()=>{wx();jN=/\//g,RN=/^(\w{2,}):\/\//i,ON=/~1/g,CN=/~0/g,IN=/^[a-zA-Z]:[\\/]/,TN=[[/\?/g,"%3F"],[/#/g,"%23"]],hd=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%3F/g,"?",/%40/g,"@"],NN=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function Ix(){let e={},t=this;for(let r of UN(t))if(typeof r==="string"){let n=t[r],i=typeof n;if(!qN.includes(i))e[r]=n}return e}function UN(e,t=[]){let r=[];while(e&&e!==HN)r=r.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let n=new Set(r);for(let i of t.concat(BN))n.delete(i);return n}function zt(e){return e instanceof kr||e instanceof Us}function bd(e){if(e.path===null)e.path=[];return e}var qN,BN,HN,kr,Us,Gr,fl,Yr,dl,fa,yd,Vs;var Ar=L(()=>{Wt();qN=["function","symbol","undefined"],BN=["constructor","prototype","__proto__"],HN=Object.getPrototypeOf({});kr=class kr extends Error{name;message;source;path;code;constructor(e,t,r){super(void 0,r);this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=t,this.path=null}toJSON=Ix.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Us=class Us extends Error{files;constructor(e){super();this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${Bs(e.$refs._root$Ref.path)}'`}toJSON=Ix.bind(this);static getParserErrors(e){let t=[],r=new Set,n=[...Object.values(e.$refs._$refs),...Object.values(e.$refs._aliases)];for(let i of n)if(i.errors){for(let s of i.errors)if(!r.has(s.footprint))r.add(s.footprint),t.push(s)}return t}get errors(){return Us.getParserErrors(this.files)}};Gr=class Gr extends kr{code="EPARSER";name="ParserError";constructor(e,t,r){super(`Error parsing ${t}: ${e}`,t,r)}};fl=class fl extends kr{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(e){super(`Could not find parser for "${e}"`,e)}};Yr=class Yr extends kr{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(e,t,r){super(e.message||`Error reading file "${t}"`,t,r);if("code"in e)this.ioErrorCode=String(e.code)}};dl=class dl extends kr{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(e){super(`Could not find resolver for "${e}"`,e)}};fa=class fa extends kr{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(e,t,r,n,i){super(`Missing $ref pointer "${Pr(t)}". Token "${e}" does not exist.`,$e(t));this.targetToken=e,this.targetRef=r,this.targetFound=n,this.parentPath=i}};yd=class yd extends kr{code="ETIMEOUT";name="TimeoutError";constructor(e){super(`Dereferencing timeout reached: ${e}ms`)}};Vs=class Vs extends kr{code="EINVALIDPOINTER";name="InvalidPointerError";constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,$e(t))}}});function ut(e,t,r=!1){let n=Ws(t,r);return n?Fe(e,n):e}function pl(e){if(!e||typeof e!=="object"||ArrayBuffer.isView(e))return!1;if(Ws(e))return!0;let t=e.$schema;if(typeof t==="string"&&(t.includes("draft-04/")||t.includes("draft-06/")||t.includes("draft-07/")||t.includes("draft/2019-09/")||t.includes("draft/2020-12/")||t.includes("oas/3.1/")))return!0;let r=e.openapi;return typeof r==="string"&&/^3\.1(?:\.|$)/.test(r)}function ml(e,t,r,n,i=!1){if(!i)return;let s=new Map,o=new Set,a=(c,l,u,d)=>{if(!c||typeof c!=="object"||ArrayBuffer.isView(c)||o.has(c))return;let h=bt(c,u),m=ut(l,c,h),y=`${h}:${m}`,g=s.get(c);if(g?.has(y))return;if(g)g.add(y);else s.set(c,new Set([y]));if(o.add(c),m!==l)e._addAlias(m,c,n,i,h,d);for(let b of Object.keys(c))a(c[b],m,h,VN(d,b));o.delete(c)};a(r,t,!1,t+"#")}function VN(e,t){return e+"/"+t.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1")}function Ws(e,t=!1){if(!e||typeof e!=="object")return;let n=bt(e,t)?e.id:e.$id;if(typeof n==="string"&&n.length>0)return n;return}function bt(e,t=!1){if(!e||typeof e!=="object")return t;let r=e.$schema;if(typeof r==="string"){if(r.includes("draft-04/"))return!0;if(r.includes("draft-06/")||r.includes("draft-07/")||r.includes("draft/2019-09/")||r.includes("draft/2020-12/")||r.includes("oas/3.1/"))return!1}let n=e.openapi;if(typeof n==="string"&&/^3\.1(?:\.|$)/.test(n))return!1;return t}var Jn=L(()=>{Wt()});function es(e,t){return fi(t)?xd.get(e)?.get(t):void 0}function Xr(e,t,r,n){if(t.child)return t.child(r,n);let i=es(e,n);if(i)return i;let s=bt(n,t.legacyIdScope),o=t.dynamicIdScope&&fi(n)&&!ArrayBuffer.isView(n)?ut(t.scopeBase,n,s):t.scopeBase,a=(t.path.includes("#")?t.path:t.path+"#")+"/"+r.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1");return{value:n,path:a,scopeBase:o,dynamicIdScope:t.dynamicIdScope,legacyIdScope:s}}function da(e,t,r,n,i,s=!0){if(!fi(t)||!fi(r.value)||!fi(n.value))return{...r,value:t};let o=r.value,a=n.value,l={...!s&&Object.hasOwn(a,"$ref")?n:r,value:t,child(d,h){if(!((!s||d!=="$ref")&&Object.hasOwn(a,d)))return Xr(e,r,d,h);if(!i||!fi(h))return Xr(e,n,d,h);let y=a[d],g=Xr(e,n,d,y);if(!fi(y)||Array.isArray(y))return{...g,value:h};let b=Object.hasOwn(o,d)?o[d]:void 0;if(fi(b)&&!Array.isArray(b))return es(e,h)||da(e,h,Xr(e,r,d,b),g,!0,!1);return{...g,value:h}}},u=xd.get(e);if(!u)u=new WeakMap,xd.set(e,u);return u.set(t,l),l}function fi(e){return e!==null&&typeof e==="object"}var xd;var $d=L(()=>{Jn();xd=new WeakMap});class di{$ref;path;originalPath;scopeBase;legacyIdScope;location;value;circular;chainCircular;indirections;constructor(e,t,r){this.$ref=e,this.path=t,this.originalPath=r||t,this.scopeBase=e.path||$e(t),this.legacyIdScope=e.legacyIdScope,this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(e,t,r,n=new Set,i=!0){let s=di.parse(this.path,this.originalPath),o=[];if(this.value=Mx(e),this.$ref.dynamicIdScope&&!Lx(this.$ref))this.legacyIdScope=bt(this.value,this.legacyIdScope),this.scopeBase=ut(this.scopeBase,this.value,this.legacyIdScope);this.setLocation(es(this.$ref.$refs,this.value)||{value:this.value,path:this.$ref.path,scopeBase:this.scopeBase,dynamicIdScope:this.$ref.dynamicIdScope,legacyIdScope:this.legacyIdScope});for(let c=0;c<s.length;c++){let l=this.circular,u=this.chainCircular,d=je.isExtended$Ref(this.value);if(hl(this,t,r,n))this.path=di.join(this.path,s.slice(c));else if(d)this.circular=l,this.chainCircular=u;let h=s[c];if(this.value===null||typeof this.value!=="object"&&typeof this.value!=="function"){this.value=null;let m=this.$ref.path||"",y=this.path.replace(m,""),g=di.join("",o),b=r?.replace(m,"");throw new fa(h,Tx(this.originalPath),y,g,b)}if(!Object.hasOwn(this.value,h)||this.value[h]===void 0||this.value[h]===null&&c===s.length-1){let m=!1;for(let _=s.length-1;_>c;_--){let k=s.slice(c,_+1).join("/");if(Object.hasOwn(this.value,k)&&this.value[k]!==void 0){this.value=this.value[k],this.setLocation(Xr(this.$ref.$refs,this.location,k,this.value)),c=_,m=!0;break}}if(m){this.chainCircular=u;continue}if(Object.hasOwn(this.value,h)&&this.value[h]===null){this.value=gl,this.setLocation(Xr(this.$ref.$refs,this.location,h,null)),this.chainCircular=u;continue}this.value=null;let y=this.$ref.path||"",g=this.path.replace(y,""),b=di.join("",o),x=r?.replace(y,"");throw new fa(h,Tx(this.originalPath),g,b,x)}else this.value=this.value[h];this.chainCircular=u,o.push(h),this.setLocation(Xr(this.$ref.$refs,this.location,h,this.value))}let a=this.location?.dynamicIdScope?this.scopeBase:this.location?.path||this.path;if(i){let c=this.value?.$ref?Fe(a,this.value.$ref):void 0,l=typeof r==="string"?Fe(this.$ref.$refs._root$Ref.path,r):r;if(je.isAllowed$Ref(this.value,t)&&c===l&&c!==this.path)this.chainCircular=!0;else if(!this.value||c)hl(this,t,r,n)}return this}set(e,t,r){let n=di.parse(this.path),i;if(n.length===0)return this.value=t,t;if(XN(this.path,n),this.value=Mx(e),this.$ref.dynamicIdScope&&!Lx(this.$ref))this.legacyIdScope=bt(this.value,this.legacyIdScope),this.scopeBase=ut(this.scopeBase,this.value,this.legacyIdScope);this.setLocation(es(this.$ref.$refs,this.value)||{value:this.value,path:this.$ref.path,scopeBase:this.scopeBase,dynamicIdScope:this.$ref.dynamicIdScope,legacyIdScope:this.legacyIdScope});for(let s=0;s<n.length-1;s++){if(hl(this,r),i=n[s],this.value&&Object.hasOwn(this.value,i)&&this.value[i]!==void 0)this.value=this.value[i];else this.value=Nx(this,i,{});this.setLocation(Xr(this.$ref.$refs,this.location,i,this.value))}return hl(this,r),i=n[n.length-1],Nx(this,i,t),e}setLocation(e){this.location=e,this.scopeBase=e.scopeBase,this.legacyIdScope=e.legacyIdScope}static parse(e,t){let r=ua(Pr(e).substring(1));if(!r)return[];let n=r.split("/");for(let i=0;i<n.length;i++)n[i]=n[i].replace(KN,"/").replace(GN,"~");if(n[0]!=="")throw new Vs(r,t===void 0?e:t);return n.slice(1)}static join(e,t){if(e.indexOf("#")===-1)e+="#";t=Array.isArray(t)?t:[t];for(let r=0;r<t.length;r++){let n=t[r];e+="/"+n.replace(/%/g,"%25").replace(zN,"~0").replace(WN,"~1")}return e}}function Tx(e){try{return decodeURI(e)}catch{return e}}function hl(e,t,r,n=new Set){let i=!1,s=r,o=[];try{while(je.isAllowed$Ref(e.value,t)){let a=je.isExtended$Ref(e.value),{value:c,path:l}=e,u=e.location?.dynamicIdScope?e.scopeBase:e.location?.path||e.path,d=Fe(u,e.value.$ref);if(d===e.path&&!QN(s))return e.circular=!0,e.chainCircular=!0,i;let h=typeof s==="string"?Fe(e.$ref.$refs._root$Ref.path,s):s;if(d===h&&d!==e.path)return e.chainCircular=!0,i;if(n.has(d))return e.chainCircular=!0,i;let m=t?.dereference?.maxDepth??500;if(n.size>=m)throw RangeError(`Maximum dereference depth (${m}) exceeded at ${e.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);n.add(d),o.push(d);let y=e.$ref.$refs._resolve(d,l,t,n,a);if(y===null)return i;if(e.indirections+=y.indirections+1,e.chainCircular||=y.circular||y.chainCircular,a){if(e.chainCircular)return i;return e.value=je.dereference(c,y.value,t),e.setLocation(da(e.$ref.$refs,e.value,y.location,e.location,t?.dereference?.mergeKeys??!0)),i}else e.$ref=y.$ref,e.path=y.path,e.value=y.value,e.scopeBase=y.scopeBase,e.legacyIdScope=y.legacyIdScope,e.location=y.location,s=l,i=!0}return i}finally{for(let a of o)n.delete(a)}}function Nx(e,t,r){if(e.value&&typeof e.value==="object")if(t==="-"&&Array.isArray(e.value))e.value.push(r);else e.value[t]=r;else throw new kr(`Error assigning $ref pointer "${e.path}".
104
- Cannot set "${t}" of a non-object.`);return r}function XN(e,t){for(let r of t)if(YN.has(r))throw new kr(`Error assigning $ref pointer "${e}".
105
- Unsafe JSON Pointer token "${r}" cannot be used for assignment.`)}function Mx(e){if(zt(e))throw e;return e}function QN(e){return typeof e=="string"&&di.parse(e).length==0}function Lx(e){return Boolean(e.path&&e.path in e.$refs._aliases)}var gl,WN,zN,KN,GN,YN,qe;var zs=L(()=>{ts();Wt();Ar();Jn();$d();gl=Symbol("null"),WN=/\//g,zN=/~/g,KN=/~1/g,GN=/~0/g,YN=new Set(["__proto__","constructor","prototype"]);qe=di});class pa{path;sourcePath;value;$refs;pathType;dynamicIdScope=!1;legacyIdScope=!1;errors=[];constructor(e){this.$refs=e}addError(e){if(this.errors===void 0)this.errors=[];let t=this.errors.map(({footprint:r})=>r);if("errors"in e&&Array.isArray(e.errors))this.errors.push(...e.errors.map(bd).filter(({footprint:r})=>!t.includes(r)));else if(!("footprint"in e)||!t.includes(e.footprint))this.errors.push(bd(e))}exists(e,t){try{return this.resolve(e,t),!0}catch{return!1}}get(e,t){return this.resolve(e,t)?.value}resolve(e,t,r,n,i,s=!0){let o=new qe(this,e,r);try{let a=o.resolve(this.value,t,n,i,s);if(a.value===gl)a.value=null;return a}catch(a){if(!t||!t.continueOnError||!zt(a))throw a;if(a.path===null)a.path=Hs(Pr(n));if(a instanceof Vs)a.source=ZN($e(n||r||e));return this.addError(a),null}}set(e,t){let r=new qe(this,e);if(this.value=r.set(this.value,t),this.value===gl)this.value=null}static is$Ref(e){return Boolean(e)&&typeof e==="object"&&e!==null&&"$ref"in e&&typeof e.$ref==="string"&&e.$ref.length>0}static isExternal$Ref(e){return pa.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,t){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||/^#%2f/i.test(e.$ref)||e.$ref==="#")return!0;else if(e.$ref[0]!=="#"&&(!t||t.resolve?.external))return!0}return}static isExtended$Ref(e){return pa.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,t,r){if(t&&typeof t==="object"&&pa.isExtended$Ref(e)){let n={};for(let o of Object.keys(e))if(o!=="$ref")ma(n,o,e[o]);let i=r?.dereference?.mergeKeys??!0,s=t;for(let o of Object.keys(s))if(!Object.hasOwn(n,o))ma(n,o,s[o]);else if(i&&typeof n[o]==="object"&&n[o]!==null&&typeof s[o]==="object"&&s[o]!==null)ma(n,o,Dx(s[o],n[o]));return n}else return t}}function ZN(e){try{return decodeURI(e)}catch{return e}}function Dx(e,t){if(typeof e!=="object"||e===null)return t;if(typeof t!=="object"||t===null)return t;if(Array.isArray(t)||Array.isArray(e))return vd(t);let r=vd(e),n=e,i=t;for(let s of Object.keys(i)){let o=i[s],a;if(Array.isArray(o))a=vd(o);else if(typeof o==="object"&&o!==null){let c=Object.hasOwn(n,s)?n[s]:void 0;a=Dx(c,o)}else a=o;ma(r,s,a)}return r}function vd(e){let t=Array.isArray(e)?Array(e.length):{},r=e;for(let n of Object.keys(r))ma(t,n,r[n]);return t}function ma(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}var je;var ts=L(()=>{zs();Ar();Wt();je=pa});class ha{circular;paths(...e){return Jx(this._$refs,e.flat()).map((r)=>Dn(r.decoded))}values(...e){let t=this._$refs;return Jx(t,e.flat()).reduce((n,i)=>(n[Dn(i.decoded)]=t[i.encoded].value,n),{})}exists(e,t){try{return this._resolve(e,"",t)!==null}catch{return!1}}get(e,t){return this._resolve(e,"",t)?.value}set(e,t){let r=Fe(this._root$Ref.path,e),n=this._getRef(r);if(!n)throw Error(`Error resolving $ref pointer "${e}".
102
+ `;return Yb(r,s,"utf8"),1}function tx(e){let t=cl(e,".nojekyll");if(al(t))return 0;return Yb(t,"","utf8"),1}var sN="/images/_optimized/*",Gb=31536000,oN="# Generated by @jxsuite/compiler — configure via build.headers in project.json.",aN="# ─── public/_headers (hand-authored; these rules override the block above) ───";var rx=L(()=>{wr();dd()});async function nx(e,t,r,n={}){let i={},s=mf(e);for(let o of r.projectContributions()){let a=o.project?.key;if(!a||!o.capabilities.projectData)continue;if(!t||!(a in t))continue;i[a]=await o.call("projectData",t[a],{io:s,projectConfig:t,registry:r,root:e,...n.lazy===!0&&{lazy:!0}})}return i}var ix=L(()=>{On()});import{cpSync as lN,existsSync as uN,mkdirSync as fN}from"node:fs";import{dirname as dN,resolve as pN}from"node:path";async function sx(e,t,r){let n=[],i=[],s=new Map;for(let o of e.assetProviders()){let a=o.project?.key,c=a?t[a]:void 0;if(a&&(c==null||J(c)&&Object.keys(c).length===0))continue;try{let l=await o.call("assets",c??null,{projectConfig:t,root:r});for(let u of l??[]){if(!J(u)||!u.urlPrefix||!u.dir)continue;let d={dir:u.dir,urlPrefix:kc(u.urlPrefix)};if(Ot(u.filter))d.filter=u.filter;let h=s.get(d.urlPrefix);if(h){if(h.dir!==d.dir)i.push(`Asset mount conflict: "${d.urlPrefix}" is claimed by both "${h.dir}" and "${d.dir}"`);continue}s.set(d.urlPrefix,d),n.push(d)}}catch(l){i.push(`Error in ${o.name}.assets: ${Pe(l)}`)}}return{errors:i,mounts:n}}function pd(e,t,r){if(t.length===0||!e)return;for(let n of oy(e,t))r.add(n)}function ox(e,t,r){let n=0,i=[];for(let s of e){let o=Ac(t,s);if(!o||!uN(o)){i.push(s);continue}let a=pN(r,decodeURIComponent(s).replace(/^\//,""));fN(dN(a),{recursive:!0}),lN(o,a),n+=1}return{copied:n,missing:i}}var ax=L(()=>{wr();Ee();vr()});async function md(e,t,r){let n=e.$layout??t.defaults?.layout??null;if(!n)return e;let i=await r(n);if(i.$layout)i=await md(i,t,r);let s=e.children??[],o=T(s)?[s]:Array.isArray(s)?s:[],a=hN(i);if(mN(a,o),e.state)a.state={...a.state,...e.state};if(e.$media)a.$media={...a.$media,...e.$media};if(e.style)a.style={...a.style,...e.style};if(e.attributes)a.attributes={...a.attributes,...e.attributes};if(e.$head)a._pageHead=e.$head;if(e.title)a._pageTitle=e.title;return delete a.$layout,a}function mN(e,t){let r=new Map,n=[];for(let i of t){let s=J(i)?i.attributes?.slot:void 0;if(s){let o=r.get(s);if(!o)o=[],r.set(s,o);o.push(i)}else n.push(i)}cx(e,r,n)}function cx(e,t,r){if(!J(e))return;if(!Array.isArray(e.children))return;let n=[];for(let i of e.children)if(J(i)&&i.tagName==="slot"){let s=i.attributes?.name,o=s?t.get(s):void 0;if(s&&o)n.push(...o),t.delete(s);else if(!s&&r.length>0)n.push(...r);else if(Array.isArray(i.children))n.push(...i.children)}else cx(i,t,r),n.push(i);e.children=n}function hN(e){return structuredClone(e)}var lx=L(()=>{Ee()});import{existsSync as gN,readFileSync as yN}from"node:fs";import{resolve as bN}from"node:path";function xN(e){return(t)=>{let r=bN(e,t);if(!gN(r))throw Error(`Layout not found: ${t} (resolved to ${r})`);try{return ti(yN(r,"utf8"),r)}catch(n){throw Error(`Invalid layout JSON at ${r}: ${Pe(n)}`,{cause:n})}}}function ux(e,t,r){return md(e,t,xN(r))}var fx=L(()=>{vr();lx()});function dx(e,t){if(!T(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function px(e=[],t=[],r=[],n={}){let i=[{attributes:{charset:n.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],s=new Map;for(let a of[...i,...e,...t,...r]){let c=hd(a);s.set(c,a)}let o=n.title??n.siteName??"Jx Site";if(s.set("title",{children:[o],tagName:"title"}),n.pageUrl&&n.siteUrl){let a=ii(n.pageUrl,n.siteUrl);if(![...s.values()].some((l)=>J(l)&&l.tagName==="link"&&l.attributes?.rel==="canonical")){let l={attributes:{href:a,rel:"canonical"},tagName:"link"};s.set(hd(l),l)}if(!s.has("meta:og:url"))s.set("meta:og:url",{attributes:{content:a,property:"og:url"},tagName:"meta"})}if(n.siteName&&!s.has("meta:og:site_name"))s.set("meta:og:site_name",{attributes:{content:n.siteName,property:"og:site_name"},tagName:"meta"});for(let a of n.alternates??[]){let c={attributes:{href:a.href,hreflang:a.hreflang,rel:"alternate"},tagName:"link"},l=hd(c);if(!s.has(l))s.set(l,c)}return[...s.values()]}function hd(e){if(!J(e))return String(e);let t=e.tagName??"unknown",r=e.attributes??{};if(t==="title")return"title";if(r.charset)return"meta:charset";if(t==="meta"&&r.name)return`meta:${r.name}`;if(t==="meta"&&r.property)return`meta:${r.property}`;if(t==="link"&&r.rel){let n=r.hreflang??r.type??r.media??r.sizes??"";return`link:${r.rel}:${r.href??""}:${String(n)}`}if(t==="script"&&r.src)return`script:${r.src}`;if(t==="style"){let n=Array.isArray(e.children)?e.children.join(""):e.textContent,i=J(n)?JSON.stringify(n):n??"";return`style:${$N(i)}`}return`${t}:${JSON.stringify(e)}`}function $N(e){let t=0;for(let r=0;r<e.length;r++)t=Math.trunc((t<<5)-t+(e.codePointAt(r)??0));return t.toString(36)}function mx(e){return e.map((t)=>vN(t)).join(`
103
+ `)}function vN(e){if(T(e))return e;if(!J(e))return"";let t=e.tagName,r=e.attributes??{},n=Object.entries(r).map(([c,l])=>l===!0?c:`${c}="${wN(l)}"`).join(" "),i=n?`<${t} ${n}>`:`<${t}>`;if(t!==void 0&&new Set(["meta","link","base","br","hr","img","input"]).has(t))return i;let o=Array.isArray(e.children)?e.children.join(""):e.textContent,a=J(o)?JSON.stringify(o,null,2):o??"";return`${i}${a}</${t}>`}function wN(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var hx=L(()=>{wr();Ee()});function _N(e){let t=e.indexOf(":");if(t===-1)return!1;if(t===e.length-1)return!1;try{return new URL(e).protocol!==""}catch{return!1}}function PN(e){if(!T(e))return[];return e.split(/\s+/).filter((t)=>{if(t==="")return!1;let r=t.toLowerCase();return!SN.has(r)&&!EN.has(r)&&!_N(t)})}function gx(e){let t=new Set;for(let r of e){if(!J(r)||r.tagName!=="link")continue;for(let n of PN(r.attributes?.rel))t.add(n)}return[...t]}var SN,EN;var yx=L(()=>{Ee();SN=new Set(["about","acl","alternate","amphtml","api-catalog","appendix","apple-touch-icon","apple-touch-startup-image","archives","author","blocked-by","bookmark","c2pa-manifest","canonical","chapter","cite-as","collection","compression-dictionary","contents","convertedfrom","copyright","create-form","current","deprecation","describedby","describes","disclosure","dns-prefetch","dpp","duplicate","edit","edit-form","edit-media","enclosure","external","first","geofeed","glossary","help","hosts","hub","ice-server","icon","index","intervalafter","intervalbefore","intervalcontains","intervaldisjoint","intervalduring","intervalequals","intervalfinishedby","intervalfinishes","intervalin","intervalmeets","intervalmetby","intervaloverlappedby","intervaloverlaps","intervalstartedby","intervalstarts","item","last","latest-version","license","linkset","lrdd","manifest","mask-icon","me","media-feed","memento","micropub","modulepreload","monitor","monitor-group","next","next-archive","nofollow","noopener","noreferrer","opener","openid2.local_id","openid2.provider","original","p3pv1","payment","pingback","preconnect","predecessor-version","prefetch","preload","prerender","prev","prev-archive","preview","previous","privacy-policy","profile","publication","rdap-active","rdap-bottom","rdap-down","rdap-top","rdap-up","related","replies","restconf","ruleinput","search","section","self","service","service-desc","service-doc","service-meta","sip-trunking-capability","sponsored","start","status","stylesheet","subsection","successor-version","sunset","tag","terms-of-service","timegate","timemap","type","ugc","up","version-history","via","webmention","working-copy","working-copy-of"]),EN=new Set(["shortcut"])});function bx(e,t,r,n=null,i=null,s=[]){if(!e.state)e.state={};let o={};if(i!==null)o.defaultLocale=i.defaultLocale,o.locales=i.locales;e.state.$site={name:t.name??"Jx Site",url:t.url??"",...o,...t.state};let a=(T(e.$lang)?e.$lang:void 0)??dn(r.urlPattern,i)??t.defaults?.lang,c=s.map((u)=>({code:u.locale,current:u.urlPattern===r.urlPattern,dir:Xo(u.locale),label:Wy(u.locale),url:u.urlPattern})),l={params:r._pathParams??{},title:e.title??e._pageTitle??t.name??"",url:r.urlPattern};if(c.length>0)l.alternates=c;if(a!==void 0)l.dir=Xo(a),l.locale=a;if(e.state.$page=l,t.state){for(let[u,d]of Object.entries(t.state))if(u!=="$site"&&u!=="$page"&&!(u in e.state))e.state[u]=d}if(t.$media)e.$media={...t.$media,...e.$media};if(t.imports&&Object.keys(t.imports).length>0){if(!e.imports)e.imports={};for(let[u,d]of Object.entries(t.imports))if(!(u in e.imports))e.imports[u]=n&&(d.startsWith("./")||d.startsWith("../"))?n(d,r):d}if(t.$elements?.length)if(!e.$elements?.length)e.$elements=[...t.$elements];else{let u=new Set,d=[];for(let h of[...t.$elements,...e.$elements]){let m=T(h)?h:J(h)?h.$ref:void 0;if(m&&!u.has(m))u.add(m),d.push(h)}e.$elements=d}return e}var xx=L(()=>{Ee();zi()});import{dirname as kN,relative as AN,resolve as jN}from"node:path";function RN(e){return(t,r)=>{if(!r.sourcePath)return t;return`./${AN(kN(r.sourcePath),jN(e,t))}`}}function $x(e,t,r,n=null,i=null,s=[]){return bx(e,t,r,n===null?null:RN(n),i,s)}var vx=L(()=>{xx()});function Dn(e){if(e.startsWith("\\\\?\\"))return e;return e.split("\\").join("/")}var ON,ca=()=>ON;var wx=L(()=>{ON=/^win/.test(globalThis.process?globalThis.process.platform:"")});function Fe(e,t){let r=new URL(Sx(e),"https://aaa.nonexistanturl.com"),n=new URL(Sx(t),r),i=t.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:a}=n;return s+o+a+i}return n.toString()+i}function Sx(e){let t=e.search(/[?#]/);return t<0?Dn(e):Dn(e.slice(0,t))+e.slice(t)}function ua(e){try{return decodeURIComponent(e)}catch{try{return decodeURIComponent(e.replace(/%(?![\dA-F]{2})/gi,"%25"))}catch{return e}}}function _r(){if(typeof window<"u"&&window.location&&window.location.href){let e=window.location.href;if(!e||!e.startsWith("http"))try{return new URL(e),e}catch{return"/"}return e}if(typeof process<"u"&&process.cwd){let e=process.cwd(),t=e.slice(-1);if(t==="/"||t==="\\")return e;else return e+"/"}return"/"}function _x(e){let t=IN.exec(e||"");if(t)return t[1].toLowerCase();return}function Px(e){let t=e.search(/[?#]/),r=t>=0?e.substring(0,t):e,n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),i=r.lastIndexOf(".");if(i>n)return r.substring(i).toLowerCase();return""}function Pr(e){if(!e)return"#";let t=e.indexOf("#");if(t>=0)return e.substring(t);return"#"}function $e(e){if(!e)return"";let t=e.indexOf("#");if(t>=0)e=e.substring(0,t);return e}function kx(e){let t=_x(e);if(t==="http"||t==="https")return!0;else if(t===void 0)return typeof window<"u";else return!1}function ll(e){if(!e||typeof e!=="string")return!0;let t=e.trim().toLowerCase();if(!t)return!0;if(t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:"))return!0;if(t.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let r=new URL(t.startsWith("//")?"http:"+t:t);if(yd(r.hostname))return!0;let n=r.port;if(n&&HN(parseInt(n)))return!0}catch{if(t.startsWith("/")&&!t.startsWith("//"))return!1;if(BN(t))return!0}return!1}async function Ax(e){if(ll(e))return{unsafe:!0};if(typeof e!=="string"||typeof process>"u"||!process.versions?.node||typeof window<"u")return{unsafe:!1};let t=new URL(e.startsWith("//")?`http:${e}`:e);if(t.protocol!=="http:"&&t.protocol!=="https:")return{unsafe:!1};let i=await(await import("node:dns/promises")).lookup(jx(t.hostname),{all:!0,verbatim:!0});if(i.length===0||i.some(({address:s})=>yd(s)))return{unsafe:!0};return{unsafe:!1,addresses:i}}function yd(e){let t=jx(e);if(!t)return!0;if(t==="localhost"||DN.some((i)=>t.endsWith(i)))return!0;let r=Rx(t);if(r)return Ox(r);let n=JN(t);if(n)return FN(n);return!1}function jx(e){let t=e.trim().toLowerCase();if(t.startsWith("[")&&t.endsWith("]"))t=t.slice(1,-1);while(t.endsWith("."))t=t.slice(0,-1);return t}function Rx(e){let t=e.split(".");if(t.length!==4)return;let r=t.map((n)=>{if(!/^\d+$/.test(n))return Number.NaN;return Number(n)});if(r.some((n)=>!Number.isInteger(n)||n<0||n>255))return;return r}function Ox([e,t,r,n]){return e===0||e===10||e===127||e===100&&t>=64&&t<=127||e===169&&t===254||e===172&&t>=16&&t<=31||e===192&&t===0&&r===0||e===192&&t===168||e===198&&(t===18||t===19)||e>=224||e===255&&t===255&&r===255&&n===255}function JN(e){if(!e.includes(":"))return;let t=e,r=t.lastIndexOf(":"),n=t.slice(r+1);if(n.includes(".")){let c=Rx(n);if(!c)return;let l=c[0]*256+c[1],u=c[2]*256+c[3];t=`${t.slice(0,r+1)}${l.toString(16)}:${u.toString(16)}`}let i=t.split("::");if(i.length>2)return;let s=Ex(i[0]),o=i.length===2?Ex(i[1]):[];if(!s||!o)return;if(i.length===1)return s.length===8?s:void 0;let a=8-s.length-o.length;if(a<1)return;return[...s,...Array(a).fill(0),...o]}function Ex(e){if(!e)return[];let t=e.split(":").map((r)=>{if(!/^[\da-f]{1,4}$/i.test(r))return Number.NaN;return Number.parseInt(r,16)});if(t.some((r)=>!Number.isInteger(r)||r<0||r>65535))return;return t}function FN(e){if(e.length!==8)return!1;let t=e.every((a)=>a===0),r=e.slice(0,7).every((a)=>a===0)&&e[7]===1,n=(e[0]&65024)===64512,i=(e[0]&65472)===65152,s=(e[0]&65280)===65280;if(t||r||n||i||s)return!0;let o=qN(e);return o?Ox(o):!1}function qN(e){let t=e.slice(0,5).every((i)=>i===0),r=t&&e[5]===0,n=t&&e[5]===65535;if(!r&&!n)return;return[Math.floor(e[6]/256),e[6]%256,Math.floor(e[7]/256),e[7]%256]}function BN(e){return e.split(/[\s/?#]+/).map((r)=>r.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((r)=>yd(r))}function HN(e){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(e)}function ul(e){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let t=_x(e);return t===void 0||t==="file"}function Cx(e){if(ca()){let t=_r(),r=e.toUpperCase(),i=Dn(t).toUpperCase(),s=r.includes(i),o=r.includes(i),a=MN.test(e)||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://");if(!(s||o||a)&&!t.startsWith("http"))e=((l,u)=>{if(l.endsWith("/")||l.endsWith("\\"))return l+u;else return l+"/"+u})(t,e);e=Dn(e)}e=encodeURI(e);for(let t of LN)e=e.replace(t[0],t[1]);return e}function Bs(e,t){e=e.replace(/%(?![0-9A-Fa-f]{2})/g,"%25");for(let n=0;n<gd.length;n+=2)e=e.replace(new RegExp(gd[n].source,"gi"),gd[n+1]);e=decodeURI(e);let r=e.toLowerCase().startsWith("file://");if(r){if(e=e.replace(/^file:\/\//i,"").replace(/^\//,""),ca()&&e[1]==="/")e=`${e[0]}:${e.substring(1)}`;if(t)e="file:///"+e;else r=!1,e=ca()?e:"/"+e}if(ca()&&!r){if(e=e.replace(CN,"\\"),e.match(/^[a-z]:\\/i))e=e[0].toUpperCase()+e.substring(1)}return e}function Hs(e){if(e=ua(e),e.length<=1||e[0]!=="#"||e[1]!=="/")return[];return e.slice(2).split("/").map((t)=>t.replace(TN,"/").replace(NN,"~"))}var CN,IN,TN,NN,MN,LN,gd,DN,la=(e)=>new URL(e);var Wt=L(()=>{wx();CN=/\//g,IN=/^(\w{2,}):\/\//i,TN=/~1/g,NN=/~0/g,MN=/^[a-zA-Z]:[\\/]/,LN=[[/\?/g,"%3F"],[/#/g,"%23"]],gd=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%3F/g,"?",/%40/g,"@"],DN=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function Ix(){let e={},t=this;for(let r of zN(t))if(typeof r==="string"){let n=t[r],i=typeof n;if(!UN.includes(i))e[r]=n}return e}function zN(e,t=[]){let r=[];while(e&&e!==WN)r=r.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let n=new Set(r);for(let i of t.concat(VN))n.delete(i);return n}function zt(e){return e instanceof kr||e instanceof Us}function xd(e){if(e.path===null)e.path=[];return e}var UN,VN,WN,kr,Us,Gr,fl,Yr,dl,fa,bd,Vs;var Ar=L(()=>{Wt();UN=["function","symbol","undefined"],VN=["constructor","prototype","__proto__"],WN=Object.getPrototypeOf({});kr=class kr extends Error{name;message;source;path;code;constructor(e,t,r){super(void 0,r);this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=t,this.path=null}toJSON=Ix.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Us=class Us extends Error{files;constructor(e){super();this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${Bs(e.$refs._root$Ref.path)}'`}toJSON=Ix.bind(this);static getParserErrors(e){let t=[],r=new Set,n=[...Object.values(e.$refs._$refs),...Object.values(e.$refs._aliases)];for(let i of n)if(i.errors){for(let s of i.errors)if(!r.has(s.footprint))r.add(s.footprint),t.push(s)}return t}get errors(){return Us.getParserErrors(this.files)}};Gr=class Gr extends kr{code="EPARSER";name="ParserError";constructor(e,t,r){super(`Error parsing ${t}: ${e}`,t,r)}};fl=class fl extends kr{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(e){super(`Could not find parser for "${e}"`,e)}};Yr=class Yr extends kr{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(e,t,r){super(e.message||`Error reading file "${t}"`,t,r);if("code"in e)this.ioErrorCode=String(e.code)}};dl=class dl extends kr{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(e){super(`Could not find resolver for "${e}"`,e)}};fa=class fa extends kr{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(e,t,r,n,i){super(`Missing $ref pointer "${Pr(t)}". Token "${e}" does not exist.`,$e(t));this.targetToken=e,this.targetRef=r,this.targetFound=n,this.parentPath=i}};bd=class bd extends kr{code="ETIMEOUT";name="TimeoutError";constructor(e){super(`Dereferencing timeout reached: ${e}ms`)}};Vs=class Vs extends kr{code="EINVALIDPOINTER";name="InvalidPointerError";constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,$e(t))}}});function ut(e,t,r=!1){let n=Ws(t,r);return n?Fe(e,n):e}function pl(e){if(!e||typeof e!=="object"||ArrayBuffer.isView(e))return!1;if(Ws(e))return!0;let t=e.$schema;if(typeof t==="string"&&(t.includes("draft-04/")||t.includes("draft-06/")||t.includes("draft-07/")||t.includes("draft/2019-09/")||t.includes("draft/2020-12/")||t.includes("oas/3.1/")))return!0;let r=e.openapi;return typeof r==="string"&&/^3\.1(?:\.|$)/.test(r)}function ml(e,t,r,n,i=!1){if(!i)return;let s=new Map,o=new Set,a=(c,l,u,d)=>{if(!c||typeof c!=="object"||ArrayBuffer.isView(c)||o.has(c))return;let h=bt(c,u),m=ut(l,c,h),y=`${h}:${m}`,g=s.get(c);if(g?.has(y))return;if(g)g.add(y);else s.set(c,new Set([y]));if(o.add(c),m!==l)e._addAlias(m,c,n,i,h,d);for(let b of Object.keys(c))a(c[b],m,h,KN(d,b));o.delete(c)};a(r,t,!1,t+"#")}function KN(e,t){return e+"/"+t.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1")}function Ws(e,t=!1){if(!e||typeof e!=="object")return;let n=bt(e,t)?e.id:e.$id;if(typeof n==="string"&&n.length>0)return n;return}function bt(e,t=!1){if(!e||typeof e!=="object")return t;let r=e.$schema;if(typeof r==="string"){if(r.includes("draft-04/"))return!0;if(r.includes("draft-06/")||r.includes("draft-07/")||r.includes("draft/2019-09/")||r.includes("draft/2020-12/")||r.includes("oas/3.1/"))return!1}let n=e.openapi;if(typeof n==="string"&&/^3\.1(?:\.|$)/.test(n))return!1;return t}var Jn=L(()=>{Wt()});function es(e,t){return fi(t)?$d.get(e)?.get(t):void 0}function Xr(e,t,r,n){if(t.child)return t.child(r,n);let i=es(e,n);if(i)return i;let s=bt(n,t.legacyIdScope),o=t.dynamicIdScope&&fi(n)&&!ArrayBuffer.isView(n)?ut(t.scopeBase,n,s):t.scopeBase,a=(t.path.includes("#")?t.path:t.path+"#")+"/"+r.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1");return{value:n,path:a,scopeBase:o,dynamicIdScope:t.dynamicIdScope,legacyIdScope:s}}function da(e,t,r,n,i,s=!0){if(!fi(t)||!fi(r.value)||!fi(n.value))return{...r,value:t};let o=r.value,a=n.value,l={...!s&&Object.hasOwn(a,"$ref")?n:r,value:t,child(d,h){if(!((!s||d!=="$ref")&&Object.hasOwn(a,d)))return Xr(e,r,d,h);if(!i||!fi(h))return Xr(e,n,d,h);let y=a[d],g=Xr(e,n,d,y);if(!fi(y)||Array.isArray(y))return{...g,value:h};let b=Object.hasOwn(o,d)?o[d]:void 0;if(fi(b)&&!Array.isArray(b))return es(e,h)||da(e,h,Xr(e,r,d,b),g,!0,!1);return{...g,value:h}}},u=$d.get(e);if(!u)u=new WeakMap,$d.set(e,u);return u.set(t,l),l}function fi(e){return e!==null&&typeof e==="object"}var $d;var vd=L(()=>{Jn();$d=new WeakMap});class di{$ref;path;originalPath;scopeBase;legacyIdScope;location;value;circular;chainCircular;indirections;constructor(e,t,r){this.$ref=e,this.path=t,this.originalPath=r||t,this.scopeBase=e.path||$e(t),this.legacyIdScope=e.legacyIdScope,this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(e,t,r,n=new Set,i=!0){let s=di.parse(this.path,this.originalPath),o=[];if(this.value=Mx(e),this.$ref.dynamicIdScope&&!Lx(this.$ref))this.legacyIdScope=bt(this.value,this.legacyIdScope),this.scopeBase=ut(this.scopeBase,this.value,this.legacyIdScope);this.setLocation(es(this.$ref.$refs,this.value)||{value:this.value,path:this.$ref.path,scopeBase:this.scopeBase,dynamicIdScope:this.$ref.dynamicIdScope,legacyIdScope:this.legacyIdScope});for(let c=0;c<s.length;c++){let l=this.circular,u=this.chainCircular,d=je.isExtended$Ref(this.value);if(hl(this,t,r,n))this.path=di.join(this.path,s.slice(c));else if(d)this.circular=l,this.chainCircular=u;let h=s[c];if(this.value===null||typeof this.value!=="object"&&typeof this.value!=="function"){this.value=null;let m=this.$ref.path||"",y=this.path.replace(m,""),g=di.join("",o),b=r?.replace(m,"");throw new fa(h,Tx(this.originalPath),y,g,b)}if(!Object.hasOwn(this.value,h)||this.value[h]===void 0||this.value[h]===null&&c===s.length-1){let m=!1;for(let _=s.length-1;_>c;_--){let P=s.slice(c,_+1).join("/");if(Object.hasOwn(this.value,P)&&this.value[P]!==void 0){this.value=this.value[P],this.setLocation(Xr(this.$ref.$refs,this.location,P,this.value)),c=_,m=!0;break}}if(m){this.chainCircular=u;continue}if(Object.hasOwn(this.value,h)&&this.value[h]===null){this.value=gl,this.setLocation(Xr(this.$ref.$refs,this.location,h,null)),this.chainCircular=u;continue}this.value=null;let y=this.$ref.path||"",g=this.path.replace(y,""),b=di.join("",o),x=r?.replace(y,"");throw new fa(h,Tx(this.originalPath),g,b,x)}else this.value=this.value[h];this.chainCircular=u,o.push(h),this.setLocation(Xr(this.$ref.$refs,this.location,h,this.value))}let a=this.location?.dynamicIdScope?this.scopeBase:this.location?.path||this.path;if(i){let c=this.value?.$ref?Fe(a,this.value.$ref):void 0,l=typeof r==="string"?Fe(this.$ref.$refs._root$Ref.path,r):r;if(je.isAllowed$Ref(this.value,t)&&c===l&&c!==this.path)this.chainCircular=!0;else if(!this.value||c)hl(this,t,r,n)}return this}set(e,t,r){let n=di.parse(this.path),i;if(n.length===0)return this.value=t,t;if(e2(this.path,n),this.value=Mx(e),this.$ref.dynamicIdScope&&!Lx(this.$ref))this.legacyIdScope=bt(this.value,this.legacyIdScope),this.scopeBase=ut(this.scopeBase,this.value,this.legacyIdScope);this.setLocation(es(this.$ref.$refs,this.value)||{value:this.value,path:this.$ref.path,scopeBase:this.scopeBase,dynamicIdScope:this.$ref.dynamicIdScope,legacyIdScope:this.legacyIdScope});for(let s=0;s<n.length-1;s++){if(hl(this,r),i=n[s],this.value&&Object.hasOwn(this.value,i)&&this.value[i]!==void 0)this.value=this.value[i];else this.value=Nx(this,i,{});this.setLocation(Xr(this.$ref.$refs,this.location,i,this.value))}return hl(this,r),i=n[n.length-1],Nx(this,i,t),e}setLocation(e){this.location=e,this.scopeBase=e.scopeBase,this.legacyIdScope=e.legacyIdScope}static parse(e,t){let r=ua(Pr(e).substring(1));if(!r)return[];let n=r.split("/");for(let i=0;i<n.length;i++)n[i]=n[i].replace(XN,"/").replace(QN,"~");if(n[0]!=="")throw new Vs(r,t===void 0?e:t);return n.slice(1)}static join(e,t){if(e.indexOf("#")===-1)e+="#";t=Array.isArray(t)?t:[t];for(let r=0;r<t.length;r++){let n=t[r];e+="/"+n.replace(/%/g,"%25").replace(YN,"~0").replace(GN,"~1")}return e}}function Tx(e){try{return decodeURI(e)}catch{return e}}function hl(e,t,r,n=new Set){let i=!1,s=r,o=[];try{while(je.isAllowed$Ref(e.value,t)){let a=je.isExtended$Ref(e.value),{value:c,path:l}=e,u=e.location?.dynamicIdScope?e.scopeBase:e.location?.path||e.path,d=Fe(u,e.value.$ref);if(d===e.path&&!t2(s))return e.circular=!0,e.chainCircular=!0,i;let h=typeof s==="string"?Fe(e.$ref.$refs._root$Ref.path,s):s;if(d===h&&d!==e.path)return e.chainCircular=!0,i;if(n.has(d))return e.chainCircular=!0,i;let m=t?.dereference?.maxDepth??500;if(n.size>=m)throw RangeError(`Maximum dereference depth (${m}) exceeded at ${e.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);n.add(d),o.push(d);let y=e.$ref.$refs._resolve(d,l,t,n,a);if(y===null)return i;if(e.indirections+=y.indirections+1,e.chainCircular||=y.circular||y.chainCircular,a){if(e.chainCircular)return i;return e.value=je.dereference(c,y.value,t),e.setLocation(da(e.$ref.$refs,e.value,y.location,e.location,t?.dereference?.mergeKeys??!0)),i}else e.$ref=y.$ref,e.path=y.path,e.value=y.value,e.scopeBase=y.scopeBase,e.legacyIdScope=y.legacyIdScope,e.location=y.location,s=l,i=!0}return i}finally{for(let a of o)n.delete(a)}}function Nx(e,t,r){if(e.value&&typeof e.value==="object")if(t==="-"&&Array.isArray(e.value))e.value.push(r);else e.value[t]=r;else throw new kr(`Error assigning $ref pointer "${e.path}".
104
+ Cannot set "${t}" of a non-object.`);return r}function e2(e,t){for(let r of t)if(ZN.has(r))throw new kr(`Error assigning $ref pointer "${e}".
105
+ Unsafe JSON Pointer token "${r}" cannot be used for assignment.`)}function Mx(e){if(zt(e))throw e;return e}function t2(e){return typeof e=="string"&&di.parse(e).length==0}function Lx(e){return Boolean(e.path&&e.path in e.$refs._aliases)}var gl,GN,YN,XN,QN,ZN,qe;var zs=L(()=>{ts();Wt();Ar();Jn();vd();gl=Symbol("null"),GN=/\//g,YN=/~/g,XN=/~1/g,QN=/~0/g,ZN=new Set(["__proto__","constructor","prototype"]);qe=di});class pa{path;sourcePath;value;$refs;pathType;dynamicIdScope=!1;legacyIdScope=!1;errors=[];constructor(e){this.$refs=e}addError(e){if(this.errors===void 0)this.errors=[];let t=this.errors.map(({footprint:r})=>r);if("errors"in e&&Array.isArray(e.errors))this.errors.push(...e.errors.map(xd).filter(({footprint:r})=>!t.includes(r)));else if(!("footprint"in e)||!t.includes(e.footprint))this.errors.push(xd(e))}exists(e,t){try{return this.resolve(e,t),!0}catch{return!1}}get(e,t){return this.resolve(e,t)?.value}resolve(e,t,r,n,i,s=!0){let o=new qe(this,e,r);try{let a=o.resolve(this.value,t,n,i,s);if(a.value===gl)a.value=null;return a}catch(a){if(!t||!t.continueOnError||!zt(a))throw a;if(a.path===null)a.path=Hs(Pr(n));if(a instanceof Vs)a.source=r2($e(n||r||e));return this.addError(a),null}}set(e,t){let r=new qe(this,e);if(this.value=r.set(this.value,t),this.value===gl)this.value=null}static is$Ref(e){return Boolean(e)&&typeof e==="object"&&e!==null&&"$ref"in e&&typeof e.$ref==="string"&&e.$ref.length>0}static isExternal$Ref(e){return pa.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,t){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||/^#%2f/i.test(e.$ref)||e.$ref==="#")return!0;else if(e.$ref[0]!=="#"&&(!t||t.resolve?.external))return!0}return}static isExtended$Ref(e){return pa.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,t,r){if(t&&typeof t==="object"&&pa.isExtended$Ref(e)){let n={};for(let o of Object.keys(e))if(o!=="$ref")ma(n,o,e[o]);let i=r?.dereference?.mergeKeys??!0,s=t;for(let o of Object.keys(s))if(!Object.hasOwn(n,o))ma(n,o,s[o]);else if(i&&typeof n[o]==="object"&&n[o]!==null&&typeof s[o]==="object"&&s[o]!==null)ma(n,o,Dx(s[o],n[o]));return n}else return t}}function r2(e){try{return decodeURI(e)}catch{return e}}function Dx(e,t){if(typeof e!=="object"||e===null)return t;if(typeof t!=="object"||t===null)return t;if(Array.isArray(t)||Array.isArray(e))return wd(t);let r=wd(e),n=e,i=t;for(let s of Object.keys(i)){let o=i[s],a;if(Array.isArray(o))a=wd(o);else if(typeof o==="object"&&o!==null){let c=Object.hasOwn(n,s)?n[s]:void 0;a=Dx(c,o)}else a=o;ma(r,s,a)}return r}function wd(e){let t=Array.isArray(e)?Array(e.length):{},r=e;for(let n of Object.keys(r))ma(t,n,r[n]);return t}function ma(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}var je;var ts=L(()=>{zs();Ar();Wt();je=pa});class ha{circular;paths(...e){return Jx(this._$refs,e.flat()).map((r)=>Dn(r.decoded))}values(...e){let t=this._$refs;return Jx(t,e.flat()).reduce((n,i)=>(n[Dn(i.decoded)]=t[i.encoded].value,n),{})}exists(e,t){try{return this._resolve(e,"",t)!==null}catch{return!1}}get(e,t){return this._resolve(e,"",t)?.value}set(e,t){let r=Fe(this._root$Ref.path,e),n=this._getRef(r);if(!n)throw Error(`Error resolving $ref pointer "${e}".
106
106
  "${$e(r)}" not found.`);n.set(r,t)}_get$Ref(e){return e=Fe(this._root$Ref.path,e),this._getRef(e)}_add(e){let t=$e(e),r=new je(this);return r.path=t,this._$refs[t]=r,this._root$Ref=this._root$Ref||r,r}_addAlias(e,t,r,n=!1,i=!1,s){let o=$e(e);if(!o||this._$refs[o]||this._aliases[o])return this._$refs[o]||this._aliases[o];let a=new je(this);return a.path=o,a.pathType=r,a.value=t,a.dynamicIdScope=n,a.legacyIdScope=i,a.sourcePath=s,this._aliases[o]=a,a}_resolve(e,t,r,n,i=!0){let s=Fe(this._root$Ref.path,e),o=this._getRef(s);if(!o)throw Error(`Error resolving $ref pointer "${e}".
107
- "${$e(s)}" not found.`);return o.resolve(s,r,e,t,n,i)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=()=>this.values();_getRef(e){let t=$e(e);return this._$refs[t]||this._aliases[t]}}function Jx(e,t){let r=Object.keys(e);if(t=Array.isArray(t[0])?t[0]:Array.prototype.slice.call(t),t.length>0&&t[0])r=r.filter((n)=>t.includes(e[n].pathType));return r.map((n)=>({encoded:n,decoded:e[n].pathType==="file"?Bs(n,!0):n}))}var Fx=L(()=>{ts();Wt()});function wd(e){return Object.keys(e||{}).filter((t)=>typeof e[t]==="object").map((t)=>(e[t].name=t,e[t]))}function Sd(e,t,r,n,i){return e.filter((s)=>!!qx(s,t,r,n,i))}function Ed(e){return e.sort((t,r)=>(t.order??Number.MAX_SAFE_INTEGER)-(r.order??Number.MAX_SAFE_INTEGER))}async function _d(e,t,r,n){let i,s=0;return new Promise((o,a)=>{c();function c(){let d=e[s++];if(!d)return a(i);let h=!1,m=!1,y=(g,b)=>{if(m=!0,h)return;if(h=!0,g)u(d,g);else l(d,b)};try{let g=qx(d,t,r,y,n);if(g&&typeof g.then==="function")g.then((b)=>y(void 0,b),(b)=>y(b,void 0));else if(g!==void 0)y(void 0,g);else if(!m&&!e2(d,t))y(Error("No promise has been returned or callback has been called."),void 0)}catch(g){y(g,void 0)}}function l(d,h){o({plugin:d,result:h})}function u(d,h){i={plugin:d,error:h},c()}})}function e2(e,t){let r=e[t];return typeof r==="function"&&r.length>=2}function qx(e,t,r,n,i){let s=e[t];if(typeof s==="function")return s.apply(e,[r,n,i]);if(!n){if(s instanceof RegExp){s.lastIndex=0;let o=s.test(r.url);return s.lastIndex=0,o}else if(typeof s==="string")return s===r.extension;else if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}async function t2(e,t,r){let n=typeof e==="string"?e:e.url,i=typeof e==="string"?void 0:e.baseUrl,s=typeof e==="string"?void 0:e.reference,o=n.indexOf("#"),a="";if(o>=0)a=n.substring(o),n=n.substring(0,o);if(s){let u=s.indexOf("#");if(u>=0)s=s.substring(0,u)}let c=t._add(n),l={url:n,hash:a,extension:Px(n),...s!==void 0?{reference:s}:{},...i!==void 0?{baseUrl:i}:{}};try{let u=await r2(l,r,t);c.pathType=u.plugin.name,l.data=u.result;let d=await n2(l,r,t);return c.value=d.result,c.dynamicIdScope=pl(c.value),c.legacyIdScope=bt(c.value),ml(t,c.path,c.value,c.pathType,c.dynamicIdScope),d.result}catch(u){if(zt(u))c.value=u;throw u}}async function r2(e,t,r){let n=wd(t.resolve);n=Sd(n,"canRead",e,void 0,r),Ed(n);try{return await _d(n,"read",e,r)}catch(i){if(!i&&t.continueOnError)throw new dl(e.url);else if(!i||!("error"in i))throw SyntaxError(`Unable to resolve $ref pointer "${e.url}"`,{cause:i});else if(i.error instanceof Yr)throw i.error;else{let s=i.error instanceof Error?i.error:Error(String(i.error));throw new Yr(s,e.url,{cause:i.error})}}}async function n2(e,t,r){let n=wd(t.parse),i=Sd(n,"canParse",e),s=i.length>0?i:n;Ed(s);try{let o=await _d(s,"parse",e,r);if(!o.plugin.allowEmpty&&i2(o.result))throw SyntaxError(`Error parsing "${e.url}" as ${o.plugin.name}.
108
- Parsed value is empty`);else return o}catch(o){if(!o&&t.continueOnError)throw new fl(e.url);else if(o&&o.message&&o.message.startsWith("Error parsing"))throw o;else if(!o||!("error"in o))throw SyntaxError(`Unable to parse ${e.url}`,{cause:o});else if(o.error instanceof Gr)throw o.error;else throw new Gr(o.error?.message??String(o.error),e.url,{cause:o.error})}}function i2(e){return e===void 0||e===null||typeof e==="object"&&Object.keys(e).length===0||typeof e==="string"&&e.trim().length===0||Buffer.isBuffer(e)&&e.length===0}var Ks;var yl=L(()=>{Wt();Jn();Ar();Ks=t2});var Bx;var Hx=L(()=>{Ar();Bx={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(e){let t=e.data;if(Buffer.isBuffer(t))t=t.toString();if(typeof t==="string"){if(t.trim().length===0)return;if(this.allowBOM&&t.charCodeAt(0)===65279)t=t.slice(1);try{return JSON.parse(t)}catch(r){throw new Gr(r.message,e.url)}}else return t}}});function Nt(e,t){return{tagName:e,nodeKind:"scalar",implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??((r)=>String(r)),representTagName:t.representTagName??(()=>e)}}function Dd(e,t){let r=t.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??((n)=>n),carrierIsResult:r,identify:t.identify,represent:t.represent??((n)=>n),representTagName:t.representTagName??(()=>e)}}function vl(e,t){let r=t.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??((n)=>n),carrierIsResult:r,identify:t.identify,represent:t.represent??((n)=>n),representTagName:t.representTagName??(()=>e)}}function w2(e){let t=e,r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0o"))return r*parseInt(t.slice(2),8);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);return r*parseInt(t,10)}function S2(e,t){if(t){if(!v2.test(e))return Te}else if(!$2.test(e))return Te;let r=w2(e);return Number.isFinite(r)?r:Te}function P2(e){let t=e,r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0o"))return r*parseInt(t.slice(2),8);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);return r*parseInt(t,10)}function k2(e,t){if(t){if(!_2.test(e))return Te}else if(!E2.test(e))return Te;let r=P2(e);return Number.isFinite(r)?r:Te}function R2(e){let t=e.replace(/_/g,""),r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);if(t.includes(":")){let n=0;for(let i of t.split(":"))n=n*60+Number(i);return r*n}if(t!=="0"&&t[0]==="0")return r*parseInt(t,8);return r*parseInt(t,10)}function O2(e){if(!j2.test(e))return Te;let t=R2(e);return Number.isFinite(t)?t:Te}function T2(e){if(!C2.test(e))return Te;let t=e.toLowerCase(),r=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let n=r*parseFloat(t);if(Number.isFinite(n)||I2.test(e))return n;return Te}function N2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function D2(e,t){if(t){if(!L2.test(e))return Te;let n=e.toLowerCase(),i=n[0]==="-"?-1:1;if("+-".includes(n[0]))n=n.slice(1);if(n===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let s=i*parseFloat(n);return Number.isFinite(s)?s:Te}if(!M2.test(e))return Te;let r=Number(e);if(Number.isFinite(r))return r;return Te}function J2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function H2(e){if(!q2.test(e))return Te;let t=e.toLowerCase().replace(/_/g,""),r=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let n=0;if(t.includes(":")){for(let i of t.split(":"))n=n*60+Number(i);n*=r}else n=r*parseFloat(t);if(Number.isFinite(n)||B2.test(e))return n;return Te}function U2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function W2(e){let t=e.replace(/\s/g,"");if(t.length%4!==0||!V2.test(t))return Te;let r=atob(t),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}function z2(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ux(e,t,r,n=0,i=0,s=0,o=0){let a=new Date(Date.UTC(e,t,r,n,i,s,o));return a.setUTCFullYear(e,t,r),a}function Y2(e){let t=K2.exec(e);if(t===null)t=G2.exec(e);if(t===null)return Te;let r=+t[1],n=+t[2]-1,i=+t[3];if(!t[4]){let u=Ux(r,n,i);if(u.getUTCFullYear()!==r||u.getUTCMonth()!==n||u.getUTCDate()!==i)return Te;return u}let s=+t[4],o=+t[5],a=+t[6],c=0;if(s>23||o>59||a>59)return Te;if(t[7]){let u=t[7].slice(0,3);while(u.length<3)u+="0";c=+u}let l=Ux(r,n,i,s,o,a,c);if(l.getUTCFullYear()!==r||l.getUTCMonth()!==n||l.getUTCDate()!==i)return Te;if(t[9]){let u=+t[10],d=+(t[11]||0);if(u>23||d>59)return Te;let h=(u*60+d)*60000;l.setTime(l.getTime()-(t[9]==="-"?-h:h))}return l}function wl(e){if(e===null||typeof e!=="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Vx(e,t){let r={};for(let n of t)if(e[n]!==void 0)r[n]=e[n];return r}function Z2(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function eM(){return{scalar:[],sequence:[],mapping:[]}}function tM(e){let t=[];for(let r of e){let n=t.length;for(let i=0;i<t.length;i++){let s=t[i];if(s.nodeKind===r.nodeKind&&s.tagName===r.tagName&&s.matchByTagPrefix===r.matchByTagPrefix){n=i;break}}t[n]=r}return t}function Wx(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let r=0;r<t.length;r++){if(Array.isArray(t[r]))return null;if(typeof t[r]==="object"&&Object.prototype.toString.call(t[r])==="[object Object]")t[r]="[object Object]"}return String(t)}if(typeof e==="object"&&Object.prototype.toString.call(e)==="[object Object]")return"[object Object]";return String(e)}function Pd(e,t,r,n,i){let s="",o="",a=Math.floor(i/2)-1;if(n-t>a)s=" ... ",t=n-a+s.length;if(r-n>a)o=" ...",r=n+a-o.length;return{str:s+e.slice(t,r).replace(/\t/g,"→")+o,pos:n-t+s.length}}function kd(e,t){return" ".repeat(Math.max(t-e.length,0))+e}function sM(e,t){if(!e.buffer)return null;let r={...iM,...t},n=/\r?\n|\r|\0/g,i=[0],s=[],o,a=-1;while(o=n.exec(e.buffer))if(s.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&a<0)a=i.length-2;if(a<0)a=i.length-1;let c="",l=Math.min(e.line+r.linesAfter,s.length).toString().length,u=r.maxLength-(r.indent+l+3);for(let h=1;h<=r.linesBefore;h++){if(a-h<0)break;let m=Pd(e.buffer,i[a-h],s[a-h],e.position-(i[a]-i[a-h]),u);c=`${" ".repeat(r.indent)}${kd((e.line-h+1).toString(),l)} | ${m.str}
109
- ${c}`}let d=Pd(e.buffer,i[a],s[a],e.position,u);c+=`${" ".repeat(r.indent)}${kd((e.line+1).toString(),l)} | ${d.str}
107
+ "${$e(s)}" not found.`);return o.resolve(s,r,e,t,n,i)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=()=>this.values();_getRef(e){let t=$e(e);return this._$refs[t]||this._aliases[t]}}function Jx(e,t){let r=Object.keys(e);if(t=Array.isArray(t[0])?t[0]:Array.prototype.slice.call(t),t.length>0&&t[0])r=r.filter((n)=>t.includes(e[n].pathType));return r.map((n)=>({encoded:n,decoded:e[n].pathType==="file"?Bs(n,!0):n}))}var Fx=L(()=>{ts();Wt()});function Sd(e){return Object.keys(e||{}).filter((t)=>typeof e[t]==="object").map((t)=>(e[t].name=t,e[t]))}function Ed(e,t,r,n,i){return e.filter((s)=>!!qx(s,t,r,n,i))}function _d(e){return e.sort((t,r)=>(t.order??Number.MAX_SAFE_INTEGER)-(r.order??Number.MAX_SAFE_INTEGER))}async function Pd(e,t,r,n){let i,s=0;return new Promise((o,a)=>{c();function c(){let d=e[s++];if(!d)return a(i);let h=!1,m=!1,y=(g,b)=>{if(m=!0,h)return;if(h=!0,g)u(d,g);else l(d,b)};try{let g=qx(d,t,r,y,n);if(g&&typeof g.then==="function")g.then((b)=>y(void 0,b),(b)=>y(b,void 0));else if(g!==void 0)y(void 0,g);else if(!m&&!n2(d,t))y(Error("No promise has been returned or callback has been called."),void 0)}catch(g){y(g,void 0)}}function l(d,h){o({plugin:d,result:h})}function u(d,h){i={plugin:d,error:h},c()}})}function n2(e,t){let r=e[t];return typeof r==="function"&&r.length>=2}function qx(e,t,r,n,i){let s=e[t];if(typeof s==="function")return s.apply(e,[r,n,i]);if(!n){if(s instanceof RegExp){s.lastIndex=0;let o=s.test(r.url);return s.lastIndex=0,o}else if(typeof s==="string")return s===r.extension;else if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}async function i2(e,t,r){let n=typeof e==="string"?e:e.url,i=typeof e==="string"?void 0:e.baseUrl,s=typeof e==="string"?void 0:e.reference,o=n.indexOf("#"),a="";if(o>=0)a=n.substring(o),n=n.substring(0,o);if(s){let u=s.indexOf("#");if(u>=0)s=s.substring(0,u)}let c=t._add(n),l={url:n,hash:a,extension:Px(n),...s!==void 0?{reference:s}:{},...i!==void 0?{baseUrl:i}:{}};try{let u=await s2(l,r,t);c.pathType=u.plugin.name,l.data=u.result;let d=await o2(l,r,t);return c.value=d.result,c.dynamicIdScope=pl(c.value),c.legacyIdScope=bt(c.value),ml(t,c.path,c.value,c.pathType,c.dynamicIdScope),d.result}catch(u){if(zt(u))c.value=u;throw u}}async function s2(e,t,r){let n=Sd(t.resolve);n=Ed(n,"canRead",e,void 0,r),_d(n);try{return await Pd(n,"read",e,r)}catch(i){if(!i&&t.continueOnError)throw new dl(e.url);else if(!i||!("error"in i))throw SyntaxError(`Unable to resolve $ref pointer "${e.url}"`,{cause:i});else if(i.error instanceof Yr)throw i.error;else{let s=i.error instanceof Error?i.error:Error(String(i.error));throw new Yr(s,e.url,{cause:i.error})}}}async function o2(e,t,r){let n=Sd(t.parse),i=Ed(n,"canParse",e),s=i.length>0?i:n;_d(s);try{let o=await Pd(s,"parse",e,r);if(!o.plugin.allowEmpty&&a2(o.result))throw SyntaxError(`Error parsing "${e.url}" as ${o.plugin.name}.
108
+ Parsed value is empty`);else return o}catch(o){if(!o&&t.continueOnError)throw new fl(e.url);else if(o&&o.message&&o.message.startsWith("Error parsing"))throw o;else if(!o||!("error"in o))throw SyntaxError(`Unable to parse ${e.url}`,{cause:o});else if(o.error instanceof Gr)throw o.error;else throw new Gr(o.error?.message??String(o.error),e.url,{cause:o.error})}}function a2(e){return e===void 0||e===null||typeof e==="object"&&Object.keys(e).length===0||typeof e==="string"&&e.trim().length===0||Buffer.isBuffer(e)&&e.length===0}var Ks;var yl=L(()=>{Wt();Jn();Ar();Ks=i2});var Bx;var Hx=L(()=>{Ar();Bx={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(e){let t=e.data;if(Buffer.isBuffer(t))t=t.toString();if(typeof t==="string"){if(t.trim().length===0)return;if(this.allowBOM&&t.charCodeAt(0)===65279)t=t.slice(1);try{return JSON.parse(t)}catch(r){throw new Gr(r.message,e.url)}}else return t}}});function Nt(e,t){return{tagName:e,nodeKind:"scalar",implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??((r)=>String(r)),representTagName:t.representTagName??(()=>e)}}function Jd(e,t){let r=t.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??((n)=>n),carrierIsResult:r,identify:t.identify,represent:t.represent??((n)=>n),representTagName:t.representTagName??(()=>e)}}function vl(e,t){let r=t.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??((n)=>n),carrierIsResult:r,identify:t.identify,represent:t.represent??((n)=>n),representTagName:t.representTagName??(()=>e)}}function _2(e){let t=e,r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0o"))return r*parseInt(t.slice(2),8);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);return r*parseInt(t,10)}function P2(e,t){if(t){if(!E2.test(e))return Te}else if(!S2.test(e))return Te;let r=_2(e);return Number.isFinite(r)?r:Te}function j2(e){let t=e,r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0o"))return r*parseInt(t.slice(2),8);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);return r*parseInt(t,10)}function R2(e,t){if(t){if(!A2.test(e))return Te}else if(!k2.test(e))return Te;let r=j2(e);return Number.isFinite(r)?r:Te}function I2(e){let t=e.replace(/_/g,""),r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);if(t.includes(":")){let n=0;for(let i of t.split(":"))n=n*60+Number(i);return r*n}if(t!=="0"&&t[0]==="0")return r*parseInt(t,8);return r*parseInt(t,10)}function T2(e){if(!C2.test(e))return Te;let t=I2(e);return Number.isFinite(t)?t:Te}function L2(e){if(!N2.test(e))return Te;let t=e.toLowerCase(),r=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let n=r*parseFloat(t);if(Number.isFinite(n)||M2.test(e))return n;return Te}function D2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function q2(e,t){if(t){if(!F2.test(e))return Te;let n=e.toLowerCase(),i=n[0]==="-"?-1:1;if("+-".includes(n[0]))n=n.slice(1);if(n===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let s=i*parseFloat(n);return Number.isFinite(s)?s:Te}if(!J2.test(e))return Te;let r=Number(e);if(Number.isFinite(r))return r;return Te}function B2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function W2(e){if(!U2.test(e))return Te;let t=e.toLowerCase().replace(/_/g,""),r=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let n=0;if(t.includes(":")){for(let i of t.split(":"))n=n*60+Number(i);n*=r}else n=r*parseFloat(t);if(Number.isFinite(n)||V2.test(e))return n;return Te}function z2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function G2(e){let t=e.replace(/\s/g,"");if(t.length%4!==0||!K2.test(t))return Te;let r=atob(t),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}function Y2(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ux(e,t,r,n=0,i=0,s=0,o=0){let a=new Date(Date.UTC(e,t,r,n,i,s,o));return a.setUTCFullYear(e,t,r),a}function Z2(e){let t=X2.exec(e);if(t===null)t=Q2.exec(e);if(t===null)return Te;let r=+t[1],n=+t[2]-1,i=+t[3];if(!t[4]){let u=Ux(r,n,i);if(u.getUTCFullYear()!==r||u.getUTCMonth()!==n||u.getUTCDate()!==i)return Te;return u}let s=+t[4],o=+t[5],a=+t[6],c=0;if(s>23||o>59||a>59)return Te;if(t[7]){let u=t[7].slice(0,3);while(u.length<3)u+="0";c=+u}let l=Ux(r,n,i,s,o,a,c);if(l.getUTCFullYear()!==r||l.getUTCMonth()!==n||l.getUTCDate()!==i)return Te;if(t[9]){let u=+t[10],d=+(t[11]||0);if(u>23||d>59)return Te;let h=(u*60+d)*60000;l.setTime(l.getTime()-(t[9]==="-"?-h:h))}return l}function wl(e){if(e===null||typeof e!=="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Vx(e,t){let r={};for(let n of t)if(e[n]!==void 0)r[n]=e[n];return r}function rM(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function nM(){return{scalar:[],sequence:[],mapping:[]}}function iM(e){let t=[];for(let r of e){let n=t.length;for(let i=0;i<t.length;i++){let s=t[i];if(s.nodeKind===r.nodeKind&&s.tagName===r.tagName&&s.matchByTagPrefix===r.matchByTagPrefix){n=i;break}}t[n]=r}return t}function Wx(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let r=0;r<t.length;r++){if(Array.isArray(t[r]))return null;if(typeof t[r]==="object"&&Object.prototype.toString.call(t[r])==="[object Object]")t[r]="[object Object]"}return String(t)}if(typeof e==="object"&&Object.prototype.toString.call(e)==="[object Object]")return"[object Object]";return String(e)}function kd(e,t,r,n,i){let s="",o="",a=Math.floor(i/2)-1;if(n-t>a)s=" ... ",t=n-a+s.length;if(r-n>a)o=" ...",r=n+a-o.length;return{str:s+e.slice(t,r).replace(/\t/g,"→")+o,pos:n-t+s.length}}function Ad(e,t){return" ".repeat(Math.max(t-e.length,0))+e}function cM(e,t){if(!e.buffer)return null;let r={...aM,...t},n=/\r?\n|\r|\0/g,i=[0],s=[],o,a=-1;while(o=n.exec(e.buffer))if(s.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&a<0)a=i.length-2;if(a<0)a=i.length-1;let c="",l=Math.min(e.line+r.linesAfter,s.length).toString().length,u=r.maxLength-(r.indent+l+3);for(let h=1;h<=r.linesBefore;h++){if(a-h<0)break;let m=kd(e.buffer,i[a-h],s[a-h],e.position-(i[a]-i[a-h]),u);c=`${" ".repeat(r.indent)}${Ad((e.line-h+1).toString(),l)} | ${m.str}
109
+ ${c}`}let d=kd(e.buffer,i[a],s[a],e.position,u);c+=`${" ".repeat(r.indent)}${Ad((e.line+1).toString(),l)} | ${d.str}
110
110
  `,c+=`${"-".repeat(r.indent+l+3+d.pos)}^
111
- `;for(let h=1;h<=r.linesAfter;h++){if(a+h>=s.length)break;let m=Pd(e.buffer,i[a+h],s[a+h],e.position-(i[a]-i[a+h]),u);c+=`${" ".repeat(r.indent)}${kd((e.line+h+1).toString(),l)} | ${m.str}
111
+ `;for(let h=1;h<=r.linesAfter;h++){if(a+h>=s.length)break;let m=kd(e.buffer,i[a+h],s[a+h],e.position-(i[a]-i[a+h]),u);c+=`${" ".repeat(r.indent)}${Ad((e.line+h+1).toString(),l)} | ${m.str}
112
112
  `}return c.replace(/\n$/,"")}function zx(e,t){let r="";if(!e.mark)return e.reason;if(e.mark.name)r+=`in "${e.mark.name}" `;if(r+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet)r+=`
113
113
 
114
114
  ${e.mark.snippet}`;return`${e.reason} ${r}`}function Kx(e){switch(e){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
115
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function aM(e){if(e<=65535)return String.fromCharCode(e);return String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function cM(e){if(e>=48&&e<=57)return e-48;return(e|32)-97+10}function lM(e){if(e===120)return 2;if(e===117)return 4;return 8}function bl(e,t,r){let n=0;while(t<r){let i=e.charCodeAt(t);if(i===10)n++,t++;else if(i===13){if(n++,t++,e.charCodeAt(t)===10)t++}else if(i===32||i===9)t++;else break}return{position:t,breaks:n}}function Wd(e){if(e===1)return" ";return`
116
- `.repeat(e-1)}function uM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=Wd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,o)}function fM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===39)n+=e.slice(s,i)+"'",i+=2,s=o=i;else if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=Wd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,r)}function dM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===92){n+=e.slice(s,i),i++;let c=e.charCodeAt(i);if(c===10||c===13)i=bl(e,i,r).position;else if(c<256&&o$[c])n+=a$[c],i++;else{let l=lM(c),u=0;for(;l>0;l--){i++;let d=cM(e.charCodeAt(i));u=(u<<4)+d}n+=aM(u),i++}s=o=i}else if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=Wd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,r)}function Gx(e,t,r,n,i,s){let o=n<0?0:n,a=e.slice(t,r).replace(/\r\n?/g,`
115
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function uM(e){if(e<=65535)return String.fromCharCode(e);return String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function fM(e){if(e>=48&&e<=57)return e-48;return(e|32)-97+10}function dM(e){if(e===120)return 2;if(e===117)return 4;return 8}function bl(e,t,r){let n=0;while(t<r){let i=e.charCodeAt(t);if(i===10)n++,t++;else if(i===13){if(n++,t++,e.charCodeAt(t)===10)t++}else if(i===32||i===9)t++;else break}return{position:t,breaks:n}}function zd(e){if(e===1)return" ";return`
116
+ `.repeat(e-1)}function pM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=zd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,o)}function mM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===39)n+=e.slice(s,i)+"'",i+=2,s=o=i;else if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=zd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,r)}function hM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===92){n+=e.slice(s,i),i++;let c=e.charCodeAt(i);if(c===10||c===13)i=bl(e,i,r).position;else if(c<256&&o$[c])n+=a$[c],i++;else{let l=dM(c),u=0;for(;l>0;l--){i++;let d=fM(e.charCodeAt(i));u=(u<<4)+d}n+=uM(u),i++}s=o=i}else if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=zd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,r)}function Gx(e,t,r,n,i,s){let o=n<0?0:n,a=e.slice(t,r).replace(/\r\n?/g,`
117
117
  `),c=a===""?[]:(a.endsWith(`
118
118
  `)?a.slice(0,-1):a).split(`
119
119
  `),l="",u=!1,d=0,h=!1;for(let m of c){let y=0;while(y<o&&m.charCodeAt(y)===32)y++;if(n<0||y>=m.length){d++;continue}let g=m.slice(o),b=g.charCodeAt(0);if(s)if(b===32||b===9)h=!0,l+=`
@@ -122,13 +122,13 @@ ${e.mark.snippet}`;return`${e.reason} ${r}`}function Kx(e){switch(e){case 48:ret
122
122
  `.repeat(d);else l+=`
123
123
  `.repeat(u?1+d:d);l+=g,u=!0,d=0}if(i===jr.KEEP)l+=`
124
124
  `.repeat(u?1+d:d);else if(i!==jr.STRIP){if(u)l+=`
125
- `}return l}function pM(e,t){if(t.valueStart===oM)return"";let{valueStart:r,valueEnd:n}=t;if(t.fast)return e.slice(r,n);switch(t.style){case ke.SINGLE_QUOTED:return fM(e,r,n);case ke.DOUBLE_QUOTED:return dM(e,r,n);case ke.LITERAL_BLOCK:return Gx(e,r,n,t.indent,t.chomping,!1);case ke.FOLDED_BLOCK:return Gx(e,r,n,t.indent,t.chomping,!0);default:return uM(e,r,n)}}function Ad(e){let t="",r=0;while(r<e.length){if(e.charCodeAt(r)!==37){t+=e[r++];continue}let n=parseInt(e.slice(r+1,r+3),16);if(r+=3,n>=192){let i=n<224?1:n<240?2:3;n&=(1<<6-i)-1;while(i-- >0)n=n<<6|parseInt(e.slice(r+1,r+3),16)&63,r+=3}if(n<65536)t+=String.fromCharCode(n);else n-=65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)}return t}function c$(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return Ad(e.slice(2,-1));let r=e.indexOf("!",1),n=r===-1?"!":e.slice(0,r+1);return Ad(t?.[n]??mM[n]??n)+Ad(e.slice(n.length))}function yM(e){if("tagStart"in e&&e.tagStart!==Gs)return e.tagStart;if("anchorStart"in e&&e.anchorStart!==Gs)return e.anchorStart;if("valueStart"in e&&e.valueStart!==Gs)return e.valueStart;if("start"in e)return e.start;return 0}function _t(e,t){rs.throwAt(e.source,e.position,t,e.filename)}function l$(e,t,r,n){try{return r.finalize(n)}catch(i){if(i instanceof rs)throw i;rs.throwAt(e.source,t,i instanceof Error?i.message:String(i),e.filename)}}function bM(e,t){let r=pM(e.source,t),n=t.tagStart===Gs?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(n!==""){if(n==="!")return{value:r,tag:i};let s=c$(n,e.tagHandlers),o=e.schema.lookupScalarTag(s);if(o){let c=o.resolve(r,!0,s);if(c===Te)_t(e,`cannot resolve a node with !<${s}> explicit tag`);return{value:c,tag:o}}let a=e.schema.lookupMappingTag(s)??e.schema.lookupSequenceTag(s);if(a){if(r!=="")_t(e,`cannot resolve a node with !<${s}> explicit tag`);let c=a.create(s);return{value:a.carrierIsResult?c:l$(e,e.position,a,c),tag:a}}_t(e,`unknown scalar tag !<${s}>`)}if(t.style===ke.PLAIN)return e.schema.resolveImplicitScalarTag(r);return{value:i.resolve(r,!1,i.tagName),tag:i}}function Yx(e,t,r){let n=t.tagStart===Gs?"":e.source.slice(t.tagStart,t.tagEnd);return n===""||n==="!"?r:c$(n,e.tagHandlers)}function u$(e){return e.nodeKind==="mapping"}function Xx(e){if(e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys)_t(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function Qx(e,t,r,n){Xx(e);for(let i of n.keys(r)){if(Xx(e),t.tag.has(t.value,i))continue;let s=t.tag.addPair(t.value,i,n.get(r,i));if(s)_t(e,s);t.overridable??=new Set,t.overridable.add(i)}}function xM(e,t,r,n){if(e.position=t.keyPosition,u$(n))Qx(e,t,r,n);else if(n.nodeKind==="sequence"&&Array.isArray(r)){if(r.length>100)_t(e,"abnormal merge sequence size");for(let i of r){let s=e.nodeTags.get(i);if(!s)_t(e,"cannot merge mappings; the provided source object is unacceptable");Qx(e,t,i,s)}}else _t(e,"cannot merge mappings; the provided source object is unacceptable")}function $M(e,t,r,n,i){if(e.position=t.keyPosition,t.keyIsMerge){xM(e,t,n,i);return}if(!e.json&&t.tag.has(t.value,r)&&!t.overridable?.has(r))_t(e,"duplicated mapping key");let s=t.tag.addPair(t.value,r,n);if(s)_t(e,s);t.overridable?.delete(r)}function jd(e,t,r){let n=e.frames[e.frames.length-1];if(n.kind==="document")n.value=t,n.hasValue=!0;else if(n.kind==="sequence"){if(u$(r))e.nodeTags.set(t,r);let i=n.tag.addItem(n.value,t,n.index++);if(i)_t(e,i)}else if(n.hasKey){let i=n.key;n.key=void 0,n.hasKey=!1,$M(e,n,i,t,r)}else n.key=t,n.keyPosition=e.position,n.hasKey=!0,n.keyIsMerge=r.tagName===gM}function Rd(e,t,r,n,i){if(t.anchorStart!==Gs){let s={value:r,tag:n,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),s),s}return null}function vM(e,t){let r={...zd,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};while(r.eventIndex<r.events.length){let n=r.events[r.eventIndex++];switch(r.position=yM(n),n.type){case ct.DOCUMENT:r.anchors=new Map,r.nodeTags=new Map,r.aliasCount=0,r.tagHandlers=Object.create(null);for(let i of n.directives)if(i.kind==="tag")r.tagHandlers[i.handle]=i.prefix;r.frames.push({kind:"document",position:r.position,value:void 0,hasValue:!1});break;case ct.SCALAR:{let{value:i,tag:s}=bM(r,n);Rd(r,n,i,s,!0),jd(r,i,s);break}case ct.SEQUENCE:{let i=Yx(r,n,"tag:yaml.org,2002:seq"),s=r.schema.lookupSequenceTag(i);if(!s)_t(r,`unknown sequence tag !<${i}>`);let o=s.create(i),a=Rd(r,n,o,s,s.carrierIsResult);r.frames.push({kind:"sequence",position:r.position,value:o,tag:s,anchor:a,index:0});break}case ct.MAPPING:{let i=Yx(r,n,"tag:yaml.org,2002:map"),s=r.schema.lookupMappingTag(i);if(!s)_t(r,`unknown mapping tag !<${i}>`);let o=s.create(i),a=Rd(r,n,o,s,s.carrierIsResult);r.frames.push({kind:"mapping",position:r.position,value:o,tag:s,anchor:a,key:void 0,keyPosition:r.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case ct.ALIAS:{if(r.maxAliases!==-1&&++r.aliasCount>r.maxAliases)_t(r,`aliases exceeded maxAliases (${r.maxAliases})`);let i=r.source.slice(n.anchorStart,n.anchorEnd),s=r.anchors.get(i);if(!s)_t(r,`unidentified alias "${i}"`);if(!s.isValueFinal)_t(r,`recursive alias "${i}" is not supported for tag ${s.tag.tagName} because it uses finalize()`);jd(r,s.value,s.tag);break}case ct.POP:{let i=r.frames.pop();if(i.kind==="mapping"&&i.hasKey)r.position=i.keyPosition,_t(r,"incomplete mapping pair in event stream");if(i.kind==="document")r.documents.push(i.value);else{let s=i.tag.carrierIsResult?i.value:l$(r,i.position,i.tag,i.value);if(i.anchor)i.anchor.value=s,i.anchor.isValueFinal=!0;jd(r,s,i.tag)}break}}}return r.documents}function kM(e,t,r){e.events.push({type:ct.DOCUMENT,explicitStart:t,explicitEnd:r,directives:e.directives})}function g$(e,t,r,n,i,s,o){e.events.push({type:ct.SEQUENCE,start:t,anchorStart:r,anchorEnd:n,tagStart:i,tagEnd:s,style:o})}function y$(e,t,r,n,i,s,o){e.events.push({type:ct.MAPPING,start:t,anchorStart:r,anchorEnd:n,tagStart:i,tagEnd:s,style:o})}function Zx(e,t){e.events.splice(t.eventsLength,0,{type:ct.MAPPING,start:t.position,anchorStart:Me,anchorEnd:Me,tagStart:Me,tagEnd:Me,style:pi.FLOW})}function ro(e,t,r,n,i,s,o,a,c=jr.CLIP,l=-1,u=!1){e.events.push({type:ct.SCALAR,valueStart:t,valueEnd:r,anchorStart:n,anchorEnd:i,tagStart:s,tagEnd:o,style:a,chomping:c,indent:l,fast:u})}function AM(e,t,r){e.events.push({type:ct.ALIAS,anchorStart:t,anchorEnd:r})}function Ys(e){e.events.push({type:ct.POP})}function Kt(e){ro(e,Me,Me,Me,Me,Me,Me,ke.PLAIN)}function e$(){return{anchorStart:Me,anchorEnd:Me,tagStart:Me,tagEnd:Me}}function Xs(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function Qs(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function ce(e,t){rs.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function wt(e){return e===10||e===13}function no(e){return e===9||e===32}function Qr(e){return no(e)||wt(e)}function Fn(e){return e===0||Qr(e)}function ns(e){return e===44||e===91||e===93||e===123||e===125}function jM(e){return e>=48&&e<=57?e-48:-1}function RM(e){if(e>=48&&e<=57)return e-48;let t=e|32;if(t>=97&&t<=102)return t-97+10;return-1}function OM(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function CM(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function $l(e){if(e.input.charCodeAt(e.position)===10)e.position++;else if(e.position++,e.input.charCodeAt(e.position)===10)e.position++;e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function Tt(e,t){let r=0,n=e.input.charCodeAt(e.position),i=e.position===e.lineStart||Qr(e.input.charCodeAt(e.position-1));while(n!==0){while(no(n)){if(i=!0,n===9&&e.firstTabInLine===-1)e.firstTabInLine=e.position;n=e.input.charCodeAt(++e.position)}if(t&&i&&n===35)do n=e.input.charCodeAt(++e.position);while(!wt(n)&&n!==0);if(!wt(n))break;$l(e),r++,i=!0,n=e.input.charCodeAt(e.position);while(n===32)e.lineIndent++,n=e.input.charCodeAt(++e.position)}return r}function eo(e,t=e.position){let r=e.input.charCodeAt(t);if((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)){let n=e.input.charCodeAt(t+3);return n===0||Qr(n)}return!1}function b$(e){if(e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279)e.position++,e.lineStart=e.position}function Gd(e){if(e.position!==e.lineStart)return!1;if(eo(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=Xs(e);b$(e),Tt(e,!0);let r=e.input.charCodeAt(e.position),n=e.position===e.lineStart&&(r===37||r===45&&eo(e));return Qs(e,t),n}function t$(e){let t=e.input.charCodeAt(e.position);while(t!==0&&!wt(t))t=e.input.charCodeAt(++e.position)}function x$(e,t,r){let n=wM.exec(e.input.slice(t,r));if(n!==null)e.position=t+n.index+n[0].length-1,ce(e,"the stream contains non-printable characters")}function IM(e,t,r){if(e.input.charCodeAt(e.position)!==33)return!1;if(t.tagStart!==Me)ce(e,"duplication of a tag property");let n=e.position,i=!1,s=!1,o="!",a=e.input.charCodeAt(++e.position);if(a===60)i=!0,a=e.input.charCodeAt(++e.position);else if(a===33)s=!0,o="!!",a=e.input.charCodeAt(++e.position);let c=e.position,l;if(i){while(a!==0&&a!==62)a=e.input.charCodeAt(++e.position);if(a!==62)ce(e,"unexpected end of the stream within a verbatim tag");l=e.input.slice(c,e.position),e.position++}else{while(a!==0&&!Qr(a)&&!(r&&ns(a))){if(a===33)if(!s){if(o=e.input.slice(c-1,e.position+1),!m$.test(o))ce(e,"named tag handle cannot contain such characters");s=!0,c=e.position+1}else ce(e,"tag suffix cannot contain exclamation marks");a=e.input.charCodeAt(++e.position)}if(l=e.input.slice(c,e.position),SM.test(l))ce(e,"tag suffix cannot contain flow indicator characters")}if(l&&!(i?EM.test(l):_M.test(l)))ce(e,`tag name cannot contain such characters: ${l}`);if(!i&&o!=="!"&&o!=="!!"&&!f$.call(e.tagHandlers,o))ce(e,`undeclared tag handle "${o}"`);return t.tagStart=n,t.tagEnd=e.position,!0}function TM(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;if(t.anchorStart!==Me)ce(e,"duplication of an anchor property");e.position++;let r=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position))&&!ns(e.input.charCodeAt(e.position)))e.position++;if(e.position===r)ce(e,"name of an anchor node must contain at least one character");return t.anchorStart=r,t.anchorEnd=e.position,!0}function NM(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;if(t.anchorStart!==Me||t.tagStart!==Me)ce(e,"alias node should not have any properties");e.position++;let r=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position))&&!ns(e.input.charCodeAt(e.position)))e.position++;if(e.position===r)ce(e,"name of an alias node must contain at least one character");return AM(e,r,e.position),!0}function Nd(e,t){if(Tt(e,!1),e.lineIndent<t)ce(e,"deficient indentation")}function MM(e,t,r){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let n=e.position,i=!0;while(e.input.charCodeAt(e.position)!==0){let s=e.input.charCodeAt(e.position);if(s===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}let o=e.position;return e.position++,ro(e,n,o,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,ke.SINGLE_QUOTED,jr.CLIP,-1,i),!0}if(wt(s))i=!1,Nd(e,t);else if(e.position===e.lineStart&&eo(e))ce(e,"unexpected end of the document within a single quoted scalar");else if(s!==9&&s<32)ce(e,"expected valid JSON character");else e.position++}ce(e,"unexpected end of the stream within a single quoted scalar")}function LM(e,t,r){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let n=e.position,i=!0;while(e.input.charCodeAt(e.position)!==0){let s=e.input.charCodeAt(e.position);if(s===34){let o=e.position;return e.position++,ro(e,n,o,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,ke.DOUBLE_QUOTED,jr.CLIP,-1,i),!0}if(s===92){i=!1;let o=e.input.charCodeAt(++e.position);if(wt(o))Nd(e,t);else if(CM(o))e.position++;else{let a=OM(o);if(a===0)ce(e,"unknown escape sequence");while(a-- >0)if(e.position++,RM(e.input.charCodeAt(e.position))<0)ce(e,"expected hexadecimal character");e.position++}}else if(wt(s))i=!1,Nd(e,t);else if(e.position===e.lineStart&&eo(e))ce(e,"unexpected end of the document within a double quoted scalar");else if(s!==9&&s<32)ce(e,"expected valid JSON character");else e.position++}ce(e,"unexpected end of the stream within a double quoted scalar")}function DM(e,t,r){let n=e.input.charCodeAt(e.position),i=jr.CLIP,s=-1,o=!1;if(n!==124&&n!==62)return!1;let a=n===124?ke.LITERAL_BLOCK:ke.FOLDED_BLOCK;e.position++;while(e.input.charCodeAt(e.position)!==0){let m=e.input.charCodeAt(e.position),y=jM(m);if(m===43||m===45){if(i!==jr.CLIP)ce(e,"repeat of a chomping mode identifier");i=m===43?jr.KEEP:jr.STRIP,e.position++}else if(y>=0){if(y===0)ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one");if(o)ce(e,"repeat of an indentation width identifier");s=t+y-1,o=!0,e.position++}else break}let c=!1;while(no(e.input.charCodeAt(e.position)))c=!0,e.position++;if(c&&e.input.charCodeAt(e.position)===35)t$(e);if(wt(e.input.charCodeAt(e.position)))$l(e);else if(e.input.charCodeAt(e.position)!==0)ce(e,"a line break is expected");let l=o?s:-1,u=0,{position:d,position:h}=e;while(e.input.charCodeAt(e.position)!==0){let m=e.position,y=0;while(e.input.charCodeAt(m+y)===32)y++;let g=e.input.charCodeAt(m+y);if(g===0){if(l>=0){if(y>l)h=m+y}else if(y>0)h=m+y;break}if(Gd(e))break;if(!o&&l===-1&&wt(g))u=Math.max(u,y);if(!o&&l===-1&&!wt(g)){if(g===9&&y<t)e.position=m+y,ce(e,"tab characters must not be used in indentation");if(y>=t&&y<u)e.position=m+y,ce(e,"bad indentation of a mapping entry")}if(l===-1&&g!==0&&!wt(g)&&y<t){e.lineIndent=y,e.position=m+y;break}if(!o&&g!==0&&!wt(g)&&l===-1)l=y;let b=l===-1?t+1:l;if(g!==0&&!wt(g)&&y<b){e.lineIndent=y,e.position=m+y;break}if(t$(e),h=e.position,wt(e.input.charCodeAt(e.position)))$l(e),h=e.position}return x$(e,d,h),ro(e,d,h,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,a,i,l),!0}function JM(e,t){let r=e.input.charCodeAt(e.position),n=t===Zs;if(r===0||Qr(r)||r===35||r===38||r===42||r===33||r===124||r===62||r===39||r===34||r===37||r===64||r===96||ns(r))return!1;if(r===63||r===45){let i=e.input.charCodeAt(e.position+1);if(Fn(i)||n&&ns(i))return!1}return!0}function FM(e,t,r,n){if(!JM(e,r))return!1;let{position:i,position:s}=e,o=e.input.charCodeAt(e.position),a=r===Zs,c=!1;while(o!==0){if(Gd(e))break;if(o===58){let l=e.input.charCodeAt(e.position+1);if(Fn(l)||a&&ns(l))break}else if(o===35){if(Qr(e.input.charCodeAt(e.position-1)))break}else if(a&&ns(o))break;else if(wt(o)){let{position:l,line:u,lineStart:d,lineIndent:h}=e;if(Tt(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=l,e.line=u,e.lineStart=d,e.lineIndent=h;break}if(!no(o))s=e.position+1;o=e.input.charCodeAt(++e.position)}if(s===i)return!1;return x$(e,i,s),ro(e,i,s,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,ke.PLAIN,jr.CLIP,-1,!c),!0}function ga(e,t){let r=e.line;if(Tt(e,!0),e.line>r&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)ce(e,"deficient indentation")}function qM(e,t,r){let n=e.input.charCodeAt(e.position),i=n===123,s=e.position,o=!0;if(n!==91&&n!==123)return!1;let a=i?125:93;if(i)y$(e,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.FLOW);else g$(e,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.FLOW);e.position++;while(e.input.charCodeAt(e.position)!==0){ga(e,t);let c=e.input.charCodeAt(e.position);if(c===a)return e.position++,Ys(e),!0;else if(!o)ce(e,"missed comma between flow collection entries");else if(c===44)ce(e,"expected the node content, but found ','");let l=!1,u=!1;if(c===63&&Qr(e.input.charCodeAt(e.position+1)))l=u=!0,e.position+=1,ga(e,t);let d=e.line,h=Xs(e),m=to(e,t,Zs,!1,!0);if(ga(e,t),c=e.input.charCodeAt(e.position),(i||u||e.line===d)&&c===58){if(l=!0,e.position++,ga(e,t),!i){if(Zx(e,h),!m)Kt(e)}else if(!m)Kt(e);if(!to(e,t,Zs,!1,!0))Kt(e);if(ga(e,t),!i)Ys(e)}else if(i&&l){if(!m)Kt(e);Kt(e)}else if(i)Kt(e);else if(l){if(Zx(e,h),!m)Kt(e);Kt(e),Ys(e)}if(c=e.input.charCodeAt(e.position),c===44)o=!0,e.position++;else o=!1}ce(e,"unexpected end of the stream within a flow collection")}function r$(e,t,r){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Fn(e.input.charCodeAt(e.position+1)))return!1;g$(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.BLOCK);while(e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1))){if(e.firstTabInLine!==-1)e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation");let n=e.line;e.position++;let i=Tt(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1)))ce(e,"bad indentation of a sequence entry");if(i&&e.lineIndent<=t)Kt(e);else to(e,t,p$,!1,!0);if(Tt(e,!0),e.lineIndent<t||e.position>=e.length)break;if(e.lineIndent>t)ce(e,"bad indentation of a sequence entry");if(e.line===n&&e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1)))ce(e,"bad indentation of a sequence entry")}return Ys(e),!0}function Od(e,t,r,n){let i=!1,s=!1,o=!1,a=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);while(c!==0){if(!i&&e.firstTabInLine!==-1)e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation");let l=e.input.charCodeAt(e.position+1),u=e.line;if((c===63||c===58)&&Fn(l)){if(!o)y$(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,pi.BLOCK),o=!0;if(c===63){if(i)Kt(e);s=!0,i=!0}else if(i)i=!1;else Kt(e),s=!0,i=!1;e.position+=1,a=!0}else{if(i)Kt(e),i=!1;let d=Xs(e);if(!to(e,r,d$,!1,!0))break;if(e.line===u){c=e.input.charCodeAt(e.position);while(no(c))c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),!Fn(c))ce(e,"a whitespace character is expected after the key-value separator within a block mapping");if(!o)e.events.splice(d.eventsLength,0,{type:ct.MAPPING,start:d.position,anchorStart:n.anchorStart,anchorEnd:n.anchorEnd,tagStart:n.tagStart,tagEnd:n.tagEnd,style:pi.BLOCK}),o=!0;s=!0,i=!1,a=!1}else if(s)ce(e,"expected ':' after a mapping key");else{if(n.anchorStart!==Me||n.tagStart!==Me)return Qs(e,d),!1;return!0}}else if(s)ce(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else{if(n.anchorStart!==Me||n.tagStart!==Me)return Qs(e,d),!1;return!0}}if(to(e,t,xl,!0,a))a=!1;if(!i){if(a)Kt(e),a=!1}if(Tt(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)ce(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}if(!s)return!1;if(i)Kt(e);if(o)Ys(e);return!0}function to(e,t,r,n,i,s=!0){if(e.depth>=e.maxDepth)ce(e,`nesting exceeded maxDepth (${e.maxDepth})`);e.depth++;let o=1,a=!1,c=!1,l=null,u=e$(),d=r===xl||r===p$,h=d,m=d;if(n&&Tt(e,!0))if(a=!0,e.lineIndent>t)o=1;else if(e.lineIndent===t)o=0;else o=-1;if(o===1)while(!0){let y=e.input.charCodeAt(e.position),g=Xs(e);if(a&&o!==1&&(y===33||y===38))break;if(a&&m&&(u.tagStart!==Me||u.anchorStart!==Me)&&(y===33||y===38)){let b=Xs(e),x=t+1;if(Od(e,e.position-e.lineStart,x,u)&&e.events[b.eventsLength]?.type===ct.MAPPING)return e.depth--,!0;Qs(e,b)}if(a&&(y===33&&u.tagStart!==Me||y===38&&u.anchorStart!==Me))break;if(!IM(e,u,r===Zs)&&!TM(e,u))break;if(l===null)l=g;if(Tt(e,!0))if(a=!0,h=m,e.lineIndent>t)o=1;else if(e.lineIndent===t)o=0;else o=-1;else h=!1}if(h)h=a||i;if(o===1||r===xl){let y=r===Zs||r===d$?t:t+1,g=e.position-e.lineStart;if(o===1)if(h&&(r$(e,g,u)||Od(e,g,y,u))||qM(e,y,u))c=!0;else{let b=e.input.charCodeAt(e.position);if(l!==null&&s&&m&&!h&&b!==124&&b!==62){let x=Xs(e),_=l.position-l.lineStart;if(Qs(e,l),Od(e,_,y,e$())&&e.events[x.eventsLength]?.type===ct.MAPPING)c=!0;else Qs(e,x)}if(!c&&(d&&DM(e,y,u)||MM(e,y,u)||LM(e,y,u)||NM(e,u)||FM(e,y,r,u)))c=!0}else if(o===0)c=h&&r$(e,g,u)}if(d=d&&!c,!c&&(u.anchorStart!==Me||u.tagStart!==Me||d))ro(e,Me,Me,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,ke.PLAIN),c=!0;return e.depth--,c||u.anchorStart!==Me||u.tagStart!==Me}function BM(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;let t=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position)))e.position++;let r=e.input.slice(t,e.position),n=[];if(r.length===0)ce(e,"directive name must not be less than one character in length");while(e.input.charCodeAt(e.position)!==0&&!wt(e.input.charCodeAt(e.position))){while(no(e.input.charCodeAt(e.position)))e.position++;if(e.input.charCodeAt(e.position)===35||wt(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let i=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position)))e.position++;n.push(e.input.slice(i,e.position))}if(wt(e.input.charCodeAt(e.position)))$l(e);if(r==="YAML"){if(e.directives.some((s)=>s.kind==="yaml"))ce(e,"duplication of %YAML directive");if(n.length!==1)ce(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);if(i===null)ce(e,"ill-formed argument of the YAML directive");if(parseInt(i[1],10)!==1)ce(e,"unacceptable YAML version of the document");e.directives.push({kind:"yaml",version:n[0]})}else if(r==="TAG"){if(n.length!==2)ce(e,"TAG directive accepts exactly two arguments");let[i,s]=n;if(!m$.test(i))ce(e,"ill-formed tag handle (first argument) of the TAG directive");if(f$.call(e.tagHandlers,i))ce(e,`there is a previously declared suffix for "${i}" tag handle`);if(!PM.test(s))ce(e,"ill-formed tag prefix (second argument) of the TAG directive");e.tagHandlers[i]=s,e.directives.push({kind:"tag",handle:i,prefix:s})}return!0}function HM(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;Tt(e,!0);while(BM(e))t=!0,Tt(e,!0);let r=!1,n=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&Fn(e.input.charCodeAt(e.position+3))){r=!0;let a=e.line;e.position+=3,Tt(e,!0),i=e.line>a}else if(t)ce(e,"directives end mark is expected");let s=e.events.length;if(!r&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&eo(e)){e.position+=3,Tt(e,!0);return}if(kM(e,r,!1),!to(e,e.lineIndent-1,xl,!1,i,i))Kt(e);if(Tt(e,!0),e.position===e.lineStart&&eo(e)){if(n=e.input.charCodeAt(e.position)===46,n){let a=e.line;if(e.position+=3,Tt(e,!0),e.line===a&&e.position<e.length)ce(e,"end of the stream or a document separator is expected")}}let o=e.events[s];if(o?.type===ct.DOCUMENT)o.explicitEnd=n;if(Ys(e),!n&&e.position<e.length&&!Gd(e))ce(e,"end of the stream or a document separator is expected")}function UM(e,t){let r=e.length,n={...Kd,...t,input:`${e}\x00`,length:r,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf("\x00");if(i!==-1)rs.throwAt(e,i,"null byte is not allowed in input",n.filename);while(n.position<n.length){if(b$(n),Tt(n,!0),n.position>=n.length)break;let s=n.position;if(HM(n),n.position===s)ce(n,"can not read a document")}return n.events}function $$(e,t={}){let r={...VM,...t},n=String(e),i=Object.keys(Kd),s=Object.keys(zd);return vM(UM(n,Vx(r,i)),{...Vx(r,s),source:n})}function v$(e,t,r){let n=null;if(typeof t==="function")n=t;else if(t!==null&&typeof t==="object")r=t;let i=$$(e,r);if(n===null)return i;for(let s of i)n(s)}function Yd(e,t){let r=$$(e,t);if(r.length===0)throw new rs("expected a document, but the input is empty");if(r.length===1)return r[0];throw new rs("expected a single document in the stream, but found more")}function El(e,t){return(e&1<<t)!==0}function w$(e){if(e.presenterOptions.quoteStyle==="single"&&El(e.allowedStylesMask,ke.SINGLE_QUOTED))return ke.SINGLE_QUOTED;return ke.DOUBLE_QUOTED}function WM(e){if(!e.presenterOptions.quoteFlowKeys)return;if(!e.isKey||!e.flowOnly||e.style!==ke.PLAIN)return;e.style=ke.DOUBLE_QUOTED}function zM(e){if(e.style===ke.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value))e.style=ke.DOUBLE_QUOTED}function KM(e){if(e.style===ke.PLAIN&&/^\s+$/.test(e.node.value))e.style=ke.DOUBLE_QUOTED}function GM(e){if(!e.presenterOptions.forceQuotes)return;if(e.isKey||e.style!==ke.PLAIN)return;if(e.node.tag!==e.presenterOptions.schema.defaultScalarTag.tagName)return;e.style=e.node.value.includes(`
126
- `)?ke.DOUBLE_QUOTED:w$(e)}function YM(e){if(e.style!==ke.PLAIN||e.isKey)return;let t=e.node.value,r=t.indexOf(`
125
+ `}return l}function gM(e,t){if(t.valueStart===lM)return"";let{valueStart:r,valueEnd:n}=t;if(t.fast)return e.slice(r,n);switch(t.style){case ke.SINGLE_QUOTED:return mM(e,r,n);case ke.DOUBLE_QUOTED:return hM(e,r,n);case ke.LITERAL_BLOCK:return Gx(e,r,n,t.indent,t.chomping,!1);case ke.FOLDED_BLOCK:return Gx(e,r,n,t.indent,t.chomping,!0);default:return pM(e,r,n)}}function jd(e){let t="",r=0;while(r<e.length){if(e.charCodeAt(r)!==37){t+=e[r++];continue}let n=parseInt(e.slice(r+1,r+3),16);if(r+=3,n>=192){let i=n<224?1:n<240?2:3;n&=(1<<6-i)-1;while(i-- >0)n=n<<6|parseInt(e.slice(r+1,r+3),16)&63,r+=3}if(n<65536)t+=String.fromCharCode(n);else n-=65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)}return t}function c$(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return jd(e.slice(2,-1));let r=e.indexOf("!",1),n=r===-1?"!":e.slice(0,r+1);return jd(t?.[n]??yM[n]??n)+jd(e.slice(n.length))}function $M(e){if("tagStart"in e&&e.tagStart!==Gs)return e.tagStart;if("anchorStart"in e&&e.anchorStart!==Gs)return e.anchorStart;if("valueStart"in e&&e.valueStart!==Gs)return e.valueStart;if("start"in e)return e.start;return 0}function _t(e,t){rs.throwAt(e.source,e.position,t,e.filename)}function l$(e,t,r,n){try{return r.finalize(n)}catch(i){if(i instanceof rs)throw i;rs.throwAt(e.source,t,i instanceof Error?i.message:String(i),e.filename)}}function vM(e,t){let r=gM(e.source,t),n=t.tagStart===Gs?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(n!==""){if(n==="!")return{value:r,tag:i};let s=c$(n,e.tagHandlers),o=e.schema.lookupScalarTag(s);if(o){let c=o.resolve(r,!0,s);if(c===Te)_t(e,`cannot resolve a node with !<${s}> explicit tag`);return{value:c,tag:o}}let a=e.schema.lookupMappingTag(s)??e.schema.lookupSequenceTag(s);if(a){if(r!=="")_t(e,`cannot resolve a node with !<${s}> explicit tag`);let c=a.create(s);return{value:a.carrierIsResult?c:l$(e,e.position,a,c),tag:a}}_t(e,`unknown scalar tag !<${s}>`)}if(t.style===ke.PLAIN)return e.schema.resolveImplicitScalarTag(r);return{value:i.resolve(r,!1,i.tagName),tag:i}}function Yx(e,t,r){let n=t.tagStart===Gs?"":e.source.slice(t.tagStart,t.tagEnd);return n===""||n==="!"?r:c$(n,e.tagHandlers)}function u$(e){return e.nodeKind==="mapping"}function Xx(e){if(e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys)_t(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function Qx(e,t,r,n){Xx(e);for(let i of n.keys(r)){if(Xx(e),t.tag.has(t.value,i))continue;let s=t.tag.addPair(t.value,i,n.get(r,i));if(s)_t(e,s);t.overridable??=new Set,t.overridable.add(i)}}function wM(e,t,r,n){if(e.position=t.keyPosition,u$(n))Qx(e,t,r,n);else if(n.nodeKind==="sequence"&&Array.isArray(r)){if(r.length>100)_t(e,"abnormal merge sequence size");for(let i of r){let s=e.nodeTags.get(i);if(!s)_t(e,"cannot merge mappings; the provided source object is unacceptable");Qx(e,t,i,s)}}else _t(e,"cannot merge mappings; the provided source object is unacceptable")}function SM(e,t,r,n,i){if(e.position=t.keyPosition,t.keyIsMerge){wM(e,t,n,i);return}if(!e.json&&t.tag.has(t.value,r)&&!t.overridable?.has(r))_t(e,"duplicated mapping key");let s=t.tag.addPair(t.value,r,n);if(s)_t(e,s);t.overridable?.delete(r)}function Rd(e,t,r){let n=e.frames[e.frames.length-1];if(n.kind==="document")n.value=t,n.hasValue=!0;else if(n.kind==="sequence"){if(u$(r))e.nodeTags.set(t,r);let i=n.tag.addItem(n.value,t,n.index++);if(i)_t(e,i)}else if(n.hasKey){let i=n.key;n.key=void 0,n.hasKey=!1,SM(e,n,i,t,r)}else n.key=t,n.keyPosition=e.position,n.hasKey=!0,n.keyIsMerge=r.tagName===xM}function Od(e,t,r,n,i){if(t.anchorStart!==Gs){let s={value:r,tag:n,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),s),s}return null}function EM(e,t){let r={...Kd,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};while(r.eventIndex<r.events.length){let n=r.events[r.eventIndex++];switch(r.position=$M(n),n.type){case ct.DOCUMENT:r.anchors=new Map,r.nodeTags=new Map,r.aliasCount=0,r.tagHandlers=Object.create(null);for(let i of n.directives)if(i.kind==="tag")r.tagHandlers[i.handle]=i.prefix;r.frames.push({kind:"document",position:r.position,value:void 0,hasValue:!1});break;case ct.SCALAR:{let{value:i,tag:s}=vM(r,n);Od(r,n,i,s,!0),Rd(r,i,s);break}case ct.SEQUENCE:{let i=Yx(r,n,"tag:yaml.org,2002:seq"),s=r.schema.lookupSequenceTag(i);if(!s)_t(r,`unknown sequence tag !<${i}>`);let o=s.create(i),a=Od(r,n,o,s,s.carrierIsResult);r.frames.push({kind:"sequence",position:r.position,value:o,tag:s,anchor:a,index:0});break}case ct.MAPPING:{let i=Yx(r,n,"tag:yaml.org,2002:map"),s=r.schema.lookupMappingTag(i);if(!s)_t(r,`unknown mapping tag !<${i}>`);let o=s.create(i),a=Od(r,n,o,s,s.carrierIsResult);r.frames.push({kind:"mapping",position:r.position,value:o,tag:s,anchor:a,key:void 0,keyPosition:r.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case ct.ALIAS:{if(r.maxAliases!==-1&&++r.aliasCount>r.maxAliases)_t(r,`aliases exceeded maxAliases (${r.maxAliases})`);let i=r.source.slice(n.anchorStart,n.anchorEnd),s=r.anchors.get(i);if(!s)_t(r,`unidentified alias "${i}"`);if(!s.isValueFinal)_t(r,`recursive alias "${i}" is not supported for tag ${s.tag.tagName} because it uses finalize()`);Rd(r,s.value,s.tag);break}case ct.POP:{let i=r.frames.pop();if(i.kind==="mapping"&&i.hasKey)r.position=i.keyPosition,_t(r,"incomplete mapping pair in event stream");if(i.kind==="document")r.documents.push(i.value);else{let s=i.tag.carrierIsResult?i.value:l$(r,i.position,i.tag,i.value);if(i.anchor)i.anchor.value=s,i.anchor.isValueFinal=!0;Rd(r,s,i.tag)}break}}}return r.documents}function RM(e,t,r){e.events.push({type:ct.DOCUMENT,explicitStart:t,explicitEnd:r,directives:e.directives})}function g$(e,t,r,n,i,s,o){e.events.push({type:ct.SEQUENCE,start:t,anchorStart:r,anchorEnd:n,tagStart:i,tagEnd:s,style:o})}function y$(e,t,r,n,i,s,o){e.events.push({type:ct.MAPPING,start:t,anchorStart:r,anchorEnd:n,tagStart:i,tagEnd:s,style:o})}function Zx(e,t){e.events.splice(t.eventsLength,0,{type:ct.MAPPING,start:t.position,anchorStart:Me,anchorEnd:Me,tagStart:Me,tagEnd:Me,style:pi.FLOW})}function ro(e,t,r,n,i,s,o,a,c=jr.CLIP,l=-1,u=!1){e.events.push({type:ct.SCALAR,valueStart:t,valueEnd:r,anchorStart:n,anchorEnd:i,tagStart:s,tagEnd:o,style:a,chomping:c,indent:l,fast:u})}function OM(e,t,r){e.events.push({type:ct.ALIAS,anchorStart:t,anchorEnd:r})}function Ys(e){e.events.push({type:ct.POP})}function Kt(e){ro(e,Me,Me,Me,Me,Me,Me,ke.PLAIN)}function e$(){return{anchorStart:Me,anchorEnd:Me,tagStart:Me,tagEnd:Me}}function Xs(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function Qs(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function ce(e,t){rs.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function wt(e){return e===10||e===13}function no(e){return e===9||e===32}function Qr(e){return no(e)||wt(e)}function Fn(e){return e===0||Qr(e)}function ns(e){return e===44||e===91||e===93||e===123||e===125}function CM(e){return e>=48&&e<=57?e-48:-1}function IM(e){if(e>=48&&e<=57)return e-48;let t=e|32;if(t>=97&&t<=102)return t-97+10;return-1}function TM(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function NM(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function $l(e){if(e.input.charCodeAt(e.position)===10)e.position++;else if(e.position++,e.input.charCodeAt(e.position)===10)e.position++;e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function Tt(e,t){let r=0,n=e.input.charCodeAt(e.position),i=e.position===e.lineStart||Qr(e.input.charCodeAt(e.position-1));while(n!==0){while(no(n)){if(i=!0,n===9&&e.firstTabInLine===-1)e.firstTabInLine=e.position;n=e.input.charCodeAt(++e.position)}if(t&&i&&n===35)do n=e.input.charCodeAt(++e.position);while(!wt(n)&&n!==0);if(!wt(n))break;$l(e),r++,i=!0,n=e.input.charCodeAt(e.position);while(n===32)e.lineIndent++,n=e.input.charCodeAt(++e.position)}return r}function eo(e,t=e.position){let r=e.input.charCodeAt(t);if((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)){let n=e.input.charCodeAt(t+3);return n===0||Qr(n)}return!1}function b$(e){if(e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279)e.position++,e.lineStart=e.position}function Yd(e){if(e.position!==e.lineStart)return!1;if(eo(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=Xs(e);b$(e),Tt(e,!0);let r=e.input.charCodeAt(e.position),n=e.position===e.lineStart&&(r===37||r===45&&eo(e));return Qs(e,t),n}function t$(e){let t=e.input.charCodeAt(e.position);while(t!==0&&!wt(t))t=e.input.charCodeAt(++e.position)}function x$(e,t,r){let n=_M.exec(e.input.slice(t,r));if(n!==null)e.position=t+n.index+n[0].length-1,ce(e,"the stream contains non-printable characters")}function MM(e,t,r){if(e.input.charCodeAt(e.position)!==33)return!1;if(t.tagStart!==Me)ce(e,"duplication of a tag property");let n=e.position,i=!1,s=!1,o="!",a=e.input.charCodeAt(++e.position);if(a===60)i=!0,a=e.input.charCodeAt(++e.position);else if(a===33)s=!0,o="!!",a=e.input.charCodeAt(++e.position);let c=e.position,l;if(i){while(a!==0&&a!==62)a=e.input.charCodeAt(++e.position);if(a!==62)ce(e,"unexpected end of the stream within a verbatim tag");l=e.input.slice(c,e.position),e.position++}else{while(a!==0&&!Qr(a)&&!(r&&ns(a))){if(a===33)if(!s){if(o=e.input.slice(c-1,e.position+1),!m$.test(o))ce(e,"named tag handle cannot contain such characters");s=!0,c=e.position+1}else ce(e,"tag suffix cannot contain exclamation marks");a=e.input.charCodeAt(++e.position)}if(l=e.input.slice(c,e.position),PM.test(l))ce(e,"tag suffix cannot contain flow indicator characters")}if(l&&!(i?kM.test(l):AM.test(l)))ce(e,`tag name cannot contain such characters: ${l}`);if(!i&&o!=="!"&&o!=="!!"&&!f$.call(e.tagHandlers,o))ce(e,`undeclared tag handle "${o}"`);return t.tagStart=n,t.tagEnd=e.position,!0}function LM(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;if(t.anchorStart!==Me)ce(e,"duplication of an anchor property");e.position++;let r=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position))&&!ns(e.input.charCodeAt(e.position)))e.position++;if(e.position===r)ce(e,"name of an anchor node must contain at least one character");return t.anchorStart=r,t.anchorEnd=e.position,!0}function DM(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;if(t.anchorStart!==Me||t.tagStart!==Me)ce(e,"alias node should not have any properties");e.position++;let r=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position))&&!ns(e.input.charCodeAt(e.position)))e.position++;if(e.position===r)ce(e,"name of an alias node must contain at least one character");return OM(e,r,e.position),!0}function Md(e,t){if(Tt(e,!1),e.lineIndent<t)ce(e,"deficient indentation")}function JM(e,t,r){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let n=e.position,i=!0;while(e.input.charCodeAt(e.position)!==0){let s=e.input.charCodeAt(e.position);if(s===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}let o=e.position;return e.position++,ro(e,n,o,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,ke.SINGLE_QUOTED,jr.CLIP,-1,i),!0}if(wt(s))i=!1,Md(e,t);else if(e.position===e.lineStart&&eo(e))ce(e,"unexpected end of the document within a single quoted scalar");else if(s!==9&&s<32)ce(e,"expected valid JSON character");else e.position++}ce(e,"unexpected end of the stream within a single quoted scalar")}function FM(e,t,r){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let n=e.position,i=!0;while(e.input.charCodeAt(e.position)!==0){let s=e.input.charCodeAt(e.position);if(s===34){let o=e.position;return e.position++,ro(e,n,o,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,ke.DOUBLE_QUOTED,jr.CLIP,-1,i),!0}if(s===92){i=!1;let o=e.input.charCodeAt(++e.position);if(wt(o))Md(e,t);else if(NM(o))e.position++;else{let a=TM(o);if(a===0)ce(e,"unknown escape sequence");while(a-- >0)if(e.position++,IM(e.input.charCodeAt(e.position))<0)ce(e,"expected hexadecimal character");e.position++}}else if(wt(s))i=!1,Md(e,t);else if(e.position===e.lineStart&&eo(e))ce(e,"unexpected end of the document within a double quoted scalar");else if(s!==9&&s<32)ce(e,"expected valid JSON character");else e.position++}ce(e,"unexpected end of the stream within a double quoted scalar")}function qM(e,t,r){let n=e.input.charCodeAt(e.position),i=jr.CLIP,s=-1,o=!1;if(n!==124&&n!==62)return!1;let a=n===124?ke.LITERAL_BLOCK:ke.FOLDED_BLOCK;e.position++;while(e.input.charCodeAt(e.position)!==0){let m=e.input.charCodeAt(e.position),y=CM(m);if(m===43||m===45){if(i!==jr.CLIP)ce(e,"repeat of a chomping mode identifier");i=m===43?jr.KEEP:jr.STRIP,e.position++}else if(y>=0){if(y===0)ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one");if(o)ce(e,"repeat of an indentation width identifier");s=t+y-1,o=!0,e.position++}else break}let c=!1;while(no(e.input.charCodeAt(e.position)))c=!0,e.position++;if(c&&e.input.charCodeAt(e.position)===35)t$(e);if(wt(e.input.charCodeAt(e.position)))$l(e);else if(e.input.charCodeAt(e.position)!==0)ce(e,"a line break is expected");let l=o?s:-1,u=0,{position:d,position:h}=e;while(e.input.charCodeAt(e.position)!==0){let m=e.position,y=0;while(e.input.charCodeAt(m+y)===32)y++;let g=e.input.charCodeAt(m+y);if(g===0){if(l>=0){if(y>l)h=m+y}else if(y>0)h=m+y;break}if(Yd(e))break;if(!o&&l===-1&&wt(g))u=Math.max(u,y);if(!o&&l===-1&&!wt(g)){if(g===9&&y<t)e.position=m+y,ce(e,"tab characters must not be used in indentation");if(y>=t&&y<u)e.position=m+y,ce(e,"bad indentation of a mapping entry")}if(l===-1&&g!==0&&!wt(g)&&y<t){e.lineIndent=y,e.position=m+y;break}if(!o&&g!==0&&!wt(g)&&l===-1)l=y;let b=l===-1?t+1:l;if(g!==0&&!wt(g)&&y<b){e.lineIndent=y,e.position=m+y;break}if(t$(e),h=e.position,wt(e.input.charCodeAt(e.position)))$l(e),h=e.position}return x$(e,d,h),ro(e,d,h,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,a,i,l),!0}function BM(e,t){let r=e.input.charCodeAt(e.position),n=t===Zs;if(r===0||Qr(r)||r===35||r===38||r===42||r===33||r===124||r===62||r===39||r===34||r===37||r===64||r===96||ns(r))return!1;if(r===63||r===45){let i=e.input.charCodeAt(e.position+1);if(Fn(i)||n&&ns(i))return!1}return!0}function HM(e,t,r,n){if(!BM(e,r))return!1;let{position:i,position:s}=e,o=e.input.charCodeAt(e.position),a=r===Zs,c=!1;while(o!==0){if(Yd(e))break;if(o===58){let l=e.input.charCodeAt(e.position+1);if(Fn(l)||a&&ns(l))break}else if(o===35){if(Qr(e.input.charCodeAt(e.position-1)))break}else if(a&&ns(o))break;else if(wt(o)){let{position:l,line:u,lineStart:d,lineIndent:h}=e;if(Tt(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=l,e.line=u,e.lineStart=d,e.lineIndent=h;break}if(!no(o))s=e.position+1;o=e.input.charCodeAt(++e.position)}if(s===i)return!1;return x$(e,i,s),ro(e,i,s,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,ke.PLAIN,jr.CLIP,-1,!c),!0}function ga(e,t){let r=e.line;if(Tt(e,!0),e.line>r&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)ce(e,"deficient indentation")}function UM(e,t,r){let n=e.input.charCodeAt(e.position),i=n===123,s=e.position,o=!0;if(n!==91&&n!==123)return!1;let a=i?125:93;if(i)y$(e,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.FLOW);else g$(e,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.FLOW);e.position++;while(e.input.charCodeAt(e.position)!==0){ga(e,t);let c=e.input.charCodeAt(e.position);if(c===a)return e.position++,Ys(e),!0;else if(!o)ce(e,"missed comma between flow collection entries");else if(c===44)ce(e,"expected the node content, but found ','");let l=!1,u=!1;if(c===63&&Qr(e.input.charCodeAt(e.position+1)))l=u=!0,e.position+=1,ga(e,t);let d=e.line,h=Xs(e),m=to(e,t,Zs,!1,!0);if(ga(e,t),c=e.input.charCodeAt(e.position),(i||u||e.line===d)&&c===58){if(l=!0,e.position++,ga(e,t),!i){if(Zx(e,h),!m)Kt(e)}else if(!m)Kt(e);if(!to(e,t,Zs,!1,!0))Kt(e);if(ga(e,t),!i)Ys(e)}else if(i&&l){if(!m)Kt(e);Kt(e)}else if(i)Kt(e);else if(l){if(Zx(e,h),!m)Kt(e);Kt(e),Ys(e)}if(c=e.input.charCodeAt(e.position),c===44)o=!0,e.position++;else o=!1}ce(e,"unexpected end of the stream within a flow collection")}function r$(e,t,r){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Fn(e.input.charCodeAt(e.position+1)))return!1;g$(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.BLOCK);while(e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1))){if(e.firstTabInLine!==-1)e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation");let n=e.line;e.position++;let i=Tt(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1)))ce(e,"bad indentation of a sequence entry");if(i&&e.lineIndent<=t)Kt(e);else to(e,t,p$,!1,!0);if(Tt(e,!0),e.lineIndent<t||e.position>=e.length)break;if(e.lineIndent>t)ce(e,"bad indentation of a sequence entry");if(e.line===n&&e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1)))ce(e,"bad indentation of a sequence entry")}return Ys(e),!0}function Cd(e,t,r,n){let i=!1,s=!1,o=!1,a=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);while(c!==0){if(!i&&e.firstTabInLine!==-1)e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation");let l=e.input.charCodeAt(e.position+1),u=e.line;if((c===63||c===58)&&Fn(l)){if(!o)y$(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,pi.BLOCK),o=!0;if(c===63){if(i)Kt(e);s=!0,i=!0}else if(i)i=!1;else Kt(e),s=!0,i=!1;e.position+=1,a=!0}else{if(i)Kt(e),i=!1;let d=Xs(e);if(!to(e,r,d$,!1,!0))break;if(e.line===u){c=e.input.charCodeAt(e.position);while(no(c))c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),!Fn(c))ce(e,"a whitespace character is expected after the key-value separator within a block mapping");if(!o)e.events.splice(d.eventsLength,0,{type:ct.MAPPING,start:d.position,anchorStart:n.anchorStart,anchorEnd:n.anchorEnd,tagStart:n.tagStart,tagEnd:n.tagEnd,style:pi.BLOCK}),o=!0;s=!0,i=!1,a=!1}else if(s)ce(e,"expected ':' after a mapping key");else{if(n.anchorStart!==Me||n.tagStart!==Me)return Qs(e,d),!1;return!0}}else if(s)ce(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else{if(n.anchorStart!==Me||n.tagStart!==Me)return Qs(e,d),!1;return!0}}if(to(e,t,xl,!0,a))a=!1;if(!i){if(a)Kt(e),a=!1}if(Tt(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)ce(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}if(!s)return!1;if(i)Kt(e);if(o)Ys(e);return!0}function to(e,t,r,n,i,s=!0){if(e.depth>=e.maxDepth)ce(e,`nesting exceeded maxDepth (${e.maxDepth})`);e.depth++;let o=1,a=!1,c=!1,l=null,u=e$(),d=r===xl||r===p$,h=d,m=d;if(n&&Tt(e,!0))if(a=!0,e.lineIndent>t)o=1;else if(e.lineIndent===t)o=0;else o=-1;if(o===1)while(!0){let y=e.input.charCodeAt(e.position),g=Xs(e);if(a&&o!==1&&(y===33||y===38))break;if(a&&m&&(u.tagStart!==Me||u.anchorStart!==Me)&&(y===33||y===38)){let b=Xs(e),x=t+1;if(Cd(e,e.position-e.lineStart,x,u)&&e.events[b.eventsLength]?.type===ct.MAPPING)return e.depth--,!0;Qs(e,b)}if(a&&(y===33&&u.tagStart!==Me||y===38&&u.anchorStart!==Me))break;if(!MM(e,u,r===Zs)&&!LM(e,u))break;if(l===null)l=g;if(Tt(e,!0))if(a=!0,h=m,e.lineIndent>t)o=1;else if(e.lineIndent===t)o=0;else o=-1;else h=!1}if(h)h=a||i;if(o===1||r===xl){let y=r===Zs||r===d$?t:t+1,g=e.position-e.lineStart;if(o===1)if(h&&(r$(e,g,u)||Cd(e,g,y,u))||UM(e,y,u))c=!0;else{let b=e.input.charCodeAt(e.position);if(l!==null&&s&&m&&!h&&b!==124&&b!==62){let x=Xs(e),_=l.position-l.lineStart;if(Qs(e,l),Cd(e,_,y,e$())&&e.events[x.eventsLength]?.type===ct.MAPPING)c=!0;else Qs(e,x)}if(!c&&(d&&qM(e,y,u)||JM(e,y,u)||FM(e,y,u)||DM(e,u)||HM(e,y,r,u)))c=!0}else if(o===0)c=h&&r$(e,g,u)}if(d=d&&!c,!c&&(u.anchorStart!==Me||u.tagStart!==Me||d))ro(e,Me,Me,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,ke.PLAIN),c=!0;return e.depth--,c||u.anchorStart!==Me||u.tagStart!==Me}function VM(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;let t=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position)))e.position++;let r=e.input.slice(t,e.position),n=[];if(r.length===0)ce(e,"directive name must not be less than one character in length");while(e.input.charCodeAt(e.position)!==0&&!wt(e.input.charCodeAt(e.position))){while(no(e.input.charCodeAt(e.position)))e.position++;if(e.input.charCodeAt(e.position)===35||wt(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let i=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position)))e.position++;n.push(e.input.slice(i,e.position))}if(wt(e.input.charCodeAt(e.position)))$l(e);if(r==="YAML"){if(e.directives.some((s)=>s.kind==="yaml"))ce(e,"duplication of %YAML directive");if(n.length!==1)ce(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);if(i===null)ce(e,"ill-formed argument of the YAML directive");if(parseInt(i[1],10)!==1)ce(e,"unacceptable YAML version of the document");e.directives.push({kind:"yaml",version:n[0]})}else if(r==="TAG"){if(n.length!==2)ce(e,"TAG directive accepts exactly two arguments");let[i,s]=n;if(!m$.test(i))ce(e,"ill-formed tag handle (first argument) of the TAG directive");if(f$.call(e.tagHandlers,i))ce(e,`there is a previously declared suffix for "${i}" tag handle`);if(!jM.test(s))ce(e,"ill-formed tag prefix (second argument) of the TAG directive");e.tagHandlers[i]=s,e.directives.push({kind:"tag",handle:i,prefix:s})}return!0}function WM(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;Tt(e,!0);while(VM(e))t=!0,Tt(e,!0);let r=!1,n=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&Fn(e.input.charCodeAt(e.position+3))){r=!0;let a=e.line;e.position+=3,Tt(e,!0),i=e.line>a}else if(t)ce(e,"directives end mark is expected");let s=e.events.length;if(!r&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&eo(e)){e.position+=3,Tt(e,!0);return}if(RM(e,r,!1),!to(e,e.lineIndent-1,xl,!1,i,i))Kt(e);if(Tt(e,!0),e.position===e.lineStart&&eo(e)){if(n=e.input.charCodeAt(e.position)===46,n){let a=e.line;if(e.position+=3,Tt(e,!0),e.line===a&&e.position<e.length)ce(e,"end of the stream or a document separator is expected")}}let o=e.events[s];if(o?.type===ct.DOCUMENT)o.explicitEnd=n;if(Ys(e),!n&&e.position<e.length&&!Yd(e))ce(e,"end of the stream or a document separator is expected")}function zM(e,t){let r=e.length,n={...Gd,...t,input:`${e}\x00`,length:r,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf("\x00");if(i!==-1)rs.throwAt(e,i,"null byte is not allowed in input",n.filename);while(n.position<n.length){if(b$(n),Tt(n,!0),n.position>=n.length)break;let s=n.position;if(WM(n),n.position===s)ce(n,"can not read a document")}return n.events}function $$(e,t={}){let r={...KM,...t},n=String(e),i=Object.keys(Gd),s=Object.keys(Kd);return EM(zM(n,Vx(r,i)),{...Vx(r,s),source:n})}function v$(e,t,r){let n=null;if(typeof t==="function")n=t;else if(t!==null&&typeof t==="object")r=t;let i=$$(e,r);if(n===null)return i;for(let s of i)n(s)}function Xd(e,t){let r=$$(e,t);if(r.length===0)throw new rs("expected a document, but the input is empty");if(r.length===1)return r[0];throw new rs("expected a single document in the stream, but found more")}function El(e,t){return(e&1<<t)!==0}function w$(e){if(e.presenterOptions.quoteStyle==="single"&&El(e.allowedStylesMask,ke.SINGLE_QUOTED))return ke.SINGLE_QUOTED;return ke.DOUBLE_QUOTED}function GM(e){if(!e.presenterOptions.quoteFlowKeys)return;if(!e.isKey||!e.flowOnly||e.style!==ke.PLAIN)return;e.style=ke.DOUBLE_QUOTED}function YM(e){if(e.style===ke.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value))e.style=ke.DOUBLE_QUOTED}function XM(e){if(e.style===ke.PLAIN&&/^\s+$/.test(e.node.value))e.style=ke.DOUBLE_QUOTED}function QM(e){if(!e.presenterOptions.forceQuotes)return;if(e.isKey||e.style!==ke.PLAIN)return;if(e.node.tag!==e.presenterOptions.schema.defaultScalarTag.tagName)return;e.style=e.node.value.includes(`
126
+ `)?ke.DOUBLE_QUOTED:w$(e)}function ZM(e){if(e.style!==ke.PLAIN||e.isKey)return;let t=e.node.value,r=t.indexOf(`
127
127
  `)!==-1;if(!El(e.allowedStylesMask,ke.LITERAL_BLOCK)){if(r)e.style=ke.DOUBLE_QUOTED;return}let n=e.presenterOptions.lineWidth;if(n===-1){if(r)e.style=ke.LITERAL_BLOCK;return}let i=Math.max(Math.min(n,40),n-e.shiftOfContent),s=0,o=!1;while(s<=t.length){let a=t.length,c=t.indexOf(`
128
- `,s);if(c!==-1)a=c;let l=t.slice(s,a);if(l.length>i&&l[0]!==" "&&/ [^ \t]/.test(l))o=!0;if(c===-1)break;s=c+1}if(o)e.style=ke.FOLDED_BLOCK;else if(r)e.style=ke.LITERAL_BLOCK}function XM(e){if(e.style===ke.PLAIN&&!El(e.allowedStylesMask,ke.PLAIN))e.style=w$(e)}function QM(e){if(!El(e.allowedStylesMask,e.style))e.style=ke.DOUBLE_QUOTED}var Te,s2,o2,a2,c2,l2,u2,f2,d2,p2,m2,h2,g2,y2,b2,x2,$2,v2,i$,E2,_2,A2,j2,Cd,C2,I2,s$,M2,L2,F2,q2,B2,Id,Jd,V2,Fd,K2,G2,qd,X2,Bd,Hd,Q2,Ud,Sl=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){let r=tM(t),n=[],i=Z2(),s=eM();for(let u of r){if(u.nodeKind==="scalar"&&u.implicit){if(u.matchByTagPrefix)throw Error("Implicit scalar tags cannot match by tag prefix");n.push(u)}switch(u.nodeKind){case"scalar":if(u.matchByTagPrefix)s.scalar.push(u);else i.scalar[u.tagName]=u;break;case"sequence":if(u.matchByTagPrefix)s.sequence.push(u);else i.sequence[u.tagName]=u;break;case"mapping":if(u.matchByTagPrefix)s.mapping.push(u);else i.mapping[u.tagName]=u}}let o=n.filter((u)=>u.implicitFirstChars===null),a=new Set;for(let u of n)if(u.implicitFirstChars!==null)for(let d of u.implicitFirstChars)a.add(d);let c=new Map;for(let u of a)c.set(u,n.filter((d)=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(u)!==-1));let l=i.scalar["tag:yaml.org,2002:str"];if(!l)throw Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=r,this.implicitScalarTags=n,this.implicitScalarByFirstChar=c,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=l,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(t){let r=this.exact.scalar[t];if(r)return r;for(let n of this.prefix.scalar)if(t.startsWith(n.tagName))return n}lookupSequenceTag(t){let r=this.exact.sequence[t];if(r)return r;for(let n of this.prefix.sequence)if(t.startsWith(n.tagName))return n}lookupMappingTag(t){let r=this.exact.mapping[t];if(r)return r;for(let n of this.prefix.mapping)if(t.startsWith(n.tagName))return n}resolveImplicitScalarTag(t){let r=this.implicitScalarByFirstChar.get(t.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of r){let s=i.resolve(t,!1,i.tagName);if(s!==Te)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(t,!1,n.tagName),tag:n}}withTags(...t){let r=[];for(let n of t)r=r.concat(n);return new e([...this.tags,...r])}},Vd,aee,ya,rM,nM,cee,lee,iM,rs,ct,ke,pi,jr,oM=-1,o$,a$,mM,hM="-#;/?:@&=+$_.~*'()",uee,Gs=-1,gM="tag:yaml.org,2002:merge",zd,Me=-1,f$,Zs=1,d$=2,p$=3,xl=4,wM,SM,m$,Td,h$,EM,_M,PM,Kd,VM,fee,dee,pee,n$,ZM="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",eL="[\\n\\r]",tL="\\uFEFF",Xd="[ \\t]",S$,_l,E$="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",_$="[-?:,\\[\\]{}#&*!|>'\"%@`]",rL="[,\\[\\]{}]",Md,Ld,nL,iL,P$,k$,A$,j$,R$,O$,sL,oL,aL,cL,lL,uL,mee,hee,gee,yee,bee,xee,$ee,fL,vee,wee,See,Eee,_ee,Pee,kee,Aee,jee,Ree,Oee,Cee,Iee,Tee,Nee,Mee,Lee;var C$=L(()=>{/*! js-yaml 5.5.0 https://github.com/nodeca/js-yaml @license MIT */Te=Symbol("NOT_RESOLVED");s2=Nt("tag:yaml.org,2002:str",{resolve:(e)=>e,identify:(e)=>typeof e==="string"}),o2=["","~","null","Null","NULL"],a2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(o2.indexOf(e)!==-1)return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),c2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>{if(e==="null"||t&&e==="")return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),l2=["","~","null","Null","NULL"],u2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(l2.indexOf(e)!==-1)return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),f2=["true","True","TRUE"],d2=["false","False","FALSE"],p2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:(e)=>{if(f2.indexOf(e)!==-1)return!0;if(d2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),m2=["true"],h2=["false"],g2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:(e)=>{if(m2.indexOf(e)!==-1)return!0;if(h2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),y2=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],b2=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],x2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:(e)=>{if(y2.indexOf(e)!==-1)return!0;if(b2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),$2=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),v2=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");i$=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:S2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),E2=new RegExp("^-?(?:0|[1-9][0-9]*)$"),_2=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");A2=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:k2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),j2=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");Cd=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:O2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),C2=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),I2=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");s$=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:T2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:N2}),M2=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),L2=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");F2=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:D2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:J2}),q2=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),B2=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");Id=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:H2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:U2}),Jd=Nt("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>{if(e==="<<"||t&&e==="")return"<<";return Te},identify:()=>!1}),V2=/^[A-Za-z0-9+/]*={0,2}$/;Fd=Nt("tag:yaml.org,2002:binary",{resolve:W2,identify:(e)=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:z2}),K2=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),G2=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");qd=Nt("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Y2,identify:(e)=>e instanceof Date,represent:(e)=>e.toISOString()}),X2=Dd("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});Bd=Dd("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let r;if(t instanceof Map){if(t.size!==1)return"cannot resolve an ordered map item";r=t.keys().next().value}else if(wl(t)){let n=Object.keys(t);if(n.length!==1)return"cannot resolve an ordered map item";r=n[0]}else return"cannot resolve an ordered map item";if(e.seen.has(r))return"duplicate key in ordered map";return e.seen.add(r),e.list.push(t),""},finalize:(e)=>e.list,identify:()=>!1}),Hd=Dd("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,t)=>{if(t instanceof Map){if(t.size!==1)return"cannot resolve a pairs item";return e.push(t.entries().next().value),""}if(Object.prototype.toString.call(t)!=="[object Object]")return"cannot resolve a pairs item";let r=t,n=Object.keys(r);if(n.length!==1)return"cannot resolve a pairs item";return e.push([n[0],r[n[0]]]),""},identify:()=>!1}),Q2=vl("tag:yaml.org,2002:map",{create:()=>({}),identify:wl,represent:(e)=>{let t=new Map;for(let r of Object.keys(e))t.set(r,e[r]);return t},addPair:(e,t,r)=>{if(t!==null&&typeof t==="object")return"object-based map does not support complex keys";let n=String(t);if(n==="__proto__")Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[n]=r;return""},has:(e,t)=>{if(t!==null&&typeof t==="object")return!1;return Object.prototype.hasOwnProperty.call(e,String(t))},keys:(e)=>Object.keys(e),get:(e,t)=>{let r=String(t);if(!Object.prototype.hasOwnProperty.call(e,r))return null;return e[r]}}),Ud=vl("tag:yaml.org,2002:set",{create:()=>new Set,identify:(e)=>e instanceof Set,represent:(e)=>{let t=new Map;for(let r of e)t.set(r,null);return t},addPair:(e,t,r)=>{if(r!==null)return"cannot resolve a set item";return e.add(t),""},has:(e,t)=>e.has(t),keys:(e)=>e.keys(),get:()=>null});Vd=new Sl([s2,X2,Q2]),aee=new Sl([...Vd.tags,c2,g2,A2,F2]),ya=new Sl([...Vd.tags,a2,p2,i$,s$]),rM=new Sl([...Vd.tags,u2,x2,Cd,Id,qd,Jd,Fd,Bd,Hd,Ud]),nM=rM.withTags({...Cd,resolve:(e,t,r)=>{let n=Cd.resolve(e,t,r);return n===Te?i$.resolve(e,t,r):n}},{...Id,resolve:(e,t,r)=>{let n=Id.resolve(e,t,r);return n===Te?s$.resolve(e,t,r):n}}),cee=vl("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,t,r)=>(e.set(t,r),""),has:(e,t)=>e.has(t),keys:(e)=>e.keys(),get:(e,t)=>e.get(t),identify:(e)=>e instanceof Map||wl(e),represent:(e)=>{if(e instanceof Map)return e;let t=new Map,r=e;for(let n of Object.keys(r))t.set(n,r[n]);return t}});lee=vl("tag:yaml.org,2002:map",{create:()=>({}),identify:wl,represent:(e)=>{let t=new Map;for(let r of Object.keys(e))t.set(r,e[r]);return t},addPair:(e,t,r)=>{let n=Wx(t);if(n===null)return"nested arrays are not supported inside keys";if(n==="__proto__")Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[n]=r;return""},has:(e,t)=>{let r=Wx(t);return r!==null&&Object.prototype.hasOwnProperty.call(e,r)},keys:(e)=>Object.keys(e),get:(e,t)=>{let r=String(t);if(!Object.prototype.hasOwnProperty.call(e,r))return null;return e[r]}}),iM={maxLength:79,indent:1,linesBefore:3,linesAfter:2};rs=class e extends Error{reason;mark;constructor(t,r){super();if(this.name="YAMLException",this.reason=t,this.mark=r,this.message=zx(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(t){return`${this.name}: ${zx(this,t)}`}static throwAt(t,r,n,i=""){let s=0,o=0;for(let c=0;c<r;c++){let l=t.charCodeAt(c);if(l===10)s++,o=c+1;else if(l===13){if(s++,t.charCodeAt(c+1)===10)c++;o=c+1}}let a={name:i,buffer:t,position:r,line:s,column:r-o};throw a.snippet=sM(a),new e(n,a)}},ct={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},ke={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},pi={BLOCK:1,FLOW:2},jr={CLIP:1,STRIP:2,KEEP:3};o$=Array(256),a$=Array(256);for(let e=0;e<256;e++)o$[e]=Kx(e)?1:0,a$[e]=Kx(e);mM=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"}),uee=hM+"!,[]";zd={filename:"",schema:ya,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};f$=Object.prototype.hasOwnProperty,wM=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,SM=/[,\[\]{}]/,m$=/^(?:!|!!|![0-9A-Za-z-]+!)$/,Td=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,h$=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,EM=new RegExp(`^(?:${Td})*$`),_M=new RegExp(`^(?:${h$})+$`),PM=new RegExp(`^(?:!(?:${Td})*|${h$}(?:${Td})*)$`),Kd={filename:"",maxDepth:100};VM={...Kd,...zd};fee=Symbol("INVALID"),dee=Symbol("visit:break"),pee=Symbol("visit:skip");n$={applyQuoteFlowKeysOption:WM,doubleQuoteForInvisibles:zM,doubleQuoteWhitespaceOnly:KM,applyForceQuotesOption:GM,tryLongOrMultilineAsBlock:YM,quoteInvalidPlain:XM,fallbackToDoubleQuoted:QM};S$=`(?:(?!(?:${eL}|${tL}))${ZM})`,_l=`(?:(?!${Xd})${S$})`,Md=_l,Ld=`(?:(?!${rL})${_l})`,nL=`(?:(?:(?!${_$})${_l})|[?:-](?=${Md}))`,iL=`(?:(?:(?!${_$})${_l})|[?:-](?=${Ld}))`,P$=`(?:(?:(?![:#])${Md})|:(?=${Md}))#*`,k$=`(?:(?:(?![:#])${Ld})|:(?=${Ld}))#*`,A$=`(?:${Xd}*${P$})*`,j$=`(?:${Xd}*${k$})*`,R$=`${nL}#*${A$}`,O$=`${iL}#*${j$}`,sL=R$,oL=O$,aL=`\\n+${P$}${A$}`,cL=`\\n+${k$}${j$}`,lL=`${R$}(?:${aL})*`,uL=`${O$}(?:${cL})*`,mee=new RegExp(`^(?:${lL})$`,"u"),hee=new RegExp(`^(?:${uL})$`,"u"),gee=new RegExp(`^(?:${sL})$`,"u"),yee=new RegExp(`^(?:${oL})$`,"u"),bee=new RegExp(`^(?:${E$})*$`,"u"),xee=new RegExp(`^(?:${E$}|\\n)*$`,"u"),$ee=new RegExp(`^(?:${S$}|\\n)*$`,"u"),fL={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(n$).map((e)=>Reflect.get(n$,e)),tagBeforeAnchor:!1},vee={...fL,schema:nM,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:()=>{}},wee=ct.DOCUMENT,See=ct.SEQUENCE,Eee=ct.MAPPING,_ee=ct.SCALAR,Pee=ct.ALIAS,kee=ct.POP,Aee=ke.PLAIN,jee=ke.SINGLE_QUOTED,Ree=ke.DOUBLE_QUOTED,Oee=ke.LITERAL_BLOCK,Cee=ke.FOLDED_BLOCK,Iee=pi.BLOCK,Tee=pi.FLOW,Nee=jr.CLIP,Mee=jr.STRIP,Lee=jr.KEEP});var dL,I$;var T$=L(()=>{Ar();C$();dL=ya.withTags(qd,Jd,Fd,Bd,Hd,Ud),I$={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(e){let t=e.data;if(Buffer.isBuffer(t))t=t.toString();if(typeof t==="string")try{return Yd(t,{schema:ya})}catch{try{return Yd(t,{schema:dL})}catch(r){try{if(v$(t,{schema:ya}).length===0)return}catch{}throw new Gr(r?.message||"Parser Error",e.url)}}else return t}}});var pL,N$;var M$=L(()=>{Ar();pL=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)(?:[?#].*)?$/i,N$={order:300,allowEmpty:!0,encoding:"utf8",canParse(e){return(typeof e.data==="string"||Buffer.isBuffer(e.data))&&pL.test(e.url)},parse(e){if(typeof e.data==="string")return e.data;else if(Buffer.isBuffer(e.data))return e.data.toString(this.encoding);else throw new Gr("data is not text",e.url)}}});var mL,L$;var D$=L(()=>{mL=/\.(jpeg|jpg|gif|png|bmp|ico)(?:[?#].*)?$/i,L$={order:400,allowEmpty:!0,canParse(e){return Buffer.isBuffer(e.data)&&mL.test(e.url)},parse(e){if(Buffer.isBuffer(e.data))return e.data;else return Buffer.from(e.data)}}});var Qd;var Zd=L(()=>{Wt();Ar();Qd={order:100,canRead(e){return ul(e.url)},async read(e){let t,r=await import("fs");try{t=Bs(e.url)}catch(n){let i=n;throw i.message=`Malformed URI: ${e.url}: ${i.message}`,new Yr(i,e.url)}if(t.endsWith("/")||t.endsWith("\\"))t=t.slice(0,-1);try{return await r.promises.readFile(t)}catch(n){let i=n;throw i.message=`Error opening file ${t}: ${i.message}`,new Yr(i,t)}}}});async function B$(e,t,r){e=la(e);let n=r||[];n.push(e.href);let i;try{let s;if(t.safeUrlResolver){let a=await Ax(e.href);if(a.unsafe)throw Error(`Unsafe URL blocked by safeUrlResolver: ${e.href}`);s=a.addresses}i=await gL(e,t,s);let o=i.response;if(o.status>=400){let a=Error(`HTTP ERROR ${o.status}`);throw a.status=o.status,a}else if(o.status>=300)if(!Number.isNaN(t.redirects)&&n.length>t.redirects){let a=Error(`Error downloading ${n[0]}.
128
+ `,s);if(c!==-1)a=c;let l=t.slice(s,a);if(l.length>i&&l[0]!==" "&&/ [^ \t]/.test(l))o=!0;if(c===-1)break;s=c+1}if(o)e.style=ke.FOLDED_BLOCK;else if(r)e.style=ke.LITERAL_BLOCK}function eL(e){if(e.style===ke.PLAIN&&!El(e.allowedStylesMask,ke.PLAIN))e.style=w$(e)}function tL(e){if(!El(e.allowedStylesMask,e.style))e.style=ke.DOUBLE_QUOTED}var Te,c2,l2,u2,f2,d2,p2,m2,h2,g2,y2,b2,x2,$2,v2,w2,S2,E2,i$,k2,A2,O2,C2,Id,N2,M2,s$,J2,F2,H2,U2,V2,Td,Fd,K2,qd,X2,Q2,Bd,eM,Hd,Ud,tM,Vd,Sl=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){let r=iM(t),n=[],i=rM(),s=nM();for(let u of r){if(u.nodeKind==="scalar"&&u.implicit){if(u.matchByTagPrefix)throw Error("Implicit scalar tags cannot match by tag prefix");n.push(u)}switch(u.nodeKind){case"scalar":if(u.matchByTagPrefix)s.scalar.push(u);else i.scalar[u.tagName]=u;break;case"sequence":if(u.matchByTagPrefix)s.sequence.push(u);else i.sequence[u.tagName]=u;break;case"mapping":if(u.matchByTagPrefix)s.mapping.push(u);else i.mapping[u.tagName]=u}}let o=n.filter((u)=>u.implicitFirstChars===null),a=new Set;for(let u of n)if(u.implicitFirstChars!==null)for(let d of u.implicitFirstChars)a.add(d);let c=new Map;for(let u of a)c.set(u,n.filter((d)=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(u)!==-1));let l=i.scalar["tag:yaml.org,2002:str"];if(!l)throw Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=r,this.implicitScalarTags=n,this.implicitScalarByFirstChar=c,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=l,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(t){let r=this.exact.scalar[t];if(r)return r;for(let n of this.prefix.scalar)if(t.startsWith(n.tagName))return n}lookupSequenceTag(t){let r=this.exact.sequence[t];if(r)return r;for(let n of this.prefix.sequence)if(t.startsWith(n.tagName))return n}lookupMappingTag(t){let r=this.exact.mapping[t];if(r)return r;for(let n of this.prefix.mapping)if(t.startsWith(n.tagName))return n}resolveImplicitScalarTag(t){let r=this.implicitScalarByFirstChar.get(t.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of r){let s=i.resolve(t,!1,i.tagName);if(s!==Te)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(t,!1,n.tagName),tag:n}}withTags(...t){let r=[];for(let n of t)r=r.concat(n);return new e([...this.tags,...r])}},Wd,dee,ya,sM,oM,pee,mee,aM,rs,ct,ke,pi,jr,lM=-1,o$,a$,yM,bM="-#;/?:@&=+$_.~*'()",hee,Gs=-1,xM="tag:yaml.org,2002:merge",Kd,Me=-1,f$,Zs=1,d$=2,p$=3,xl=4,_M,PM,m$,Nd,h$,kM,AM,jM,Gd,KM,gee,yee,bee,n$,rL="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",nL="[\\n\\r]",iL="\\uFEFF",Qd="[ \\t]",S$,_l,E$="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",_$="[-?:,\\[\\]{}#&*!|>'\"%@`]",sL="[,\\[\\]{}]",Ld,Dd,oL,aL,P$,k$,A$,j$,R$,O$,cL,lL,uL,fL,dL,pL,xee,$ee,vee,wee,See,Eee,_ee,mL,Pee,kee,Aee,jee,Ree,Oee,Cee,Iee,Tee,Nee,Mee,Lee,Dee,Jee,Fee,qee,Bee;var C$=L(()=>{/*! js-yaml 5.5.0 https://github.com/nodeca/js-yaml @license MIT */Te=Symbol("NOT_RESOLVED");c2=Nt("tag:yaml.org,2002:str",{resolve:(e)=>e,identify:(e)=>typeof e==="string"}),l2=["","~","null","Null","NULL"],u2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(l2.indexOf(e)!==-1)return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),f2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>{if(e==="null"||t&&e==="")return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),d2=["","~","null","Null","NULL"],p2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(d2.indexOf(e)!==-1)return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),m2=["true","True","TRUE"],h2=["false","False","FALSE"],g2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:(e)=>{if(m2.indexOf(e)!==-1)return!0;if(h2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),y2=["true"],b2=["false"],x2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:(e)=>{if(y2.indexOf(e)!==-1)return!0;if(b2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),$2=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],v2=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],w2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:(e)=>{if($2.indexOf(e)!==-1)return!0;if(v2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),S2=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),E2=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");i$=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:P2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),k2=new RegExp("^-?(?:0|[1-9][0-9]*)$"),A2=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");O2=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:R2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),C2=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");Id=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:T2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),N2=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),M2=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");s$=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:L2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:D2}),J2=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),F2=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");H2=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:q2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:B2}),U2=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),V2=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");Td=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:W2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:z2}),Fd=Nt("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>{if(e==="<<"||t&&e==="")return"<<";return Te},identify:()=>!1}),K2=/^[A-Za-z0-9+/]*={0,2}$/;qd=Nt("tag:yaml.org,2002:binary",{resolve:G2,identify:(e)=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:Y2}),X2=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Q2=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");Bd=Nt("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Z2,identify:(e)=>e instanceof Date,represent:(e)=>e.toISOString()}),eM=Jd("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});Hd=Jd("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let r;if(t instanceof Map){if(t.size!==1)return"cannot resolve an ordered map item";r=t.keys().next().value}else if(wl(t)){let n=Object.keys(t);if(n.length!==1)return"cannot resolve an ordered map item";r=n[0]}else return"cannot resolve an ordered map item";if(e.seen.has(r))return"duplicate key in ordered map";return e.seen.add(r),e.list.push(t),""},finalize:(e)=>e.list,identify:()=>!1}),Ud=Jd("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,t)=>{if(t instanceof Map){if(t.size!==1)return"cannot resolve a pairs item";return e.push(t.entries().next().value),""}if(Object.prototype.toString.call(t)!=="[object Object]")return"cannot resolve a pairs item";let r=t,n=Object.keys(r);if(n.length!==1)return"cannot resolve a pairs item";return e.push([n[0],r[n[0]]]),""},identify:()=>!1}),tM=vl("tag:yaml.org,2002:map",{create:()=>({}),identify:wl,represent:(e)=>{let t=new Map;for(let r of Object.keys(e))t.set(r,e[r]);return t},addPair:(e,t,r)=>{if(t!==null&&typeof t==="object")return"object-based map does not support complex keys";let n=String(t);if(n==="__proto__")Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[n]=r;return""},has:(e,t)=>{if(t!==null&&typeof t==="object")return!1;return Object.prototype.hasOwnProperty.call(e,String(t))},keys:(e)=>Object.keys(e),get:(e,t)=>{let r=String(t);if(!Object.prototype.hasOwnProperty.call(e,r))return null;return e[r]}}),Vd=vl("tag:yaml.org,2002:set",{create:()=>new Set,identify:(e)=>e instanceof Set,represent:(e)=>{let t=new Map;for(let r of e)t.set(r,null);return t},addPair:(e,t,r)=>{if(r!==null)return"cannot resolve a set item";return e.add(t),""},has:(e,t)=>e.has(t),keys:(e)=>e.keys(),get:()=>null});Wd=new Sl([c2,eM,tM]),dee=new Sl([...Wd.tags,f2,x2,O2,H2]),ya=new Sl([...Wd.tags,u2,g2,i$,s$]),sM=new Sl([...Wd.tags,p2,w2,Id,Td,Bd,Fd,qd,Hd,Ud,Vd]),oM=sM.withTags({...Id,resolve:(e,t,r)=>{let n=Id.resolve(e,t,r);return n===Te?i$.resolve(e,t,r):n}},{...Td,resolve:(e,t,r)=>{let n=Td.resolve(e,t,r);return n===Te?s$.resolve(e,t,r):n}}),pee=vl("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,t,r)=>(e.set(t,r),""),has:(e,t)=>e.has(t),keys:(e)=>e.keys(),get:(e,t)=>e.get(t),identify:(e)=>e instanceof Map||wl(e),represent:(e)=>{if(e instanceof Map)return e;let t=new Map,r=e;for(let n of Object.keys(r))t.set(n,r[n]);return t}});mee=vl("tag:yaml.org,2002:map",{create:()=>({}),identify:wl,represent:(e)=>{let t=new Map;for(let r of Object.keys(e))t.set(r,e[r]);return t},addPair:(e,t,r)=>{let n=Wx(t);if(n===null)return"nested arrays are not supported inside keys";if(n==="__proto__")Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[n]=r;return""},has:(e,t)=>{let r=Wx(t);return r!==null&&Object.prototype.hasOwnProperty.call(e,r)},keys:(e)=>Object.keys(e),get:(e,t)=>{let r=String(t);if(!Object.prototype.hasOwnProperty.call(e,r))return null;return e[r]}}),aM={maxLength:79,indent:1,linesBefore:3,linesAfter:2};rs=class e extends Error{reason;mark;constructor(t,r){super();if(this.name="YAMLException",this.reason=t,this.mark=r,this.message=zx(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(t){return`${this.name}: ${zx(this,t)}`}static throwAt(t,r,n,i=""){let s=0,o=0;for(let c=0;c<r;c++){let l=t.charCodeAt(c);if(l===10)s++,o=c+1;else if(l===13){if(s++,t.charCodeAt(c+1)===10)c++;o=c+1}}let a={name:i,buffer:t,position:r,line:s,column:r-o};throw a.snippet=cM(a),new e(n,a)}},ct={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},ke={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},pi={BLOCK:1,FLOW:2},jr={CLIP:1,STRIP:2,KEEP:3};o$=Array(256),a$=Array(256);for(let e=0;e<256;e++)o$[e]=Kx(e)?1:0,a$[e]=Kx(e);yM=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"}),hee=bM+"!,[]";Kd={filename:"",schema:ya,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};f$=Object.prototype.hasOwnProperty,_M=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PM=/[,\[\]{}]/,m$=/^(?:!|!!|![0-9A-Za-z-]+!)$/,Nd=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,h$=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,kM=new RegExp(`^(?:${Nd})*$`),AM=new RegExp(`^(?:${h$})+$`),jM=new RegExp(`^(?:!(?:${Nd})*|${h$}(?:${Nd})*)$`),Gd={filename:"",maxDepth:100};KM={...Gd,...Kd};gee=Symbol("INVALID"),yee=Symbol("visit:break"),bee=Symbol("visit:skip");n$={applyQuoteFlowKeysOption:GM,doubleQuoteForInvisibles:YM,doubleQuoteWhitespaceOnly:XM,applyForceQuotesOption:QM,tryLongOrMultilineAsBlock:ZM,quoteInvalidPlain:eL,fallbackToDoubleQuoted:tL};S$=`(?:(?!(?:${nL}|${iL}))${rL})`,_l=`(?:(?!${Qd})${S$})`,Ld=_l,Dd=`(?:(?!${sL})${_l})`,oL=`(?:(?:(?!${_$})${_l})|[?:-](?=${Ld}))`,aL=`(?:(?:(?!${_$})${_l})|[?:-](?=${Dd}))`,P$=`(?:(?:(?![:#])${Ld})|:(?=${Ld}))#*`,k$=`(?:(?:(?![:#])${Dd})|:(?=${Dd}))#*`,A$=`(?:${Qd}*${P$})*`,j$=`(?:${Qd}*${k$})*`,R$=`${oL}#*${A$}`,O$=`${aL}#*${j$}`,cL=R$,lL=O$,uL=`\\n+${P$}${A$}`,fL=`\\n+${k$}${j$}`,dL=`${R$}(?:${uL})*`,pL=`${O$}(?:${fL})*`,xee=new RegExp(`^(?:${dL})$`,"u"),$ee=new RegExp(`^(?:${pL})$`,"u"),vee=new RegExp(`^(?:${cL})$`,"u"),wee=new RegExp(`^(?:${lL})$`,"u"),See=new RegExp(`^(?:${E$})*$`,"u"),Eee=new RegExp(`^(?:${E$}|\\n)*$`,"u"),_ee=new RegExp(`^(?:${S$}|\\n)*$`,"u"),mL={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(n$).map((e)=>Reflect.get(n$,e)),tagBeforeAnchor:!1},Pee={...mL,schema:oM,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:()=>{}},kee=ct.DOCUMENT,Aee=ct.SEQUENCE,jee=ct.MAPPING,Ree=ct.SCALAR,Oee=ct.ALIAS,Cee=ct.POP,Iee=ke.PLAIN,Tee=ke.SINGLE_QUOTED,Nee=ke.DOUBLE_QUOTED,Mee=ke.LITERAL_BLOCK,Lee=ke.FOLDED_BLOCK,Dee=pi.BLOCK,Jee=pi.FLOW,Fee=jr.CLIP,qee=jr.STRIP,Bee=jr.KEEP});var hL,I$;var T$=L(()=>{Ar();C$();hL=ya.withTags(Bd,Fd,qd,Hd,Ud,Vd),I$={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(e){let t=e.data;if(Buffer.isBuffer(t))t=t.toString();if(typeof t==="string")try{return Xd(t,{schema:ya})}catch{try{return Xd(t,{schema:hL})}catch(r){try{if(v$(t,{schema:ya}).length===0)return}catch{}throw new Gr(r?.message||"Parser Error",e.url)}}else return t}}});var gL,N$;var M$=L(()=>{Ar();gL=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)(?:[?#].*)?$/i,N$={order:300,allowEmpty:!0,encoding:"utf8",canParse(e){return(typeof e.data==="string"||Buffer.isBuffer(e.data))&&gL.test(e.url)},parse(e){if(typeof e.data==="string")return e.data;else if(Buffer.isBuffer(e.data))return e.data.toString(this.encoding);else throw new Gr("data is not text",e.url)}}});var yL,L$;var D$=L(()=>{yL=/\.(jpeg|jpg|gif|png|bmp|ico)(?:[?#].*)?$/i,L$={order:400,allowEmpty:!0,canParse(e){return Buffer.isBuffer(e.data)&&yL.test(e.url)},parse(e){if(Buffer.isBuffer(e.data))return e.data;else return Buffer.from(e.data)}}});var Zd;var ep=L(()=>{Wt();Ar();Zd={order:100,canRead(e){return ul(e.url)},async read(e){let t,r=await import("fs");try{t=Bs(e.url)}catch(n){let i=n;throw i.message=`Malformed URI: ${e.url}: ${i.message}`,new Yr(i,e.url)}if(t.endsWith("/")||t.endsWith("\\"))t=t.slice(0,-1);try{return await r.promises.readFile(t)}catch(n){let i=n;throw i.message=`Error opening file ${t}: ${i.message}`,new Yr(i,t)}}}});async function B$(e,t,r){e=la(e);let n=r||[];n.push(e.href);let i;try{let s;if(t.safeUrlResolver){let a=await Ax(e.href);if(a.unsafe)throw Error(`Unsafe URL blocked by safeUrlResolver: ${e.href}`);s=a.addresses}i=await xL(e,t,s);let o=i.response;if(o.status>=400){let a=Error(`HTTP ERROR ${o.status}`);throw a.status=o.status,a}else if(o.status>=300)if(!Number.isNaN(t.redirects)&&n.length>t.redirects){let a=Error(`Error downloading ${n[0]}.
129
129
  Too many redirects:
130
130
  ${n.join(`
131
- `)}`);throw a.status=o.status,new Yr(a)}else{let a=o.getHeader("location");if(!a){let u=Error(`HTTP ${o.status} redirect with no location header`);throw u.status=o.status,u}let c=Fe(e.href,a),l=la(c).origin===e.origin?t:EL(t);return B$(c,l,n)}else return await o.readBody(t.maxContentLength??q$)}catch(s){let o=s instanceof Error?s:Error(String(s)),a=Error(`Error downloading ${e.href}: ${o.message}`,{cause:o});if("code"in o)a.code=o.code;throw new Yr(a,e.href)}finally{i?.cancelTimeout(),await i?.response.discard()}}async function gL(e,t,r){let n,i;if(t.timeout&&typeof AbortController<"u"){let o=new AbortController;n=o,i=setTimeout(()=>o.abort(),t.timeout)}let s=()=>{if(i!==void 0)clearTimeout(i),i=void 0};try{return{response:r&&r.length>0?await xL(e,t,r,n?.signal):yL(await fetch(e,{method:"GET",headers:t.headers||{},credentials:t.withCredentials?"include":"same-origin",redirect:"manual",signal:n?n.signal:null})),cancelTimeout:s}}catch(o){throw s(),o}}function yL(e){return{status:e.status,getHeader:(t)=>e.headers.get(t),readBody:(t)=>bL(e,t),async discard(){if(e.body&&!e.bodyUsed)await e.body.cancel().catch(()=>{return})}}}async function bL(e,t){if(H$(e.headers.get("content-length"),t),!e.body)return Buffer.alloc(0);let r=e.body.getReader(),n=[],i=0;for(;;){let{done:s,value:o}=await r.read();if(s)return Buffer.concat(n,i);if(i+=o.byteLength,i>t)throw await r.cancel().catch(()=>{return}),tp(t);n.push(o)}}async function xL(e,t,r,n){let i=e.protocol==="https:"?"node:https":"node:http",{request:s}=await import(i),o={method:"GET",headers:$L(t.headers),lookup:SL(e.hostname,r),agent:!1,autoSelectFamily:!0};if(n)o.signal=n;let a=await new Promise((l,u)=>{let d=!1,h=s(e,o,(m)=>{d=!0,l(m)});h.on("error",u),h.on("upgrade",(m,y)=>{y.destroy(),u(Error("Unexpected HTTP protocol upgrade"))}),h.on("close",()=>{if(!d)u(Error("The connection was closed before an HTTP response was received"))}),h.end()});a.on("error",()=>{return});let c=a.statusCode;if(c===void 0||c<200||c>599)throw a.destroy(),Error(`Invalid HTTP status code: ${c}`);return{status:c,getHeader(l){let u=a.headers[l.toLowerCase()];return Array.isArray(u)?u.join(", "):u??null},readBody:(l)=>vL(a,l,n),async discard(){if(!a.destroyed)a.destroy()}}}function $L(e){let t=new Headers({accept:"*/*","accept-encoding":"gzip, deflate, br","user-agent":"node"});new Headers(e??void 0).forEach((n,i)=>t.set(i,n));for(let n of hL)t.delete(n);let r={};return t.forEach((n,i)=>{r[i]=n}),r}async function vL(e,t,r){H$(e.headers["content-length"],t);let n=(e.statusCode===204||e.statusCode===205?"":e.headers["content-encoding"]??"").split(",").map((_)=>_.trim().toLowerCase()).filter((_)=>_&&_!=="identity");if(n.length>J$)throw Error(`Too many content-encodings: maximum allowed is ${J$}`);for(let _ of n)if(!["gzip","x-gzip","deflate","x-deflate","br","zstd"].includes(_))throw Error(`Unsupported content-encoding: ${_}`);let i="node:stream",s="node:stream/promises",o="node:zlib",[{Duplex:a,Transform:c,Writable:l},{pipeline:u},d]=await Promise.all([import(i),import(s),import(o)]),h=Error("The connection was closed before the response body was complete");if(e.destroyed)throw e.errored??h;let m=()=>{let _=0;return new c({transform(k,E,w){_+=k.length,w(_>t?tp(t):null,k)}})},y=[m()];for(let _ of n.reverse()){let k=_==="gzip"||_==="x-gzip"?d.createGunzip():_==="deflate"||_==="x-deflate"?wL(d,a):_==="br"?d.createBrotliDecompress():d.createZstdDecompress();y.push(k,m())}let g=[],b=0,x=new l({write(_,k,E){g.push(_),b+=_.length,E()}});try{await u([e,...y,x],r?{signal:r}:{})}catch(_){if(_ instanceof Error&&"code"in _&&_.code==="ERR_STREAM_PREMATURE_CLOSE")throw h;throw _}return Buffer.concat(g,b)}function wL(e,t){let r;return new t({read(){r?.resume()},write(n,i,s){if(!r){if(n.length===0){s();return}r=(n[0]&15)===8?e.createInflate():e.createInflateRaw(),r.on("data",(o)=>{if(!this.push(o))r?.pause()}),r.on("end",()=>this.push(null)),r.on("error",(o)=>this.destroy(o))}r.write(n,i,s)},final(n){if(r)r.end(n);else this.push(null),n()},destroy(n,i){r?.destroy(),i(n)}})}function H$(e,t){if(e&&Number(e)>t)throw tp(t)}function tp(e){return Error(`Response body exceeds the maxContentLength of ${e} bytes`)}function SL(e,t){let r=F$(e),n=t.map(({address:i,family:s})=>({address:i,family:s}));return(i,s,o)=>{let a=F$(i),c=s.family==="IPv4"?4:s.family==="IPv6"?6:s.family||0,l=n.filter(({family:u})=>c===0||u===c);if(a!==r||l.length===0){let u=Error(`No validated address is available for ${i}`);u.code="ENOTFOUND",o(u,"",0)}else if(s.all)o(null,l);else{let u=l[0];o(null,u.address,u.family)}}}function F$(e){return e.replace(/^\[|\]$/g,"").replace(/\.+$/,"").toLowerCase()}function EL(e){if(!e.headers)return e;let t=new Headers(e.headers);return t.delete("authorization"),t.delete("proxy-authorization"),t.delete("cookie"),{...e,headers:t}}var q$=52428800,J$=5,hL,ep;var rp=L(()=>{Wt();Ar();hL=["connection","content-length","expect","host","keep-alive","proxy-connection","te","trailer","transfer-encoding","upgrade"],ep={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,maxContentLength:q$,canRead(e){return kx(e.url)&&(!this.safeUrlResolver||!ll(e.url))},read(e){let t=la(e.url);if(typeof window<"u"&&!t.protocol)t.protocol=la(location.href).protocol;return B$(t,this)}}});function z$(e,t){if(U$(t)){let r=Object.keys(t).filter((n)=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=t[i],o=e[i];if(U$(s))e[i]=z$(o||{},s);else if(s!==void 0)e[i]=s}}return e}function U$(e){return e&&typeof e==="object"&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)&&!(typeof Headers<"u"&&e instanceof Headers)}var V$=()=>({parse:{json:{...Bx},yaml:{...I$},text:{...N$},binary:{...L$}},resolve:{file:{...Qd},http:{...ep},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}),W$=(e)=>{let t=V$();if(e)z$(t,e);return t};var np=L(()=>{Hx();T$();M$();D$();Zd();rp()});function _L(e,t=!0){let r,n,i,s,o=Array.prototype.slice.call(e);if(typeof o[o.length-1]==="function")s=o.pop();if(typeof o[0]==="string")if(r=o[0],typeof o[2]==="object")n=o[1],i=o[2];else n=void 0,i=o[1];else r="",n=o[0],i=o[1];if(i=W$(i),t&&!i.mutateInputSchema&&typeof n==="object")n=structuredClone(n);return{path:r,schema:n,options:i,callback:s}}var ba;var K$=L(()=>{np();ba=_L});async function sp(e,t,r){let n=e.$refs._root$Ref.path,i=e.$refs._root$Ref.dynamicIdScope?ut(n,e.schema,e.$refs._root$Ref.legacyIdScope):n,s={$refs:e.$refs,options:t,excludedPathMatcher:r,documentLoads:new Map,externalDocuments:new Set,excludedPaths:new Set,excludedAncestorPaths:new Set};await kl({value:e.schema,path:n+"#",originPaths:[n+"#"],scopeBase:i,dynamicIdScope:e.$refs._root$Ref.dynamicIdScope,legacyIdScope:e.$refs._root$Ref.legacyIdScope},"#",void 0,void 0,s),await kL(s)}async function kl(e,t,r,n,i,s=!1){if(!s&&i.excludedPathMatcher(t,e.value)){X$(e,i);return}let o=e.value;if(!o||typeof o!=="object"||ArrayBuffer.isView(o)||r0(r,o))return;io(e);let a={value:o,...r?{parent:r}:{}};if(je.is$Ref(o)&&je.isAllowed$Ref(o,i.options)){if(!await PL(e,t,n,i)&&je.isExtended$Ref(o))await G$(e,t,a,n,i);return}await G$(e,t,a,n,i)}async function G$(e,t,r,n,i){let s=e.value;await Promise.all(Object.keys(s).filter((o)=>o!=="$ref").map(async(o)=>{let a=qe.join(t,o);if(e.children){if(CL(e,o)&&i.excludedPathMatcher(a,void 0)){Pl(e,o,i);return}}else{if(Object.getOwnPropertyDescriptor(s,o)?.get&&i.excludedPathMatcher(a,void 0)){Pl(e,o,i);return}let u=s[o],d=t0(e,o,u);if(i.excludedPathMatcher(a,u)){Pl(e,o,i);return}await kl(d,a,r,n,i,!0);return}let c=is(e,o);if(!c)return;if(i.excludedPathMatcher(a,c.value)){Pl(e,o,i);return}await kl(c,a,r,n,i,!0)}))}async function PL(e,t,r,n){let i=e.value,s=e.referenceLocation||e;io(s);let o=je.isExternal$Ref(i),a=o&&n.options.dereference?.externalReferenceResolution==="root"?_r():s.dynamicIdScope?s.scopeBase:s.path,c=Fe(a,i.$ref);if(n0(r,c))return!1;if(i0(r,s.path,n.options),o&&!await op(i,c,a,s.path,n))return!1;let l={path:c,depth:(r?.depth??0)+1,...r?{parent:r}:{}},u=await Q$(c,t,n,l);if(!u)return!1;let d=Z$(e,u,n.options.dereference?.mergeKeys??!0);return await kl(d,t,void 0,l,n),!0}async function op(e,t,r,n,i){let s=$e(t),o=i.documentLoads.get(s);if(o)return o;let a=i.$refs._get$Ref(s);if(a)return ip(s,i),!zt(a.value);let c=Ks({url:t,baseUrl:r,reference:e.$ref},i.$refs,i.options).then(()=>(ip(s,i),!0)).catch((l)=>{if(!i.options.continueOnError||!zt(l))throw l;if(i.$refs._$refs[s])ip(s,i),l.source=decodeURI($e(n)),l.path=Hs(Pr(n));return!1});return i.documentLoads.set(s,c),c}function ip(e,t){if(t.$refs._$refs[e])t.externalDocuments.add(e)}async function kL(e){let t=$e(e.$refs._root$Ref.path);for(let r of e.externalDocuments){if(r===t)continue;let n=e.$refs._get$Ref(r);if(!n||zt(n.value))continue;let i=n.dynamicIdScope?ut(n.path,n.value,n.legacyIdScope):n.path;await Y$(n.value,n.path+"#",i,n.dynamicIdScope,n.legacyIdScope,void 0,new WeakMap,e)}}async function Y$(e,t,r,n,i,s,o,a){if(a.excludedPaths.has(t)||!e||typeof e!=="object"||ArrayBuffer.isView(e)||r0(s,e))return;let c=a.excludedAncestorPaths.has(t),l=`${i}:${r}`,u=o.get(e);if(!c&&u?.has(l))return;if(!c)if(u)u.add(l);else o.set(e,new Set([l]));let d={value:e,...s?{parent:s}:{}},h=[];if(je.isExternal$Ref(e)){let m=e,y=a.options.dereference?.externalReferenceResolution==="root"?_r():n?r:t,g=Fe(y,m.$ref);h.push(op(m,g,y,t,a))}h.push(...Object.keys(e).map(async(m)=>{let y=qe.join(t,m);if(a.excludedPaths.has(y))return;let g=e[m],b=bt(g,i),x=n&&g&&typeof g==="object"&&!ArrayBuffer.isView(g)?ut(r,g,b):r;await Y$(g,y,x,n,b,d,o,a)})),await Promise.all(h)}function X$(e,t){for(let r of e.originPaths||[e.path]){let n=AL(r);if(t.excludedPaths.has(n))continue;t.excludedPaths.add(n);let s=$e(n)+"#";for(let o of qe.parse(n))t.excludedAncestorPaths.add(s),s=qe.join(s,o)}}function Pl(e,t,r){X$({...e,path:qe.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((n)=>qe.join(n,t))},r)}function AL(e){let t=$e(e),r=Pr(e)||"#";return t+r}async function Q$(e,t,r,n){let i=$e(e),s=r.$refs._get$Ref(i);if(!s||zt(s.value))return;let o={value:s.value,path:s.path+"#",originPaths:[s.sourcePath||s.path+"#"],scopeBase:s.path,dynamicIdScope:s.dynamicIdScope,legacyIdScope:s.legacyIdScope},a=r.$refs._aliases[i]===s;if(o.dynamicIdScope&&!a)o.legacyIdScope=bt(o.value,o.legacyIdScope),o.scopeBase=ut(o.scopeBase,o.value,o.legacyIdScope);let c;try{c=qe.parse(e)}catch{return}for(let l=0;l<c.length;l++){let u=await jL(o,t,r,n);if(!u)return;o=u;let d=c[l],h=is(o,d);if(!h||h.value===void 0||h.value===null&&l===c.length-1){h=void 0;for(let m=c.length-1;m>l;m--){let y=c.slice(l,m+1).join("/"),g=is(o,y);if(g?.value!==void 0){h=g,l=m;break}}if(!h){let m=is(o,d);if(!m||m.value!==null)return;h=m}}o=h,io(o)}return o}async function jL(e,t,r,n){let i=e,s=n;while(je.is$Ref(i.value)&&je.isAllowed$Ref(i.value,r.options)){let o=i.value,a=i.referenceLocation||i;io(a);let c=je.isExternal$Ref(o),l=c&&r.options.dereference?.externalReferenceResolution==="root"?_r():a.dynamicIdScope?a.scopeBase:a.path,u=Fe(l,o.$ref);if(n0(s,u))return je.isExtended$Ref(o)?i:void 0;if(i0(s,a.path,r.options),c&&!await op(o,u,l,a.path,r))return;let d={path:u,depth:(s?.depth??0)+1,...s?{parent:s}:{}},h=await Q$(u,t,r,d);if(!h)return;i=Z$(i,h,r.options.dereference?.mergeKeys??!0),s=d}return i}function Z$(e,t,r){if(!je.isExtended$Ref(e.value)||t.value===null||typeof t.value!=="object")return t;return e0(t,e,r,!0,void 0)}function e0(e,t,r,n,i){let s=e.value,o=t.value,a=RL(i,s,o);if(a)return a;let c=!n&&Array.isArray(e.value)?Array(e.value.length):{},l=new Map,u={value:c,path:e.path,originPaths:OL(e,t),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,children:l,resolveMetadata(){io(e),u.scopeBase=e.scopeBase,u.dynamicIdScope=e.dynamicIdScope,u.legacyIdScope=e.legacyIdScope}},d={target:s,source:o,value:u,...i?{parent:i}:{}},h=new Set(Object.keys(o).filter((g)=>!(n&&g==="$ref"))),m=new Set(Object.keys(s)),y=new Set([...h,...m]);for(let g of y){let b=()=>{let x=h.has(g)?is(t,g):void 0,_;if(x&&(!m.has(g)||!r||x.value===null||typeof x.value!=="object"||Array.isArray(x.value)))_=x;else{let k=is(e,g);_=x&&k.value!==null&&typeof k.value==="object"?e0(k,x,!0,!1,d):x||k}if(l.set(g,_),TL(c,g,_.value),g==="$ref"&&typeof _.value==="string")u.referenceLocation=_.owner||e;return _};l.set(g,{resolve:b,requiresPrecheck:IL(o,s,g,h.has(g),m.has(g),r)}),NL(c,g,()=>is(u,g).value)}return u}function RL(e,t,r){for(let n=e;n;n=n.parent)if(n.target===t&&n.source===r)return n.value;return}function is(e,t){if(e.children){let n=e.children.get(t);if(!n||!("resolve"in n))return n;let i=n.resolve();return e.children.set(t,i),i}let r=e.value;if(r===null||typeof r!=="object"&&typeof r!=="function"||!(t in r))return;return t0(e,t,r[t])}function t0(e,t,r){let n={value:r,path:qe.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((i)=>qe.join(i,t)),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,owner:e,resolveMetadata(){io(e);let i=bt(r,e.legacyIdScope);n.legacyIdScope=i,n.scopeBase=e.dynamicIdScope&&r&&typeof r==="object"&&!ArrayBuffer.isView(r)?ut(e.scopeBase,r,i):e.scopeBase}};return n}function OL(e,t){return[...new Set([...e.originPaths||[e.path],...t.originPaths||[t.path]])]}function io(e){let t=e.resolveMetadata;if(t)delete e.resolveMetadata,t()}function CL(e,t){let r=e.children?.get(t);return Boolean(r&&"resolve"in r&&r.requiresPrecheck)}function IL(e,t,r,n,i,s){let o=n?Object.getOwnPropertyDescriptor(e,r):void 0;if(o?.get)return!0;if(!n)return Boolean(i&&Object.getOwnPropertyDescriptor(t,r)?.get);let a=o?.value;return!(!i||!s||a===null||typeof a!=="object"||Array.isArray(a))&&Boolean(Object.getOwnPropertyDescriptor(t,r)?.get)}function r0(e,t){for(let r=e;r;r=r.parent)if(r.value===t)return!0;return!1}function n0(e,t){for(let r=e;r;r=r.parent)if(r.path===t)return!0;return!1}function i0(e,t,r){let n=r.dereference?.maxDepth??500;if((e?.depth??0)>=n)throw RangeError(`Maximum dereference depth (${n}) exceeded at ${t}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`)}function TL(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function NL(e,t,r){Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0})}var s0=L(()=>{ts();zs();yl();Wt();Ar();Jn()});function ML(e,t){if(typeof t.resolve?.excludedPathMatcher==="function")return Promise.reject(TypeError("Use the top-level resolveExcludedPathMatcher option; resolve keys are resolver plugins."));if(!t.resolve?.external)return Promise.resolve();if(t.resolveExcludedPathMatcher)return sp(e,t,t.resolveExcludedPathMatcher);try{let n=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=ap(e.schema,e.$refs._root$Ref.path+"#",n,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,e.$refs,t);return Promise.all(i)}catch(n){return Promise.reject(n)}}function ap(e,t,r,n,i,s,o,a,c,l=new Set){a||=new Map;let u=[];if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!l.has(e)){let d=`${i}:${r}`,h=a.get(e);if(h?.has(d))return u;if(h)h.add(d);else a.set(e,new Set([d]));l.add(e);let m=r;if(je.isExternal$Ref(e))u.push(LL(e,t,m,n,s,o));let y=Object.keys(e);for(let g of y){let b=qe.join(t,g),x=e[g],_=bt(x,i),k=n&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?ut(m,x,_):m;u=u.concat(ap(x,b,k,n,_,s,o,a,c,l))}l.delete(e)}return u}async function LL(e,t,r,n,i,s){let a=s.dereference?.externalReferenceResolution==="root"?_r():n?r:t,c=Fe(a,e.$ref),l=$e(c),u=i._get$Ref(l);if(u)return Promise.resolve(u.value);try{let d=e.$ref,h={url:c,baseUrl:a};if(typeof d==="string")h.reference=d;let m=await Ks(h,i,s),y=i._get$Ref(l),g=y?.dynamicIdScope??!1,b=y?.legacyIdScope??!1,x=g?ut(l,m,b):l,_=ap(m,l+"#",x,g,b,i,s,new Map,!0);return Promise.all(_)}catch(d){if(!s?.continueOnError||!zt(d))throw d;if(i._$refs[l])d.source=decodeURI($e(t)),d.path=Hs(Pr(t));return[]}}var o0;var a0=L(()=>{ts();zs();yl();s0();Wt();Ar();Jn();o0=ML});function DL(e,t){let r=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,n=[],i=new Set([$e(e.$refs._root$Ref.path),$e(r)]);lp(e,"schema",e.$refs._root$Ref.path+"#",r,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,!1,"#",0,n,e.$refs,t,i,new Set);let s=Ws(e.schema,e.$refs._root$Ref.legacyIdScope);if(JL(n,t,s,r),(t.bundle||{}).optimizeInternalRefs!==!1)BL(n,e.schema)}function lp(e,t,r,n,i,s,o,a,c,l,u,d,h,m,y=!1){let g=t===null?e:e[t],b=d.bundle||{},x=b.excludedPathMatcher||(()=>!1);if(g&&typeof g==="object"&&!ArrayBuffer.isView(g)&&(y||!x(a,g))&&!m.has(g)){m.add(g);let _=n;if(je.isAllowed$Ref(g,d))c0(e,t,r,_,i,o,a,c,l,u,d,h,m);else{let k=Object.keys(g).sort((E,w)=>{if(E==="definitions"||E==="$defs")return-1;else if(w==="definitions"||w==="$defs")return 1;else return E.length-w.length});for(let E of k){let w=qe.join(r,E),P=qe.join(a,E);if(Object.getOwnPropertyDescriptor(g,E)?.get&&x(P,void 0))continue;let j=g[E];if(x(P,j))continue;let D=bt(j,s),F=i&&j&&typeof j==="object"&&!ArrayBuffer.isView(j)?ut(_,j,D):_,N=i&&cp(j,D),q=o||N,U=h;if(N)U=new Set(h),U.add($e(F));if(je.isAllowed$Ref(j,d))c0(g,E,w,F,i,q,P,c,l,u,d,U,m);else lp(g,E,w,F,i,D,q,P,c,l,u,d,U,m,!0);if(j&&typeof j==="object"&&!Array.isArray(j)){if("$ref"in j)b?.onBundle?.(j.$ref,g[E],g,E)}}}}}function c0(e,t,r,n,i,s,o,a,c,l,u,d,h){let m=t===null?e:e[t],g=je.isExternal$Ref(m)&&u.dereference?.externalReferenceResolution==="root"?_r():i?n:r,b=Fe(g,m.$ref),x=l._resolve(b,o,u);if(x===null)return;let k=qe.parse(o).length,E=$e(x.path),w=Pr(x.path),P=l._aliases[E],R=Boolean(P&&WL(l._root$Ref.value,x.$ref.value)),j=E!==l._root$Ref.path&&!d.has(E)&&!R,D=Boolean(P)&&x.$ref.value!==l._root$Ref.value,F=Ws(x.$ref.value,x.$ref.legacyIdScope),N=P?x.$ref.path:x.$ref.dynamicIdScope?ut(x.$ref.path,x.$ref.value,x.$ref.legacyIdScope):x.$ref.path,q=je.isExtended$Ref(m);a+=x.indirections;let U=FL(c,e,t);if(U)if(k<U.depth||a<U.indirections)qL(c,U);else return;if(c.push({$ref:m,parent:e,key:t,pathFromRoot:o,depth:k,file:E,hash:w,value:x.value,circular:x.circular,extended:q,external:j,nestedResource:D,indirections:a,scopeBase:n,dynamicIdScope:i,nestedIdScope:s,targetResourceBase:N,...F===void 0?{}:{targetResourceId:F}}),!U||j){let ne=x.$ref.dynamicIdScope?x.scopeBase:x.$ref.path,ue=s||x.$ref.dynamicIdScope&&cp(x.value,x.legacyIdScope),ie=new Set(d);if(x.value===x.$ref.value&&cp(x.$ref.value,x.$ref.legacyIdScope))ie.add($e(x.$ref.path)),ie.add($e(ne));lp(x.value,null,x.path,ne,x.$ref.dynamicIdScope,x.legacyIdScope,ue,o,a+1,c,l,u,ie,h)}}function JL(e,t,r,n){e.sort((a,c)=>{if(a.file!==c.file)return a.file<c.file?-1:1;else if(a.hash!==c.hash)return a.hash<c.hash?-1:1;else if(a.circular!==c.circular)return a.circular?-1:1;else if(a.extended!==c.extended)return a.extended?1:-1;else if(a.indirections!==c.indirections)return a.indirections-c.indirections;else if(a.depth!==c.depth)return a.depth-c.depth;else{let l=Math.max(a.pathFromRoot.lastIndexOf("/definitions"),a.pathFromRoot.lastIndexOf("/$defs")),u=Math.max(c.pathFromRoot.lastIndexOf("/definitions"),c.pathFromRoot.lastIndexOf("/$defs"));if(l!==u)return u-l;else return a.pathFromRoot.length-c.pathFromRoot.length}});let i,s,o;for(let a of e){let c=t.bundle||{};if(!a.external){if(c.optimizeInternalRefs!==!1){let l=$e(a.targetResourceBase),u=$e(a.scopeBase);if(l!==u)a.$ref.$ref=VL(a);else if(!a.nestedResource)a.$ref.$ref=a.hash}}else if(a.file===i&&a.hash===s)a.$ref.$ref=l0(a,o,r,n);else if(a.file===i&&a.hash.indexOf(s+"/")===0){let l=qe.join(o,qe.parse(a.hash.replace(s,"#")));a.$ref.$ref=l0(a,l,r,n)}else if(i=a.file,s=a.hash,o=a.pathFromRoot,a.$ref=a.parent[a.key]=je.dereference(a.$ref,a.value,t),a.circular)a.$ref.$ref=a.pathFromRoot}}function FL(e,t,r){for(let n of e)if(n&&n.parent===t&&n.key===r)return n;return}function qL(e,t){let r=e.indexOf(t);e.splice(r,1)}function BL(e,t){for(let r of e){if(!r.$ref||typeof r.$ref!=="object"||!("$ref"in r.$ref))continue;let n=r.$ref.$ref;if(typeof n!=="string"||!Al(n))continue;let i=HL(t,n);if(i!==n)r.$ref.$ref=i}}function HL(e,t){if(!Al(t))return t;let r=qe.parse(t),n=e,i=[];for(let s of r){if(n===null||n===void 0||typeof n!=="object")return t;if(!Object.prototype.hasOwnProperty.call(n,s)&&"$ref"in n&&typeof n.$ref==="string"&&Al(n.$ref)){let o=qe.parse(n.$ref);if(i.length=0,i.push(...o),n=UL(e,n.$ref),n===null||n===void 0||typeof n!=="object")return t}n=n[s],i.push(s)}return qe.join("#",i)}function UL(e,t){if(!Al(t))return;let r=qe.parse(t),n=e;for(let i of r){if(n===null||n===void 0||typeof n!=="object")return;n=n[i]}return n}function Al(e){return e[0]==="#"&&ua(e.substring(1)).startsWith("/")}function l0(e,t,r,n){if(!e.dynamicIdScope||!e.nestedIdScope||!n)return t;let i=n;if(r&&$e(Fe(e.scopeBase,r))===$e(n))i=r;return $e(i)+t}function VL(e){let t=$e(e.targetResourceBase);if(typeof e.$ref.$ref==="string"&&$e(Fe(e.scopeBase,e.$ref.$ref))===t)return e.$ref.$ref;if(e.targetResourceId&&$e(Fe(e.scopeBase,e.targetResourceId))===t)t=e.targetResourceId;return e.hash==="#"?t:t+e.hash}function cp(e,t=!1){return Ws(e,t)!==void 0}function WL(e,t){if(!t||typeof t!=="object")return!1;let r=new Set,n=(i)=>{if(i===t)return!0;if(!i||typeof i!=="object"||ArrayBuffer.isView(i)||r.has(i))return!1;return r.add(i),Object.keys(i).some((s)=>n(i[s]))};return n(e)}var u0;var f0=L(()=>{ts();zs();Wt();Jn();u0=DL});function zL(e,t){let r=Date.now(),n=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=up(e.schema,e.$refs._root$Ref.path,n,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,"#",new Set,new Map,new Map,e.$refs,t,r,0);e.$refs.circular=i.circular,e.schema=i.value}function up(e,t,r,n,i,s,o,a,c,l,u,d,h,m){let y,g={value:e,circular:!1};p0(d,u);let b=u.dereference||{},x=b.maxDepth??500;if(h>x)throw RangeError(`Maximum dereference depth (${x}) exceeded at ${s}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let _=b.excludedPathMatcher||(()=>!1);if(b?.circular==="ignore"||!a.has(e)){if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!_(s,e)){o.add(e),a.set(e,!1);let k=m||es(l,e)||{value:e,path:t,scopeBase:r,dynamicIdScope:n,legacyIdScope:i};if(je.isAllowed$Ref(e,u))y=d0(e,k.path,k.scopeBase,k.dynamicIdScope,s,o,a,c,l,u,d,h,k),g.circular=y.circular,g.value=y.value;else for(let E of Object.keys(e)){p0(d,u);let w=qe.join(t,E),P=qe.join(s,E);if(Object.getOwnPropertyDescriptor(e,E)?.get&&_(P,void 0))continue;let j=e[E];if(_(P,j))continue;let D=Xr(l,k,E,j),F;if(je.isAllowed$Ref(j,u)){if(y=d0(j,D.path,D.scopeBase,D.dynamicIdScope,P,o,a,c,l,u,d,h,D),F=y.circular,e[E]!==y.value){let N=new Map;if(b?.preservedProperties){if(typeof e[E]==="object"&&!Array.isArray(e[E]))b?.preservedProperties.forEach((U)=>{if(U in e[E])N.set(U,e[E][U])})}let q=y.value;if(b?.cloneReferences&&!F&&q&&typeof q==="object")q=structuredClone(q);if(e[E]=q,b?.preservedProperties){if(N.size&&e[E]!==null&&typeof e[E]==="object"&&!Array.isArray(e[E]))N.forEach((U,ne)=>{e[E][ne]=U})}b?.onDereference?.(j.$ref,e[E],e,E)}}else if(!o.has(j)){if(y=up(j,D.path,D.scopeBase,D.dynamicIdScope,D.legacyIdScope,P,o,a,c,l,u,d,h+1,D),F=y.circular,e[E]!==y.value)e[E]=y.value}else F=xa(w,l,u);g.circular=g.circular||F}o.delete(e),a.set(e,g.circular)}}else g.circular=a.get(e)||!1;return g}function d0(e,t,r,n,i,s,o,a,c,l,u,d,h){let g=je.isExternal$Ref(e)&&l?.dereference?.externalReferenceResolution==="root"?_r():n?r:t,b=Fe(g,e.$ref),x=a.get(b);if(x&&!je.isExtended$Ref(e))if(!x.circular)return x;else if(typeof x.value==="object"&&"$ref"in x.value&&"$ref"in e){if(x.value.$ref===e.$ref)return xa(t,c,l),x}else return xa(t,c,l),x;let _=c._resolve(b,t,l);if(_===null)return{circular:!1,value:null};let k=_.circular,E=k||_.chainCircular||s.has(_.value);if(E)xa(t,c,l);let w=je.dereference(e,_.value,l),P=_.location,R=je.isExtended$Ref(e)?da(c,w,P,h,l.dereference?.mergeKeys??!0):P;if(!E){let D=up(w,R.path,R.scopeBase,R.dynamicIdScope,R.legacyIdScope,i,s,o,a,c,l,u,d+1,R);if(E=D.circular,w=D.value,E&&x?.circular)xa(t,c,l)}if(E&&!k&&l.dereference?.circular==="ignore")w=e;if(k&&w!==e)w.$ref=i;let j={circular:E,value:w};if(Object.keys(e).length===1)a.set(b,j);return j}function p0(e,t){if(t&&t.timeoutMs){if(Date.now()-e>t.timeoutMs)throw new yd(t.timeoutMs)}}function xa(e,t,r){if(t.circular=!0,r?.dereference?.onCircular?.(e),!r.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${e}`);return!0}var m0;var h0=L(()=>{ts();zs();Wt();Jn();Ar();$d();m0=zL});function KL(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(t){setTimeout(t,0)}}var fp;var g0=L(()=>{fp=KL()});function lr(e,t){if(e){t.then(function(r){fp(function(){e(null,r)})},function(r){fp(function(){e(r)})});return}else return t}var y0=L(()=>{g0()});class qn{schema=null;$refs=new ha;async parse(){let e;try{e=ba(arguments)}catch(n){return jl(arguments,n)}let t,r=e.schema!==void 0&&e.schema!==null;if(!e.path&&!r){let n=Error(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return lr(e.callback,Promise.reject(n))}this.schema=null,this.$refs=new ha;try{let n="http";if(ul(e.path))e.path=Cx(e.path),n="file";if(e.path=Fe(_r(),e.path),r&&(typeof e.schema==="object"||typeof e.schema==="boolean")){let s=this.$refs._add(e.path);s.value=e.schema,s.pathType=n,s.dynamicIdScope=pl(s.value),s.legacyIdScope=bt(s.value),ml(this.$refs,s.path,s.value,s.pathType,s.dynamicIdScope),t=Promise.resolve(e.schema)}else t=Ks(e.path,this.$refs,e.options);let i=await t;if(typeof i==="boolean"||i!==null&&typeof i==="object"&&!Buffer.isBuffer(i))return this.schema=i,lr(e.callback,Promise.resolve(this.schema));else if(e.options.continueOnError)return this.schema=null,lr(e.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(n){if(!e.options.continueOnError||!zt(n))return lr(e.callback,Promise.reject(n));if(this.$refs._$refs[$e(e.path)])this.$refs._$refs[$e(e.path)].addError(n);return lr(e.callback,Promise.resolve(null))}}static parse(){let e=new qn;return e.parse.apply(e,arguments)}async resolve(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.parse(e.path,e.schema,e.options),await o0(this,e.options),dp(this),lr(e.callback,Promise.resolve(this.$refs))}catch(t){return lr(e.callback,Promise.reject(t))}}static resolve(){let e=new qn;return e.resolve.apply(e,arguments)}static bundle(){let e=new qn;return e.bundle.apply(e,arguments)}async bundle(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),u0(this,e.options),dp(this),lr(e.callback,Promise.resolve(this.schema))}catch(t){return lr(e.callback,Promise.reject(t))}}static dereference(){let e=new qn;return e.dereference.apply(e,arguments)}async dereference(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),m0(this,e.options),dp(this),lr(e.callback,Promise.resolve(this.schema))}catch(t){return lr(e.callback,Promise.reject(t))}}}function jl(e,t){let r=e[e.length-1];return lr(typeof r==="function"?r:void 0,Promise.reject(t))}function dp(e){if(Us.getParserErrors(e).length>0)throw new Us(e)}var Hte,Ute,Vte,b0;var x0=L(()=>{Fx();yl();K$();a0();f0();h0();Wt();Zd();rp();Ar();y0();Jn();np();Wt();Hte=qn.parse,Ute=qn.resolve,Vte=qn.bundle,b0=qn.dereference});function GL(e,t){if(t.routing==="prefix-except-default"&&e===t.defaultLocale)return"/";return`/${e.toLowerCase()}/`}function $0(e){if(e===null||e.locales.length<2)return"";let t=JSON.stringify(e.locales),r=JSON.stringify(e.defaultLocale),n=JSON.stringify(Object.fromEntries(e.locales.map((i)=>[i,GL(i,e)])));return`
131
+ `)}`);throw a.status=o.status,new Yr(a)}else{let a=o.getHeader("location");if(!a){let u=Error(`HTTP ${o.status} redirect with no location header`);throw u.status=o.status,u}let c=Fe(e.href,a),l=la(c).origin===e.origin?t:kL(t);return B$(c,l,n)}else return await o.readBody(t.maxContentLength??q$)}catch(s){let o=s instanceof Error?s:Error(String(s)),a=Error(`Error downloading ${e.href}: ${o.message}`,{cause:o});if("code"in o)a.code=o.code;throw new Yr(a,e.href)}finally{i?.cancelTimeout(),await i?.response.discard()}}async function xL(e,t,r){let n,i;if(t.timeout&&typeof AbortController<"u"){let o=new AbortController;n=o,i=setTimeout(()=>o.abort(),t.timeout)}let s=()=>{if(i!==void 0)clearTimeout(i),i=void 0};try{return{response:r&&r.length>0?await wL(e,t,r,n?.signal):$L(await fetch(e,{method:"GET",headers:t.headers||{},credentials:t.withCredentials?"include":"same-origin",redirect:"manual",signal:n?n.signal:null})),cancelTimeout:s}}catch(o){throw s(),o}}function $L(e){return{status:e.status,getHeader:(t)=>e.headers.get(t),readBody:(t)=>vL(e,t),async discard(){if(e.body&&!e.bodyUsed)await e.body.cancel().catch(()=>{return})}}}async function vL(e,t){if(H$(e.headers.get("content-length"),t),!e.body)return Buffer.alloc(0);let r=e.body.getReader(),n=[],i=0;for(;;){let{done:s,value:o}=await r.read();if(s)return Buffer.concat(n,i);if(i+=o.byteLength,i>t)throw await r.cancel().catch(()=>{return}),rp(t);n.push(o)}}async function wL(e,t,r,n){let i=e.protocol==="https:"?"node:https":"node:http",{request:s}=await import(i),o={method:"GET",headers:SL(t.headers),lookup:PL(e.hostname,r),agent:!1,autoSelectFamily:!0};if(n)o.signal=n;let a=await new Promise((l,u)=>{let d=!1,h=s(e,o,(m)=>{d=!0,l(m)});h.on("error",u),h.on("upgrade",(m,y)=>{y.destroy(),u(Error("Unexpected HTTP protocol upgrade"))}),h.on("close",()=>{if(!d)u(Error("The connection was closed before an HTTP response was received"))}),h.end()});a.on("error",()=>{return});let c=a.statusCode;if(c===void 0||c<200||c>599)throw a.destroy(),Error(`Invalid HTTP status code: ${c}`);return{status:c,getHeader(l){let u=a.headers[l.toLowerCase()];return Array.isArray(u)?u.join(", "):u??null},readBody:(l)=>EL(a,l,n),async discard(){if(!a.destroyed)a.destroy()}}}function SL(e){let t=new Headers({accept:"*/*","accept-encoding":"gzip, deflate, br","user-agent":"node"});new Headers(e??void 0).forEach((n,i)=>t.set(i,n));for(let n of bL)t.delete(n);let r={};return t.forEach((n,i)=>{r[i]=n}),r}async function EL(e,t,r){H$(e.headers["content-length"],t);let n=(e.statusCode===204||e.statusCode===205?"":e.headers["content-encoding"]??"").split(",").map((_)=>_.trim().toLowerCase()).filter((_)=>_&&_!=="identity");if(n.length>J$)throw Error(`Too many content-encodings: maximum allowed is ${J$}`);for(let _ of n)if(!["gzip","x-gzip","deflate","x-deflate","br","zstd"].includes(_))throw Error(`Unsupported content-encoding: ${_}`);let i="node:stream",s="node:stream/promises",o="node:zlib",[{Duplex:a,Transform:c,Writable:l},{pipeline:u},d]=await Promise.all([import(i),import(s),import(o)]),h=Error("The connection was closed before the response body was complete");if(e.destroyed)throw e.errored??h;let m=()=>{let _=0;return new c({transform(P,E,w){_+=P.length,w(_>t?rp(t):null,P)}})},y=[m()];for(let _ of n.reverse()){let P=_==="gzip"||_==="x-gzip"?d.createGunzip():_==="deflate"||_==="x-deflate"?_L(d,a):_==="br"?d.createBrotliDecompress():d.createZstdDecompress();y.push(P,m())}let g=[],b=0,x=new l({write(_,P,E){g.push(_),b+=_.length,E()}});try{await u([e,...y,x],r?{signal:r}:{})}catch(_){if(_ instanceof Error&&"code"in _&&_.code==="ERR_STREAM_PREMATURE_CLOSE")throw h;throw _}return Buffer.concat(g,b)}function _L(e,t){let r;return new t({read(){r?.resume()},write(n,i,s){if(!r){if(n.length===0){s();return}r=(n[0]&15)===8?e.createInflate():e.createInflateRaw(),r.on("data",(o)=>{if(!this.push(o))r?.pause()}),r.on("end",()=>this.push(null)),r.on("error",(o)=>this.destroy(o))}r.write(n,i,s)},final(n){if(r)r.end(n);else this.push(null),n()},destroy(n,i){r?.destroy(),i(n)}})}function H$(e,t){if(e&&Number(e)>t)throw rp(t)}function rp(e){return Error(`Response body exceeds the maxContentLength of ${e} bytes`)}function PL(e,t){let r=F$(e),n=t.map(({address:i,family:s})=>({address:i,family:s}));return(i,s,o)=>{let a=F$(i),c=s.family==="IPv4"?4:s.family==="IPv6"?6:s.family||0,l=n.filter(({family:u})=>c===0||u===c);if(a!==r||l.length===0){let u=Error(`No validated address is available for ${i}`);u.code="ENOTFOUND",o(u,"",0)}else if(s.all)o(null,l);else{let u=l[0];o(null,u.address,u.family)}}}function F$(e){return e.replace(/^\[|\]$/g,"").replace(/\.+$/,"").toLowerCase()}function kL(e){if(!e.headers)return e;let t=new Headers(e.headers);return t.delete("authorization"),t.delete("proxy-authorization"),t.delete("cookie"),{...e,headers:t}}var q$=52428800,J$=5,bL,tp;var np=L(()=>{Wt();Ar();bL=["connection","content-length","expect","host","keep-alive","proxy-connection","te","trailer","transfer-encoding","upgrade"],tp={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,maxContentLength:q$,canRead(e){return kx(e.url)&&(!this.safeUrlResolver||!ll(e.url))},read(e){let t=la(e.url);if(typeof window<"u"&&!t.protocol)t.protocol=la(location.href).protocol;return B$(t,this)}}});function z$(e,t){if(U$(t)){let r=Object.keys(t).filter((n)=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=t[i],o=e[i];if(U$(s))e[i]=z$(o||{},s);else if(s!==void 0)e[i]=s}}return e}function U$(e){return e&&typeof e==="object"&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)&&!(typeof Headers<"u"&&e instanceof Headers)}var V$=()=>({parse:{json:{...Bx},yaml:{...I$},text:{...N$},binary:{...L$}},resolve:{file:{...Zd},http:{...tp},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}),W$=(e)=>{let t=V$();if(e)z$(t,e);return t};var ip=L(()=>{Hx();T$();M$();D$();ep();np()});function AL(e,t=!0){let r,n,i,s,o=Array.prototype.slice.call(e);if(typeof o[o.length-1]==="function")s=o.pop();if(typeof o[0]==="string")if(r=o[0],typeof o[2]==="object")n=o[1],i=o[2];else n=void 0,i=o[1];else r="",n=o[0],i=o[1];if(i=W$(i),t&&!i.mutateInputSchema&&typeof n==="object")n=structuredClone(n);return{path:r,schema:n,options:i,callback:s}}var ba;var K$=L(()=>{ip();ba=AL});async function op(e,t,r){let n=e.$refs._root$Ref.path,i=e.$refs._root$Ref.dynamicIdScope?ut(n,e.schema,e.$refs._root$Ref.legacyIdScope):n,s={$refs:e.$refs,options:t,excludedPathMatcher:r,documentLoads:new Map,externalDocuments:new Set,excludedPaths:new Set,excludedAncestorPaths:new Set};await kl({value:e.schema,path:n+"#",originPaths:[n+"#"],scopeBase:i,dynamicIdScope:e.$refs._root$Ref.dynamicIdScope,legacyIdScope:e.$refs._root$Ref.legacyIdScope},"#",void 0,void 0,s),await RL(s)}async function kl(e,t,r,n,i,s=!1){if(!s&&i.excludedPathMatcher(t,e.value)){X$(e,i);return}let o=e.value;if(!o||typeof o!=="object"||ArrayBuffer.isView(o)||r0(r,o))return;io(e);let a={value:o,...r?{parent:r}:{}};if(je.is$Ref(o)&&je.isAllowed$Ref(o,i.options)){if(!await jL(e,t,n,i)&&je.isExtended$Ref(o))await G$(e,t,a,n,i);return}await G$(e,t,a,n,i)}async function G$(e,t,r,n,i){let s=e.value;await Promise.all(Object.keys(s).filter((o)=>o!=="$ref").map(async(o)=>{let a=qe.join(t,o);if(e.children){if(NL(e,o)&&i.excludedPathMatcher(a,void 0)){Pl(e,o,i);return}}else{if(Object.getOwnPropertyDescriptor(s,o)?.get&&i.excludedPathMatcher(a,void 0)){Pl(e,o,i);return}let u=s[o],d=t0(e,o,u);if(i.excludedPathMatcher(a,u)){Pl(e,o,i);return}await kl(d,a,r,n,i,!0);return}let c=is(e,o);if(!c)return;if(i.excludedPathMatcher(a,c.value)){Pl(e,o,i);return}await kl(c,a,r,n,i,!0)}))}async function jL(e,t,r,n){let i=e.value,s=e.referenceLocation||e;io(s);let o=je.isExternal$Ref(i),a=o&&n.options.dereference?.externalReferenceResolution==="root"?_r():s.dynamicIdScope?s.scopeBase:s.path,c=Fe(a,i.$ref);if(n0(r,c))return!1;if(i0(r,s.path,n.options),o&&!await ap(i,c,a,s.path,n))return!1;let l={path:c,depth:(r?.depth??0)+1,...r?{parent:r}:{}},u=await Q$(c,t,n,l);if(!u)return!1;let d=Z$(e,u,n.options.dereference?.mergeKeys??!0);return await kl(d,t,void 0,l,n),!0}async function ap(e,t,r,n,i){let s=$e(t),o=i.documentLoads.get(s);if(o)return o;let a=i.$refs._get$Ref(s);if(a)return sp(s,i),!zt(a.value);let c=Ks({url:t,baseUrl:r,reference:e.$ref},i.$refs,i.options).then(()=>(sp(s,i),!0)).catch((l)=>{if(!i.options.continueOnError||!zt(l))throw l;if(i.$refs._$refs[s])sp(s,i),l.source=decodeURI($e(n)),l.path=Hs(Pr(n));return!1});return i.documentLoads.set(s,c),c}function sp(e,t){if(t.$refs._$refs[e])t.externalDocuments.add(e)}async function RL(e){let t=$e(e.$refs._root$Ref.path);for(let r of e.externalDocuments){if(r===t)continue;let n=e.$refs._get$Ref(r);if(!n||zt(n.value))continue;let i=n.dynamicIdScope?ut(n.path,n.value,n.legacyIdScope):n.path;await Y$(n.value,n.path+"#",i,n.dynamicIdScope,n.legacyIdScope,void 0,new WeakMap,e)}}async function Y$(e,t,r,n,i,s,o,a){if(a.excludedPaths.has(t)||!e||typeof e!=="object"||ArrayBuffer.isView(e)||r0(s,e))return;let c=a.excludedAncestorPaths.has(t),l=`${i}:${r}`,u=o.get(e);if(!c&&u?.has(l))return;if(!c)if(u)u.add(l);else o.set(e,new Set([l]));let d={value:e,...s?{parent:s}:{}},h=[];if(je.isExternal$Ref(e)){let m=e,y=a.options.dereference?.externalReferenceResolution==="root"?_r():n?r:t,g=Fe(y,m.$ref);h.push(ap(m,g,y,t,a))}h.push(...Object.keys(e).map(async(m)=>{let y=qe.join(t,m);if(a.excludedPaths.has(y))return;let g=e[m],b=bt(g,i),x=n&&g&&typeof g==="object"&&!ArrayBuffer.isView(g)?ut(r,g,b):r;await Y$(g,y,x,n,b,d,o,a)})),await Promise.all(h)}function X$(e,t){for(let r of e.originPaths||[e.path]){let n=OL(r);if(t.excludedPaths.has(n))continue;t.excludedPaths.add(n);let s=$e(n)+"#";for(let o of qe.parse(n))t.excludedAncestorPaths.add(s),s=qe.join(s,o)}}function Pl(e,t,r){X$({...e,path:qe.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((n)=>qe.join(n,t))},r)}function OL(e){let t=$e(e),r=Pr(e)||"#";return t+r}async function Q$(e,t,r,n){let i=$e(e),s=r.$refs._get$Ref(i);if(!s||zt(s.value))return;let o={value:s.value,path:s.path+"#",originPaths:[s.sourcePath||s.path+"#"],scopeBase:s.path,dynamicIdScope:s.dynamicIdScope,legacyIdScope:s.legacyIdScope},a=r.$refs._aliases[i]===s;if(o.dynamicIdScope&&!a)o.legacyIdScope=bt(o.value,o.legacyIdScope),o.scopeBase=ut(o.scopeBase,o.value,o.legacyIdScope);let c;try{c=qe.parse(e)}catch{return}for(let l=0;l<c.length;l++){let u=await CL(o,t,r,n);if(!u)return;o=u;let d=c[l],h=is(o,d);if(!h||h.value===void 0||h.value===null&&l===c.length-1){h=void 0;for(let m=c.length-1;m>l;m--){let y=c.slice(l,m+1).join("/"),g=is(o,y);if(g?.value!==void 0){h=g,l=m;break}}if(!h){let m=is(o,d);if(!m||m.value!==null)return;h=m}}o=h,io(o)}return o}async function CL(e,t,r,n){let i=e,s=n;while(je.is$Ref(i.value)&&je.isAllowed$Ref(i.value,r.options)){let o=i.value,a=i.referenceLocation||i;io(a);let c=je.isExternal$Ref(o),l=c&&r.options.dereference?.externalReferenceResolution==="root"?_r():a.dynamicIdScope?a.scopeBase:a.path,u=Fe(l,o.$ref);if(n0(s,u))return je.isExtended$Ref(o)?i:void 0;if(i0(s,a.path,r.options),c&&!await ap(o,u,l,a.path,r))return;let d={path:u,depth:(s?.depth??0)+1,...s?{parent:s}:{}},h=await Q$(u,t,r,d);if(!h)return;i=Z$(i,h,r.options.dereference?.mergeKeys??!0),s=d}return i}function Z$(e,t,r){if(!je.isExtended$Ref(e.value)||t.value===null||typeof t.value!=="object")return t;return e0(t,e,r,!0,void 0)}function e0(e,t,r,n,i){let s=e.value,o=t.value,a=IL(i,s,o);if(a)return a;let c=!n&&Array.isArray(e.value)?Array(e.value.length):{},l=new Map,u={value:c,path:e.path,originPaths:TL(e,t),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,children:l,resolveMetadata(){io(e),u.scopeBase=e.scopeBase,u.dynamicIdScope=e.dynamicIdScope,u.legacyIdScope=e.legacyIdScope}},d={target:s,source:o,value:u,...i?{parent:i}:{}},h=new Set(Object.keys(o).filter((g)=>!(n&&g==="$ref"))),m=new Set(Object.keys(s)),y=new Set([...h,...m]);for(let g of y){let b=()=>{let x=h.has(g)?is(t,g):void 0,_;if(x&&(!m.has(g)||!r||x.value===null||typeof x.value!=="object"||Array.isArray(x.value)))_=x;else{let P=is(e,g);_=x&&P.value!==null&&typeof P.value==="object"?e0(P,x,!0,!1,d):x||P}if(l.set(g,_),LL(c,g,_.value),g==="$ref"&&typeof _.value==="string")u.referenceLocation=_.owner||e;return _};l.set(g,{resolve:b,requiresPrecheck:ML(o,s,g,h.has(g),m.has(g),r)}),DL(c,g,()=>is(u,g).value)}return u}function IL(e,t,r){for(let n=e;n;n=n.parent)if(n.target===t&&n.source===r)return n.value;return}function is(e,t){if(e.children){let n=e.children.get(t);if(!n||!("resolve"in n))return n;let i=n.resolve();return e.children.set(t,i),i}let r=e.value;if(r===null||typeof r!=="object"&&typeof r!=="function"||!(t in r))return;return t0(e,t,r[t])}function t0(e,t,r){let n={value:r,path:qe.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((i)=>qe.join(i,t)),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,owner:e,resolveMetadata(){io(e);let i=bt(r,e.legacyIdScope);n.legacyIdScope=i,n.scopeBase=e.dynamicIdScope&&r&&typeof r==="object"&&!ArrayBuffer.isView(r)?ut(e.scopeBase,r,i):e.scopeBase}};return n}function TL(e,t){return[...new Set([...e.originPaths||[e.path],...t.originPaths||[t.path]])]}function io(e){let t=e.resolveMetadata;if(t)delete e.resolveMetadata,t()}function NL(e,t){let r=e.children?.get(t);return Boolean(r&&"resolve"in r&&r.requiresPrecheck)}function ML(e,t,r,n,i,s){let o=n?Object.getOwnPropertyDescriptor(e,r):void 0;if(o?.get)return!0;if(!n)return Boolean(i&&Object.getOwnPropertyDescriptor(t,r)?.get);let a=o?.value;return!(!i||!s||a===null||typeof a!=="object"||Array.isArray(a))&&Boolean(Object.getOwnPropertyDescriptor(t,r)?.get)}function r0(e,t){for(let r=e;r;r=r.parent)if(r.value===t)return!0;return!1}function n0(e,t){for(let r=e;r;r=r.parent)if(r.path===t)return!0;return!1}function i0(e,t,r){let n=r.dereference?.maxDepth??500;if((e?.depth??0)>=n)throw RangeError(`Maximum dereference depth (${n}) exceeded at ${t}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`)}function LL(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function DL(e,t,r){Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0})}var s0=L(()=>{ts();zs();yl();Wt();Ar();Jn()});function JL(e,t){if(typeof t.resolve?.excludedPathMatcher==="function")return Promise.reject(TypeError("Use the top-level resolveExcludedPathMatcher option; resolve keys are resolver plugins."));if(!t.resolve?.external)return Promise.resolve();if(t.resolveExcludedPathMatcher)return op(e,t,t.resolveExcludedPathMatcher);try{let n=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=cp(e.schema,e.$refs._root$Ref.path+"#",n,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,e.$refs,t);return Promise.all(i)}catch(n){return Promise.reject(n)}}function cp(e,t,r,n,i,s,o,a,c,l=new Set){a||=new Map;let u=[];if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!l.has(e)){let d=`${i}:${r}`,h=a.get(e);if(h?.has(d))return u;if(h)h.add(d);else a.set(e,new Set([d]));l.add(e);let m=r;if(je.isExternal$Ref(e))u.push(FL(e,t,m,n,s,o));let y=Object.keys(e);for(let g of y){let b=qe.join(t,g),x=e[g],_=bt(x,i),P=n&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?ut(m,x,_):m;u=u.concat(cp(x,b,P,n,_,s,o,a,c,l))}l.delete(e)}return u}async function FL(e,t,r,n,i,s){let a=s.dereference?.externalReferenceResolution==="root"?_r():n?r:t,c=Fe(a,e.$ref),l=$e(c),u=i._get$Ref(l);if(u)return Promise.resolve(u.value);try{let d=e.$ref,h={url:c,baseUrl:a};if(typeof d==="string")h.reference=d;let m=await Ks(h,i,s),y=i._get$Ref(l),g=y?.dynamicIdScope??!1,b=y?.legacyIdScope??!1,x=g?ut(l,m,b):l,_=cp(m,l+"#",x,g,b,i,s,new Map,!0);return Promise.all(_)}catch(d){if(!s?.continueOnError||!zt(d))throw d;if(i._$refs[l])d.source=decodeURI($e(t)),d.path=Hs(Pr(t));return[]}}var o0;var a0=L(()=>{ts();zs();yl();s0();Wt();Ar();Jn();o0=JL});function qL(e,t){let r=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,n=[],i=new Set([$e(e.$refs._root$Ref.path),$e(r)]);up(e,"schema",e.$refs._root$Ref.path+"#",r,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,!1,"#",0,n,e.$refs,t,i,new Set);let s=Ws(e.schema,e.$refs._root$Ref.legacyIdScope);if(BL(n,t,s,r),(t.bundle||{}).optimizeInternalRefs!==!1)VL(n,e.schema)}function up(e,t,r,n,i,s,o,a,c,l,u,d,h,m,y=!1){let g=t===null?e:e[t],b=d.bundle||{},x=b.excludedPathMatcher||(()=>!1);if(g&&typeof g==="object"&&!ArrayBuffer.isView(g)&&(y||!x(a,g))&&!m.has(g)){m.add(g);let _=n;if(je.isAllowed$Ref(g,d))c0(e,t,r,_,i,o,a,c,l,u,d,h,m);else{let P=Object.keys(g).sort((E,w)=>{if(E==="definitions"||E==="$defs")return-1;else if(w==="definitions"||w==="$defs")return 1;else return E.length-w.length});for(let E of P){let w=qe.join(r,E),k=qe.join(a,E);if(Object.getOwnPropertyDescriptor(g,E)?.get&&x(k,void 0))continue;let j=g[E];if(x(k,j))continue;let D=bt(j,s),F=i&&j&&typeof j==="object"&&!ArrayBuffer.isView(j)?ut(_,j,D):_,N=i&&lp(j,D),q=o||N,U=h;if(N)U=new Set(h),U.add($e(F));if(je.isAllowed$Ref(j,d))c0(g,E,w,F,i,q,k,c,l,u,d,U,m);else up(g,E,w,F,i,D,q,k,c,l,u,d,U,m,!0);if(j&&typeof j==="object"&&!Array.isArray(j)){if("$ref"in j)b?.onBundle?.(j.$ref,g[E],g,E)}}}}}function c0(e,t,r,n,i,s,o,a,c,l,u,d,h){let m=t===null?e:e[t],g=je.isExternal$Ref(m)&&u.dereference?.externalReferenceResolution==="root"?_r():i?n:r,b=Fe(g,m.$ref),x=l._resolve(b,o,u);if(x===null)return;let P=qe.parse(o).length,E=$e(x.path),w=Pr(x.path),k=l._aliases[E],R=Boolean(k&&GL(l._root$Ref.value,x.$ref.value)),j=E!==l._root$Ref.path&&!d.has(E)&&!R,D=Boolean(k)&&x.$ref.value!==l._root$Ref.value,F=Ws(x.$ref.value,x.$ref.legacyIdScope),N=k?x.$ref.path:x.$ref.dynamicIdScope?ut(x.$ref.path,x.$ref.value,x.$ref.legacyIdScope):x.$ref.path,q=je.isExtended$Ref(m);a+=x.indirections;let U=HL(c,e,t);if(U)if(P<U.depth||a<U.indirections)UL(c,U);else return;if(c.push({$ref:m,parent:e,key:t,pathFromRoot:o,depth:P,file:E,hash:w,value:x.value,circular:x.circular,extended:q,external:j,nestedResource:D,indirections:a,scopeBase:n,dynamicIdScope:i,nestedIdScope:s,targetResourceBase:N,...F===void 0?{}:{targetResourceId:F}}),!U||j){let ne=x.$ref.dynamicIdScope?x.scopeBase:x.$ref.path,ue=s||x.$ref.dynamicIdScope&&lp(x.value,x.legacyIdScope),ie=new Set(d);if(x.value===x.$ref.value&&lp(x.$ref.value,x.$ref.legacyIdScope))ie.add($e(x.$ref.path)),ie.add($e(ne));up(x.value,null,x.path,ne,x.$ref.dynamicIdScope,x.legacyIdScope,ue,o,a+1,c,l,u,ie,h)}}function BL(e,t,r,n){e.sort((a,c)=>{if(a.file!==c.file)return a.file<c.file?-1:1;else if(a.hash!==c.hash)return a.hash<c.hash?-1:1;else if(a.circular!==c.circular)return a.circular?-1:1;else if(a.extended!==c.extended)return a.extended?1:-1;else if(a.indirections!==c.indirections)return a.indirections-c.indirections;else if(a.depth!==c.depth)return a.depth-c.depth;else{let l=Math.max(a.pathFromRoot.lastIndexOf("/definitions"),a.pathFromRoot.lastIndexOf("/$defs")),u=Math.max(c.pathFromRoot.lastIndexOf("/definitions"),c.pathFromRoot.lastIndexOf("/$defs"));if(l!==u)return u-l;else return a.pathFromRoot.length-c.pathFromRoot.length}});let i,s,o;for(let a of e){let c=t.bundle||{};if(!a.external){if(c.optimizeInternalRefs!==!1){let l=$e(a.targetResourceBase),u=$e(a.scopeBase);if(l!==u)a.$ref.$ref=KL(a);else if(!a.nestedResource)a.$ref.$ref=a.hash}}else if(a.file===i&&a.hash===s)a.$ref.$ref=l0(a,o,r,n);else if(a.file===i&&a.hash.indexOf(s+"/")===0){let l=qe.join(o,qe.parse(a.hash.replace(s,"#")));a.$ref.$ref=l0(a,l,r,n)}else if(i=a.file,s=a.hash,o=a.pathFromRoot,a.$ref=a.parent[a.key]=je.dereference(a.$ref,a.value,t),a.circular)a.$ref.$ref=a.pathFromRoot}}function HL(e,t,r){for(let n of e)if(n&&n.parent===t&&n.key===r)return n;return}function UL(e,t){let r=e.indexOf(t);e.splice(r,1)}function VL(e,t){for(let r of e){if(!r.$ref||typeof r.$ref!=="object"||!("$ref"in r.$ref))continue;let n=r.$ref.$ref;if(typeof n!=="string"||!Al(n))continue;let i=WL(t,n);if(i!==n)r.$ref.$ref=i}}function WL(e,t){if(!Al(t))return t;let r=qe.parse(t),n=e,i=[];for(let s of r){if(n===null||n===void 0||typeof n!=="object")return t;if(!Object.prototype.hasOwnProperty.call(n,s)&&"$ref"in n&&typeof n.$ref==="string"&&Al(n.$ref)){let o=qe.parse(n.$ref);if(i.length=0,i.push(...o),n=zL(e,n.$ref),n===null||n===void 0||typeof n!=="object")return t}n=n[s],i.push(s)}return qe.join("#",i)}function zL(e,t){if(!Al(t))return;let r=qe.parse(t),n=e;for(let i of r){if(n===null||n===void 0||typeof n!=="object")return;n=n[i]}return n}function Al(e){return e[0]==="#"&&ua(e.substring(1)).startsWith("/")}function l0(e,t,r,n){if(!e.dynamicIdScope||!e.nestedIdScope||!n)return t;let i=n;if(r&&$e(Fe(e.scopeBase,r))===$e(n))i=r;return $e(i)+t}function KL(e){let t=$e(e.targetResourceBase);if(typeof e.$ref.$ref==="string"&&$e(Fe(e.scopeBase,e.$ref.$ref))===t)return e.$ref.$ref;if(e.targetResourceId&&$e(Fe(e.scopeBase,e.targetResourceId))===t)t=e.targetResourceId;return e.hash==="#"?t:t+e.hash}function lp(e,t=!1){return Ws(e,t)!==void 0}function GL(e,t){if(!t||typeof t!=="object")return!1;let r=new Set,n=(i)=>{if(i===t)return!0;if(!i||typeof i!=="object"||ArrayBuffer.isView(i)||r.has(i))return!1;return r.add(i),Object.keys(i).some((s)=>n(i[s]))};return n(e)}var u0;var f0=L(()=>{ts();zs();Wt();Jn();u0=qL});function YL(e,t){let r=Date.now(),n=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=fp(e.schema,e.$refs._root$Ref.path,n,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,"#",new Set,new Map,new Map,e.$refs,t,r,0);e.$refs.circular=i.circular,e.schema=i.value}function fp(e,t,r,n,i,s,o,a,c,l,u,d,h,m){let y,g={value:e,circular:!1};p0(d,u);let b=u.dereference||{},x=b.maxDepth??500;if(h>x)throw RangeError(`Maximum dereference depth (${x}) exceeded at ${s}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let _=b.excludedPathMatcher||(()=>!1);if(b?.circular==="ignore"||!a.has(e)){if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!_(s,e)){o.add(e),a.set(e,!1);let P=m||es(l,e)||{value:e,path:t,scopeBase:r,dynamicIdScope:n,legacyIdScope:i};if(je.isAllowed$Ref(e,u))y=d0(e,P.path,P.scopeBase,P.dynamicIdScope,s,o,a,c,l,u,d,h,P),g.circular=y.circular,g.value=y.value;else for(let E of Object.keys(e)){p0(d,u);let w=qe.join(t,E),k=qe.join(s,E);if(Object.getOwnPropertyDescriptor(e,E)?.get&&_(k,void 0))continue;let j=e[E];if(_(k,j))continue;let D=Xr(l,P,E,j),F;if(je.isAllowed$Ref(j,u)){if(y=d0(j,D.path,D.scopeBase,D.dynamicIdScope,k,o,a,c,l,u,d,h,D),F=y.circular,e[E]!==y.value){let N=new Map;if(b?.preservedProperties){if(typeof e[E]==="object"&&!Array.isArray(e[E]))b?.preservedProperties.forEach((U)=>{if(U in e[E])N.set(U,e[E][U])})}let q=y.value;if(b?.cloneReferences&&!F&&q&&typeof q==="object")q=structuredClone(q);if(e[E]=q,b?.preservedProperties){if(N.size&&e[E]!==null&&typeof e[E]==="object"&&!Array.isArray(e[E]))N.forEach((U,ne)=>{e[E][ne]=U})}b?.onDereference?.(j.$ref,e[E],e,E)}}else if(!o.has(j)){if(y=fp(j,D.path,D.scopeBase,D.dynamicIdScope,D.legacyIdScope,k,o,a,c,l,u,d,h+1,D),F=y.circular,e[E]!==y.value)e[E]=y.value}else F=xa(w,l,u);g.circular=g.circular||F}o.delete(e),a.set(e,g.circular)}}else g.circular=a.get(e)||!1;return g}function d0(e,t,r,n,i,s,o,a,c,l,u,d,h){let g=je.isExternal$Ref(e)&&l?.dereference?.externalReferenceResolution==="root"?_r():n?r:t,b=Fe(g,e.$ref),x=a.get(b);if(x&&!je.isExtended$Ref(e))if(!x.circular)return x;else if(typeof x.value==="object"&&"$ref"in x.value&&"$ref"in e){if(x.value.$ref===e.$ref)return xa(t,c,l),x}else return xa(t,c,l),x;let _=c._resolve(b,t,l);if(_===null)return{circular:!1,value:null};let P=_.circular,E=P||_.chainCircular||s.has(_.value);if(E)xa(t,c,l);let w=je.dereference(e,_.value,l),k=_.location,R=je.isExtended$Ref(e)?da(c,w,k,h,l.dereference?.mergeKeys??!0):k;if(!E){let D=fp(w,R.path,R.scopeBase,R.dynamicIdScope,R.legacyIdScope,i,s,o,a,c,l,u,d+1,R);if(E=D.circular,w=D.value,E&&x?.circular)xa(t,c,l)}if(E&&!P&&l.dereference?.circular==="ignore")w=e;if(P&&w!==e)w.$ref=i;let j={circular:E,value:w};if(Object.keys(e).length===1)a.set(b,j);return j}function p0(e,t){if(t&&t.timeoutMs){if(Date.now()-e>t.timeoutMs)throw new bd(t.timeoutMs)}}function xa(e,t,r){if(t.circular=!0,r?.dereference?.onCircular?.(e),!r.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${e}`);return!0}var m0;var h0=L(()=>{ts();zs();Wt();Jn();Ar();vd();m0=YL});function XL(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(t){setTimeout(t,0)}}var dp;var g0=L(()=>{dp=XL()});function lr(e,t){if(e){t.then(function(r){dp(function(){e(null,r)})},function(r){dp(function(){e(r)})});return}else return t}var y0=L(()=>{g0()});class qn{schema=null;$refs=new ha;async parse(){let e;try{e=ba(arguments)}catch(n){return jl(arguments,n)}let t,r=e.schema!==void 0&&e.schema!==null;if(!e.path&&!r){let n=Error(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return lr(e.callback,Promise.reject(n))}this.schema=null,this.$refs=new ha;try{let n="http";if(ul(e.path))e.path=Cx(e.path),n="file";if(e.path=Fe(_r(),e.path),r&&(typeof e.schema==="object"||typeof e.schema==="boolean")){let s=this.$refs._add(e.path);s.value=e.schema,s.pathType=n,s.dynamicIdScope=pl(s.value),s.legacyIdScope=bt(s.value),ml(this.$refs,s.path,s.value,s.pathType,s.dynamicIdScope),t=Promise.resolve(e.schema)}else t=Ks(e.path,this.$refs,e.options);let i=await t;if(typeof i==="boolean"||i!==null&&typeof i==="object"&&!Buffer.isBuffer(i))return this.schema=i,lr(e.callback,Promise.resolve(this.schema));else if(e.options.continueOnError)return this.schema=null,lr(e.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(n){if(!e.options.continueOnError||!zt(n))return lr(e.callback,Promise.reject(n));if(this.$refs._$refs[$e(e.path)])this.$refs._$refs[$e(e.path)].addError(n);return lr(e.callback,Promise.resolve(null))}}static parse(){let e=new qn;return e.parse.apply(e,arguments)}async resolve(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.parse(e.path,e.schema,e.options),await o0(this,e.options),pp(this),lr(e.callback,Promise.resolve(this.$refs))}catch(t){return lr(e.callback,Promise.reject(t))}}static resolve(){let e=new qn;return e.resolve.apply(e,arguments)}static bundle(){let e=new qn;return e.bundle.apply(e,arguments)}async bundle(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),u0(this,e.options),pp(this),lr(e.callback,Promise.resolve(this.schema))}catch(t){return lr(e.callback,Promise.reject(t))}}static dereference(){let e=new qn;return e.dereference.apply(e,arguments)}async dereference(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),m0(this,e.options),pp(this),lr(e.callback,Promise.resolve(this.schema))}catch(t){return lr(e.callback,Promise.reject(t))}}}function jl(e,t){let r=e[e.length-1];return lr(typeof r==="function"?r:void 0,Promise.reject(t))}function pp(e){if(Us.getParserErrors(e).length>0)throw new Us(e)}var Kte,Gte,Yte,b0;var x0=L(()=>{Fx();yl();K$();a0();f0();h0();Wt();ep();np();Ar();y0();Jn();ip();Wt();Kte=qn.parse,Gte=qn.resolve,Yte=qn.bundle,b0=qn.dereference});function QL(e,t){if(t.routing==="prefix-except-default"&&e===t.defaultLocale)return"/";return`/${e.toLowerCase()}/`}function $0(e){if(e===null||e.locales.length<2)return"";let t=JSON.stringify(e.locales),r=JSON.stringify(e.defaultLocale),n=JSON.stringify(Object.fromEntries(e.locales.map((i)=>[i,QL(i,e)])));return`
132
132
  // ─── Locale negotiation (RFC 4647 Lookup over Accept-Language) ───────────────
133
133
  const JX_LOCALES = ${t}
134
134
  const JX_DEFAULT_LOCALE = ${r}
@@ -210,8 +210,8 @@ const app = new Hono()
210
210
  ${o}
211
211
 
212
212
  export default app
213
- `}function pp(e,t={}){let{adapter:r=null,mounts:n=[],connectors:i=[],i18n:s=null,base:o=""}=t,a=ze(o,t.baseUrl??"/_jx/server");if(e.length===0&&n.length===0&&!r)return null;let c=e.map(({exportName:m,src:y})=>`import { ${m} } from '${y}'`).join(`
214
- `),l=YL(n,i),u=e.map(({exportName:m})=>v0(m,a)).join(`
213
+ `}function mp(e,t={}){let{adapter:r=null,mounts:n=[],connectors:i=[],i18n:s=null,base:o=""}=t,a=ze(o,t.baseUrl??"/_jx/server");if(e.length===0&&n.length===0&&!r)return null;let c=e.map(({exportName:m,src:y})=>`import { ${m} } from '${y}'`).join(`
214
+ `),l=ZL(n,i),u=e.map(({exportName:m})=>v0(m,a)).join(`
215
215
  `),d=r==="cloudflare-workers"||r==="cloudflare-pages"?`
216
216
  app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
217
217
  `:`
@@ -223,7 +223,7 @@ const app = new Hono()
223
223
  ${h}${l.routes}${u}
224
224
  ${d}
225
225
  export default app
226
- `}function YL(e,t){if(e.length===0)return{imports:"",routes:""};let r=e.toSorted((s,o)=>s.order-o.order),n=[];for(let s of r)n.push(`import { ${s.className} } from '${s.module}'`);for(let s of t)n.push(`import { ${s.className} } from '${s.module}'`);let i=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${t.map((s)=>`${JSON.stringify(s.provider)}: ${s.className}`).join(", ")} }`];for(let[s,o]of r.entries()){let a=JSON.stringify(o.options);i.push(`const jxMount${s} = await ${o.className}.mount({ ...${a}, connectors: jxConnectors }, jxCtx)`,`app.all('${o.basePath}/*', (c) => jxMount${s}(c.req.raw, c.env))`,`app.all('${o.basePath}', (c) => jxMount${s}(c.req.raw, c.env))`)}return{imports:`
226
+ `}function ZL(e,t){if(e.length===0)return{imports:"",routes:""};let r=e.toSorted((s,o)=>s.order-o.order),n=[];for(let s of r)n.push(`import { ${s.className} } from '${s.module}'`);for(let s of t)n.push(`import { ${s.className} } from '${s.module}'`);let i=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${t.map((s)=>`${JSON.stringify(s.provider)}: ${s.className}`).join(", ")} }`];for(let[s,o]of r.entries()){let a=JSON.stringify(o.options);i.push(`const jxMount${s} = await ${o.className}.mount({ ...${a}, connectors: jxConnectors }, jxCtx)`,`app.all('${o.basePath}/*', (c) => jxMount${s}(c.req.raw, c.env))`,`app.all('${o.basePath}', (c) => jxMount${s}(c.req.raw, c.env))`)}return{imports:`
227
227
  ${n.join(`
228
228
  `)}`,routes:`${i.join(`
229
229
  `)}
@@ -235,7 +235,7 @@ app.post('${t}/${e}', async (c) => {
235
235
  } catch (e) {
236
236
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
237
237
  }
238
- })`}var mp=L(()=>{wr();x0();mn()});async function Cl(e,t={}){let{resolveElementPath:r,$media:n,formats:i}=t,s=[],o=new Set;async function a(c,l){let u,d;if(T(c)){let{readFileSync:E}=await import("node:fs"),{resolve:w}=await import("node:path");if(d=l?w(l,c):w(c),o.has(d))return;if(o.add(d),d.endsWith(".json"))u=ti(E(d,"utf8"),d);else{let{extname:P}=await import("node:path"),R=P(d).toLowerCase(),j=i?.byExtension(R,"parse");if(!j){await Promise.resolve().then(() => On());throw _c(d,R)}u=await j.parseDocument(E(d,"utf8"))}}else{if(u=c,d=null,u.tagName&&o.has(u.tagName))return;if(u.tagName)o.add(u.tagName)}let{tagName:h}=u;if(!h||!h.includes("-"))throw Error(`compileElement: tagName "${h}" must contain a hyphen`);let{dirname:m}=await import("node:path"),y=d?m(d):null,g=[];if(Array.isArray(u.$elements))for(let E of u.$elements){let w=Je(E)?E.$ref:E;if(!T(w))continue;if(y)await a(w,y);let P=r?r(w,y):w.replace(/\.json$/,".js");g.push(P)}let b=rl(h);if(n)u.$media={...n,...u.$media};let{rewriteSrc:x}=t,_=va(u,b,g,x?(E)=>x(E,y):void 0,Yi(u,t.defaults)),k=d?d.replace(/\.json$/,".js"):`${h}.js`;s.push({content:_,path:k,tagName:h})}return await a(e,t.basePath??null),{files:s}}async function XL(e,t={}){let{title:r="Jx App",reactivitySrc:n="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:i="https://esm.sh/lit-html@3.3.0"}=t,s=await Cl(e,t),o=s.files.at(-1);if(!o)throw Error("compileElementPage: no element modules were produced");let{basename:a}=await import("node:path"),c=a(o.path),l=`<!DOCTYPE html>
238
+ })`}var hp=L(()=>{wr();x0();mn()});async function Cl(e,t={}){let{resolveElementPath:r,$media:n,formats:i}=t,s=[],o=new Set;async function a(c,l){let u,d;if(T(c)){let{readFileSync:E}=await import("node:fs"),{resolve:w}=await import("node:path");if(d=l?w(l,c):w(c),o.has(d))return;if(o.add(d),d.endsWith(".json"))u=ti(E(d,"utf8"),d);else{let{extname:k}=await import("node:path"),R=k(d).toLowerCase(),j=i?.byExtension(R,"parse");if(!j){await Promise.resolve().then(() => On());throw _c(d,R)}u=await j.parseDocument(E(d,"utf8"))}}else{if(u=c,d=null,u.tagName&&o.has(u.tagName))return;if(u.tagName)o.add(u.tagName)}let{tagName:h}=u;if(!h||!h.includes("-"))throw Error(`compileElement: tagName "${h}" must contain a hyphen`);let{dirname:m}=await import("node:path"),y=d?m(d):null,g=[];if(Array.isArray(u.$elements))for(let E of u.$elements){let w=Je(E)?E.$ref:E;if(!T(w))continue;if(y)await a(w,y);let k=r?r(w,y):w.replace(/\.json$/,".js");g.push(k)}let b=rl(h);if(n)u.$media={...n,...u.$media};let{rewriteSrc:x}=t,_=va(u,b,g,x?(E)=>x(E,y):void 0,Yi(u,t.defaults)),P=d?d.replace(/\.json$/,".js"):`${h}.js`;s.push({content:_,path:P,tagName:h})}return await a(e,t.basePath??null),{files:s}}async function eD(e,t={}){let{title:r="Jx App",reactivitySrc:n="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:i="https://esm.sh/lit-html@3.3.0"}=t,s=await Cl(e,t),o=s.files.at(-1);if(!o)throw Error("compileElementPage: no element modules were produced");let{basename:a}=await import("node:path"),c=a(o.path),l=`<!DOCTYPE html>
239
239
  <html lang="en">
240
240
  <head>
241
241
  <meta charset="utf-8">
@@ -254,42 +254,42 @@ app.post('${t}/${e}', async (c) => {
254
254
  <${o.tagName}></${o.tagName}>
255
255
  <script type="module" src="./${c}"></script>
256
256
  </body>
257
- </html>`;return{files:s.files,html:l}}function QL(e){if(!J(e)||Array.isArray(e))return JSON.stringify(e);if("default"in e)return JSON.stringify(e.default);if(ei(e))return;if(e.$prototype==="LocalStorage"||e.$prototype==="SessionStorage")return JSON.stringify(e.default??null);if(e.$prototype==="Request")return"null";return JSON.stringify(e)}function ZL(e){let t=new Set,r=new Set,n=(s)=>{if(s.startsWith("#/state/"))t.add(s.slice(8).split("/")[0])},i=(s)=>{if(T(s)){for(let a of s.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))t.add(a[1]);return}if(!J(s)||r.has(s))return;if(r.add(s),Array.isArray(s)){for(let a of s)i(a);return}let o=s;if(o.operator==="call"&&Je(o.target))n(o.target.$ref);for(let[a,c]of Object.entries(o)){if(a.startsWith("on")&&a!=="observedAttributes"&&Je(c))n(c.$ref);i(c)}};return i(e.children),i(e.state),t}function va(e,t,r,n,i=null){let s=["// Generated by @jxsuite/compiler — do not edit manually"];if(e.$id)s.push(`// Source: ${e.$id}`);for(let w of r)s.push(`import '${w}';`);let o=new Map,a=new Map,c=e.state??{},l=ZL(e);for(let[w,P]of Object.entries(c))if(xr(P)&&P.$src){let R=P.$src;if(P.$lazy===!0){if(!l.has(w)&&!w0.has(w))throw Error(`"${w}" declares "$lazy": true but is used as a computed value, not called. A lazily loaded function resolves to a promise; a computed must resolve now. Remove "$lazy", or call ${w}() from a handler instead of binding its value.`);let D=a.get(R);if(!D)D=[],a.set(R,D);D.push({binding:w,exportName:Gf(w,P)});continue}let j=o.get(R);if(!j)j=[],o.set(R,j);j.push(Yc(w,P))}for(let[w,P]of o){let R=n?n(w):w;s.push(`import { ${P.join(", ")} } from '${R}';`)}let u=Object.entries(c).flatMap(([w,P])=>un(P)&&P.$prototype==="Request"?[[w,P]]:[]);s.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html, nothing } from 'lit-html';",el());let d=i===null&&ci(e.children);if(d)s.push(_b());let h=0;for(let[w,P]of a){let R=n?n(w):w,j=`_jxLazy${h}`;h+=1,s.push(`let ${j};`,`const ${j}Load = () => (${j} ??= import('${R}'));`,...P.map(({binding:D,exportName:F})=>`const ${D} = (...args) => ${j}Load().then((m) => m.${F}(...args));`))}s.push("",`class ${t} extends HTMLElement {`," #effects = [];",...i===null?[]:[" #root = null;"],""," constructor() {"," super();");let m=[],y=[],g=[],b=[],x=[];for(let[w,P]of Object.entries(c))if($r(P))if(Ni(P))b.push([w,P]);else if(Nn(P.$expression.operator))g.push([w,P]);else y.push([w,P]);else if(xr(P))if(P.$src&&!T(P.body))if(l.has(w)||w0.has(w))g.push([w,P]);else y.push([w,P]);else if(T(P.body)&&Mi(P.body))y.push([w,P]);else g.push([w,P]);else if(T(P)&&P.includes("${"))x.push([w,P]);else{let R=QL(P);if(R!==void 0)m.push([w,R])}s.push(" this.state = reactive({");for(let[w,P]of m)s.push(` ${Ps(w)}: ${P},`);s.push(" });");for(let[w,P]of g)if(s.push(""),$r(P)){let R=Vt(P.$expression,{eventParam:"e",statePrefix:"s"});s.push(` ${Ie("this.state",Ct(w))} = (s, e) => { ${R}; };`)}else if(Zn(P)){let R=Lr(P.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = (s, e) => {`,R," };")}else{let R=P.parameters?Rn(P.parameters):P.arguments??["state"],j=R.join(", "),D=T(P.body)?P.body:"";if(R[0]==="state")if(P.$src)s.push(` ${Ie("this.state",Ct(w))} = (${j}) => ${w}(${j});`);else s.push(` ${Ie("this.state",Ct(w))} = (${j}) => {`,` ${D}`," };");else{let F=R.map((N)=>N==="state"?"state":"e").join(", ");if(P.$src)s.push(` ${Ie("this.state",Ct(w))} = (state, e) => ${w}(${F});`);else s.push(` ${Ie("this.state",Ct(w))} = (state, e) => {`,` const _fn = (${j}) => {`,` ${D}`," };",` return _fn(${F});`," };")}}for(let[w,P]of b){s.push("");let R=Vt(P.$expression,{eventParam:"e",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = ${sa(P,R)};`)}for(let[w,P]of x)s.push("",` ${Ie("this.state",Ct(w))} = computed(() => ${Zc(P.replaceAll("state.","this.state."))});`);for(let[w,P]of y)if(s.push(""),$r(P)){let R=Vt(P.$expression,{eventParam:"e",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = computed(() => ${R});`)}else if(P.$src)s.push(` ${Ie("this.state",Ct(w))} = computed(() => ${w}(this.state));`);else{s.push(` ${Ie("this.state",Ct(w))} = computed(() => {`);let R=(T(P.body)?P.body:"").replaceAll("state.","this.state.");s.push(` ${R}`," });")}s.push(" }","");let _=[];if(Array.isArray(e.children)){let w={n:0};for(let P of e.children)li(P,_,e.$media??{},"",w,e.tagName)}let k=_0(),E=!Array.isArray(e.children)&&e.textContent!==void 0?` ${Il(e.textContent)}`:Ol(e.children,e.style," ",!1,!1,k);s.push(" template() {"," const s = this.state;",...k.decls," return html`",E," `;"," }","",...i===null?[]:[" #renderRoot() {"," if (this.#root) return this.#root;",i==="closed"?" this.#root = this.attachInternals().shadowRoot ?? this.attachShadow({ mode: 'closed' });":" this.#root = this.shadowRoot ?? this.attachShadow({ mode: 'open' });"," return this.#root;"," }",""]," connectedCallback() {"," const _pa = this.getAttribute('data-jx-props');"," if (_pa) {"," try {"," const _p = JSON.parse(_pa);"," for (const [k, v] of Object.entries(_p)) {"," if (k.startsWith('#')) continue;"," if (k in this.state) this.state[k] = v;"," }"," } catch {}"," this.removeAttribute('data-jx-props');"," }"," const _pn = this.getAttributeNames().filter(n => n.startsWith('props.') && n.length > 6);"," for (const _n of _pn) {"," const _k = _n.slice(6);"," if (_k.startsWith('#')) { this.removeAttribute(_n); continue; }"," if (_k in this.state) {"," this.state[_k] = this.getAttribute(_n);"," this.removeAttribute(_n);"," }"," }"," for (const key of Object.keys(this.state)) {"," if (key.startsWith('#')) continue;"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }");for(let[w,P]of u)s.push(Xc(w,P,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));if(J(e.style)){let w=[];for(let[P,R]of Object.entries(e.style)){if(P.startsWith(":")||P.startsWith(".")||P.startsWith("&")||P.startsWith("[")||P.startsWith("@"))continue;if(T(R)&&R.includes("${"))w.push([ar(P),R])}if(w.length>0){s.push(" this.#effects.push(effect(() => {");for(let[P,R]of w){let j=R.replaceAll(/\$\{([^}]+)\}/g,(D,F)=>`\${${F.replaceAll("state.","this.state.")}}`);s.push(` this.style['${P}'] = \`${j}\`;`)}s.push(" }));")}}if(d)s.push(` const _slotted = ${Xf}(this);`);if(s.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"),i===null)s.push(" this.replaceChildren();"," this.#effects.push(effect(() => render(this.template(), this)));");else s.push(" const _root = this.#renderRoot();"," for (const _n of [..._root.childNodes]) {"," if (!(_n.nodeType === 1 && _n.tagName === 'LINK')) _n.remove();"," }"," this.#effects.push(effect(() => render(this.template(), _root)));");if(d)s.push(` ${Qf}(this, _slotted);`);return s.push(" if (typeof this.state.onMount === 'function') {"," queueMicrotask(() => this.state.onMount(this.state));"," }"," }",""," disconnectedCallback() {"," for (const _e of this.#effects) { stop(_e); }"," this.#effects.length = 0;"," if (typeof this.state.onUnmount === 'function') { this.state.onUnmount(this.state); }"," }","}","",`customElements.define('${e.tagName}', ${t});`,""),s.join(`
257
+ </html>`;return{files:s.files,html:l}}function tD(e){if(!J(e)||Array.isArray(e))return JSON.stringify(e);if("default"in e)return JSON.stringify(e.default);if(ei(e))return;if(e.$prototype==="LocalStorage"||e.$prototype==="SessionStorage")return JSON.stringify(e.default??null);if(e.$prototype==="Request")return"null";return JSON.stringify(e)}function rD(e){let t=new Set,r=new Set,n=(s)=>{if(s.startsWith("#/state/"))t.add(s.slice(8).split("/")[0])},i=(s)=>{if(T(s)){for(let a of s.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))t.add(a[1]);return}if(!J(s)||r.has(s))return;if(r.add(s),Array.isArray(s)){for(let a of s)i(a);return}let o=s;if(o.operator==="call"&&Je(o.target))n(o.target.$ref);for(let[a,c]of Object.entries(o)){if(a.startsWith("on")&&a!=="observedAttributes"&&Je(c))n(c.$ref);i(c)}};return i(e.children),i(e.state),t}function va(e,t,r,n,i=null){let s=["// Generated by @jxsuite/compiler — do not edit manually"];if(e.$id)s.push(`// Source: ${e.$id}`);for(let w of r)s.push(`import '${w}';`);let o=new Map,a=new Map,c=e.state??{},l=rD(e);for(let[w,k]of Object.entries(c))if(xr(k)&&k.$src){let R=k.$src;if(k.$lazy===!0){if(!l.has(w)&&!w0.has(w))throw Error(`"${w}" declares "$lazy": true but is used as a computed value, not called. A lazily loaded function resolves to a promise; a computed must resolve now. Remove "$lazy", or call ${w}() from a handler instead of binding its value.`);let D=a.get(R);if(!D)D=[],a.set(R,D);D.push({binding:w,exportName:Yf(w,k)});continue}let j=o.get(R);if(!j)j=[],o.set(R,j);j.push(Yc(w,k))}for(let[w,k]of o){let R=n?n(w):w;s.push(`import { ${k.join(", ")} } from '${R}';`)}let u=Object.entries(c).flatMap(([w,k])=>un(k)&&k.$prototype==="Request"?[[w,k]]:[]);s.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html, nothing } from 'lit-html';",el());let d=i===null&&ci(e.children);if(d)s.push(_b());let h=0;for(let[w,k]of a){let R=n?n(w):w,j=`_jxLazy${h}`;h+=1,s.push(`let ${j};`,`const ${j}Load = () => (${j} ??= import('${R}'));`,...k.map(({binding:D,exportName:F})=>`const ${D} = (...args) => ${j}Load().then((m) => m.${F}(...args));`))}s.push("",`class ${t} extends HTMLElement {`," #effects = [];",...i===null?[]:[" #root = null;"],""," constructor() {"," super();");let m=[],y=[],g=[],b=[],x=[];for(let[w,k]of Object.entries(c))if($r(k))if(Ni(k))b.push([w,k]);else if(Nn(k.$expression.operator))g.push([w,k]);else y.push([w,k]);else if(xr(k))if(k.$src&&!T(k.body))if(l.has(w)||w0.has(w))g.push([w,k]);else y.push([w,k]);else if(T(k.body)&&Mi(k.body))y.push([w,k]);else g.push([w,k]);else if(T(k)&&k.includes("${"))x.push([w,k]);else{let R=tD(k);if(R!==void 0)m.push([w,R])}s.push(" this.state = reactive({");for(let[w,k]of m)s.push(` ${Ps(w)}: ${k},`);s.push(" });");for(let[w,k]of g)if(s.push(""),$r(k)){let R=Vt(k.$expression,{eventParam:"e",statePrefix:"s"});s.push(` ${Ie("this.state",Ct(w))} = (s, e) => { ${R}; };`)}else if(Zn(k)){let R=Lr(k.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = (s, e) => {`,R," };")}else{let R=k.parameters?Rn(k.parameters):k.arguments??["state"],j=R.join(", "),D=T(k.body)?k.body:"";if(R[0]==="state")if(k.$src)s.push(` ${Ie("this.state",Ct(w))} = (${j}) => ${w}(${j});`);else s.push(` ${Ie("this.state",Ct(w))} = (${j}) => {`,` ${D}`," };");else{let F=R.map((N)=>N==="state"?"state":"e").join(", ");if(k.$src)s.push(` ${Ie("this.state",Ct(w))} = (state, e) => ${w}(${F});`);else s.push(` ${Ie("this.state",Ct(w))} = (state, e) => {`,` const _fn = (${j}) => {`,` ${D}`," };",` return _fn(${F});`," };")}}for(let[w,k]of b){s.push("");let R=Vt(k.$expression,{eventParam:"e",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = ${sa(k,R)};`)}for(let[w,k]of x)s.push("",` ${Ie("this.state",Ct(w))} = computed(() => ${Zc(k.replaceAll("state.","this.state."))});`);for(let[w,k]of y)if(s.push(""),$r(k)){let R=Vt(k.$expression,{eventParam:"e",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = computed(() => ${R});`)}else if(k.$src)s.push(` ${Ie("this.state",Ct(w))} = computed(() => ${w}(this.state));`);else{s.push(` ${Ie("this.state",Ct(w))} = computed(() => {`);let R=(T(k.body)?k.body:"").replaceAll("state.","this.state.");s.push(` ${R}`," });")}s.push(" }","");let _=[];if(Array.isArray(e.children)){let w={n:0};for(let k of e.children)li(k,_,e.$media??{},"",w,e.tagName)}let P=_0(),E=!Array.isArray(e.children)&&e.textContent!==void 0?` ${Il(e.textContent)}`:Ol(e.children,e.style," ",!1,!1,P);s.push(" template() {"," const s = this.state;",...P.decls," return html`",E," `;"," }","",...i===null?[]:[" #renderRoot() {"," if (this.#root) return this.#root;",i==="closed"?" this.#root = this.attachInternals().shadowRoot ?? this.attachShadow({ mode: 'closed' });":" this.#root = this.shadowRoot ?? this.attachShadow({ mode: 'open' });"," return this.#root;"," }",""]," connectedCallback() {"," const _pa = this.getAttribute('data-jx-props');"," if (_pa) {"," try {"," const _p = JSON.parse(_pa);"," for (const [k, v] of Object.entries(_p)) {"," if (k.startsWith('#')) continue;"," if (k in this.state) this.state[k] = v;"," }"," } catch {}"," this.removeAttribute('data-jx-props');"," }"," const _pn = this.getAttributeNames().filter(n => n.startsWith('props.') && n.length > 6);"," for (const _n of _pn) {"," const _k = _n.slice(6);"," if (_k.startsWith('#')) { this.removeAttribute(_n); continue; }"," if (_k in this.state) {"," this.state[_k] = this.getAttribute(_n);"," this.removeAttribute(_n);"," }"," }"," for (const key of Object.keys(this.state)) {"," if (key.startsWith('#')) continue;"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }");for(let[w,k]of u)s.push(Xc(w,k,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));if(J(e.style)){let w=[];for(let[k,R]of Object.entries(e.style)){if(k.startsWith(":")||k.startsWith(".")||k.startsWith("&")||k.startsWith("[")||k.startsWith("@"))continue;if(T(R)&&R.includes("${"))w.push([ar(k),R])}if(w.length>0){s.push(" this.#effects.push(effect(() => {");for(let[k,R]of w){let j=R.replaceAll(/\$\{([^}]+)\}/g,(D,F)=>`\${${F.replaceAll("state.","this.state.")}}`);s.push(` this.style['${k}'] = \`${j}\`;`)}s.push(" }));")}}if(d)s.push(` const _slotted = ${Qf}(this);`);if(s.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"),i===null)s.push(" this.replaceChildren();"," this.#effects.push(effect(() => render(this.template(), this)));");else s.push(" const _root = this.#renderRoot();"," for (const _n of [..._root.childNodes]) {"," if (!(_n.nodeType === 1 && _n.tagName === 'LINK')) _n.remove();"," }"," this.#effects.push(effect(() => render(this.template(), _root)));");if(d)s.push(` ${Zf}(this, _slotted);`);return s.push(" if (typeof this.state.onMount === 'function') {"," queueMicrotask(() => this.state.onMount(this.state));"," }"," }",""," disconnectedCallback() {"," for (const _e of this.#effects) { stop(_e); }"," this.#effects.length = 0;"," if (typeof this.state.onUnmount === 'function') { this.state.onUnmount(this.state); }"," }","}","",`customElements.define('${e.tagName}', ${t});`,""),s.join(`
258
258
  `)}function _0(){return{byText:new Map,decls:[]}}function P0(e,t){let r=e.byText.get(t);if(r)return r;let n=`_c${e.decls.length}`;e.decls.push(` const ${n} = html\`
259
259
  ${t}
260
- \`;`);let i=`\${${n}}`;return e.byText.set(t,i),i}function Ol(e,t,r,n=!1,i=!1,s=null,o=!1){if(!e)return"";let a=o?Js:"";if(lt(e))return`${E0(e,r)}${a}`;if(!Array.isArray(e))return"";return e.map((c)=>{if(lt(c))return`${E0(c,r)}${a}`;let l=gp(c,n?"":r,n,i,s);return T(c)&&c.includes("${")||J(c)&&fn(c.tagName)?`${l}${a}`:l}).join(n?"":`
261
- `)}function gp(e,t,r=!1,n=!1,i=null,s=null){if(T(e)){if(e.includes("${"))return`${t}${Il(e)}`;return`${t}${Se(e)}`}if(Ir(e)||Rt(e))return`${t}${Se(String(e))}`;if(!J(e))return"";if(fn(e.tagName)){let g=e.tagName.$expression,b=Ki(g.target,{eventParam:"e",statePrefix:"s"}),x=g.operator==="?:"?[[!0,g.value],[!1,g.initial]]:[...Object.entries(g.cases),["__default__",g.default]],_=x.map(([,j])=>j),k=_.map((j)=>r||ui.has(j)),E=null;if(i&&k.every((j)=>j===k[0])){let j=S0(e,`${t} `,k[0]===!0,n,i,_.some((D)=>D.includes("-")));if(j.trim()!=="")E=P0(i,j)}let w=x.map(([j,D])=>{let F={...e,tagName:D};return[j,gp(F,`${t} `,r,n,i,E)]});if(g.operator==="?:"){let[,j]=w[0],[,D]=w[1];return`${t}\${${b}
260
+ \`;`);let i=`\${${n}}`;return e.byText.set(t,i),i}function Ol(e,t,r,n=!1,i=!1,s=null,o=!1){if(!e)return"";let a=o?Js:"";if(lt(e))return`${E0(e,r)}${a}`;if(!Array.isArray(e))return"";return e.map((c)=>{if(lt(c))return`${E0(c,r)}${a}`;let l=yp(c,n?"":r,n,i,s);return T(c)&&c.includes("${")||J(c)&&fn(c.tagName)?`${l}${a}`:l}).join(n?"":`
261
+ `)}function yp(e,t,r=!1,n=!1,i=null,s=null){if(T(e)){if(e.includes("${"))return`${t}${Il(e)}`;return`${t}${Se(e)}`}if(Ir(e)||Rt(e))return`${t}${Se(String(e))}`;if(!J(e))return"";if(fn(e.tagName)){let g=e.tagName.$expression,b=Ki(g.target,{eventParam:"e",statePrefix:"s"}),x=g.operator==="?:"?[[!0,g.value],[!1,g.initial]]:[...Object.entries(g.cases),["__default__",g.default]],_=x.map(([,j])=>j),P=_.map((j)=>r||ui.has(j)),E=null;if(i&&P.every((j)=>j===P[0])){let j=S0(e,`${t} `,P[0]===!0,n,i,_.some((D)=>D.includes("-")));if(j.trim()!=="")E=P0(i,j)}let w=x.map(([j,D])=>{let F={...e,tagName:D};return[j,yp(F,`${t} `,r,n,i,E)]});if(g.operator==="?:"){let[,j]=w[0],[,D]=w[1];return`${t}\${${b}
262
262
  ? html\`
263
263
  ${j}
264
264
  \`
265
265
  : html\`
266
266
  ${D}
267
- \`}`}let P=w.flatMap(([j,D])=>j==="__default__"?[]:[` ${JSON.stringify(j)}: html\`
267
+ \`}`}let k=w.flatMap(([j,D])=>j==="__default__"?[]:[` ${JSON.stringify(j)}: html\`
268
268
  ${D}
269
269
  \``]),[,R]=w.at(-1);return`${t}\${{
270
- ${P.join(`,
270
+ ${k.join(`,
271
271
  `)}
272
272
  }[String(${b})] ?? html\`
273
273
  ${R}
274
- \`}`}let o=e.tagName??"div",a=r||ui.has(o),c=[];if(e.attributes)for(let[g,b]of Object.entries(e.attributes))if(Je(b))c.push(`${g}="\${${Ds}('${g}', ${hn(b.$ref)}) ?? nothing}"`);else if(T(b)&&eD(b))c.push(`${g}="\${${Ds}('${g}', ${Rr(b).slice(2,-1)}) ?? nothing}"`);else if(T(b)&&b.includes("${"))c.push(`${g}="${Rr(b)}"`);else if(Rt(b)){let x=Gi(g,b);if(x!==null)c.push(x===""?g:`${g}="${x}"`)}else c.push(`${g}="${b}"`);if(e.id)c.push(`id="${Rr(String(e.id))}"`);if(e.className)c.push(`class="${Rr(String(e.className))}"`);for(let[g,b]of Object.entries(e)){if(Mn.has(g)||g.startsWith("$")||g.startsWith("on")||g==="tagName"||g==="id"||g==="className"||g==="style"||g==="children"||g==="textContent"||g==="innerHTML"||g==="attributes")continue;if(Rl(b))c.push(`.${g}="\${${hn(b.$ref)}}"`);else if(T(b)&&b.includes("${"))c.push(`.${g}="${Rr(b)}"`);else c.push(`.${g}="\${${JSON.stringify(b)}}"`)}if(e.$props)for(let[g,b]of Object.entries(e.$props))if(Rl(b))c.push(`.${g}="\${${hn(b.$ref)}}"`);else if(T(b)&&b.includes("${"))c.push(`.${g}="${Rr(b)}"`);else c.push(`.${g}="\${${JSON.stringify(b)}}"`);let l=n?"s.$map = $map; ":"";for(let[g,b]of Object.entries(e)){if(!g.startsWith("on")||g==="observedAttributes")continue;let x=g.slice(2).toLowerCase();if(Rl(b))c.push(l?`@${x}="\${(e) => { ${l}${hn(b.$ref)}(s, e); }}"`:`@${x}="\${(e) => ${hn(b.$ref)}(s, e)}"`);else if(J(b)&&"$expression"in b){let _=Vt(b.$expression,{eventParam:"e",statePrefix:"s"});c.push(`@${x}="\${(e) => { ${l}${_}; }}"`)}else if(xr(b))c.push(`@${x}="\${(e) => { ${l}${tD(b)} }}"`)}let u=A0(e.style);if(u)c.push(`style="${u}"`);let d=c.length>0?`
274
+ \`}`}let o=e.tagName??"div",a=r||ui.has(o),c=[];if(e.attributes)for(let[g,b]of Object.entries(e.attributes))if(Je(b))c.push(`${g}="\${${Ds}('${g}', ${hn(b.$ref)}) ?? nothing}"`);else if(T(b)&&nD(b))c.push(`${g}="\${${Ds}('${g}', ${Rr(b).slice(2,-1)}) ?? nothing}"`);else if(T(b)&&b.includes("${"))c.push(`${g}="${Rr(b)}"`);else if(Rt(b)){let x=Gi(g,b);if(x!==null)c.push(x===""?g:`${g}="${x}"`)}else c.push(`${g}="${b}"`);if(e.id)c.push(`id="${Rr(String(e.id))}"`);if(e.className)c.push(`class="${Rr(String(e.className))}"`);for(let[g,b]of Object.entries(e)){if(Mn.has(g)||g.startsWith("$")||g.startsWith("on")||g==="tagName"||g==="id"||g==="className"||g==="style"||g==="children"||g==="textContent"||g==="innerHTML"||g==="attributes")continue;if(Rl(b))c.push(`.${g}="\${${hn(b.$ref)}}"`);else if(T(b)&&b.includes("${"))c.push(`.${g}="${Rr(b)}"`);else c.push(`.${g}="\${${JSON.stringify(b)}}"`)}if(e.$props)for(let[g,b]of Object.entries(e.$props))if(Rl(b))c.push(`.${g}="\${${hn(b.$ref)}}"`);else if(T(b)&&b.includes("${"))c.push(`.${g}="${Rr(b)}"`);else c.push(`.${g}="\${${JSON.stringify(b)}}"`);let l=n?"s.$map = $map; ":"";for(let[g,b]of Object.entries(e)){if(!g.startsWith("on")||g==="observedAttributes")continue;let x=g.slice(2).toLowerCase();if(Rl(b))c.push(l?`@${x}="\${(e) => { ${l}${hn(b.$ref)}(s, e); }}"`:`@${x}="\${(e) => ${hn(b.$ref)}(s, e)}"`);else if(J(b)&&"$expression"in b){let _=Vt(b.$expression,{eventParam:"e",statePrefix:"s"});c.push(`@${x}="\${(e) => { ${l}${_}; }}"`)}else if(xr(b))c.push(`@${x}="\${(e) => { ${l}${iD(b)} }}"`)}let u=A0(e.style);if(u)c.push(`style="${u}"`);let d=c.length>0?`
275
275
  ${t} ${c.join(`
276
276
  ${t} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(o))return`${t}<${o}${d}
277
277
  ${t}>`;let m=s??S0(e,t,a,n,i,o.includes("-")),y=o==="slot"?Js:"";return a?`${y}<${o}${d}>${m}${y}</${o}>`:`${t}${y}<${o}${d}
278
- ${t}>${m}${y}</${o}>`}function S0(e,t,r,n,i,s=!1){if(e.$switch){let o=Je(e.$switch)?e.$switch.$ref:e.$switch,a=hn(o),c=[];for(let[h,m]of Object.entries(e.cases??{})){if(!m||Je(m))continue;c.push([h,gp(m,`${t} `,!1,n,i)])}let l=c.map(([,h])=>h),u=new Set(l.filter((h,m)=>l.indexOf(h)!==m&&h.trim()!==""));return`\${{
278
+ ${t}>${m}${y}</${o}>`}function S0(e,t,r,n,i,s=!1){if(e.$switch){let o=Je(e.$switch)?e.$switch.$ref:e.$switch,a=hn(o),c=[];for(let[h,m]of Object.entries(e.cases??{})){if(!m||Je(m))continue;c.push([h,yp(m,`${t} `,!1,n,i)])}let l=c.map(([,h])=>h),u=new Set(l.filter((h,m)=>l.indexOf(h)!==m&&h.trim()!==""));return`\${{
279
279
  ${c.map(([h,m])=>{let y=i&&u.has(m)?P0(i,m):m;return` ${JSON.stringify(h)}: html\`
280
280
  ${y}
281
281
  \``}).join(`,
282
282
  `)}
283
283
  }[${a}]}`}if(e.textContent!==void 0){let o=Il(e.textContent),a=Je(e.textContent)||T(e.textContent)&&e.textContent.includes("${");return s&&a?`${o}${Js}`:o}if(e.innerHTML!==void 0)return e.innerHTML;if(e.children)return r?Ol(e.children,e.style,"",!0,n,i,s):`
284
284
  ${Ol(e.children,e.style,`${t} `,!1,n,i,s)}
285
- ${t}`;return""}function E0(e,t){let r=Je(e.items)?hn(e.items.$ref):"ITEMS",n=e.map;if(!n)return"";let i=n.tagName??"div",s=[];if(n.attributes)for(let[m,y]of Object.entries(n.attributes))if(Je(y))s.push(`${m}="\${${hp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`${m}="${Rr(y)}"`);else s.push(`${m}="${y}"`);if(n.id)s.push(`id="${Rr(String(n.id))}"`);if(n.className)s.push(`class="${Rr(String(n.className))}"`);for(let[m,y]of Object.entries(n)){if(Mn.has(m)||m.startsWith("$")||m.startsWith("on")||m==="tagName"||m==="id"||m==="className"||m==="style"||m==="children"||m==="textContent"||m==="innerHTML"||m==="attributes")continue;if(Rl(y))s.push(`.${m}="\${${hp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`.${m}="${Rr(y)}"`);else s.push(`.${m}="\${${JSON.stringify(y)}}"`)}if(n.$props)for(let[m,y]of Object.entries(n.$props))if(Je(y))s.push(`.${m}="\${${hp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`.${m}="${Rr(y)}"`);else s.push(`.${m}="\${${JSON.stringify(y)}}"`);let o=A0(n.style);if(o)s.push(`style="${o}"`);for(let[m,y]of Object.entries(n)){if(!m.startsWith("on"))continue;let g=m.slice(2).toLowerCase();if(Je(y))s.push(`@${g}="\${(e) => { s.$map = $map; ${hn(y.$ref)}(s, e); }}"`);else if($r(y)){let b=Vt(y.$expression,{eventParam:"e",statePrefix:"s"});s.push(`@${g}="\${(e) => { s.$map = $map; ${b}; }}"`)}}let a=s.length>0?`
285
+ ${t}`;return""}function E0(e,t){let r=Je(e.items)?hn(e.items.$ref):"ITEMS",n=e.map;if(!n)return"";let i=n.tagName??"div",s=[];if(n.attributes)for(let[m,y]of Object.entries(n.attributes))if(Je(y))s.push(`${m}="\${${gp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`${m}="${Rr(y)}"`);else s.push(`${m}="${y}"`);if(n.id)s.push(`id="${Rr(String(n.id))}"`);if(n.className)s.push(`class="${Rr(String(n.className))}"`);for(let[m,y]of Object.entries(n)){if(Mn.has(m)||m.startsWith("$")||m.startsWith("on")||m==="tagName"||m==="id"||m==="className"||m==="style"||m==="children"||m==="textContent"||m==="innerHTML"||m==="attributes")continue;if(Rl(y))s.push(`.${m}="\${${gp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`.${m}="${Rr(y)}"`);else s.push(`.${m}="\${${JSON.stringify(y)}}"`)}if(n.$props)for(let[m,y]of Object.entries(n.$props))if(Je(y))s.push(`.${m}="\${${gp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`.${m}="${Rr(y)}"`);else s.push(`.${m}="\${${JSON.stringify(y)}}"`);let o=A0(n.style);if(o)s.push(`style="${o}"`);for(let[m,y]of Object.entries(n)){if(!m.startsWith("on"))continue;let g=m.slice(2).toLowerCase();if(Je(y))s.push(`@${g}="\${(e) => { s.$map = $map; ${hn(y.$ref)}(s, e); }}"`);else if($r(y)){let b=Vt(y.$expression,{eventParam:"e",statePrefix:"s"});s.push(`@${g}="\${(e) => { s.$map = $map; ${b}; }}"`)}}let a=s.length>0?`
286
286
  ${t} ${s.join(`
287
287
  ${t} `)}`:"",c=_0(),l="";if(n.textContent!==void 0)l=Il(n.textContent);else if(n.children)l=`
288
288
  ${Ol(n.children,null,`${t} `,!1,!0,c)}
289
289
  ${t} `;let u=`html\`
290
290
  ${t} <${i}${a}
291
291
  ${t} >${l}</${i}>
292
- ${t}\``,d=(u.includes("$map")?"const $map = { item, index }; ":"")+c.decls.map((m)=>`${m.trim()} `).join(""),h=d?`(item, index) => { ${d}return ${u}; }`:`(item, index) => ${u}`;return`${t}\${${r}.map(${h})}`}function Rl(e){return Je(e)&&e.$ref!==""}function hn(e){if(e.startsWith("#/state/"))return Ie("s",e.slice(8));if(e.startsWith("$map/"))return k0(e.slice(5));if(e.startsWith("parent#/"))return Ie("s",e.slice(8));if(e.startsWith("window#/"))return Ie("window",e.slice(8));if(e.startsWith("document#/"))return Ie("document",e.slice(10));return Ie("s",e)}function k0(e){let[t,...r]=ai(e);return Ie(t??"",r.map((n)=>Ct(n)).join("/"))}function hp(e){if(e.startsWith("$map/"))return k0(e.slice(5));return hn(e)}function Rr(e){return e.replaceAll("state.","s.")}function eD(e){return e.startsWith("${")&&e.endsWith("}")&&!e.slice(2).includes("${")}function Il(e){if(Je(e))return`\${${hn(e.$ref)}}`;if(T(e)&&e.includes("${"))return Rr(e);return String(e)}function tD(e){if(Zn(e))return Lr(e.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let t=T(e.body)?e.body:"",r=e.parameters?Rn(e.parameters):e.arguments??[];if(r.length>0){let n=r.map((i)=>i==="state"?"s":"e").join(", ");return`((${r.join(", ")}) => { ${t} })(${n});`}return t.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function A0(e){if(!J(e))return"";let t=[];for(let[r,n]of Object.entries(e)){if(r.startsWith(":")||r.startsWith(".")||r.startsWith("&")||r.startsWith("[")||r.startsWith("@"))continue;if(T(n)&&n.includes("${")){let i=ar(r);t.push(`${i}: ${Rr(n)}`)}}return t.join("; ")}var w0;var wa=L(()=>{Os();mn();Ee();vr();ks();w0=new Set(["onMount","onUnmount","onAdopted"])});function j0(e,t){let{title:r="Jx App",reactivitySrc:n,litHtmlSrc:i}=t,s=Ms(e,null,e.state??{},e.$media??{}),o=Fs(e,e.$media??{},t.projectStyle??null),a=[],c=R0(e,!1,s,a),l=[],u="",d="";if(a.length>0){for(let y of a){let g=va(y.def,y.className,[],t.rewriteSrc);l.push({content:g,path:`_islands/${y.tagName}.js`,tagName:y.tagName})}u=`<script type="importmap">
292
+ ${t}\``,d=(u.includes("$map")?"const $map = { item, index }; ":"")+c.decls.map((m)=>`${m.trim()} `).join(""),h=d?`(item, index) => { ${d}return ${u}; }`:`(item, index) => ${u}`;return`${t}\${${r}.map(${h})}`}function Rl(e){return Je(e)&&e.$ref!==""}function hn(e){if(e.startsWith("#/state/"))return Ie("s",e.slice(8));if(e.startsWith("$map/"))return k0(e.slice(5));if(e.startsWith("parent#/"))return Ie("s",e.slice(8));if(e.startsWith("window#/"))return Ie("window",e.slice(8));if(e.startsWith("document#/"))return Ie("document",e.slice(10));return Ie("s",e)}function k0(e){let[t,...r]=ai(e);return Ie(t??"",r.map((n)=>Ct(n)).join("/"))}function gp(e){if(e.startsWith("$map/"))return k0(e.slice(5));return hn(e)}function Rr(e){return e.replaceAll("state.","s.")}function nD(e){return e.startsWith("${")&&e.endsWith("}")&&!e.slice(2).includes("${")}function Il(e){if(Je(e))return`\${${hn(e.$ref)}}`;if(T(e)&&e.includes("${"))return Rr(e);return String(e)}function iD(e){if(Zn(e))return Lr(e.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let t=T(e.body)?e.body:"",r=e.parameters?Rn(e.parameters):e.arguments??[];if(r.length>0){let n=r.map((i)=>i==="state"?"s":"e").join(", ");return`((${r.join(", ")}) => { ${t} })(${n});`}return t.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function A0(e){if(!J(e))return"";let t=[];for(let[r,n]of Object.entries(e)){if(r.startsWith(":")||r.startsWith(".")||r.startsWith("&")||r.startsWith("[")||r.startsWith("@"))continue;if(T(n)&&n.includes("${")){let i=ar(r);t.push(`${i}: ${Rr(n)}`)}}return t.join("; ")}var w0;var wa=L(()=>{Os();mn();Ee();vr();ks();w0=new Set(["onMount","onUnmount","onAdopted"])});function j0(e,t){let{title:r="Jx App",reactivitySrc:n,litHtmlSrc:i}=t,s=Ms(e,null,e.state??{},e.$media??{}),o=Fs(e,e.$media??{},t.projectStyle??null),a=[],c=R0(e,!1,s,a),l=[],u="",d="";if(a.length>0){for(let y of a){let g=va(y.def,y.className,[],t.rewriteSrc);l.push({content:g,path:`_islands/${y.tagName}.js`,tagName:y.tagName})}u=`<script type="importmap">
293
293
  {
294
294
  "imports": {
295
295
  "@vue/reactivity": "${n}",
@@ -311,10 +311,10 @@ ${t}\``,d=(u.includes("$map")?"const $map = { item, index }; ":"")+c.decls.map((
311
311
  ${c}
312
312
  ${d}
313
313
  </body>
314
- </html>`;return{files:l,html:m}}function R0(e,t,r,n){if(T(e))return Se(e);if(Ir(e)||Rt(e))return Se(String(e));if(!J(e))return"";let i=Ms(e,r.scope,e.state??r.scopeDefs,e.$media??r.media);if(t){let l=n.length,u=`jx-island-${l}`,d=`JxIsland${l}`,h={...e,tagName:u};return n.push({className:d,def:h,tagName:u}),`<${u}></${u}>`}let s=td(e.tagName,i.scope),o=Xi(e,i.scope);if(ed.has(s))return`<${s}${o}>`;let a=r.preformatted===!0||ui.has(s),c=rD(e,{...i,preformatted:a},n);return`<${s}${o}>${c}</${s}>`}function rD(e,t,r){if(e.textContent!==void 0){let n=Be(e.textContent,t.scope);return n==null?"":Se(String(n))}if(e.innerHTML){let n=Be(e.innerHTML,t.scope);return n==null?e.innerHTML:String(n)}if(Array.isArray(e.children))return e.children.map((n)=>R0(n,$b(n),t,r)).join(oa(t.preformatted));return""}var O0=L(()=>{mn();wa();Ee()});function xp(e,t){let{title:r="Jx App",reactivitySrc:n=Ts,litHtmlSrc:i=Ns,modulePath:s="app.js"}=t,o=Ms(e,null,e.state??{},e.$media??{}),a=Fs(e,e.$media??{},t.projectStyle??null),c={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},l=new Map,u=new Map,d=[],h=[],m=[],y=[],g=[],b=new Map,x=e.state??{};for(let[R,j]of Object.entries(x)){if(!J(j)||Array.isArray(j)){if(he(j))h.push([R,`() => ${Zc(j)}`]);else d.push([R,j]);continue}if($r(j)){let D=j.$expression,F=Vt(D,{eventParam:"e",statePrefix:"state"});if(Ni(j))g.push(`state[${JSON.stringify(R)}] = ${sa(j,F)};`);else if(Nn(D.operator))y.push([R,{args:["state","e"],body:F}]);else h.push([R,`() => ${F}`]);continue}if(xr(j)){let D=j.parameters?Rn(j.parameters):j.arguments,{body:F}=j;if(Array.isArray(F)){let N=Lr(F,{eventParam:"e",statePrefix:"state"});if(j.parameters&&j.parameters.length>0)g.push(`state[${JSON.stringify(R)}] = ${sa(j,`(() => {
314
+ </html>`;return{files:l,html:m}}function R0(e,t,r,n){if(T(e))return Se(e);if(Ir(e)||Rt(e))return Se(String(e));if(!J(e))return"";let i=Ms(e,r.scope,e.state??r.scopeDefs,e.$media??r.media);if(t){let l=n.length,u=`jx-island-${l}`,d=`JxIsland${l}`,h={...e,tagName:u};return n.push({className:d,def:h,tagName:u}),`<${u}></${u}>`}let s=rd(e.tagName,i.scope),o=Xi(e,i.scope);if(td.has(s))return`<${s}${o}>`;let a=r.preformatted===!0||ui.has(s),c=sD(e,{...i,preformatted:a},n);return`<${s}${o}>${c}</${s}>`}function sD(e,t,r){if(e.textContent!==void 0){let n=Be(e.textContent,t.scope);return n==null?"":Se(String(n))}if(e.innerHTML){let n=Be(e.innerHTML,t.scope);return n==null?e.innerHTML:String(n)}if(Array.isArray(e.children))return e.children.map((n)=>R0(n,$b(n),t,r)).join(oa(t.preformatted));return""}var O0=L(()=>{mn();wa();Ee()});function $p(e,t){let{title:r="Jx App",reactivitySrc:n=Ts,litHtmlSrc:i=Ns,modulePath:s="app.js"}=t,o=Ms(e,null,e.state??{},e.$media??{}),a=Fs(e,e.$media??{},t.projectStyle??null),c={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},l=new Map,u=new Map,d=[],h=[],m=[],y=[],g=[],b=new Map,x=e.state??{};for(let[R,j]of Object.entries(x)){if(!J(j)||Array.isArray(j)){if(he(j))h.push([R,`() => ${Zc(j)}`]);else d.push([R,j]);continue}if($r(j)){let D=j.$expression,F=Vt(D,{eventParam:"e",statePrefix:"state"});if(Ni(j))g.push(`state[${JSON.stringify(R)}] = ${sa(j,F)};`);else if(Nn(D.operator))y.push([R,{args:["state","e"],body:F}]);else h.push([R,`() => ${F}`]);continue}if(xr(j)){let D=j.parameters?Rn(j.parameters):j.arguments,{body:F}=j;if(Array.isArray(F)){let N=Lr(F,{eventParam:"e",statePrefix:"state"});if(j.parameters&&j.parameters.length>0)g.push(`state[${JSON.stringify(R)}] = ${sa(j,`(() => {
315
315
  ${N}
316
- })()`)};`);else y.push([R,{args:["state","e"],body:N}])}else if(j.$src){let N=b.get(j.$src);if(!N)N=new Set,b.set(j.$src,N);N.add(Yc(R,j)),h.push([R,`() => { return ${R}(state); }`])}else if(T(F)&&Mi(F))h.push([R,`() => { ${F} }`]);else y.push([R,{args:D??["state"],body:F}]);continue}if(ei(j))continue;if(wg(j)){d.push([R,j.default]);continue}if(un(j)){if(j.$prototype==="LocalStorage"||j.$prototype==="SessionStorage"){let D=j.$prototype==="LocalStorage"?"localStorage":"sessionStorage",F=j.key??R,N=j.default??null;d.push([R,null]),g.push(iD(R,D,F,N));continue}if(j.$prototype==="Request"){d.push([R,null]),g.push(Xc(R,j));continue}if(j.$prototype==="Cookie"){d.push([R,null]),g.push(sD(R,j.name??R,j.default??null));continue}}d.push([R,j])}let _=C0(e,o,l,u,c);for(let[R,j]of l)if(!m.some(([D])=>D===R))m.push([R,j]);for(let[R,j]of u)if(!y.some(([D])=>D===R))y.push([R,j]);let k=nD(d,h,m,y,g,b,c,n,t.rewriteSrc),E=[` "@vue/reactivity": "${n}"`,` "lit-html": "${i}"`],w=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((R)=>Wr(String(R))!==null)?`<script>${Ls()}</script>
317
- `:"",P=`<!DOCTYPE html>
316
+ })()`)};`);else y.push([R,{args:["state","e"],body:N}])}else if(j.$src){let N=b.get(j.$src);if(!N)N=new Set,b.set(j.$src,N);N.add(Yc(R,j)),h.push([R,`() => { return ${R}(state); }`])}else if(T(F)&&Mi(F))h.push([R,`() => { ${F} }`]);else y.push([R,{args:D??["state"],body:F}]);continue}if(ei(j))continue;if(wg(j)){d.push([R,j.default]);continue}if(un(j)){if(j.$prototype==="LocalStorage"||j.$prototype==="SessionStorage"){let D=j.$prototype==="LocalStorage"?"localStorage":"sessionStorage",F=j.key??R,N=j.default??null;d.push([R,null]),g.push(aD(R,D,F,N));continue}if(j.$prototype==="Request"){d.push([R,null]),g.push(Xc(R,j));continue}if(j.$prototype==="Cookie"){d.push([R,null]),g.push(cD(R,j.name??R,j.default??null));continue}}d.push([R,j])}let _=C0(e,o,l,u,c);for(let[R,j]of l)if(!m.some(([D])=>D===R))m.push([R,j]);for(let[R,j]of u)if(!y.some(([D])=>D===R))y.push([R,j]);let P=oD(d,h,m,y,g,b,c,n,t.rewriteSrc),E=[` "@vue/reactivity": "${n}"`,` "lit-html": "${i}"`],w=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((R)=>Wr(String(R))!==null)?`<script>${Ls()}</script>
317
+ `:"",k=`<!DOCTYPE html>
318
318
  <html lang="en">
319
319
  <head>
320
320
  <meta charset="utf-8">
@@ -334,19 +334,19 @@ ${E.join(`,
334
334
  <body>
335
335
  ${_}
336
336
  </body>
337
- </html>`;return{files:[{content:k,path:s}],html:P}}function C0(e,t,r,n,i){if(T(e))return Se(e);if(Ir(e)||Rt(e))return Se(String(e));if(!J(e))return"";let s=Ms(e,t.scope,e.state??t.scopeDefs,e.$media??t.media);if(fn(e.tagName))throw Error(`A tag chosen at creation is not supported on a dynamic page yet (candidates: ${$s(e.tagName).join(", ")}). Move the element into a component, or give it a literal tagName.`);let o=e.tagName??"div";s.preformatted=t.preformatted===!0||ui.has(o);let a=[],c=!1;if(e.textContent!==void 0){let g=e.textContent;if(cr(g)){let b=Bn(g.$ref);a.push(`:text-content="${b}"`),yp(r,b,g.$ref),c=!0}else if(he(g)){let b=`_t${i.t}`;i.t+=1,a.push(`:text-content="${b}"`),r.set(b,`() => \`${g}\``),c=!0}}for(let[g,b]of Object.entries(e)){if(!g.startsWith("on")||g==="observedAttributes")continue;let x=g.slice(2).toLowerCase();if(cr(b)){let _=Bn(b.$ref);a.push(`@${x}="${_}"`),c=!0}else if(xr(b)){let _=`_h${i.h}`;i.h+=1,a.push(`@${x}="${_}"`);let{body:k}=b;n.set(_,Array.isArray(k)?{args:["state","e"],body:Lr(k,{eventParam:"e",statePrefix:"state"})}:{args:b.parameters?Rn(b.parameters):b.arguments??["state","event"],body:k}),c=!0}else if($r(b)){let _=`_h${i.h}`;i.h+=1,a.push(`@${x}="${_}"`);let k=Vt(b.$expression,{eventParam:"e",statePrefix:"state"});n.set(_,{args:["state","e"],body:k}),c=!0}}if(J(e.style))for(let[g,b]of Object.entries(e.style)){if(g.startsWith(":")||g.startsWith(".")||g.startsWith("&")||g.startsWith("[")||g.startsWith("@"))continue;if(T0(b))continue;if(he(b)){let x=`_s${i.s}`;i.s+=1,a.push(`:style.${ar(g)}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}if(J(e.attributes)){for(let[g,b]of Object.entries(e.attributes))if(cr(b)){let x=Bn(b.$ref);a.push(`:attr.${g}="${x}"`),yp(r,x,b.$ref),c=!0}else if(he(b)){let x=`_t${i.t}`;i.t+=1,a.push(`:attr.${g}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}for(let[g,b]of Object.entries(e)){if(Mn.has(g)||g.startsWith("on")||g.startsWith("$")||g==="tagName"||g==="id"||g==="className"||g==="style"||g==="children"||g==="textContent"||g==="innerHTML"||g==="attributes")continue;if(cr(b)){let x=Bn(b.$ref);a.push(`:${ar(g)}="${x}"`),yp(r,x,b.$ref),c=!0}else if(he(b)){let x=`_t${i.t}`;i.t+=1,a.push(`:${ar(g)}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}let l=Xi(e,s.scope),u=c?" data-bind":"",d=a.length>0?` ${a.join(" ")}`:"",h="",m=e;if(m.$switch){i.needsLit=!0;let g=`_sw${i.sw}`;i.sw+=1;let b=cr(m.$switch)?`state.${Bn(m.$switch.$ref)}`:`\`${String(m.$switch)}\``,x=m.cases??{},_=Object.entries(x).filter(([,E])=>E&&!cr(E)).map(([E,w])=>`${JSON.stringify(E)}: html\`${bp(w,s.preformatted)}\``);r.set(g,`() => ({${_.join(", ")}})[String(${b})] ?? html\`\``),a.push(`:render="${g}"`);let k=` ${a.join(" ")}`;return`<${o}${l} data-bind${k}></${o}>`}if(m.textContent!==void 0&&!c){let g=Be(m.textContent,s.scope);h=g==null?"":Se(String(g))}else if(m.textContent!==void 0&&c){let g=Be(m.textContent,s.scope);h=g==null?"":Se(String(g))}else if(m.innerHTML){let g=Be(m.innerHTML,s.scope);h=g==null?m.innerHTML:String(g)}else if(lt(m.children)){i.needsLit=!0;let g=`_list${i.l}`;i.l+=1;let b=m.children,x;if(cr(b.items))x=`state.${Bn(b.items.$ref)}`;else x=JSON.stringify(b.items);let _=$p(b.map);r.set(g,`() => (${x} ?? []).map((item, index) => html\`${_}\`)`),a.push(`:render="${g}"`),c=!0;let k=" data-bind",E=` ${a.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${l}${k}${E}>`;return`<${o}${l}${k}${E}></${o}>`}else if(Array.isArray(m.children)&&m.children.some((g)=>lt(g))){i.needsLit=!0;let g=`_children${i.l}`;i.l+=1;let b=m.children.map((_)=>bp(_,s.preformatted)).join(oa(s.preformatted," "));r.set(g,s.preformatted?`() => html\`${b}\``:`() => html\`
337
+ </html>`;return{files:[{content:P,path:s}],html:k}}function C0(e,t,r,n,i){if(T(e))return Se(e);if(Ir(e)||Rt(e))return Se(String(e));if(!J(e))return"";let s=Ms(e,t.scope,e.state??t.scopeDefs,e.$media??t.media);if(fn(e.tagName))throw Error(`A tag chosen at creation is not supported on a dynamic page yet (candidates: ${$s(e.tagName).join(", ")}). Move the element into a component, or give it a literal tagName.`);let o=e.tagName??"div";s.preformatted=t.preformatted===!0||ui.has(o);let a=[],c=!1;if(e.textContent!==void 0){let g=e.textContent;if(cr(g)){let b=Bn(g.$ref);a.push(`:text-content="${b}"`),bp(r,b,g.$ref),c=!0}else if(he(g)){let b=`_t${i.t}`;i.t+=1,a.push(`:text-content="${b}"`),r.set(b,`() => \`${g}\``),c=!0}}for(let[g,b]of Object.entries(e)){if(!g.startsWith("on")||g==="observedAttributes")continue;let x=g.slice(2).toLowerCase();if(cr(b)){let _=Bn(b.$ref);a.push(`@${x}="${_}"`),c=!0}else if(xr(b)){let _=`_h${i.h}`;i.h+=1,a.push(`@${x}="${_}"`);let{body:P}=b;n.set(_,Array.isArray(P)?{args:["state","e"],body:Lr(P,{eventParam:"e",statePrefix:"state"})}:{args:b.parameters?Rn(b.parameters):b.arguments??["state","event"],body:P}),c=!0}else if($r(b)){let _=`_h${i.h}`;i.h+=1,a.push(`@${x}="${_}"`);let P=Vt(b.$expression,{eventParam:"e",statePrefix:"state"});n.set(_,{args:["state","e"],body:P}),c=!0}}if(J(e.style))for(let[g,b]of Object.entries(e.style)){if(g.startsWith(":")||g.startsWith(".")||g.startsWith("&")||g.startsWith("[")||g.startsWith("@"))continue;if(T0(b))continue;if(he(b)){let x=`_s${i.s}`;i.s+=1,a.push(`:style.${ar(g)}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}if(J(e.attributes)){for(let[g,b]of Object.entries(e.attributes))if(cr(b)){let x=Bn(b.$ref);a.push(`:attr.${g}="${x}"`),bp(r,x,b.$ref),c=!0}else if(he(b)){let x=`_t${i.t}`;i.t+=1,a.push(`:attr.${g}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}for(let[g,b]of Object.entries(e)){if(Mn.has(g)||g.startsWith("on")||g.startsWith("$")||g==="tagName"||g==="id"||g==="className"||g==="style"||g==="children"||g==="textContent"||g==="innerHTML"||g==="attributes")continue;if(cr(b)){let x=Bn(b.$ref);a.push(`:${ar(g)}="${x}"`),bp(r,x,b.$ref),c=!0}else if(he(b)){let x=`_t${i.t}`;i.t+=1,a.push(`:${ar(g)}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}let l=Xi(e,s.scope),u=c?" data-bind":"",d=a.length>0?` ${a.join(" ")}`:"",h="",m=e;if(m.$switch){i.needsLit=!0;let g=`_sw${i.sw}`;i.sw+=1;let b=cr(m.$switch)?`state.${Bn(m.$switch.$ref)}`:`\`${String(m.$switch)}\``,x=m.cases??{},_=Object.entries(x).filter(([,E])=>E&&!cr(E)).map(([E,w])=>`${JSON.stringify(E)}: html\`${xp(w,s.preformatted)}\``);r.set(g,`() => ({${_.join(", ")}})[String(${b})] ?? html\`\``),a.push(`:render="${g}"`);let P=` ${a.join(" ")}`;return`<${o}${l} data-bind${P}></${o}>`}if(m.textContent!==void 0&&!c){let g=Be(m.textContent,s.scope);h=g==null?"":Se(String(g))}else if(m.textContent!==void 0&&c){let g=Be(m.textContent,s.scope);h=g==null?"":Se(String(g))}else if(m.innerHTML){let g=Be(m.innerHTML,s.scope);h=g==null?m.innerHTML:String(g)}else if(lt(m.children)){i.needsLit=!0;let g=`_list${i.l}`;i.l+=1;let b=m.children,x;if(cr(b.items))x=`state.${Bn(b.items.$ref)}`;else x=JSON.stringify(b.items);let _=vp(b.map);r.set(g,`() => (${x} ?? []).map((item, index) => html\`${_}\`)`),a.push(`:render="${g}"`),c=!0;let P=" data-bind",E=` ${a.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${l}${P}${E}>`;return`<${o}${l}${P}${E}></${o}>`}else if(Array.isArray(m.children)&&m.children.some((g)=>lt(g))){i.needsLit=!0;let g=`_children${i.l}`;i.l+=1;let b=m.children.map((_)=>xp(_,s.preformatted)).join(oa(s.preformatted," "));r.set(g,s.preformatted?`() => html\`${b}\``:`() => html\`
338
338
  ${b}
339
- \``),a.push(`:render="${g}"`),c=!0;let x=` ${a.join(" ")}`;return`<${o}${l} data-bind${x}></${o}>`}else if(Array.isArray(m.children))h=m.children.map((g)=>C0(g,s,r,n,i)).join(oa(s.preformatted));if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${l}${u}${d}>`;return`<${o}${l}${u}${d}>${h}</${o}>`}function $p(e,t=!1){if(!e)return"";if(fn(e.tagName))throw Error(`A tag chosen at creation is not supported inside a dynamic page's repeater yet (candidates: ${$s(e.tagName).join(", ")}). Move the item into a component, or give it a literal tagName.`);let r=e.tagName??"div",n=t||ui.has(r),i="";if(e.id)i+=` id="${e.id}"`;if(e.className)i+=` class="${mi(e.className)}"`;if(J(e.$props))for(let[c,l]of Object.entries(e.$props))if(cr(l))i+=` .${c}="\${${oD(l.$ref)}}"`;else if(he(l))i+=` .${c}="${mi(l)}"`;else i+=` .${c}="\${${JSON.stringify(l)}}"`;if(J(e.attributes))for(let[c,l]of Object.entries(e.attributes)){if(he(l)){i+=` ${c}="${mi(l)}"`;continue}if(Rt(l)){let u=Gi(c,l);if(u!==null)i+=u===""?` ${c}`:` ${c}="${Se(u)}"`;continue}i+=` ${c}="${Se(String(l))}"`}if(J(e.style)){let c=[];for(let[l,u]of Object.entries(e.style)){if(l.startsWith(":")||l.startsWith(".")||l.startsWith("&")||l.startsWith("[")||l.startsWith("@"))continue;if(T0(u))continue;let d=ar(l);if(he(String(u)))c.push(`${d}: ${mi(String(u))}`);else c.push(`${d}: ${u}`)}if(c.length>0)i+=` style="${c.join("; ")}"`}for(let[c,l]of Object.entries(e)){if(!c.startsWith("on")||c==="observedAttributes")continue;let u=c.slice(2).toLowerCase();if(cr(l)){let d=Bn(l.$ref);i+=` @${u}=\${(e) => { state.$map = { item, index }; on.${d}(e); }}`}else if(Zn(l)){let d=Lr(l.body,{eventParam:"e",statePrefix:"state"});i+=` @${u}=\${(e) => { state.$map = { item, index }; ${d} }}`}else if(xr(l)){let d=mi(l.body);i+=` @${u}=\${(e) => { ${d} }}`}else if(J(l)&&"$expression"in l){let d=Vt(l.$expression,{eventParam:"e",statePrefix:"state"});i+=` @${u}=\${(e) => { state.$map = { item, index }; ${d}; }}`}}if(e.contentEditable)i+=` contenteditable="${e.contentEditable}"`;let s=r.includes("-")?Js:"",o="";if(e.textContent!==void 0){let c=String(e.textContent);if(he(c))o=`${mi(c)}${s}`;else if(cr(e.textContent))o=`\${state.${Bn(e.textContent.$ref)}}${s}`;else o=Se(c)}else if(e.innerHTML)o=mi(String(e.innerHTML));else if(lt(e.children))o=`
339
+ \``),a.push(`:render="${g}"`),c=!0;let x=` ${a.join(" ")}`;return`<${o}${l} data-bind${x}></${o}>`}else if(Array.isArray(m.children))h=m.children.map((g)=>C0(g,s,r,n,i)).join(oa(s.preformatted));if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${l}${u}${d}>`;return`<${o}${l}${u}${d}>${h}</${o}>`}function vp(e,t=!1){if(!e)return"";if(fn(e.tagName))throw Error(`A tag chosen at creation is not supported inside a dynamic page's repeater yet (candidates: ${$s(e.tagName).join(", ")}). Move the item into a component, or give it a literal tagName.`);let r=e.tagName??"div",n=t||ui.has(r),i="";if(e.id)i+=` id="${e.id}"`;if(e.className)i+=` class="${mi(e.className)}"`;if(J(e.$props))for(let[c,l]of Object.entries(e.$props))if(cr(l))i+=` .${c}="\${${lD(l.$ref)}}"`;else if(he(l))i+=` .${c}="${mi(l)}"`;else i+=` .${c}="\${${JSON.stringify(l)}}"`;if(J(e.attributes))for(let[c,l]of Object.entries(e.attributes)){if(he(l)){i+=` ${c}="${mi(l)}"`;continue}if(Rt(l)){let u=Gi(c,l);if(u!==null)i+=u===""?` ${c}`:` ${c}="${Se(u)}"`;continue}i+=` ${c}="${Se(String(l))}"`}if(J(e.style)){let c=[];for(let[l,u]of Object.entries(e.style)){if(l.startsWith(":")||l.startsWith(".")||l.startsWith("&")||l.startsWith("[")||l.startsWith("@"))continue;if(T0(u))continue;let d=ar(l);if(he(String(u)))c.push(`${d}: ${mi(String(u))}`);else c.push(`${d}: ${u}`)}if(c.length>0)i+=` style="${c.join("; ")}"`}for(let[c,l]of Object.entries(e)){if(!c.startsWith("on")||c==="observedAttributes")continue;let u=c.slice(2).toLowerCase();if(cr(l)){let d=Bn(l.$ref);i+=` @${u}=\${(e) => { state.$map = { item, index }; on.${d}(e); }}`}else if(Zn(l)){let d=Lr(l.body,{eventParam:"e",statePrefix:"state"});i+=` @${u}=\${(e) => { state.$map = { item, index }; ${d} }}`}else if(xr(l)){let d=mi(l.body);i+=` @${u}=\${(e) => { ${d} }}`}else if(J(l)&&"$expression"in l){let d=Vt(l.$expression,{eventParam:"e",statePrefix:"state"});i+=` @${u}=\${(e) => { state.$map = { item, index }; ${d}; }}`}}if(e.contentEditable)i+=` contenteditable="${e.contentEditable}"`;let s=r.includes("-")?Js:"",o="";if(e.textContent!==void 0){let c=String(e.textContent);if(he(c))o=`${mi(c)}${s}`;else if(cr(e.textContent))o=`\${state.${Bn(e.textContent.$ref)}}${s}`;else o=Se(c)}else if(e.innerHTML)o=mi(String(e.innerHTML));else if(lt(e.children))o=`
340
340
  ${I0(e.children)}${s}
341
- `;else if(Array.isArray(e.children)){let c=e.children.map((l)=>{let u=bp(l,n);return lt(l)||T(l)&&he(l)?`${u}${s}`:u});o=n?c.join(""):`
341
+ `;else if(Array.isArray(e.children)){let c=e.children.map((l)=>{let u=xp(l,n);return lt(l)||T(l)&&he(l)?`${u}${s}`:u});o=n?c.join(""):`
342
342
  ${c.join(`
343
343
  `)}
344
- `}if(new Set(["input","br","hr","img","meta","link"]).has(r))return`<${r}${i}>`;return`<${r}${i}>${o}</${r}>`}function bp(e,t=!1){if(T(e))return he(e)?mi(e):Se(e);if(Ir(e)||Rt(e))return Se(String(e));if(lt(e))return I0(e);return $p(e,t)}function I0(e){let{items:t}=e,r=cr(t)?`state.${Bn(t.$ref)}`:JSON.stringify(t??[]),n=$p(e.map);return`\${(${r} ?? []).map((item, index) => html\`${n}\`)}`}function mi(e){return e.replaceAll("$map.","")}function nD(e,t,r,n,i,s,o,a,c){let l=[],{needsLit:u}=o,d=t.length>0;l.push("// Generated by @jxsuite/compiler — do not edit manually");let h=["reactive","effect"];if(d)h.push("computed");if(l.push(`import { ${h.join(", ")} } from '@vue/reactivity';`),u)l.push("import { html, render } from 'lit-html';");for(let[m,y]of s){let g=c?c(m):m;l.push(`import { ${[...y].join(", ")} } from '${g}';`)}l.push("",el(),"","const state = reactive({");for(let[m,y]of e)l.push(` ${Ps(m)}: ${JSON.stringify(y)},`);if(l.push("});",""),i.length>0){for(let m of i)l.push(m);l.push("")}if(t.length>0){for(let[m,y]of t)l.push(`${Ie("state",Ct(m))} = computed(${y});`);l.push("")}if(r.length>0){l.push("const bind = {");for(let[m,y]of r)l.push(` ${Ps(m)}: ${y},`);l.push("};")}else l.push("const bind = {};");if(l.push(""),n.length>0){l.push("const on = {");for(let[m,y]of n){let g=y.args??["state"],b=g.map((x)=>x==="state"?"state":"e").join(", ");l.push(` ${Ps(m)}: (e) => { const fn = (${g.join(", ")}) => { ${y.body} }; fn(${b}); },`)}l.push("};")}else l.push("const on = {};");if(l.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),u)l.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else l.push(" if (parts[0] === 'style' && parts.length > 1) {");return l.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => {",` const _t = ${Ds}(parts[1], bind[key]());`," if (_t === null) { el.removeAttribute(parts[1]); }"," else { el.setAttribute(parts[1], _t); }"," });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),l.join(`
345
- `)}function iD(e,t,r,n){return[`// ${e}: ${t} (key: "${r}")`,"try {",` const _s = ${t}.getItem(${JSON.stringify(r)});`,` state.${e} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(n)};`,`} catch { state.${e} = ${JSON.stringify(n)}; }`,"effect(() => {",` const v = state.${e};`," try {",` if (v === null) ${t}.removeItem(${JSON.stringify(r)});`,` else ${t}.setItem(${JSON.stringify(r)}, JSON.stringify(v));`," } catch {}","});"].join(`
346
- `)}function sD(e,t,r){return[`// ${e}: Cookie (name: "${t}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${t}=([^;]*)"));`,` try { state.${e} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(r)}; }`,` catch { state.${e} = _m ? _m[1] : ${JSON.stringify(r)}; }`,"}"].join(`
347
- `)}function T0(e){return e===null||J(e)}function oD(e){if(e.startsWith("$map/")){let[t,...r]=ai(e.slice(5));return Ie(t??"",r.map((n)=>Ct(n)).join("/"))}if(e.startsWith("#/state/"))return Ie("state",e.slice(8));return Ie("state",e)}function Bn(e){return eb(e.startsWith("#/state/")?e.slice(8):e)}function yp(e,t,r){if(e.has(t))return;e.set(t,`() => ${Ie("state",r.startsWith("#/state/")?r.slice(8):r)}`)}var vp=L(()=>{Os();mn();Ee();ks()});function M0(e){let t=e.title;if(!t)throw Error("compileClassJson: missing title (class name)");let r=cD(e.extends),n=e.$defs,i=n?.fields??{},s=n?.constructor,o=aD(s)?s:void 0,a=n?.methods??{},c=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(e.$id)c.push(`// Source: ${e.$id}`);c.push("");let l=r!=="Object"?` extends ${r}`:"";c.push(`class ${t}${l} {`);for(let[u,d]of Object.entries(i)){if(d.scope!=="static")continue;let h=d.identifier??u,m=d.access==="private"?"#":"",y=d.initializer!==void 0?JSON.stringify(d.initializer):d.default!==void 0?JSON.stringify(d.default):"null";c.push(` static ${m}${h} = ${y};`)}for(let[u,d]of Object.entries(i)){if(d.scope==="static")continue;if(d.access!=="private")continue;let h=d.identifier??u;c.push(` #${h};`)}if(Object.keys(i).length>0)c.push("");if(c.push(" constructor(config = {}) {"),o?.superCall||r!=="Object"){let u=o?.superCall?.arguments?o.superCall.arguments.join(", "):"";c.push(` super(${u});`)}for(let[u,d]of Object.entries(i)){if(d.scope==="static")continue;let h=d.identifier??u,m=d.access==="private"?"#":"",y=d.initializer!==void 0?JSON.stringify(d.initializer):d.default!==void 0?JSON.stringify(d.default):"null";c.push(` this.${m}${h} = config.${h} !== undefined ? config.${h} : ${y};`)}if(o?.body){let u=Array.isArray(o.body)?o.body:[o.body];for(let d of u)c.push(` ${d}`)}c.push(" }");for(let[u,d]of Object.entries(a)){let h=d.identifier??u,m=d.scope==="static",g=d.access==="private"?"#":"",b=m?"static ":"",x=d.returnType?.$ref?.includes("Promise")||uD(d)?"async ":"",_=N0(d.parameters??[]),k=lD(d.body);if(c.push(""),d.role==="accessor"){if(d.getter)c.push(` ${b}get ${g}${h}() {`,` ${d.getter.body}`," }");if(d.setter){let E=N0(d.setter.parameters??[]);c.push(` ${b}set ${g}${h}(${E}) {`,` ${d.setter.body}`," }")}}else{c.push(` ${b}${x}${g}${h}(${_}) {`);for(let E of k)c.push(` ${E}`);c.push(" }")}}return c.push("}","",`export { ${t} };`,`export default ${t};`,""),c.join(`
348
- `)}function aD(e){return typeof e==="object"}function cD(e){if(!e)return"Object";if(T(e))return e;if(e.$ref){let t=e.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return t?t[1]:"Object"}return"Object"}function N0(e){return e.map((t)=>{if(t.$ref)return t.$ref.split("/").pop();let r=t.identifier??t.name;return T(r)?r:"arg"}).join(", ")}function lD(e){if(!e)return[""];return Array.isArray(e)?e:[e]}function uD(e){return(Array.isArray(e.body)?e.body.join(`
349
- `):e.body??"").includes("await ")}var L0=L(()=>{Ee()});import{readFileSync as fD}from"node:fs";async function wp(e,t={}){let{title:r="Jx App",reactivitySrc:n=Ts,litHtmlSrc:i=Ns,projectStyle:s=null}=t,o;if(T(e)){let a=fD(e,"utf8");if(e.endsWith(".json"))o=ti(a,e);else{let{extname:c}=await import("node:path"),l=c(e).toLowerCase(),u=t.formats?.byExtension(l,"parse");if(!u){await Promise.resolve().then(() => On());throw _c(e,l)}o=await u.parseDocument(a)}}else o=e;if(Eg(o)){await Promise.resolve().then(() => L0());let c=M0(o),l=T(e)?e.replace(/\.class\.json$/,".js"):`${o.title}.js`;return{files:[{content:c,path:l}],html:""}}if(!Qc(o))return j0(o,{litHtmlSrc:i,projectStyle:s,reactivitySrc:n,...D0(t),title:r});if(o.tagName&&o.tagName.includes("-")){let{tagName:a}=o,c=rl(a),u={content:va(o,c,[],t.rewriteSrc),path:`${a}.js`,tagName:a},d=Fs(o,o.$media??{},s),h=`<!DOCTYPE html>
344
+ `}if(new Set(["input","br","hr","img","meta","link"]).has(r))return`<${r}${i}>`;return`<${r}${i}>${o}</${r}>`}function xp(e,t=!1){if(T(e))return he(e)?mi(e):Se(e);if(Ir(e)||Rt(e))return Se(String(e));if(lt(e))return I0(e);return vp(e,t)}function I0(e){let{items:t}=e,r=cr(t)?`state.${Bn(t.$ref)}`:JSON.stringify(t??[]),n=vp(e.map);return`\${(${r} ?? []).map((item, index) => html\`${n}\`)}`}function mi(e){return e.replaceAll("$map.","")}function oD(e,t,r,n,i,s,o,a,c){let l=[],{needsLit:u}=o,d=t.length>0;l.push("// Generated by @jxsuite/compiler — do not edit manually");let h=["reactive","effect"];if(d)h.push("computed");if(l.push(`import { ${h.join(", ")} } from '@vue/reactivity';`),u)l.push("import { html, render } from 'lit-html';");for(let[m,y]of s){let g=c?c(m):m;l.push(`import { ${[...y].join(", ")} } from '${g}';`)}l.push("",el(),"","const state = reactive({");for(let[m,y]of e)l.push(` ${Ps(m)}: ${JSON.stringify(y)},`);if(l.push("});",""),i.length>0){for(let m of i)l.push(m);l.push("")}if(t.length>0){for(let[m,y]of t)l.push(`${Ie("state",Ct(m))} = computed(${y});`);l.push("")}if(r.length>0){l.push("const bind = {");for(let[m,y]of r)l.push(` ${Ps(m)}: ${y},`);l.push("};")}else l.push("const bind = {};");if(l.push(""),n.length>0){l.push("const on = {");for(let[m,y]of n){let g=y.args??["state"],b=g.map((x)=>x==="state"?"state":"e").join(", ");l.push(` ${Ps(m)}: (e) => { const fn = (${g.join(", ")}) => { ${y.body} }; fn(${b}); },`)}l.push("};")}else l.push("const on = {};");if(l.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),u)l.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else l.push(" if (parts[0] === 'style' && parts.length > 1) {");return l.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => {",` const _t = ${Ds}(parts[1], bind[key]());`," if (_t === null) { el.removeAttribute(parts[1]); }"," else { el.setAttribute(parts[1], _t); }"," });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),l.join(`
345
+ `)}function aD(e,t,r,n){return[`// ${e}: ${t} (key: "${r}")`,"try {",` const _s = ${t}.getItem(${JSON.stringify(r)});`,` state.${e} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(n)};`,`} catch { state.${e} = ${JSON.stringify(n)}; }`,"effect(() => {",` const v = state.${e};`," try {",` if (v === null) ${t}.removeItem(${JSON.stringify(r)});`,` else ${t}.setItem(${JSON.stringify(r)}, JSON.stringify(v));`," } catch {}","});"].join(`
346
+ `)}function cD(e,t,r){return[`// ${e}: Cookie (name: "${t}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${t}=([^;]*)"));`,` try { state.${e} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(r)}; }`,` catch { state.${e} = _m ? _m[1] : ${JSON.stringify(r)}; }`,"}"].join(`
347
+ `)}function T0(e){return e===null||J(e)}function lD(e){if(e.startsWith("$map/")){let[t,...r]=ai(e.slice(5));return Ie(t??"",r.map((n)=>Ct(n)).join("/"))}if(e.startsWith("#/state/"))return Ie("state",e.slice(8));return Ie("state",e)}function Bn(e){return eb(e.startsWith("#/state/")?e.slice(8):e)}function bp(e,t,r){if(e.has(t))return;e.set(t,`() => ${Ie("state",r.startsWith("#/state/")?r.slice(8):r)}`)}var wp=L(()=>{Os();mn();Ee();ks()});function M0(e){let t=e.title;if(!t)throw Error("compileClassJson: missing title (class name)");let r=fD(e.extends),n=e.$defs,i=n?.fields??{},s=n?.constructor,o=uD(s)?s:void 0,a=n?.methods??{},c=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(e.$id)c.push(`// Source: ${e.$id}`);c.push("");let l=r!=="Object"?` extends ${r}`:"";c.push(`class ${t}${l} {`);for(let[u,d]of Object.entries(i)){if(d.scope!=="static")continue;let h=d.identifier??u,m=d.access==="private"?"#":"",y=d.initializer!==void 0?JSON.stringify(d.initializer):d.default!==void 0?JSON.stringify(d.default):"null";c.push(` static ${m}${h} = ${y};`)}for(let[u,d]of Object.entries(i)){if(d.scope==="static")continue;if(d.access!=="private")continue;let h=d.identifier??u;c.push(` #${h};`)}if(Object.keys(i).length>0)c.push("");if(c.push(" constructor(config = {}) {"),o?.superCall||r!=="Object"){let u=o?.superCall?.arguments?o.superCall.arguments.join(", "):"";c.push(` super(${u});`)}for(let[u,d]of Object.entries(i)){if(d.scope==="static")continue;let h=d.identifier??u,m=d.access==="private"?"#":"",y=d.initializer!==void 0?JSON.stringify(d.initializer):d.default!==void 0?JSON.stringify(d.default):"null";c.push(` this.${m}${h} = config.${h} !== undefined ? config.${h} : ${y};`)}if(o?.body){let u=Array.isArray(o.body)?o.body:[o.body];for(let d of u)c.push(` ${d}`)}c.push(" }");for(let[u,d]of Object.entries(a)){let h=d.identifier??u,m=d.scope==="static",g=d.access==="private"?"#":"",b=m?"static ":"",x=d.returnType?.$ref?.includes("Promise")||pD(d)?"async ":"",_=N0(d.parameters??[]),P=dD(d.body);if(c.push(""),d.role==="accessor"){if(d.getter)c.push(` ${b}get ${g}${h}() {`,` ${d.getter.body}`," }");if(d.setter){let E=N0(d.setter.parameters??[]);c.push(` ${b}set ${g}${h}(${E}) {`,` ${d.setter.body}`," }")}}else{c.push(` ${b}${x}${g}${h}(${_}) {`);for(let E of P)c.push(` ${E}`);c.push(" }")}}return c.push("}","",`export { ${t} };`,`export default ${t};`,""),c.join(`
348
+ `)}function uD(e){return typeof e==="object"}function fD(e){if(!e)return"Object";if(T(e))return e;if(e.$ref){let t=e.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return t?t[1]:"Object"}return"Object"}function N0(e){return e.map((t)=>{if(t.$ref)return t.$ref.split("/").pop();let r=t.identifier??t.name;return T(r)?r:"arg"}).join(", ")}function dD(e){if(!e)return[""];return Array.isArray(e)?e:[e]}function pD(e){return(Array.isArray(e.body)?e.body.join(`
349
+ `):e.body??"").includes("await ")}var L0=L(()=>{Ee()});import{readFileSync as mD}from"node:fs";async function Sp(e,t={}){let{title:r="Jx App",reactivitySrc:n=Ts,litHtmlSrc:i=Ns,projectStyle:s=null}=t,o;if(T(e)){let a=mD(e,"utf8");if(e.endsWith(".json"))o=ti(a,e);else{let{extname:c}=await import("node:path"),l=c(e).toLowerCase(),u=t.formats?.byExtension(l,"parse");if(!u){await Promise.resolve().then(() => On());throw _c(e,l)}o=await u.parseDocument(a)}}else o=e;if(Eg(o)){await Promise.resolve().then(() => L0());let c=M0(o),l=T(e)?e.replace(/\.class\.json$/,".js"):`${o.title}.js`;return{files:[{content:c,path:l}],html:""}}if(!Qc(o))return j0(o,{litHtmlSrc:i,projectStyle:s,reactivitySrc:n,...D0(t),title:r});if(o.tagName&&o.tagName.includes("-")){let{tagName:a}=o,c=rl(a),u={content:va(o,c,[],t.rewriteSrc),path:`${a}.js`,tagName:a},d=Fs(o,o.$media??{},s),h=`<!DOCTYPE html>
350
350
  <html lang="en">
351
351
  <head>
352
352
  <meta charset="utf-8">
@@ -366,47 +366,47 @@ ${E.join(`,
366
366
  <${a}></${a}>
367
367
  <script type="module" src="./${a}.js"></script>
368
368
  </body>
369
- </html>`;return{files:[u],html:h}}return xp(o,{litHtmlSrc:i,projectStyle:s,reactivitySrc:n,...D0(t),title:r})}function D0(e){let t={};if(e.prePaintScheme===!1)t.prePaintScheme=!1;if(e.rewriteSrc)t.rewriteSrc=e.rewriteSrc;return t}async function _re(e,t){let[r,n]=await Promise.all([wp(e),$a(e)]),{writeFileSync:i,mkdirSync:s}=await import("node:fs"),{dirname:o,join:a}=await import("node:path");if(t){i(t,r.html,"utf8"),console.error(`Written to ${t}`);let c=o(t);for(let l of r.files){let u=a(c,l.path);s(o(u),{recursive:!0}),i(u,l.content,"utf8"),console.error(`Written to ${u}`)}}else process.stdout.write(r.html);if(n&&t){let c=t.replace(/(\.[^.]+)?$/,"-server.js");i(c,n,"utf8"),console.error(`Server handler written to ${c}`)}}var J0=L(()=>{mn();mp();wa();O0();vp();Ee();vr();mn();mp();wa();vp()});import{readFileSync as dD}from"node:fs";import{dirname as Sp,resolve as Tl}from"node:path";import{createRequire as pD}from"node:module";function gD(e){return Ot(e.resolve)}async function F0(e,t,r,n={}){let i=e.imports??{},{state:s}=e;if(!s)return;for(let[o,a]of Object.entries(s)){if(!un(a))continue;if(mD.has(a.$prototype))continue;if(a.timing&&a.timing!=="compiler"){let c=n.registry?.byName(a.$prototype);if(c?.capabilities.lower)try{let l=await c.call("lower",a,{projectConfig:n.config,root:r,route:t});if(ee(l)){let u=l.$bundle;if(Array.isArray(u)){for(let d of u)if(T(d))n.registerBundle?.(d)}delete l.$bundle}s[o]=l}catch(l){console.warn(`prototype-resolver: failed to lower "${o}" ($prototype: "${a.$prototype}"):`,Pe(l))}continue}if(!a.$src){let c=i[a.$prototype]??yD(n,a.$prototype);if(!c)continue;a.$src=c}try{let c=await bD(a,t,r,s,n);if(a.timing&&ee(c))c.timing=a.timing;s[o]=c}catch(c){console.warn(`prototype-resolver: failed to resolve "${o}" ($prototype: "${a.$prototype}"):`,Pe(c))}}}function yD(e,t){return e.registry?.byName(t)?.classPath}async function bD(e,t,r,n,i){let s=e.$src;if(!s)throw Error(`$prototype "${e.$prototype}" has no $src to resolve`);let o;if(s.startsWith("./")||s.startsWith("../"))o=t.sourcePath?Tl(Sp(t.sourcePath),s):Tl(r,s);else o=pD(Tl(r,"package.json")).resolve(s);let a=dD(o,"utf8"),c=Ig(a,o);if(!c.$implementation)throw Error(`${s} has no $implementation field`);let l=Tl(Sp(o),c.$implementation),u=await df(l),d=e.$export??c.title??e.$prototype,h=u[d]??u.default?.[d];if(!h)throw Error(`Module ${c.$implementation} does not export "${d}"`);let m={};for(let[g,b]of Object.entries(e))if(!hD.has(g))m[g]=b;if(m.src&&!m.basePath&&t.sourcePath)m.basePath=Sp(t.sourcePath);m._project={config:i.config??null,root:r,...i.sections},m._document={route:t,state:n};let y=new h(m);if(gD(y))return await y.resolve();return y}var mD,hD;var q0=L(()=>{On();Ee();vr();mD=new Set(["Function","LocalStorage","SessionStorage","Array"]),hD=new Set(["$prototype","$src","$export","timing","default","description"])});var B0=(e)=>typeof e<"u"&&e!==null,xD=(e)=>typeof e==="object",$D=(e)=>Object.prototype.toString.call(e)==="[object Object]",vD=(e)=>typeof e==="function",wD=(e)=>typeof e==="boolean",SD=(e)=>e instanceof Buffer,ED=(e)=>{if(B0(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},_D=(e)=>e instanceof ArrayBuffer,PD=(e)=>typeof e==="string"&&e.length>0,kD=(e)=>typeof e==="number"&&Number.isFinite(e),AD=(e)=>Number.isInteger(e),jD=(e,t,r)=>e>=t&&e<=r,RD=(e,t)=>t.includes(e),OD=(e,t,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return Error(`Expected ${t} for ${e} but received ${n} of type ${typeof r}`)},CD=(e,t)=>(t.message=e.message,t),f;var gn=L(()=>{/*!
369
+ </html>`;return{files:[u],html:h}}return $p(o,{litHtmlSrc:i,projectStyle:s,reactivitySrc:n,...D0(t),title:r})}function D0(e){let t={};if(e.prePaintScheme===!1)t.prePaintScheme=!1;if(e.rewriteSrc)t.rewriteSrc=e.rewriteSrc;return t}async function Rre(e,t){let[r,n]=await Promise.all([Sp(e),$a(e)]),{writeFileSync:i,mkdirSync:s}=await import("node:fs"),{dirname:o,join:a}=await import("node:path");if(t){i(t,r.html,"utf8"),console.error(`Written to ${t}`);let c=o(t);for(let l of r.files){let u=a(c,l.path);s(o(u),{recursive:!0}),i(u,l.content,"utf8"),console.error(`Written to ${u}`)}}else process.stdout.write(r.html);if(n&&t){let c=t.replace(/(\.[^.]+)?$/,"-server.js");i(c,n,"utf8"),console.error(`Server handler written to ${c}`)}}var J0=L(()=>{mn();hp();wa();O0();wp();Ee();vr();mn();hp();wa();wp()});import{readFileSync as hD}from"node:fs";import{dirname as Ep,resolve as Tl}from"node:path";import{createRequire as gD}from"node:module";function xD(e){return Ot(e.resolve)}async function F0(e,t,r,n={}){let i=e.imports??{},{state:s}=e;if(!s)return;for(let[o,a]of Object.entries(s)){if(!un(a))continue;if(yD.has(a.$prototype))continue;if(a.timing&&a.timing!=="compiler"){let c=n.registry?.byName(a.$prototype);if(c?.capabilities.lower)try{let l=await c.call("lower",a,{projectConfig:n.config,root:r,route:t});if(ee(l)){let u=l.$bundle;if(Array.isArray(u)){for(let d of u)if(T(d))n.registerBundle?.(d)}delete l.$bundle}s[o]=l}catch(l){console.warn(`prototype-resolver: failed to lower "${o}" ($prototype: "${a.$prototype}"):`,Pe(l))}continue}if(!a.$src){let c=i[a.$prototype]??$D(n,a.$prototype);if(!c)continue;a.$src=c}try{let c=await vD(a,t,r,s,n);if(a.timing&&ee(c))c.timing=a.timing;s[o]=c}catch(c){console.warn(`prototype-resolver: failed to resolve "${o}" ($prototype: "${a.$prototype}"):`,Pe(c))}}}function $D(e,t){return e.registry?.byName(t)?.classPath}async function vD(e,t,r,n,i){let s=e.$src;if(!s)throw Error(`$prototype "${e.$prototype}" has no $src to resolve`);let o;if(s.startsWith("./")||s.startsWith("../"))o=t.sourcePath?Tl(Ep(t.sourcePath),s):Tl(r,s);else o=gD(Tl(r,"package.json")).resolve(s);let a=hD(o,"utf8"),c=Ig(a,o);if(!c.$implementation)throw Error(`${s} has no $implementation field`);let l=Tl(Ep(o),c.$implementation),u=await pf(l),d=e.$export??c.title??e.$prototype,h=u[d]??u.default?.[d];if(!h)throw Error(`Module ${c.$implementation} does not export "${d}"`);let m={};for(let[g,b]of Object.entries(e))if(!bD.has(g))m[g]=b;if(m.src&&!m.basePath&&t.sourcePath)m.basePath=Ep(t.sourcePath);m._project={config:i.config??null,root:r,...i.sections},m._document={route:t,state:n};let y=new h(m);if(xD(y))return await y.resolve();return y}var yD,bD;var q0=L(()=>{On();Ee();vr();yD=new Set(["Function","LocalStorage","SessionStorage","Array"]),bD=new Set(["$prototype","$src","$export","timing","default","description"])});var B0=(e)=>typeof e<"u"&&e!==null,wD=(e)=>typeof e==="object",SD=(e)=>Object.prototype.toString.call(e)==="[object Object]",ED=(e)=>typeof e==="function",_D=(e)=>typeof e==="boolean",PD=(e)=>e instanceof Buffer,kD=(e)=>{if(B0(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},AD=(e)=>e instanceof ArrayBuffer,jD=(e)=>typeof e==="string"&&e.length>0,RD=(e)=>typeof e==="number"&&Number.isFinite(e),OD=(e)=>Number.isInteger(e),CD=(e,t,r)=>e>=t&&e<=r,ID=(e,t)=>t.includes(e),TD=(e,t,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return Error(`Expected ${t} for ${e} but received ${n} of type ${typeof r}`)},ND=(e,t)=>(t.message=e.message,t),f;var gn=L(()=>{/*!
370
370
  Copyright 2013 Lovell Fuller and others.
371
371
  SPDX-License-Identifier: Apache-2.0
372
- */f={defined:B0,object:xD,plainObject:$D,fn:vD,bool:wD,buffer:SD,typedArray:ED,arrayBuffer:_D,string:PD,number:kD,integer:AD,inRange:jD,inArray:RD,invalidParameterError:OD,nativeError:CD}});var V0=C(function(Jre,U0){var H0=()=>process.platform==="linux",Nl=null,ID=()=>{if(!Nl)if(H0()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,Nl=process.report.getReport(),process.report.excludeNetwork=e}else Nl={};return Nl};U0.exports={isLinux:H0,getReport:ID}});var z0=C(function(Fre,W0){var so=De("fs"),TD=(e)=>{let t=so.openSync(e,"r"),r=Buffer.alloc(2048),n=so.readSync(t,r,0,2048,0);return so.close(t,()=>{}),r.subarray(0,n)},ND=(e)=>new Promise((t,r)=>{so.open(e,"r",(n,i)=>{if(n)r(n);else{let s=Buffer.alloc(2048);so.read(i,s,0,2048,0,(o,a)=>{t(s.subarray(0,a)),so.close(i,()=>{})})}})});W0.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:TD,readFile:ND}});var G0=C(function(qre,K0){var MD=(e)=>{if(e.length<64)return null;if(e.readUInt32BE(0)!==2135247942)return null;if(e.readUInt8(4)!==2)return null;if(e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let i=0;i<n;i++){let s=t+i*r;if(e.readUInt32LE(s)===3){let a=e.readUInt32LE(s+8),c=e.readUInt32LE(s+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};K0.exports={interpreterPath:MD}});var Ll=C(function(Bre,dv){var X0=De("child_process"),{isLinux:oo,getReport:Q0}=V0(),{LDD_PATH:Ml,SELF_PATH:Z0,readFile:Ep,readFileSync:_p}=z0(),{interpreterPath:ev}=G0(),yn,bn,xn,hi="",tv=()=>{if(!hi)return new Promise((e)=>{X0.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(t,r)=>{hi=t?" ":r,e(hi)})});return hi},rv=()=>{if(!hi)try{hi=X0.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(e){hi=" "}return hi},Hn="glibc",nv=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,ss="musl",LD=(e)=>e.includes("libc.musl-")||e.includes("ld-musl-"),iv=()=>{let e=Q0();if(e.header&&e.header.glibcVersionRuntime)return Hn;if(Array.isArray(e.sharedObjects)){if(e.sharedObjects.some(LD))return ss}return null},sv=(e)=>{let[t,r]=e.split(/[\r\n]+/);if(t&&t.includes(Hn))return Hn;if(r&&r.includes(ss))return ss;return null},ov=(e)=>{if(e){if(e.includes("/ld-musl-"))return ss;else if(e.includes("/ld-linux-"))return Hn}return null},av=(e)=>{if(e=e.toString(),e.includes("musl"))return ss;if(e.includes("GNU C Library"))return Hn;return null},DD=async()=>{if(bn!==void 0)return bn;bn=null;try{let e=await Ep(Ml);bn=av(e)}catch(e){}return bn},JD=()=>{if(bn!==void 0)return bn;bn=null;try{let e=_p(Ml);bn=av(e)}catch(e){}return bn},FD=async()=>{if(yn!==void 0)return yn;yn=null;try{let e=await Ep(Z0),t=ev(e);yn=ov(t)}catch(e){}return yn},qD=()=>{if(yn!==void 0)return yn;yn=null;try{let e=_p(Z0),t=ev(e);yn=ov(t)}catch(e){}return yn},cv=async()=>{let e=null;if(oo()){if(e=await FD(),!e){if(e=await DD(),!e)e=iv();if(!e){let t=await tv();e=sv(t)}}}return e},lv=()=>{let e=null;if(oo()){if(e=qD(),!e){if(e=JD(),!e)e=iv();if(!e){let t=rv();e=sv(t)}}}return e},BD=async()=>oo()&&await cv()!==Hn,HD=()=>oo()&&lv()!==Hn,UD=async()=>{if(xn!==void 0)return xn;xn=null;try{let t=(await Ep(Ml)).match(nv);if(t)xn=t[1]}catch(e){}return xn},VD=()=>{if(xn!==void 0)return xn;xn=null;try{let t=_p(Ml).match(nv);if(t)xn=t[1]}catch(e){}return xn},uv=()=>{let e=Q0();if(e.header&&e.header.glibcVersionRuntime)return e.header.glibcVersionRuntime;return null},Y0=(e)=>e.trim().split(/\s+/)[1],fv=(e)=>{let[t,r,n]=e.split(/[\r\n]+/);if(t&&t.includes(Hn))return Y0(t);if(r&&n&&r.includes(ss))return Y0(n);return null},WD=async()=>{let e=null;if(oo()){if(e=await UD(),!e)e=uv();if(!e){let t=await tv();e=fv(t)}}return e},zD=()=>{let e=null;if(oo()){if(e=VD(),!e)e=uv();if(!e){let t=rv();e=fv(t)}}return e};dv.exports={GLIBC:Hn,MUSL:ss,family:cv,familySync:lv,isNonGlibcLinux:BD,isNonGlibcLinuxSync:HD,version:WD,versionSync:zD}});var ao=C(function(Hre,pv){var KD=Number.MAX_SAFE_INTEGER||9007199254740991,GD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];pv.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:KD,RELEASE_TYPES:GD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Sa=C(function(Ure,mv){var YD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};mv.exports=YD});var co=C(function($n,hv){var{MAX_SAFE_COMPONENT_LENGTH:Pp,MAX_SAFE_BUILD_LENGTH:XD,MAX_LENGTH:QD}=ao(),ZD=Sa();$n=hv.exports={};var eJ=$n.re=[],tJ=$n.safeRe=[],Y=$n.src=[],rJ=$n.safeSrc=[],X=$n.t={},nJ=0,kp="[a-zA-Z0-9-]",iJ=[["\\s",1],["\\d",QD],[kp,XD]],sJ=(e)=>{for(let[t,r]of iJ)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},xe=(e,t,r)=>{let n=sJ(t),i=nJ++;ZD(e,i,t),X[e]=i,Y[i]=t,rJ[i]=n,eJ[i]=new RegExp(t,r?"g":void 0),tJ[i]=new RegExp(n,r?"g":void 0)};xe("NUMERICIDENTIFIER","0|[1-9]\\d*");xe("NUMERICIDENTIFIERLOOSE","\\d+");xe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${kp}*`);xe("MAINVERSION",`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`);xe("MAINVERSIONLOOSE",`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`);xe("PRERELEASEIDENTIFIER",`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIER]})`);xe("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIERLOOSE]})`);xe("PRERELEASE",`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`);xe("PRERELEASELOOSE",`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`);xe("BUILDIDENTIFIER",`${kp}+`);xe("BUILD",`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`);xe("FULLPLAIN",`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`);xe("FULL",`^${Y[X.FULLPLAIN]}$`);xe("LOOSEPLAIN",`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`);xe("LOOSE",`^${Y[X.LOOSEPLAIN]}$`);xe("GTLT","((?:<|>)?=?)");xe("XRANGEIDENTIFIERLOOSE",`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);xe("XRANGEIDENTIFIER",`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`);xe("XRANGEPLAIN",`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`);xe("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`);xe("XRANGE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`);xe("XRANGELOOSE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`);xe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Pp}})(?:\\.(\\d{1,${Pp}}))?(?:\\.(\\d{1,${Pp}}))?`);xe("COERCE",`${Y[X.COERCEPLAIN]}(?:$|[^\\d])`);xe("COERCEFULL",Y[X.COERCEPLAIN]+`(?:${Y[X.PRERELEASE]})?(?:${Y[X.BUILD]})?(?:$|[^\\d])`);xe("COERCERTL",Y[X.COERCE],!0);xe("COERCERTLFULL",Y[X.COERCEFULL],!0);xe("LONETILDE","(?:~>?)");xe("TILDETRIM",`(\\s*)${Y[X.LONETILDE]}\\s+`,!0);$n.tildeTrimReplace="$1~";xe("TILDE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`);xe("TILDELOOSE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`);xe("LONECARET","(?:\\^)");xe("CARETTRIM",`(\\s*)${Y[X.LONECARET]}\\s+`,!0);$n.caretTrimReplace="$1^";xe("CARET",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`);xe("CARETLOOSE",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`);xe("COMPARATORLOOSE",`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`);xe("COMPARATOR",`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`);xe("COMPARATORTRIM",`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0);$n.comparatorTrimReplace="$1$2$3";xe("HYPHENRANGE",`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`);xe("HYPHENRANGELOOSE",`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`);xe("STAR","(<|>)?=?\\s*\\*");xe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");xe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Dl=C(function(Vre,gv){var oJ=Object.freeze({loose:!0}),aJ=Object.freeze({}),cJ=(e)=>{if(!e)return aJ;if(typeof e!=="object")return oJ;return e};gv.exports=cJ});var Ap=C(function(Wre,xv){var yv=/^[0-9]+$/,bv=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=yv.test(e),n=yv.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},lJ=(e,t)=>bv(t,e);xv.exports={compareIdentifiers:bv,rcompareIdentifiers:lJ}});var Pt=C(function(zre,vv){var Jl=Sa(),{MAX_LENGTH:$v,MAX_SAFE_INTEGER:Fl}=ao(),{safeRe:ql,t:Bl}=co(),uJ=Dl(),{compareIdentifiers:jp}=Ap(),fJ=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(jp(e[n],r[n])!==0)return!1;return!0};class Zr{constructor(e,t){if(t=uJ(t),e instanceof Zr)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>$v)throw TypeError(`version is longer than ${$v} characters`);Jl("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?ql[Bl.LOOSE]:ql[Bl.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Fl||this.major<0)throw TypeError("Invalid major version");if(this.minor>Fl||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Fl||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Fl)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Jl("SemVer.compare",this.version,this.options,e),!(e instanceof Zr)){if(typeof e==="string"&&e===this.version)return 0;e=new Zr(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Zr))e=new Zr(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof Zr))e=new Zr(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Jl("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return jp(r,n)}while(++t)}compareBuild(e){if(!(e instanceof Zr))e=new Zr(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Jl("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return jp(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?ql[Bl.PRERELEASELOOSE]:ql[Bl.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(fJ(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}vv.exports=Zr});var gi=C(function(Kre,Sv){var wv=Pt(),dJ=(e,t,r=!1)=>{if(e instanceof wv)return e;try{return new wv(e,t)}catch(n){if(!r)return null;throw n}};Sv.exports=dJ});var _v=C(function(Gre,Ev){var pJ=gi(),mJ=(e,t)=>{let r=pJ(e,t);return r?r.version:null};Ev.exports=mJ});var kv=C(function(Yre,Pv){var hJ=gi(),gJ=(e,t)=>{let r=hJ(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Pv.exports=gJ});var Rv=C(function(Xre,jv){var Av=Pt(),yJ=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Av(e instanceof Av?e.version:e,r).inc(t,n,i).version}catch(s){return null}};jv.exports=yJ});var Iv=C(function(Qre,Cv){var Ov=gi(),bJ=(e,t)=>{let r=Ov(e,null,!0),n=Ov(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let u=c?"pre":"";if(r.major!==n.major)return u+"major";if(r.minor!==n.minor)return u+"minor";if(r.patch!==n.patch)return u+"patch";return"prerelease"};Cv.exports=bJ});var Nv=C(function(Zre,Tv){var xJ=Pt(),$J=(e,t)=>new xJ(e,t).major;Tv.exports=$J});var Lv=C(function(ene,Mv){var vJ=Pt(),wJ=(e,t)=>new vJ(e,t).minor;Mv.exports=wJ});var Jv=C(function(tne,Dv){var SJ=Pt(),EJ=(e,t)=>new SJ(e,t).patch;Dv.exports=EJ});var qv=C(function(rne,Fv){var _J=gi(),PJ=(e,t)=>{let r=_J(e,t);return r&&r.prerelease.length?r.prerelease:null};Fv.exports=PJ});var Dr=C(function(nne,Hv){var Bv=Pt(),kJ=(e,t,r)=>new Bv(e,r).compare(new Bv(t,r));Hv.exports=kJ});var Vv=C(function(ine,Uv){var AJ=Dr(),jJ=(e,t,r)=>AJ(t,e,r);Uv.exports=jJ});var zv=C(function(sne,Wv){var RJ=Dr(),OJ=(e,t)=>RJ(e,t,!0);Wv.exports=OJ});var Hl=C(function(one,Gv){var Kv=Pt(),CJ=(e,t,r)=>{let n=new Kv(e,r),i=new Kv(t,r);return n.compare(i)||n.compareBuild(i)};Gv.exports=CJ});var Xv=C(function(ane,Yv){var IJ=Hl(),TJ=(e,t)=>e.sort((r,n)=>IJ(r,n,t));Yv.exports=TJ});var Zv=C(function(cne,Qv){var NJ=Hl(),MJ=(e,t)=>e.sort((r,n)=>NJ(n,r,t));Qv.exports=MJ});var Ea=C(function(lne,ew){var LJ=Dr(),DJ=(e,t,r)=>LJ(e,t,r)>0;ew.exports=DJ});var Ul=C(function(une,tw){var JJ=Dr(),FJ=(e,t,r)=>JJ(e,t,r)<0;tw.exports=FJ});var Rp=C(function(fne,rw){var qJ=Dr(),BJ=(e,t,r)=>qJ(e,t,r)===0;rw.exports=BJ});var Op=C(function(dne,nw){var HJ=Dr(),UJ=(e,t,r)=>HJ(e,t,r)!==0;nw.exports=UJ});var Vl=C(function(pne,iw){var VJ=Dr(),WJ=(e,t,r)=>VJ(e,t,r)>=0;iw.exports=WJ});var Wl=C(function(mne,sw){var zJ=Dr(),KJ=(e,t,r)=>zJ(e,t,r)<=0;sw.exports=KJ});var Cp=C(function(hne,ow){var GJ=Rp(),YJ=Op(),XJ=Ea(),QJ=Vl(),ZJ=Ul(),eF=Wl(),tF=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return GJ(e,r,n);case"!=":return YJ(e,r,n);case">":return XJ(e,r,n);case">=":return QJ(e,r,n);case"<":return ZJ(e,r,n);case"<=":return eF(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};ow.exports=tF});var cw=C(function(gne,aw){var rF=Pt(),nF=gi(),{safeRe:zl,t:Kl}=co(),iF=(e,t)=>{if(e instanceof rF)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?zl[Kl.COERCEFULL]:zl[Kl.COERCE]);else{let c=t.includePrerelease?zl[Kl.COERCERTLFULL]:zl[Kl.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return nF(`${n}.${i}.${s}${o}${a}`,t)};aw.exports=iF});var uw=C(function(yne,lw){var sF=gi(),oF=ao(),aF=Pt(),cF=(e,t,r)=>{if(!oF.RELEASE_TYPES.includes(t))return null;let n=lF(e,r);return n&&uF(n,t)},lF=(e,t)=>{let r=e instanceof aF?e.version:e;return sF(r,t)},uF=(e,t)=>{if(fF(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},fF=(e)=>e.startsWith("pre");lw.exports=cF});var pw=C(function(bne,dw){class fw{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}dw.exports=fw});var Jr=C(function(xne,yw){var dF=/\s+/g;class _a{constructor(e,t){if(t=mF(t),e instanceof _a)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new _a(e.raw,t);if(e instanceof Ip)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(dF," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!hw(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&SF(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(wF,"");let r=((this.options.includePrerelease&&$F)|(this.options.loose&&vF))+":"+e,n=mw.get(r);if(n)return n;let i=this.options.loose,s=i?Gt[kt.HYPHENRANGELOOSE]:Gt[kt.HYPHENRANGE];e=e.replace(s,TF(this.options.includePrerelease)),Ge("hyphen replace",e),e=e.replace(Gt[kt.COMPARATORTRIM],yF),Ge("comparator trim",e),e=e.replace(Gt[kt.TILDETRIM],bF),Ge("tilde trim",e),e=e.replace(Gt[kt.CARETTRIM],xF),Ge("caret trim",e);let o=e.split(" ").map((u)=>EF(u,this.options)).join(" ").split(/\s+/).map((u)=>IF(u,this.options));if(i)o=o.filter((u)=>(Ge("loose invalid filter",u,this.options),!!u.match(Gt[kt.COMPARATORLOOSE])));Ge("range list",o);let a=new Map,c=o.map((u)=>new Ip(u,this.options));for(let u of c){if(hw(u))return[u];a.set(u.value,u)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return mw.set(r,l),l}intersects(e,t){if(!(e instanceof _a))throw TypeError("a Range is required");return this.set.some((r)=>gw(r,t)&&e.set.some((n)=>gw(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new hF(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(NF(this.set[t],e,this.options))return!0;return!1}}yw.exports=_a;var pF=pw(),mw=new pF,mF=Dl(),Ip=Pa(),Ge=Sa(),hF=Pt(),{safeRe:Gt,src:gF,t:kt,comparatorTrimReplace:yF,tildeTrimReplace:bF,caretTrimReplace:xF}=co(),{FLAG_INCLUDE_PRERELEASE:$F,FLAG_LOOSE:vF}=ao(),wF=new RegExp(gF[kt.BUILD],"g"),hw=(e)=>e.value==="<0.0.0-0",SF=(e)=>e.value==="",gw=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},EF=(e,t)=>(e=e.replace(Gt[kt.BUILD],""),Ge("comp",e,t),e=AF(e,t),Ge("caret",e),e=PF(e,t),Ge("tildes",e),e=RF(e,t),Ge("xrange",e),e=CF(e,t),Ge("stars",e),e),xt=(e)=>!e||e.toLowerCase()==="x"||e==="*",_F=(e,t,r)=>xt(e)&&!xt(t)||xt(t)&&r&&!xt(r),PF=(e,t)=>e.trim().split(/\s+/).map((r)=>kF(r,t)).join(" "),kF=(e,t)=>{let r=t.loose?Gt[kt.TILDELOOSE]:Gt[kt.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{Ge("tilde",e,i,s,o,a,c);let l;if(xt(s))l="";else if(xt(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(xt(a))l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(c)Ge("replaceTilde pr",c),l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;return Ge("tilde return",l),l})},AF=(e,t)=>e.trim().split(/\s+/).map((r)=>jF(r,t)).join(" "),jF=(e,t)=>{Ge("caret",e,t);let r=t.loose?Gt[kt.CARETLOOSE]:Gt[kt.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{Ge("caret",e,i,s,o,a,c);let l;if(xt(s))l="";else if(xt(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(xt(a))if(s==="0")l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(c)if(Ge("replaceCaret pr",c),s==="0")if(o==="0")l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`;else if(Ge("no pr"),s==="0")if(o==="0")l=`>=${s}.${o}.${a} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`;return Ge("caret return",l),l})},RF=(e,t)=>(Ge("replaceXRanges",e,t),e.split(/\s+/).map((r)=>OF(r,t)).join(" ")),OF=(e,t)=>{e=e.trim();let r=t.loose?Gt[kt.XRANGELOOSE]:Gt[kt.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{if(Ge("xRange",e,n,i,s,o,a,c),_F(s,o,a))return e;let l=xt(s),u=l||xt(o),d=u||xt(a),h=d;if(i==="="&&h)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&h){if(u)o=0;if(a=0,i===">")if(i=">=",u)s=+s+1,o=0,a=0;else o=+o+1,a=0;else if(i==="<=")if(i="<",u)s=+s+1;else o=+o+1;if(i==="<")c="-0";n=`${i+s}.${o}.${a}${c}`}else if(u)n=`>=${s}.0.0${c} <${+s+1}.0.0-0`;else if(d)n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`;return Ge("xRange return",n),n})},CF=(e,t)=>(Ge("replaceStars",e,t),e.trim().replace(Gt[kt.STAR],"")),IF=(e,t)=>(Ge("replaceGTE0",e,t),e.trim().replace(Gt[t.includePrerelease?kt.GTE0PRE:kt.GTE0],"")),TF=(e)=>(t,r,n,i,s,o,a,c,l,u,d,h)=>{if(xt(n))r="";else if(xt(i))r=`>=${n}.0.0${e?"-0":""}`;else if(xt(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(xt(l))c="";else if(xt(u))c=`<${+l+1}.0.0-0`;else if(xt(d))c=`<${l}.${+u+1}.0-0`;else if(h)c=`<=${l}.${u}.${d}-${h}`;else if(e)c=`<${l}.${u}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},NF=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(Ge(e[n].semver),e[n].semver===Ip.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var Pa=C(function($ne,Sw){var ka=Symbol("SemVer ANY");class Gl{static get ANY(){return ka}constructor(e,t){if(t=bw(t),e instanceof Gl)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),Np("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ka)this.value="";else this.value=this.operator+this.semver.version;Np("comp",this)}parse(e){let t=this.options.loose?xw[$w.COMPARATORLOOSE]:xw[$w.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=ka;else this.semver=new vw(r[2],this.options.loose)}toString(){return this.value}test(e){if(Np("Comparator.test",e,this.options.loose),this.semver===ka||e===ka)return!0;if(typeof e==="string")try{e=new vw(e,this.options)}catch(t){return!1}return Tp(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Gl))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new ww(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new ww(this.value,t).test(e.semver)}if(t=bw(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Tp(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Tp(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Sw.exports=Gl;var bw=Dl(),{safeRe:xw,t:$w}=co(),Tp=Cp(),Np=Sa(),vw=Pt(),ww=Jr()});var Aa=C(function(vne,Ew){var MF=Jr(),LF=(e,t,r)=>{try{t=new MF(t,r)}catch(n){return!1}return t.test(e)};Ew.exports=LF});var Pw=C(function(wne,_w){var DF=Jr(),JF=(e,t)=>new DF(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));_w.exports=JF});var Aw=C(function(Sne,kw){var FF=Pt(),qF=Jr(),BF=(e,t,r)=>{let n=null,i=null,s=null;try{s=new qF(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new FF(n,r)}}),n};kw.exports=BF});var Rw=C(function(Ene,jw){var HF=Pt(),UF=Jr(),VF=(e,t,r)=>{let n=null,i=null,s=null;try{s=new UF(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new HF(n,r)}}),n};jw.exports=VF});var Iw=C(function(_ne,Cw){var Mp=Pt(),WF=Jr(),Ow=Ea(),zF=(e,t)=>{e=new WF(e,t);let r=new Mp("0.0.0");if(e.test(r))return r;if(r=new Mp("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let a=new Mp(o.semver.version);switch(o.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!s||Ow(a,s))s=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Ow(r,s)))r=s}if(r&&e.test(r))return r;return null};Cw.exports=zF});var Nw=C(function(Pne,Tw){var KF=Jr(),GF=(e,t)=>{try{return new KF(e,t).range||"*"}catch(r){return null}};Tw.exports=GF});var Yl=C(function(kne,Jw){var YF=Pt(),Dw=Pa(),{ANY:XF}=Dw,QF=Jr(),ZF=Aa(),Mw=Ea(),Lw=Ul(),e5=Wl(),t5=Vl(),r5=(e,t,r,n)=>{e=new YF(e,n),t=new QF(t,n);let i,s,o,a,c;switch(r){case">":i=Mw,s=e5,o=Lw,a=">",c=">=";break;case"<":i=Lw,s=t5,o=Mw,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(ZF(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],d=null,h=null;if(u.forEach((m)=>{if(m.semver===XF)m=new Dw(">=0.0.0");if(d=d||m,h=h||m,i(m.semver,d.semver,n))d=m;else if(o(m.semver,h.semver,n))h=m}),d.operator===a||d.operator===c)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;else if(h.operator===c&&o(e,h.semver))return!1}return!0};Jw.exports=r5});var qw=C(function(Ane,Fw){var n5=Yl(),i5=(e,t,r)=>n5(e,t,">",r);Fw.exports=i5});var Hw=C(function(jne,Bw){var s5=Yl(),o5=(e,t,r)=>s5(e,t,"<",r);Bw.exports=o5});var Ww=C(function(Rne,Vw){var Uw=Jr(),a5=(e,t,r)=>(e=new Uw(e,r),t=new Uw(t,r),e.intersects(t,r));Vw.exports=a5});var Kw=C(function(One,zw){var c5=Aa(),l5=Dr();zw.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((u,d)=>l5(u,d,r));for(let u of o)if(c5(u,t,r)){if(s=u,!i)i=u}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let a=[];for(let[u,d]of n)if(u===d)a.push(u);else if(!d&&u===o[0])a.push("*");else if(!d)a.push(`>=${u}`);else if(u===o[0])a.push(`<=${d}`);else a.push(`${u} - ${d}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var eS=C(function(Cne,Zw){var Gw=Jr(),Jp=Pa(),{ANY:Lp}=Jp,Dp=Aa(),Fp=Dr(),u5=(e,t,r={})=>{if(e===t)return!0;e=new Gw(e,r),t=new Gw(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=d5(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},f5=[new Jp(">=0.0.0-0")],Yw=[new Jp(">=0.0.0")],d5=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Lp)if(t.length===1&&t[0].semver===Lp)return!0;else if(r.includePrerelease)e=f5;else e=Yw;if(t.length===1&&t[0].semver===Lp)if(r.includePrerelease)return!0;else t=Yw;let n=new Set,i,s;for(let m of e)if(m.operator===">"||m.operator===">=")i=Xw(i,m,r);else if(m.operator==="<"||m.operator==="<=")s=Qw(s,m,r);else n.add(m.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Fp(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let m of n){if(i&&!Dp(m,String(i),r))return null;if(s&&!Dp(m,String(s),r))return null;for(let y of t)if(!Dp(m,String(y),r))return!1;return!0}let a,c,l,u,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0)d=!1;for(let m of t){if(u=u||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",i){if(h){if(m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===h.major&&m.semver.minor===h.minor&&m.semver.patch===h.patch)h=!1}if(m.operator===">"||m.operator===">="){if(a=Xw(i,m,r),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(s){if(d){if(m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch)d=!1}if(m.operator==="<"||m.operator==="<="){if(c=Qw(s,m,r),c===m&&c!==s)return!1}else if(s.operator==="<="&&!m.test(s.semver))return!1}if(!m.operator&&(s||i)&&o!==0)return!1}if(i&&l&&!s&&o!==0)return!1;if(s&&u&&!i&&o!==0)return!1;if(h||d)return!1;return!0},Xw=(e,t,r)=>{if(!e)return t;let n=Fp(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Qw=(e,t,r)=>{if(!e)return t;let n=Fp(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Zw.exports=u5});var iS=C(function(Ine,nS){var qp=co(),tS=ao(),p5=Pt(),rS=Ap(),m5=gi(),h5=_v(),g5=kv(),y5=Rv(),b5=Iv(),x5=Nv(),$5=Lv(),v5=Jv(),w5=qv(),S5=Dr(),E5=Vv(),_5=zv(),P5=Hl(),k5=Xv(),A5=Zv(),j5=Ea(),R5=Ul(),O5=Rp(),C5=Op(),I5=Vl(),T5=Wl(),N5=Cp(),M5=cw(),L5=uw(),D5=Pa(),J5=Jr(),F5=Aa(),q5=Pw(),B5=Aw(),H5=Rw(),U5=Iw(),V5=Nw(),W5=Yl(),z5=qw(),K5=Hw(),G5=Ww(),Y5=Kw(),X5=eS();nS.exports={parse:m5,valid:h5,clean:g5,inc:y5,diff:b5,major:x5,minor:$5,patch:v5,prerelease:w5,compare:S5,rcompare:E5,compareLoose:_5,compareBuild:P5,sort:k5,rsort:A5,gt:j5,lt:R5,eq:O5,neq:C5,gte:I5,lte:T5,cmp:N5,coerce:M5,truncate:L5,Comparator:D5,Range:J5,satisfies:F5,toComparators:q5,maxSatisfying:B5,minSatisfying:H5,minVersion:U5,validRange:V5,outside:W5,gtr:z5,ltr:K5,intersects:G5,simplifyRange:Y5,subset:X5,SemVer:p5,re:qp.re,src:qp.src,tokens:qp.t,SEMVER_SPEC_VERSION:tS.SEMVER_SPEC_VERSION,RELEASE_TYPES:tS.RELEASE_TYPES,compareIdentifiers:rS.compareIdentifiers,rcompareIdentifiers:rS.rcompareIdentifiers}});var Un;var Xl=L(()=>{Un={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.5","@img/sharp-darwin-x64":"0.35.5","@img/sharp-freebsd-wasm32":"0.35.5","@img/sharp-libvips-darwin-arm64":"1.3.4","@img/sharp-libvips-darwin-x64":"1.3.4","@img/sharp-libvips-linux-arm":"1.3.4","@img/sharp-libvips-linux-arm64":"1.3.4","@img/sharp-libvips-linux-ppc64":"1.3.4","@img/sharp-libvips-linux-riscv64":"1.3.4","@img/sharp-libvips-linux-s390x":"1.3.4","@img/sharp-libvips-linux-x64":"1.3.4","@img/sharp-libvips-linuxmusl-arm64":"1.3.4","@img/sharp-libvips-linuxmusl-x64":"1.3.4","@img/sharp-linux-arm":"0.35.5","@img/sharp-linux-arm64":"0.35.5","@img/sharp-linux-ppc64":"0.35.5","@img/sharp-linux-riscv64":"0.35.5","@img/sharp-linux-s390x":"0.35.5","@img/sharp-linux-x64":"0.35.5","@img/sharp-linuxmusl-arm64":"0.35.5","@img/sharp-linuxmusl-x64":"0.35.5","@img/sharp-webcontainers-wasm32":"0.35.5","@img/sharp-win32-arm64":"0.35.5","@img/sharp-win32-ia32":"0.35.5","@img/sharp-win32-x64":"0.35.5"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.14","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.3","@img/sharp-libvips-dev":"1.3.4","@img/sharp-libvips-dev-wasm32":"1.3.4","@img/sharp-libvips-win32-arm64":"1.3.4","@img/sharp-libvips-win32-ia32":"1.3.4","@img/sharp-libvips-win32-x64":"1.3.4","@types/node":"*",emnapi:"^1.11.3","exif-reader":"^2.0.3",icc:"^4.0.0","node-addon-api":"^8.9.2","node-gyp":"^12.4.0",publint:"^0.3.24","tar-fs":"^3.1.3",tsd:"^0.33.0",yauzl:"^3.4.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.7"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as ja}from"node:child_process";import{createHash as Z5}from"node:crypto";var Ra,Hp,eq,oS,tq,Up,rq=(e)=>{if(e instanceof Error)console.error(`sharp: Installation error: ${e.message}`);else console.log(`sharp: ${e}`)},aS=()=>Hp.default.isNonGlibcLinuxSync()?Hp.default.familySync():"",nq=()=>`${process.platform}${aS()}-${process.arch}`,lo=()=>{if(cS())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r==="string"?r:aS();return`${t||process.platform}${n}-${e||process.arch}`},iq=()=>{try{return De(`@img/sharp-libvips-dev-${lo()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},sq=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},oq=()=>{try{return De(`@img/sharp-libvips-dev-${lo()}/lib`)}catch{try{return De(`@img/sharp-libvips-${lo()}/lib`)}catch{}}return""},aq=()=>{if(process.release?.name==="node"&&process.versions){if(!Ra.default.satisfies(process.versions.node,Un.engines.node))return{found:process.versions.node,expected:Un.engines.node}}},cS=()=>{let{CC:e}=process.env;return Boolean(e?.endsWith("/emcc"))},cq=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(ja("sysctl sysctl.proc_translated",Up).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},sS=(e)=>Z5("sha512").update(e).digest("hex"),lq=()=>{try{let e=sS(`imgsharp-libvips-${lo()}`),t=Ra.default.coerce(Un.optionalDependencies[`@img/sharp-libvips-${lo()}`],{includePrerelease:!0}).version;return sS(`${e}npm:${t}`).slice(0,10)}catch{}return""},uq=()=>ja(`node-gyp rebuild --directory=src ${cS()?"--nodedir=emscripten":""}`,{...Up,stdio:"inherit"}).status,lS=()=>{if(process.platform!=="win32")return(ja("pkg-config --modversion vips-cpp",{...Up,env:{...process.env,PKG_CONFIG_PATH:uS()}}).stdout||"").trim();else return""},fq=()=>{try{let e=(ja("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch(e){}return},dq=()=>{try{let e=(ja("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch(e){}return},uS=()=>{if(process.platform!=="win32")return[fq(),dq(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},Bp=(e,t,r)=>{if(r)r(`Detected ${t}, skipping search for globally-installed libvips`);return e},pq=(e)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return Bp(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return Bp(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(cq())return Bp(!1,"Rosetta",e);let t=lS();return!!t&&Ra.default.gte(t,oS)},Ql;var Vp=L(()=>{Xl();Ra=Bt(iS(),1),Hp=Bt(Ll(),1);/*!
372
+ */f={defined:B0,object:wD,plainObject:SD,fn:ED,bool:_D,buffer:PD,typedArray:kD,arrayBuffer:AD,string:jD,number:RD,integer:OD,inRange:CD,inArray:ID,invalidParameterError:TD,nativeError:ND}});var V0=C(function(Ure,U0){var H0=()=>process.platform==="linux",Nl=null,MD=()=>{if(!Nl)if(H0()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,Nl=process.report.getReport(),process.report.excludeNetwork=e}else Nl={};return Nl};U0.exports={isLinux:H0,getReport:MD}});var z0=C(function(Vre,W0){var so=De("fs"),LD=(e)=>{let t=so.openSync(e,"r"),r=Buffer.alloc(2048),n=so.readSync(t,r,0,2048,0);return so.close(t,()=>{}),r.subarray(0,n)},DD=(e)=>new Promise((t,r)=>{so.open(e,"r",(n,i)=>{if(n)r(n);else{let s=Buffer.alloc(2048);so.read(i,s,0,2048,0,(o,a)=>{t(s.subarray(0,a)),so.close(i,()=>{})})}})});W0.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:LD,readFile:DD}});var G0=C(function(Wre,K0){var JD=(e)=>{if(e.length<64)return null;if(e.readUInt32BE(0)!==2135247942)return null;if(e.readUInt8(4)!==2)return null;if(e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let i=0;i<n;i++){let s=t+i*r;if(e.readUInt32LE(s)===3){let a=e.readUInt32LE(s+8),c=e.readUInt32LE(s+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};K0.exports={interpreterPath:JD}});var Ll=C(function(zre,dv){var X0=De("child_process"),{isLinux:oo,getReport:Q0}=V0(),{LDD_PATH:Ml,SELF_PATH:Z0,readFile:_p,readFileSync:Pp}=z0(),{interpreterPath:ev}=G0(),yn,bn,xn,hi="",tv=()=>{if(!hi)return new Promise((e)=>{X0.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(t,r)=>{hi=t?" ":r,e(hi)})});return hi},rv=()=>{if(!hi)try{hi=X0.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(e){hi=" "}return hi},Hn="glibc",nv=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,ss="musl",FD=(e)=>e.includes("libc.musl-")||e.includes("ld-musl-"),iv=()=>{let e=Q0();if(e.header&&e.header.glibcVersionRuntime)return Hn;if(Array.isArray(e.sharedObjects)){if(e.sharedObjects.some(FD))return ss}return null},sv=(e)=>{let[t,r]=e.split(/[\r\n]+/);if(t&&t.includes(Hn))return Hn;if(r&&r.includes(ss))return ss;return null},ov=(e)=>{if(e){if(e.includes("/ld-musl-"))return ss;else if(e.includes("/ld-linux-"))return Hn}return null},av=(e)=>{if(e=e.toString(),e.includes("musl"))return ss;if(e.includes("GNU C Library"))return Hn;return null},qD=async()=>{if(bn!==void 0)return bn;bn=null;try{let e=await _p(Ml);bn=av(e)}catch(e){}return bn},BD=()=>{if(bn!==void 0)return bn;bn=null;try{let e=Pp(Ml);bn=av(e)}catch(e){}return bn},HD=async()=>{if(yn!==void 0)return yn;yn=null;try{let e=await _p(Z0),t=ev(e);yn=ov(t)}catch(e){}return yn},UD=()=>{if(yn!==void 0)return yn;yn=null;try{let e=Pp(Z0),t=ev(e);yn=ov(t)}catch(e){}return yn},cv=async()=>{let e=null;if(oo()){if(e=await HD(),!e){if(e=await qD(),!e)e=iv();if(!e){let t=await tv();e=sv(t)}}}return e},lv=()=>{let e=null;if(oo()){if(e=UD(),!e){if(e=BD(),!e)e=iv();if(!e){let t=rv();e=sv(t)}}}return e},VD=async()=>oo()&&await cv()!==Hn,WD=()=>oo()&&lv()!==Hn,zD=async()=>{if(xn!==void 0)return xn;xn=null;try{let t=(await _p(Ml)).match(nv);if(t)xn=t[1]}catch(e){}return xn},KD=()=>{if(xn!==void 0)return xn;xn=null;try{let t=Pp(Ml).match(nv);if(t)xn=t[1]}catch(e){}return xn},uv=()=>{let e=Q0();if(e.header&&e.header.glibcVersionRuntime)return e.header.glibcVersionRuntime;return null},Y0=(e)=>e.trim().split(/\s+/)[1],fv=(e)=>{let[t,r,n]=e.split(/[\r\n]+/);if(t&&t.includes(Hn))return Y0(t);if(r&&n&&r.includes(ss))return Y0(n);return null},GD=async()=>{let e=null;if(oo()){if(e=await zD(),!e)e=uv();if(!e){let t=await tv();e=fv(t)}}return e},YD=()=>{let e=null;if(oo()){if(e=KD(),!e)e=uv();if(!e){let t=rv();e=fv(t)}}return e};dv.exports={GLIBC:Hn,MUSL:ss,family:cv,familySync:lv,isNonGlibcLinux:VD,isNonGlibcLinuxSync:WD,version:GD,versionSync:YD}});var ao=C(function(Kre,pv){var XD=Number.MAX_SAFE_INTEGER||9007199254740991,QD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];pv.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:XD,RELEASE_TYPES:QD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Sa=C(function(Gre,mv){var ZD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};mv.exports=ZD});var co=C(function($n,hv){var{MAX_SAFE_COMPONENT_LENGTH:kp,MAX_SAFE_BUILD_LENGTH:eJ,MAX_LENGTH:tJ}=ao(),rJ=Sa();$n=hv.exports={};var nJ=$n.re=[],iJ=$n.safeRe=[],Y=$n.src=[],sJ=$n.safeSrc=[],X=$n.t={},oJ=0,Ap="[a-zA-Z0-9-]",aJ=[["\\s",1],["\\d",tJ],[Ap,eJ]],cJ=(e)=>{for(let[t,r]of aJ)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},xe=(e,t,r)=>{let n=cJ(t),i=oJ++;rJ(e,i,t),X[e]=i,Y[i]=t,sJ[i]=n,nJ[i]=new RegExp(t,r?"g":void 0),iJ[i]=new RegExp(n,r?"g":void 0)};xe("NUMERICIDENTIFIER","0|[1-9]\\d*");xe("NUMERICIDENTIFIERLOOSE","\\d+");xe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ap}*`);xe("MAINVERSION",`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`);xe("MAINVERSIONLOOSE",`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`);xe("PRERELEASEIDENTIFIER",`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIER]})`);xe("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIERLOOSE]})`);xe("PRERELEASE",`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`);xe("PRERELEASELOOSE",`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`);xe("BUILDIDENTIFIER",`${Ap}+`);xe("BUILD",`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`);xe("FULLPLAIN",`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`);xe("FULL",`^${Y[X.FULLPLAIN]}$`);xe("LOOSEPLAIN",`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`);xe("LOOSE",`^${Y[X.LOOSEPLAIN]}$`);xe("GTLT","((?:<|>)?=?)");xe("XRANGEIDENTIFIERLOOSE",`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);xe("XRANGEIDENTIFIER",`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`);xe("XRANGEPLAIN",`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`);xe("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`);xe("XRANGE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`);xe("XRANGELOOSE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`);xe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${kp}})(?:\\.(\\d{1,${kp}}))?(?:\\.(\\d{1,${kp}}))?`);xe("COERCE",`${Y[X.COERCEPLAIN]}(?:$|[^\\d])`);xe("COERCEFULL",Y[X.COERCEPLAIN]+`(?:${Y[X.PRERELEASE]})?(?:${Y[X.BUILD]})?(?:$|[^\\d])`);xe("COERCERTL",Y[X.COERCE],!0);xe("COERCERTLFULL",Y[X.COERCEFULL],!0);xe("LONETILDE","(?:~>?)");xe("TILDETRIM",`(\\s*)${Y[X.LONETILDE]}\\s+`,!0);$n.tildeTrimReplace="$1~";xe("TILDE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`);xe("TILDELOOSE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`);xe("LONECARET","(?:\\^)");xe("CARETTRIM",`(\\s*)${Y[X.LONECARET]}\\s+`,!0);$n.caretTrimReplace="$1^";xe("CARET",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`);xe("CARETLOOSE",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`);xe("COMPARATORLOOSE",`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`);xe("COMPARATOR",`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`);xe("COMPARATORTRIM",`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0);$n.comparatorTrimReplace="$1$2$3";xe("HYPHENRANGE",`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`);xe("HYPHENRANGELOOSE",`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`);xe("STAR","(<|>)?=?\\s*\\*");xe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");xe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Dl=C(function(Yre,gv){var lJ=Object.freeze({loose:!0}),uJ=Object.freeze({}),fJ=(e)=>{if(!e)return uJ;if(typeof e!=="object")return lJ;return e};gv.exports=fJ});var jp=C(function(Xre,xv){var yv=/^[0-9]+$/,bv=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=yv.test(e),n=yv.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},dJ=(e,t)=>bv(t,e);xv.exports={compareIdentifiers:bv,rcompareIdentifiers:dJ}});var Pt=C(function(Qre,vv){var Jl=Sa(),{MAX_LENGTH:$v,MAX_SAFE_INTEGER:Fl}=ao(),{safeRe:ql,t:Bl}=co(),pJ=Dl(),{compareIdentifiers:Rp}=jp(),mJ=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(Rp(e[n],r[n])!==0)return!1;return!0};class Zr{constructor(e,t){if(t=pJ(t),e instanceof Zr)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>$v)throw TypeError(`version is longer than ${$v} characters`);Jl("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?ql[Bl.LOOSE]:ql[Bl.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Fl||this.major<0)throw TypeError("Invalid major version");if(this.minor>Fl||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Fl||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Fl)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Jl("SemVer.compare",this.version,this.options,e),!(e instanceof Zr)){if(typeof e==="string"&&e===this.version)return 0;e=new Zr(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Zr))e=new Zr(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof Zr))e=new Zr(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Jl("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Rp(r,n)}while(++t)}compareBuild(e){if(!(e instanceof Zr))e=new Zr(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Jl("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Rp(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?ql[Bl.PRERELEASELOOSE]:ql[Bl.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(mJ(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}vv.exports=Zr});var gi=C(function(Zre,Sv){var wv=Pt(),hJ=(e,t,r=!1)=>{if(e instanceof wv)return e;try{return new wv(e,t)}catch(n){if(!r)return null;throw n}};Sv.exports=hJ});var _v=C(function(ene,Ev){var gJ=gi(),yJ=(e,t)=>{let r=gJ(e,t);return r?r.version:null};Ev.exports=yJ});var kv=C(function(tne,Pv){var bJ=gi(),xJ=(e,t)=>{let r=bJ(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Pv.exports=xJ});var Rv=C(function(rne,jv){var Av=Pt(),$J=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Av(e instanceof Av?e.version:e,r).inc(t,n,i).version}catch(s){return null}};jv.exports=$J});var Iv=C(function(nne,Cv){var Ov=gi(),vJ=(e,t)=>{let r=Ov(e,null,!0),n=Ov(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let u=c?"pre":"";if(r.major!==n.major)return u+"major";if(r.minor!==n.minor)return u+"minor";if(r.patch!==n.patch)return u+"patch";return"prerelease"};Cv.exports=vJ});var Nv=C(function(ine,Tv){var wJ=Pt(),SJ=(e,t)=>new wJ(e,t).major;Tv.exports=SJ});var Lv=C(function(sne,Mv){var EJ=Pt(),_J=(e,t)=>new EJ(e,t).minor;Mv.exports=_J});var Jv=C(function(one,Dv){var PJ=Pt(),kJ=(e,t)=>new PJ(e,t).patch;Dv.exports=kJ});var qv=C(function(ane,Fv){var AJ=gi(),jJ=(e,t)=>{let r=AJ(e,t);return r&&r.prerelease.length?r.prerelease:null};Fv.exports=jJ});var Dr=C(function(cne,Hv){var Bv=Pt(),RJ=(e,t,r)=>new Bv(e,r).compare(new Bv(t,r));Hv.exports=RJ});var Vv=C(function(lne,Uv){var OJ=Dr(),CJ=(e,t,r)=>OJ(t,e,r);Uv.exports=CJ});var zv=C(function(une,Wv){var IJ=Dr(),TJ=(e,t)=>IJ(e,t,!0);Wv.exports=TJ});var Hl=C(function(fne,Gv){var Kv=Pt(),NJ=(e,t,r)=>{let n=new Kv(e,r),i=new Kv(t,r);return n.compare(i)||n.compareBuild(i)};Gv.exports=NJ});var Xv=C(function(dne,Yv){var MJ=Hl(),LJ=(e,t)=>e.sort((r,n)=>MJ(r,n,t));Yv.exports=LJ});var Zv=C(function(pne,Qv){var DJ=Hl(),JJ=(e,t)=>e.sort((r,n)=>DJ(n,r,t));Qv.exports=JJ});var Ea=C(function(mne,ew){var FJ=Dr(),qJ=(e,t,r)=>FJ(e,t,r)>0;ew.exports=qJ});var Ul=C(function(hne,tw){var BJ=Dr(),HJ=(e,t,r)=>BJ(e,t,r)<0;tw.exports=HJ});var Op=C(function(gne,rw){var UJ=Dr(),VJ=(e,t,r)=>UJ(e,t,r)===0;rw.exports=VJ});var Cp=C(function(yne,nw){var WJ=Dr(),zJ=(e,t,r)=>WJ(e,t,r)!==0;nw.exports=zJ});var Vl=C(function(bne,iw){var KJ=Dr(),GJ=(e,t,r)=>KJ(e,t,r)>=0;iw.exports=GJ});var Wl=C(function(xne,sw){var YJ=Dr(),XJ=(e,t,r)=>YJ(e,t,r)<=0;sw.exports=XJ});var Ip=C(function($ne,ow){var QJ=Op(),ZJ=Cp(),eF=Ea(),tF=Vl(),rF=Ul(),nF=Wl(),iF=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return QJ(e,r,n);case"!=":return ZJ(e,r,n);case">":return eF(e,r,n);case">=":return tF(e,r,n);case"<":return rF(e,r,n);case"<=":return nF(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};ow.exports=iF});var cw=C(function(vne,aw){var sF=Pt(),oF=gi(),{safeRe:zl,t:Kl}=co(),aF=(e,t)=>{if(e instanceof sF)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?zl[Kl.COERCEFULL]:zl[Kl.COERCE]);else{let c=t.includePrerelease?zl[Kl.COERCERTLFULL]:zl[Kl.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return oF(`${n}.${i}.${s}${o}${a}`,t)};aw.exports=aF});var uw=C(function(wne,lw){var cF=gi(),lF=ao(),uF=Pt(),fF=(e,t,r)=>{if(!lF.RELEASE_TYPES.includes(t))return null;let n=dF(e,r);return n&&pF(n,t)},dF=(e,t)=>{let r=e instanceof uF?e.version:e;return cF(r,t)},pF=(e,t)=>{if(mF(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},mF=(e)=>e.startsWith("pre");lw.exports=fF});var pw=C(function(Sne,dw){class fw{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}dw.exports=fw});var Jr=C(function(Ene,yw){var hF=/\s+/g;class _a{constructor(e,t){if(t=yF(t),e instanceof _a)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new _a(e.raw,t);if(e instanceof Tp)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(hF," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!hw(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&PF(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(_F,"");let r=((this.options.includePrerelease&&SF)|(this.options.loose&&EF))+":"+e,n=mw.get(r);if(n)return n;let i=this.options.loose,s=i?Gt[kt.HYPHENRANGELOOSE]:Gt[kt.HYPHENRANGE];e=e.replace(s,LF(this.options.includePrerelease)),Ge("hyphen replace",e),e=e.replace(Gt[kt.COMPARATORTRIM],$F),Ge("comparator trim",e),e=e.replace(Gt[kt.TILDETRIM],vF),Ge("tilde trim",e),e=e.replace(Gt[kt.CARETTRIM],wF),Ge("caret trim",e);let o=e.split(" ").map((u)=>kF(u,this.options)).join(" ").split(/\s+/).map((u)=>MF(u,this.options));if(i)o=o.filter((u)=>(Ge("loose invalid filter",u,this.options),!!u.match(Gt[kt.COMPARATORLOOSE])));Ge("range list",o);let a=new Map,c=o.map((u)=>new Tp(u,this.options));for(let u of c){if(hw(u))return[u];a.set(u.value,u)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return mw.set(r,l),l}intersects(e,t){if(!(e instanceof _a))throw TypeError("a Range is required");return this.set.some((r)=>gw(r,t)&&e.set.some((n)=>gw(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new bF(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(DF(this.set[t],e,this.options))return!0;return!1}}yw.exports=_a;var gF=pw(),mw=new gF,yF=Dl(),Tp=Pa(),Ge=Sa(),bF=Pt(),{safeRe:Gt,src:xF,t:kt,comparatorTrimReplace:$F,tildeTrimReplace:vF,caretTrimReplace:wF}=co(),{FLAG_INCLUDE_PRERELEASE:SF,FLAG_LOOSE:EF}=ao(),_F=new RegExp(xF[kt.BUILD],"g"),hw=(e)=>e.value==="<0.0.0-0",PF=(e)=>e.value==="",gw=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},kF=(e,t)=>(e=e.replace(Gt[kt.BUILD],""),Ge("comp",e,t),e=OF(e,t),Ge("caret",e),e=jF(e,t),Ge("tildes",e),e=IF(e,t),Ge("xrange",e),e=NF(e,t),Ge("stars",e),e),xt=(e)=>!e||e.toLowerCase()==="x"||e==="*",AF=(e,t,r)=>xt(e)&&!xt(t)||xt(t)&&r&&!xt(r),jF=(e,t)=>e.trim().split(/\s+/).map((r)=>RF(r,t)).join(" "),RF=(e,t)=>{let r=t.loose?Gt[kt.TILDELOOSE]:Gt[kt.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{Ge("tilde",e,i,s,o,a,c);let l;if(xt(s))l="";else if(xt(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(xt(a))l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(c)Ge("replaceTilde pr",c),l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;return Ge("tilde return",l),l})},OF=(e,t)=>e.trim().split(/\s+/).map((r)=>CF(r,t)).join(" "),CF=(e,t)=>{Ge("caret",e,t);let r=t.loose?Gt[kt.CARETLOOSE]:Gt[kt.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{Ge("caret",e,i,s,o,a,c);let l;if(xt(s))l="";else if(xt(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(xt(a))if(s==="0")l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(c)if(Ge("replaceCaret pr",c),s==="0")if(o==="0")l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`;else if(Ge("no pr"),s==="0")if(o==="0")l=`>=${s}.${o}.${a} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`;return Ge("caret return",l),l})},IF=(e,t)=>(Ge("replaceXRanges",e,t),e.split(/\s+/).map((r)=>TF(r,t)).join(" ")),TF=(e,t)=>{e=e.trim();let r=t.loose?Gt[kt.XRANGELOOSE]:Gt[kt.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{if(Ge("xRange",e,n,i,s,o,a,c),AF(s,o,a))return e;let l=xt(s),u=l||xt(o),d=u||xt(a),h=d;if(i==="="&&h)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&h){if(u)o=0;if(a=0,i===">")if(i=">=",u)s=+s+1,o=0,a=0;else o=+o+1,a=0;else if(i==="<=")if(i="<",u)s=+s+1;else o=+o+1;if(i==="<")c="-0";n=`${i+s}.${o}.${a}${c}`}else if(u)n=`>=${s}.0.0${c} <${+s+1}.0.0-0`;else if(d)n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`;return Ge("xRange return",n),n})},NF=(e,t)=>(Ge("replaceStars",e,t),e.trim().replace(Gt[kt.STAR],"")),MF=(e,t)=>(Ge("replaceGTE0",e,t),e.trim().replace(Gt[t.includePrerelease?kt.GTE0PRE:kt.GTE0],"")),LF=(e)=>(t,r,n,i,s,o,a,c,l,u,d,h)=>{if(xt(n))r="";else if(xt(i))r=`>=${n}.0.0${e?"-0":""}`;else if(xt(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(xt(l))c="";else if(xt(u))c=`<${+l+1}.0.0-0`;else if(xt(d))c=`<${l}.${+u+1}.0-0`;else if(h)c=`<=${l}.${u}.${d}-${h}`;else if(e)c=`<${l}.${u}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},DF=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(Ge(e[n].semver),e[n].semver===Tp.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var Pa=C(function(_ne,Sw){var ka=Symbol("SemVer ANY");class Gl{static get ANY(){return ka}constructor(e,t){if(t=bw(t),e instanceof Gl)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),Mp("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ka)this.value="";else this.value=this.operator+this.semver.version;Mp("comp",this)}parse(e){let t=this.options.loose?xw[$w.COMPARATORLOOSE]:xw[$w.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=ka;else this.semver=new vw(r[2],this.options.loose)}toString(){return this.value}test(e){if(Mp("Comparator.test",e,this.options.loose),this.semver===ka||e===ka)return!0;if(typeof e==="string")try{e=new vw(e,this.options)}catch(t){return!1}return Np(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Gl))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new ww(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new ww(this.value,t).test(e.semver)}if(t=bw(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Np(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Np(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Sw.exports=Gl;var bw=Dl(),{safeRe:xw,t:$w}=co(),Np=Ip(),Mp=Sa(),vw=Pt(),ww=Jr()});var Aa=C(function(Pne,Ew){var JF=Jr(),FF=(e,t,r)=>{try{t=new JF(t,r)}catch(n){return!1}return t.test(e)};Ew.exports=FF});var Pw=C(function(kne,_w){var qF=Jr(),BF=(e,t)=>new qF(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));_w.exports=BF});var Aw=C(function(Ane,kw){var HF=Pt(),UF=Jr(),VF=(e,t,r)=>{let n=null,i=null,s=null;try{s=new UF(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new HF(n,r)}}),n};kw.exports=VF});var Rw=C(function(jne,jw){var WF=Pt(),zF=Jr(),KF=(e,t,r)=>{let n=null,i=null,s=null;try{s=new zF(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new WF(n,r)}}),n};jw.exports=KF});var Iw=C(function(Rne,Cw){var Lp=Pt(),GF=Jr(),Ow=Ea(),YF=(e,t)=>{e=new GF(e,t);let r=new Lp("0.0.0");if(e.test(r))return r;if(r=new Lp("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let a=new Lp(o.semver.version);switch(o.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!s||Ow(a,s))s=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Ow(r,s)))r=s}if(r&&e.test(r))return r;return null};Cw.exports=YF});var Nw=C(function(One,Tw){var XF=Jr(),QF=(e,t)=>{try{return new XF(e,t).range||"*"}catch(r){return null}};Tw.exports=QF});var Yl=C(function(Cne,Jw){var ZF=Pt(),Dw=Pa(),{ANY:e5}=Dw,t5=Jr(),r5=Aa(),Mw=Ea(),Lw=Ul(),n5=Wl(),i5=Vl(),s5=(e,t,r,n)=>{e=new ZF(e,n),t=new t5(t,n);let i,s,o,a,c;switch(r){case">":i=Mw,s=n5,o=Lw,a=">",c=">=";break;case"<":i=Lw,s=i5,o=Mw,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(r5(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],d=null,h=null;if(u.forEach((m)=>{if(m.semver===e5)m=new Dw(">=0.0.0");if(d=d||m,h=h||m,i(m.semver,d.semver,n))d=m;else if(o(m.semver,h.semver,n))h=m}),d.operator===a||d.operator===c)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;else if(h.operator===c&&o(e,h.semver))return!1}return!0};Jw.exports=s5});var qw=C(function(Ine,Fw){var o5=Yl(),a5=(e,t,r)=>o5(e,t,">",r);Fw.exports=a5});var Hw=C(function(Tne,Bw){var c5=Yl(),l5=(e,t,r)=>c5(e,t,"<",r);Bw.exports=l5});var Ww=C(function(Nne,Vw){var Uw=Jr(),u5=(e,t,r)=>(e=new Uw(e,r),t=new Uw(t,r),e.intersects(t,r));Vw.exports=u5});var Kw=C(function(Mne,zw){var f5=Aa(),d5=Dr();zw.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((u,d)=>d5(u,d,r));for(let u of o)if(f5(u,t,r)){if(s=u,!i)i=u}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let a=[];for(let[u,d]of n)if(u===d)a.push(u);else if(!d&&u===o[0])a.push("*");else if(!d)a.push(`>=${u}`);else if(u===o[0])a.push(`<=${d}`);else a.push(`${u} - ${d}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var eS=C(function(Lne,Zw){var Gw=Jr(),Fp=Pa(),{ANY:Dp}=Fp,Jp=Aa(),qp=Dr(),p5=(e,t,r={})=>{if(e===t)return!0;e=new Gw(e,r),t=new Gw(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=h5(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},m5=[new Fp(">=0.0.0-0")],Yw=[new Fp(">=0.0.0")],h5=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Dp)if(t.length===1&&t[0].semver===Dp)return!0;else if(r.includePrerelease)e=m5;else e=Yw;if(t.length===1&&t[0].semver===Dp)if(r.includePrerelease)return!0;else t=Yw;let n=new Set,i,s;for(let m of e)if(m.operator===">"||m.operator===">=")i=Xw(i,m,r);else if(m.operator==="<"||m.operator==="<=")s=Qw(s,m,r);else n.add(m.semver);if(n.size>1)return null;let o;if(i&&s){if(o=qp(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let m of n){if(i&&!Jp(m,String(i),r))return null;if(s&&!Jp(m,String(s),r))return null;for(let y of t)if(!Jp(m,String(y),r))return!1;return!0}let a,c,l,u,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0)d=!1;for(let m of t){if(u=u||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",i){if(h){if(m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===h.major&&m.semver.minor===h.minor&&m.semver.patch===h.patch)h=!1}if(m.operator===">"||m.operator===">="){if(a=Xw(i,m,r),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(s){if(d){if(m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch)d=!1}if(m.operator==="<"||m.operator==="<="){if(c=Qw(s,m,r),c===m&&c!==s)return!1}else if(s.operator==="<="&&!m.test(s.semver))return!1}if(!m.operator&&(s||i)&&o!==0)return!1}if(i&&l&&!s&&o!==0)return!1;if(s&&u&&!i&&o!==0)return!1;if(h||d)return!1;return!0},Xw=(e,t,r)=>{if(!e)return t;let n=qp(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Qw=(e,t,r)=>{if(!e)return t;let n=qp(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Zw.exports=p5});var iS=C(function(Dne,nS){var Bp=co(),tS=ao(),g5=Pt(),rS=jp(),y5=gi(),b5=_v(),x5=kv(),$5=Rv(),v5=Iv(),w5=Nv(),S5=Lv(),E5=Jv(),_5=qv(),P5=Dr(),k5=Vv(),A5=zv(),j5=Hl(),R5=Xv(),O5=Zv(),C5=Ea(),I5=Ul(),T5=Op(),N5=Cp(),M5=Vl(),L5=Wl(),D5=Ip(),J5=cw(),F5=uw(),q5=Pa(),B5=Jr(),H5=Aa(),U5=Pw(),V5=Aw(),W5=Rw(),z5=Iw(),K5=Nw(),G5=Yl(),Y5=qw(),X5=Hw(),Q5=Ww(),Z5=Kw(),eq=eS();nS.exports={parse:y5,valid:b5,clean:x5,inc:$5,diff:v5,major:w5,minor:S5,patch:E5,prerelease:_5,compare:P5,rcompare:k5,compareLoose:A5,compareBuild:j5,sort:R5,rsort:O5,gt:C5,lt:I5,eq:T5,neq:N5,gte:M5,lte:L5,cmp:D5,coerce:J5,truncate:F5,Comparator:q5,Range:B5,satisfies:H5,toComparators:U5,maxSatisfying:V5,minSatisfying:W5,minVersion:z5,validRange:K5,outside:G5,gtr:Y5,ltr:X5,intersects:Q5,simplifyRange:Z5,subset:eq,SemVer:g5,re:Bp.re,src:Bp.src,tokens:Bp.t,SEMVER_SPEC_VERSION:tS.SEMVER_SPEC_VERSION,RELEASE_TYPES:tS.RELEASE_TYPES,compareIdentifiers:rS.compareIdentifiers,rcompareIdentifiers:rS.rcompareIdentifiers}});var Un;var Xl=L(()=>{Un={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.5","@img/sharp-darwin-x64":"0.35.5","@img/sharp-freebsd-wasm32":"0.35.5","@img/sharp-libvips-darwin-arm64":"1.3.4","@img/sharp-libvips-darwin-x64":"1.3.4","@img/sharp-libvips-linux-arm":"1.3.4","@img/sharp-libvips-linux-arm64":"1.3.4","@img/sharp-libvips-linux-ppc64":"1.3.4","@img/sharp-libvips-linux-riscv64":"1.3.4","@img/sharp-libvips-linux-s390x":"1.3.4","@img/sharp-libvips-linux-x64":"1.3.4","@img/sharp-libvips-linuxmusl-arm64":"1.3.4","@img/sharp-libvips-linuxmusl-x64":"1.3.4","@img/sharp-linux-arm":"0.35.5","@img/sharp-linux-arm64":"0.35.5","@img/sharp-linux-ppc64":"0.35.5","@img/sharp-linux-riscv64":"0.35.5","@img/sharp-linux-s390x":"0.35.5","@img/sharp-linux-x64":"0.35.5","@img/sharp-linuxmusl-arm64":"0.35.5","@img/sharp-linuxmusl-x64":"0.35.5","@img/sharp-webcontainers-wasm32":"0.35.5","@img/sharp-win32-arm64":"0.35.5","@img/sharp-win32-ia32":"0.35.5","@img/sharp-win32-x64":"0.35.5"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.14","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.3","@img/sharp-libvips-dev":"1.3.4","@img/sharp-libvips-dev-wasm32":"1.3.4","@img/sharp-libvips-win32-arm64":"1.3.4","@img/sharp-libvips-win32-ia32":"1.3.4","@img/sharp-libvips-win32-x64":"1.3.4","@types/node":"*",emnapi:"^1.11.3","exif-reader":"^2.0.3",icc:"^4.0.0","node-addon-api":"^8.9.2","node-gyp":"^12.4.0",publint:"^0.3.24","tar-fs":"^3.1.3",tsd:"^0.33.0",yauzl:"^3.4.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.7"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as ja}from"node:child_process";import{createHash as rq}from"node:crypto";var Ra,Up,nq,oS,iq,Vp,sq=(e)=>{if(e instanceof Error)console.error(`sharp: Installation error: ${e.message}`);else console.log(`sharp: ${e}`)},aS=()=>Up.default.isNonGlibcLinuxSync()?Up.default.familySync():"",oq=()=>`${process.platform}${aS()}-${process.arch}`,lo=()=>{if(cS())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r==="string"?r:aS();return`${t||process.platform}${n}-${e||process.arch}`},aq=()=>{try{return De(`@img/sharp-libvips-dev-${lo()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},cq=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},lq=()=>{try{return De(`@img/sharp-libvips-dev-${lo()}/lib`)}catch{try{return De(`@img/sharp-libvips-${lo()}/lib`)}catch{}}return""},uq=()=>{if(process.release?.name==="node"&&process.versions){if(!Ra.default.satisfies(process.versions.node,Un.engines.node))return{found:process.versions.node,expected:Un.engines.node}}},cS=()=>{let{CC:e}=process.env;return Boolean(e?.endsWith("/emcc"))},fq=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(ja("sysctl sysctl.proc_translated",Vp).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},sS=(e)=>rq("sha512").update(e).digest("hex"),dq=()=>{try{let e=sS(`imgsharp-libvips-${lo()}`),t=Ra.default.coerce(Un.optionalDependencies[`@img/sharp-libvips-${lo()}`],{includePrerelease:!0}).version;return sS(`${e}npm:${t}`).slice(0,10)}catch{}return""},pq=()=>ja(`node-gyp rebuild --directory=src ${cS()?"--nodedir=emscripten":""}`,{...Vp,stdio:"inherit"}).status,lS=()=>{if(process.platform!=="win32")return(ja("pkg-config --modversion vips-cpp",{...Vp,env:{...process.env,PKG_CONFIG_PATH:uS()}}).stdout||"").trim();else return""},mq=()=>{try{let e=(ja("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch(e){}return},hq=()=>{try{let e=(ja("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch(e){}return},uS=()=>{if(process.platform!=="win32")return[mq(),hq(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},Hp=(e,t,r)=>{if(r)r(`Detected ${t}, skipping search for globally-installed libvips`);return e},gq=(e)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return Hp(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return Hp(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(fq())return Hp(!1,"Rosetta",e);let t=lS();return!!t&&Ra.default.gte(t,oS)},Ql;var Wp=L(()=>{Xl();Ra=Bt(iS(),1),Up=Bt(Ll(),1);/*!
373
373
  Copyright 2013 Lovell Fuller and others.
374
374
  SPDX-License-Identifier: Apache-2.0
375
- */eq=process.env.npm_package_config_libvips||Un.config.libvips,oS=Ra.default.coerce(eq).version,tq=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],Up={encoding:"utf8",shell:!0},Ql={minimumLibvipsVersion:oS,prebuiltPlatforms:tq,buildPlatformArch:lo,buildSharpLibvipsIncludeDir:iq,buildSharpLibvipsCPlusPlusDir:sq,buildSharpLibvipsLibDir:oq,isUnsupportedNodeRuntime:aq,runtimePlatformArch:nq,log:rq,yarnLocator:lq,spawnRebuild:uq,globalLibvipsVersion:lS,pkgConfigPath:uS,useGlobalLibvips:pq}});import{createRequire as mq}from"node:module";var Zl,$t,dS,hq,fS,gq,yq,Vn,He,yi,Le;var Oa=L(()=>{Vp();Xl();Zl=Bt(Ll(),1);/*!
375
+ */nq=process.env.npm_package_config_libvips||Un.config.libvips,oS=Ra.default.coerce(nq).version,iq=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],Vp={encoding:"utf8",shell:!0},Ql={minimumLibvipsVersion:oS,prebuiltPlatforms:iq,buildPlatformArch:lo,buildSharpLibvipsIncludeDir:aq,buildSharpLibvipsCPlusPlusDir:cq,buildSharpLibvipsLibDir:lq,isUnsupportedNodeRuntime:uq,runtimePlatformArch:oq,log:sq,yarnLocator:dq,spawnRebuild:pq,globalLibvipsVersion:lS,pkgConfigPath:uS,useGlobalLibvips:gq}});import{createRequire as yq}from"node:module";var Zl,$t,dS,bq,fS,xq,$q,Vn,He,yi,Le;var Oa=L(()=>{Wp();Xl();Zl=Bt(Ll(),1);/*!
376
376
  Copyright 2013 Lovell Fuller and others.
377
377
  SPDX-License-Identifier: Apache-2.0
378
- */$t=mq(import.meta.url),{version:dS}=Un,{runtimePlatformArch:hq,isUnsupportedNodeRuntime:fS,prebuiltPlatforms:gq,minimumLibvipsVersion:yq}=Ql,Vn=hq(),yi=[];try{He=$t(`../src/build/Release/sharp-${Vn}-${dS}.node`)}catch(e){yi.push(e)}if(!He)try{He=$t(`../src/build/Release/sharp-wasm32-${dS}.node`)}catch(e){yi.push(e)}if(!He)try{switch(Vn){case"darwin-arm64":He=$t("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":He=$t("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":He=$t("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":He=$t("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":He=$t("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":He=$t("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":He=$t("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":He=$t("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":He=$t("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":He=$t("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":He=$t("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":He=$t("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":He=$t("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":He=$t("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":He=$t("@img/sharp-webcontainers-wasm32/sharp.node");break}if(He&&["linux-x64","linuxmusl-x64"].includes(Vn)&&!He._isUsingX64V2()){let e=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",yi.push(e),He=null}if(He&&process.versions.electron&&Vn.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(e){yi.push(e)}if(!He)try{He=$t("@img/sharp-wasm32/sharp.node")}catch(e){yi.push(e)}if(!He){let[e,t,r]=["linux","darwin","win32"].map((s)=>Vn.startsWith(s)),n=[`Could not load the "sharp" module using the ${Vn} runtime`];yi.forEach((s)=>{if(!s.code?.endsWith("MODULE_NOT_FOUND"))n.push(s.code?`${s.code}: ${s.message}`:s.message)});let i=yi.map((s)=>s.message).join(" ");if(n.push("Possible solutions:"),fS()){let{found:s,expected:o}=fS();n.push("- Please upgrade Node.js:",` Found ${s}`,` Requires ${o}`)}else if(gq.includes(Vn)&&!/libstdc\+\+\.so/.test(i)){let[s,o]=Vn.split("-"),a=s.endsWith("musl")?" --libc=musl":"";n.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${s.replace("musl","")}${a} --cpu=${o} sharp`)}else n.push(`- Manually install libvips >= ${yq}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:s}=$t(`@img/sharp-libvips-${Vn}/package`),o=`${Zl.familySync()} ${Zl.versionSync()}`,a=`${s.musl?"musl":"glibc"} ${s.musl||s.glibc}`;n.push("- Update your OS:",` Found ${o}`,` Requires ${a}`)}catch(s){}if(e&&/\/snap\/core[0-9]{2}/.test(i))n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(t&&/Incompatible library version/.test(i))n.push("- Update Homebrew:"," brew update && brew upgrade vips");if(yi.some((s)=>s.code==="ERR_DLOPEN_DISABLED"))n.push("- Run Node.js without using the --no-addons flag");if(r&&/The specified procedure could not be found/.test(i))n.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw n.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(n.join(`
379
- `))}Le=He});import bq from"node:util";import Wp from"node:stream";function vq(){let e=this.constructor.call(),{debuglog:t,queueListener:r,...n}=this.options;if(e.options=structuredClone(n),e.options.debuglog=t,e.options.queueListener=r,this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")});return e}var xq,$q=(e)=>{os.queue.emit("change",e)},os=function(e,t){if(arguments.length===1&&!f.defined(e))throw Error("Invalid input");if(!(this instanceof os))return new os(e,t);return Wp.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(r)=>{this.emit("warning",r),xq(r)},queueListener:$q},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this},vn;var pS=L(()=>{gn();Oa();/*!
378
+ */$t=yq(import.meta.url),{version:dS}=Un,{runtimePlatformArch:bq,isUnsupportedNodeRuntime:fS,prebuiltPlatforms:xq,minimumLibvipsVersion:$q}=Ql,Vn=bq(),yi=[];try{He=$t(`../src/build/Release/sharp-${Vn}-${dS}.node`)}catch(e){yi.push(e)}if(!He)try{He=$t(`../src/build/Release/sharp-wasm32-${dS}.node`)}catch(e){yi.push(e)}if(!He)try{switch(Vn){case"darwin-arm64":He=$t("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":He=$t("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":He=$t("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":He=$t("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":He=$t("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":He=$t("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":He=$t("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":He=$t("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":He=$t("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":He=$t("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":He=$t("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":He=$t("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":He=$t("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":He=$t("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":He=$t("@img/sharp-webcontainers-wasm32/sharp.node");break}if(He&&["linux-x64","linuxmusl-x64"].includes(Vn)&&!He._isUsingX64V2()){let e=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",yi.push(e),He=null}if(He&&process.versions.electron&&Vn.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(e){yi.push(e)}if(!He)try{He=$t("@img/sharp-wasm32/sharp.node")}catch(e){yi.push(e)}if(!He){let[e,t,r]=["linux","darwin","win32"].map((s)=>Vn.startsWith(s)),n=[`Could not load the "sharp" module using the ${Vn} runtime`];yi.forEach((s)=>{if(!s.code?.endsWith("MODULE_NOT_FOUND"))n.push(s.code?`${s.code}: ${s.message}`:s.message)});let i=yi.map((s)=>s.message).join(" ");if(n.push("Possible solutions:"),fS()){let{found:s,expected:o}=fS();n.push("- Please upgrade Node.js:",` Found ${s}`,` Requires ${o}`)}else if(xq.includes(Vn)&&!/libstdc\+\+\.so/.test(i)){let[s,o]=Vn.split("-"),a=s.endsWith("musl")?" --libc=musl":"";n.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${s.replace("musl","")}${a} --cpu=${o} sharp`)}else n.push(`- Manually install libvips >= ${$q}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:s}=$t(`@img/sharp-libvips-${Vn}/package`),o=`${Zl.familySync()} ${Zl.versionSync()}`,a=`${s.musl?"musl":"glibc"} ${s.musl||s.glibc}`;n.push("- Update your OS:",` Found ${o}`,` Requires ${a}`)}catch(s){}if(e&&/\/snap\/core[0-9]{2}/.test(i))n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(t&&/Incompatible library version/.test(i))n.push("- Update Homebrew:"," brew update && brew upgrade vips");if(yi.some((s)=>s.code==="ERR_DLOPEN_DISABLED"))n.push("- Run Node.js without using the --no-addons flag");if(r&&/The specified procedure could not be found/.test(i))n.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw n.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(n.join(`
379
+ `))}Le=He});import vq from"node:util";import zp from"node:stream";function Eq(){let e=this.constructor.call(),{debuglog:t,queueListener:r,...n}=this.options;if(e.options=structuredClone(n),e.options.debuglog=t,e.options.queueListener=r,this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")});return e}var wq,Sq=(e)=>{os.queue.emit("change",e)},os=function(e,t){if(arguments.length===1&&!f.defined(e))throw Error("Invalid input");if(!(this instanceof os))return new os(e,t);return zp.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(r)=>{this.emit("warning",r),wq(r)},queueListener:Sq},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this},vn;var pS=L(()=>{gn();Oa();/*!
380
380
  Copyright 2013 Lovell Fuller and others.
381
381
  SPDX-License-Identifier: Apache-2.0
382
- */xq=bq.debuglog("sharp");Object.setPrototypeOf(os.prototype,Wp.Duplex.prototype);Object.setPrototypeOf(os,Wp.Duplex);Object.assign(os.prototype,{clone:vq});vn=os});function mS(e){let t=Sq.filter((r)=>f.defined(e[r])).map((r)=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function Eq(e,t,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(e))n.file=e;else if(f.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");n.buffer=e}else if(f.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(e,0,e.byteLength)}else if(f.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(f.plainObject(e)&&!f.defined(t)){if(t=e,mS(t))n.buffer=[]}else if(!f.defined(e)&&!f.defined(t)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map((i)=>this._createInputDescriptor(i));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${e}' of type ${typeof e}${f.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(f.object(t)){if(f.defined(t.failOn))if(f.string(t.failOn)&&f.inArray(t.failOn,["none","truncated","error","warning"]))n.failOn=t.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(f.defined(t.autoOrient))if(f.bool(t.autoOrient))n.autoOrient=t.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",t.autoOrient);if(f.defined(t.density))if(f.number(t.density)&&f.inRange(t.density,1,1e5))n.density=t.density;else throw f.invalidParameterError("density","number between 1 and 100000",t.density);if(f.defined(t.ignoreIcc))if(f.bool(t.ignoreIcc))n.ignoreIcc=t.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(f.defined(t.limitInputPixels))if(f.bool(t.limitInputPixels))n.limitInputPixels=t.limitInputPixels?268402689:0;else if(f.integer(t.limitInputPixels)&&f.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=t.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(f.defined(t.limitInputChannels))if(f.bool(t.limitInputChannels))n.limitInputChannels=t.limitInputChannels?5:0;else if(f.integer(t.limitInputChannels)&&f.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=t.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(f.defined(t.unlimited))if(f.bool(t.unlimited))n.unlimited=t.unlimited;else throw f.invalidParameterError("unlimited","boolean",t.unlimited);if(f.defined(t.sequentialRead))if(f.bool(t.sequentialRead))n.sequentialRead=t.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(f.defined(t.raw)){if(f.object(t.raw)&&f.integer(t.raw.width)&&f.inRange(t.raw.width,1,1e8)&&f.integer(t.raw.height)&&f.inRange(t.raw.height,1,1e8)&&f.integer(t.raw.channels)&&f.inRange(t.raw.channels,1,4))switch(n.rawWidth=t.raw.width,n.rawHeight=t.raw.height,n.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:n.rawDepth="uchar";break;case Int8Array:n.rawDepth="char";break;case Uint16Array:n.rawDepth="ushort";break;case Int16Array:n.rawDepth="short";break;case Uint32Array:n.rawDepth="uint";break;case Int32Array:n.rawDepth="int";break;case Float32Array:n.rawDepth="float";break;case Float64Array:n.rawDepth="double";break;default:n.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(n.rawPremultiplied=!1,f.defined(t.raw.premultiplied))if(f.bool(t.raw.premultiplied))n.rawPremultiplied=t.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(n.rawPageHeight=0,f.defined(t.raw.pageHeight))if(f.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);n.rawPageHeight=t.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(f.defined(t.animated))if(f.bool(t.animated))n.pages=t.animated?-1:1;else throw f.invalidParameterError("animated","boolean",t.animated);if(f.defined(t.pages))if(f.integer(t.pages)&&f.inRange(t.pages,-1,1e5))n.pages=t.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(f.defined(t.page))if(f.integer(t.page)&&f.inRange(t.page,0,1e5))n.page=t.page;else throw f.invalidParameterError("page","integer between 0 and 100000",t.page);if(f.object(t.openSlide)&&f.defined(t.openSlide.level))if(f.integer(t.openSlide.level)&&f.inRange(t.openSlide.level,0,256))n.openSlideLevel=t.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(f.defined(t.level))if(f.integer(t.level)&&f.inRange(t.level,0,256))n.openSlideLevel=t.level;else throw f.invalidParameterError("level","integer between 0 and 256",t.level);if(f.object(t.tiff)&&f.defined(t.tiff.subifd))if(f.integer(t.tiff.subifd)&&f.inRange(t.tiff.subifd,-1,1e5))n.tiffSubifd=t.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(f.defined(t.subifd))if(f.integer(t.subifd)&&f.inRange(t.subifd,-1,1e5))n.tiffSubifd=t.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(f.object(t.svg)){if(f.defined(t.svg.stylesheet))if(f.string(t.svg.stylesheet))n.svgStylesheet=t.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(f.defined(t.svg.highBitdepth))if(f.bool(t.svg.highBitdepth))n.svgHighBitdepth=t.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(f.object(t.pdf)&&f.defined(t.pdf.background))n.pdfBackground=this._getBackgroundColourOption(t.pdf.background);else if(f.defined(t.pdfBackground))n.pdfBackground=this._getBackgroundColourOption(t.pdfBackground);if(f.object(t.jp2)&&f.defined(t.jp2.oneshot))if(f.bool(t.jp2.oneshot))n.jp2Oneshot=t.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(f.defined(t.create))if(f.object(t.create)&&f.integer(t.create.width)&&f.inRange(t.create.width,1,1e8)&&f.integer(t.create.height)&&f.inRange(t.create.height,1,1e8)&&f.integer(t.create.channels)){if(n.createWidth=t.create.width,n.createHeight=t.create.height,n.createChannels=t.create.channels,n.createPageHeight=0,f.defined(t.create.pageHeight))if(f.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);n.createPageHeight=t.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(f.defined(t.create.noise)){if(!f.object(t.create.noise))throw Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=t.create.noise.type,!f.inRange(t.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(n.createNoiseMean=128,f.defined(t.create.noise.mean))if(f.number(t.create.noise.mean)&&f.inRange(t.create.noise.mean,0,1e4))n.createNoiseMean=t.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(n.createNoiseSigma=30,f.defined(t.create.noise.sigma))if(f.number(t.create.noise.sigma)&&f.inRange(t.create.noise.sigma,0,1e4))n.createNoiseSigma=t.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(f.defined(t.create.background)){if(!f.inRange(t.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);n.createBackground=this._getBackgroundColourOption(t.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete n.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(f.defined(t.text))if(f.object(t.text)&&f.string(t.text.text)){if(n.textValue=t.text.text,f.defined(t.text.height)&&f.defined(t.text.dpi))throw Error("Expected only one of dpi or height");if(f.defined(t.text.font))if(f.string(t.text.font))n.textFont=t.text.font;else throw f.invalidParameterError("text.font","string",t.text.font);if(f.defined(t.text.fontfile))if(f.string(t.text.fontfile))n.textFontfile=t.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",t.text.fontfile);if(f.defined(t.text.width))if(f.integer(t.text.width)&&f.inRange(t.text.width,1,1e6))n.textWidth=t.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(f.defined(t.text.height))if(f.integer(t.text.height)&&f.inRange(t.text.height,1,1e6))n.textHeight=t.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(f.defined(t.text.align))if(f.string(t.text.align)&&f.string(this.constructor.align[t.text.align]))n.textAlign=this.constructor.align[t.text.align];else throw f.invalidParameterError("text.align","valid alignment",t.text.align);if(f.defined(t.text.justify))if(f.bool(t.text.justify))n.textJustify=t.text.justify;else throw f.invalidParameterError("text.justify","boolean",t.text.justify);if(f.defined(t.text.dpi))if(f.integer(t.text.dpi)&&f.inRange(t.text.dpi,1,1e6))n.textDpi=t.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(f.defined(t.text.rgba))if(f.bool(t.text.rgba))n.textRgba=t.text.rgba;else throw f.invalidParameterError("text.rgba","bool",t.text.rgba);if(f.defined(t.text.spacing))if(f.integer(t.text.spacing)&&f.inRange(t.text.spacing,-1e6,1e6))n.textSpacing=t.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(f.defined(t.text.wrap))if(f.string(t.text.wrap)&&f.inArray(t.text.wrap,["word","char","word-char","none"]))n.textWrap=t.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete n.buffer}else throw Error("Expected a valid string to create an image with text.");if(f.defined(t.join))if(f.defined(this.options.join)){if(f.defined(t.join.animated))if(f.bool(t.join.animated))n.joinAnimated=t.join.animated;else throw f.invalidParameterError("join.animated","boolean",t.join.animated);if(f.defined(t.join.across))if(f.integer(t.join.across)&&f.inRange(t.join.across,1,1e6))n.joinAcross=t.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(f.defined(t.join.shim))if(f.integer(t.join.shim)&&f.inRange(t.join.shim,0,1e6))n.joinShim=t.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(f.defined(t.join.background))n.joinBackground=this._getBackgroundColourOption(t.join.background);if(f.defined(t.join.halign))if(f.string(t.join.halign)&&f.string(this.constructor.align[t.join.halign]))n.joinHalign=this.constructor.align[t.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",t.join.halign);if(f.defined(t.join.valign))if(f.string(t.join.valign)&&f.string(this.constructor.align[t.join.valign]))n.joinValign=this.constructor.align[t.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(f.defined(t))throw Error(`Invalid input options ${t}`);return n}function _q(e,t,r){if(Array.isArray(this.options.input.buffer))if(f.buffer(e))this.options.input.buffer.push(e),r();else r(Error("Non-Buffer data on Writable Stream"));else r(Error("Unexpected data on Writable Stream"))}function Pq(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function kq(){return Array.isArray(this.options.input.buffer)}function Aq(e){if(this.writableFinished)e();else this.once("finish",e)}function jq(e){let t=Error();if(f.fn(e)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.metadata(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)})});else Le.metadata(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.metadata(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})});else return new Promise((r,n)=>{Le.metadata(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})}function Rq(e){let t=Error();if(f.fn(e)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.stats(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)})});else Le.stats(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.stats(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})});else return new Promise((r,n)=>{Le.stats(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})}var wq,Sq,hS=(e)=>{Object.assign(e.prototype,{_inputOptionsFromObject:mS,_createInputDescriptor:Eq,_write:_q,_flattenBufferIn:Pq,_isStreamInput:kq,_whenStreamInFinished:Aq,metadata:jq,stats:Rq}),e.align=wq};var gS=L(()=>{gn();Oa();/*!
382
+ */wq=vq.debuglog("sharp");Object.setPrototypeOf(os.prototype,zp.Duplex.prototype);Object.setPrototypeOf(os,zp.Duplex);Object.assign(os.prototype,{clone:Eq});vn=os});function mS(e){let t=Pq.filter((r)=>f.defined(e[r])).map((r)=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function kq(e,t,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(e))n.file=e;else if(f.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");n.buffer=e}else if(f.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(e,0,e.byteLength)}else if(f.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(f.plainObject(e)&&!f.defined(t)){if(t=e,mS(t))n.buffer=[]}else if(!f.defined(e)&&!f.defined(t)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map((i)=>this._createInputDescriptor(i));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${e}' of type ${typeof e}${f.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(f.object(t)){if(f.defined(t.failOn))if(f.string(t.failOn)&&f.inArray(t.failOn,["none","truncated","error","warning"]))n.failOn=t.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(f.defined(t.autoOrient))if(f.bool(t.autoOrient))n.autoOrient=t.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",t.autoOrient);if(f.defined(t.density))if(f.number(t.density)&&f.inRange(t.density,1,1e5))n.density=t.density;else throw f.invalidParameterError("density","number between 1 and 100000",t.density);if(f.defined(t.ignoreIcc))if(f.bool(t.ignoreIcc))n.ignoreIcc=t.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(f.defined(t.limitInputPixels))if(f.bool(t.limitInputPixels))n.limitInputPixels=t.limitInputPixels?268402689:0;else if(f.integer(t.limitInputPixels)&&f.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=t.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(f.defined(t.limitInputChannels))if(f.bool(t.limitInputChannels))n.limitInputChannels=t.limitInputChannels?5:0;else if(f.integer(t.limitInputChannels)&&f.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=t.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(f.defined(t.unlimited))if(f.bool(t.unlimited))n.unlimited=t.unlimited;else throw f.invalidParameterError("unlimited","boolean",t.unlimited);if(f.defined(t.sequentialRead))if(f.bool(t.sequentialRead))n.sequentialRead=t.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(f.defined(t.raw)){if(f.object(t.raw)&&f.integer(t.raw.width)&&f.inRange(t.raw.width,1,1e8)&&f.integer(t.raw.height)&&f.inRange(t.raw.height,1,1e8)&&f.integer(t.raw.channels)&&f.inRange(t.raw.channels,1,4))switch(n.rawWidth=t.raw.width,n.rawHeight=t.raw.height,n.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:n.rawDepth="uchar";break;case Int8Array:n.rawDepth="char";break;case Uint16Array:n.rawDepth="ushort";break;case Int16Array:n.rawDepth="short";break;case Uint32Array:n.rawDepth="uint";break;case Int32Array:n.rawDepth="int";break;case Float32Array:n.rawDepth="float";break;case Float64Array:n.rawDepth="double";break;default:n.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(n.rawPremultiplied=!1,f.defined(t.raw.premultiplied))if(f.bool(t.raw.premultiplied))n.rawPremultiplied=t.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(n.rawPageHeight=0,f.defined(t.raw.pageHeight))if(f.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);n.rawPageHeight=t.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(f.defined(t.animated))if(f.bool(t.animated))n.pages=t.animated?-1:1;else throw f.invalidParameterError("animated","boolean",t.animated);if(f.defined(t.pages))if(f.integer(t.pages)&&f.inRange(t.pages,-1,1e5))n.pages=t.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(f.defined(t.page))if(f.integer(t.page)&&f.inRange(t.page,0,1e5))n.page=t.page;else throw f.invalidParameterError("page","integer between 0 and 100000",t.page);if(f.object(t.openSlide)&&f.defined(t.openSlide.level))if(f.integer(t.openSlide.level)&&f.inRange(t.openSlide.level,0,256))n.openSlideLevel=t.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(f.defined(t.level))if(f.integer(t.level)&&f.inRange(t.level,0,256))n.openSlideLevel=t.level;else throw f.invalidParameterError("level","integer between 0 and 256",t.level);if(f.object(t.tiff)&&f.defined(t.tiff.subifd))if(f.integer(t.tiff.subifd)&&f.inRange(t.tiff.subifd,-1,1e5))n.tiffSubifd=t.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(f.defined(t.subifd))if(f.integer(t.subifd)&&f.inRange(t.subifd,-1,1e5))n.tiffSubifd=t.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(f.object(t.svg)){if(f.defined(t.svg.stylesheet))if(f.string(t.svg.stylesheet))n.svgStylesheet=t.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(f.defined(t.svg.highBitdepth))if(f.bool(t.svg.highBitdepth))n.svgHighBitdepth=t.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(f.object(t.pdf)&&f.defined(t.pdf.background))n.pdfBackground=this._getBackgroundColourOption(t.pdf.background);else if(f.defined(t.pdfBackground))n.pdfBackground=this._getBackgroundColourOption(t.pdfBackground);if(f.object(t.jp2)&&f.defined(t.jp2.oneshot))if(f.bool(t.jp2.oneshot))n.jp2Oneshot=t.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(f.defined(t.create))if(f.object(t.create)&&f.integer(t.create.width)&&f.inRange(t.create.width,1,1e8)&&f.integer(t.create.height)&&f.inRange(t.create.height,1,1e8)&&f.integer(t.create.channels)){if(n.createWidth=t.create.width,n.createHeight=t.create.height,n.createChannels=t.create.channels,n.createPageHeight=0,f.defined(t.create.pageHeight))if(f.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);n.createPageHeight=t.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(f.defined(t.create.noise)){if(!f.object(t.create.noise))throw Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=t.create.noise.type,!f.inRange(t.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(n.createNoiseMean=128,f.defined(t.create.noise.mean))if(f.number(t.create.noise.mean)&&f.inRange(t.create.noise.mean,0,1e4))n.createNoiseMean=t.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(n.createNoiseSigma=30,f.defined(t.create.noise.sigma))if(f.number(t.create.noise.sigma)&&f.inRange(t.create.noise.sigma,0,1e4))n.createNoiseSigma=t.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(f.defined(t.create.background)){if(!f.inRange(t.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);n.createBackground=this._getBackgroundColourOption(t.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete n.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(f.defined(t.text))if(f.object(t.text)&&f.string(t.text.text)){if(n.textValue=t.text.text,f.defined(t.text.height)&&f.defined(t.text.dpi))throw Error("Expected only one of dpi or height");if(f.defined(t.text.font))if(f.string(t.text.font))n.textFont=t.text.font;else throw f.invalidParameterError("text.font","string",t.text.font);if(f.defined(t.text.fontfile))if(f.string(t.text.fontfile))n.textFontfile=t.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",t.text.fontfile);if(f.defined(t.text.width))if(f.integer(t.text.width)&&f.inRange(t.text.width,1,1e6))n.textWidth=t.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(f.defined(t.text.height))if(f.integer(t.text.height)&&f.inRange(t.text.height,1,1e6))n.textHeight=t.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(f.defined(t.text.align))if(f.string(t.text.align)&&f.string(this.constructor.align[t.text.align]))n.textAlign=this.constructor.align[t.text.align];else throw f.invalidParameterError("text.align","valid alignment",t.text.align);if(f.defined(t.text.justify))if(f.bool(t.text.justify))n.textJustify=t.text.justify;else throw f.invalidParameterError("text.justify","boolean",t.text.justify);if(f.defined(t.text.dpi))if(f.integer(t.text.dpi)&&f.inRange(t.text.dpi,1,1e6))n.textDpi=t.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(f.defined(t.text.rgba))if(f.bool(t.text.rgba))n.textRgba=t.text.rgba;else throw f.invalidParameterError("text.rgba","bool",t.text.rgba);if(f.defined(t.text.spacing))if(f.integer(t.text.spacing)&&f.inRange(t.text.spacing,-1e6,1e6))n.textSpacing=t.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(f.defined(t.text.wrap))if(f.string(t.text.wrap)&&f.inArray(t.text.wrap,["word","char","word-char","none"]))n.textWrap=t.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete n.buffer}else throw Error("Expected a valid string to create an image with text.");if(f.defined(t.join))if(f.defined(this.options.join)){if(f.defined(t.join.animated))if(f.bool(t.join.animated))n.joinAnimated=t.join.animated;else throw f.invalidParameterError("join.animated","boolean",t.join.animated);if(f.defined(t.join.across))if(f.integer(t.join.across)&&f.inRange(t.join.across,1,1e6))n.joinAcross=t.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(f.defined(t.join.shim))if(f.integer(t.join.shim)&&f.inRange(t.join.shim,0,1e6))n.joinShim=t.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(f.defined(t.join.background))n.joinBackground=this._getBackgroundColourOption(t.join.background);if(f.defined(t.join.halign))if(f.string(t.join.halign)&&f.string(this.constructor.align[t.join.halign]))n.joinHalign=this.constructor.align[t.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",t.join.halign);if(f.defined(t.join.valign))if(f.string(t.join.valign)&&f.string(this.constructor.align[t.join.valign]))n.joinValign=this.constructor.align[t.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(f.defined(t))throw Error(`Invalid input options ${t}`);return n}function Aq(e,t,r){if(Array.isArray(this.options.input.buffer))if(f.buffer(e))this.options.input.buffer.push(e),r();else r(Error("Non-Buffer data on Writable Stream"));else r(Error("Unexpected data on Writable Stream"))}function jq(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function Rq(){return Array.isArray(this.options.input.buffer)}function Oq(e){if(this.writableFinished)e();else this.once("finish",e)}function Cq(e){let t=Error();if(f.fn(e)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.metadata(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)})});else Le.metadata(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.metadata(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})});else return new Promise((r,n)=>{Le.metadata(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})}function Iq(e){let t=Error();if(f.fn(e)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.stats(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)})});else Le.stats(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.stats(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})});else return new Promise((r,n)=>{Le.stats(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})}var _q,Pq,hS=(e)=>{Object.assign(e.prototype,{_inputOptionsFromObject:mS,_createInputDescriptor:kq,_write:Aq,_flattenBufferIn:jq,_isStreamInput:Rq,_whenStreamInFinished:Oq,metadata:Cq,stats:Iq}),e.align=_q};var gS=L(()=>{gn();Oa();/*!
383
383
  Copyright 2013 Lovell Fuller and others.
384
384
  SPDX-License-Identifier: Apache-2.0
385
- */wq={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},Sq=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function Kp(e){return e.angle%360!==0||e.rotationAngle!==0}function eu(e){return e.width!==-1||e.height!==-1}function Iq(e,t,r){if(eu(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(f.defined(e))if(f.object(e)&&!f.defined(r))r=e;else if(f.integer(e)&&f.inRange(e,1,1e8))this.options.width=e;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",e);else this.options.width=-1;if(f.defined(t))if(f.integer(t)&&f.inRange(t,1,1e8))this.options.height=t;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(f.object(r)){if(f.defined(r.width))if(f.integer(r.width)&&f.inRange(r.width,1,1e8))this.options.width=r.width;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",r.width);if(f.defined(r.height))if(f.integer(r.height)&&f.inRange(r.height,1,1e8))this.options.height=r.height;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",r.height);if(f.defined(r.fit)){let n=Cq[r.fit];if(f.string(n))this.options.canvas=n;else throw f.invalidParameterError("fit","valid fit",r.fit)}if(f.defined(r.position)){let n=f.integer(r.position)?r.position:$S[r.position]||xS[r.position]||bS[r.position];if(f.integer(n)&&(f.inRange(n,0,8)||f.inRange(n,16,17)))this.options.position=n;else throw f.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),f.defined(r.kernel))if(f.string(zp[r.kernel]))this.options.kernel=zp[r.kernel];else throw f.invalidParameterError("kernel","valid kernel name",r.kernel);if(f.defined(r.withoutEnlargement))this._setBooleanOption("withoutEnlargement",r.withoutEnlargement);if(f.defined(r.withoutReduction))this._setBooleanOption("withoutReduction",r.withoutReduction);if(f.defined(r.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}if(Kp(this.options)&&eu(this.options))this.options.rotateBefore=!0;return this}function Tq(e){if(f.integer(e))if(f.inRange(e,1,1e8))this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else throw f.invalidParameterError("extend","integer between 1 and 100000000",e);else if(f.object(e)){if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,0,1e8))this.options.extendTop=e.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",e.top);if(f.defined(e.bottom))if(f.integer(e.bottom)&&f.inRange(e.bottom,0,1e8))this.options.extendBottom=e.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",e.bottom);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,0,1e8))this.options.extendLeft=e.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",e.left);if(f.defined(e.right))if(f.integer(e.right)&&f.inRange(e.right,0,1e8))this.options.extendRight=e.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),f.defined(e.extendWith))if(f.string(yS[e.extendWith]))this.options.extendWith=yS[e.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw f.invalidParameterError("extend","integer or object",e);return this}function Nq(e){let t=eu(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${t}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(r){let n=e[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),Kp(this.options)&&!eu(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function Mq(e){if(this.options.trimThreshold=10,f.defined(e))if(f.object(e)){if(f.defined(e.background))this._setBackgroundColourOption("trimBackground",e.background);if(f.defined(e.threshold))if(f.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw f.invalidParameterError("threshold","positive number",e.threshold);if(f.defined(e.lineArt))this._setBooleanOption("trimLineArt",e.lineArt);if(f.defined(e.margin))if(f.integer(e.margin)&&f.inRange(e.margin,0,1e7))this.options.trimMargin=e.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",e.margin)}else throw f.invalidParameterError("trim","object",e);if(Kp(this.options))this.options.rotateBefore=!0;return this}var bS,xS,yS,$S,zp,Oq,Cq,vS=(e)=>{Object.assign(e.prototype,{resize:Iq,extend:Tq,extract:Nq,trim:Mq}),e.gravity=bS,e.strategy=$S,e.kernel=zp,e.fit=Oq,e.position=xS};var wS=L(()=>{gn();/*!
385
+ */_q={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},Pq=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function Gp(e){return e.angle%360!==0||e.rotationAngle!==0}function eu(e){return e.width!==-1||e.height!==-1}function Mq(e,t,r){if(eu(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(f.defined(e))if(f.object(e)&&!f.defined(r))r=e;else if(f.integer(e)&&f.inRange(e,1,1e8))this.options.width=e;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",e);else this.options.width=-1;if(f.defined(t))if(f.integer(t)&&f.inRange(t,1,1e8))this.options.height=t;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(f.object(r)){if(f.defined(r.width))if(f.integer(r.width)&&f.inRange(r.width,1,1e8))this.options.width=r.width;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",r.width);if(f.defined(r.height))if(f.integer(r.height)&&f.inRange(r.height,1,1e8))this.options.height=r.height;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",r.height);if(f.defined(r.fit)){let n=Nq[r.fit];if(f.string(n))this.options.canvas=n;else throw f.invalidParameterError("fit","valid fit",r.fit)}if(f.defined(r.position)){let n=f.integer(r.position)?r.position:$S[r.position]||xS[r.position]||bS[r.position];if(f.integer(n)&&(f.inRange(n,0,8)||f.inRange(n,16,17)))this.options.position=n;else throw f.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),f.defined(r.kernel))if(f.string(Kp[r.kernel]))this.options.kernel=Kp[r.kernel];else throw f.invalidParameterError("kernel","valid kernel name",r.kernel);if(f.defined(r.withoutEnlargement))this._setBooleanOption("withoutEnlargement",r.withoutEnlargement);if(f.defined(r.withoutReduction))this._setBooleanOption("withoutReduction",r.withoutReduction);if(f.defined(r.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}if(Gp(this.options)&&eu(this.options))this.options.rotateBefore=!0;return this}function Lq(e){if(f.integer(e))if(f.inRange(e,1,1e8))this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else throw f.invalidParameterError("extend","integer between 1 and 100000000",e);else if(f.object(e)){if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,0,1e8))this.options.extendTop=e.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",e.top);if(f.defined(e.bottom))if(f.integer(e.bottom)&&f.inRange(e.bottom,0,1e8))this.options.extendBottom=e.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",e.bottom);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,0,1e8))this.options.extendLeft=e.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",e.left);if(f.defined(e.right))if(f.integer(e.right)&&f.inRange(e.right,0,1e8))this.options.extendRight=e.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),f.defined(e.extendWith))if(f.string(yS[e.extendWith]))this.options.extendWith=yS[e.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw f.invalidParameterError("extend","integer or object",e);return this}function Dq(e){let t=eu(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${t}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(r){let n=e[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),Gp(this.options)&&!eu(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function Jq(e){if(this.options.trimThreshold=10,f.defined(e))if(f.object(e)){if(f.defined(e.background))this._setBackgroundColourOption("trimBackground",e.background);if(f.defined(e.threshold))if(f.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw f.invalidParameterError("threshold","positive number",e.threshold);if(f.defined(e.lineArt))this._setBooleanOption("trimLineArt",e.lineArt);if(f.defined(e.margin))if(f.integer(e.margin)&&f.inRange(e.margin,0,1e7))this.options.trimMargin=e.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",e.margin)}else throw f.invalidParameterError("trim","object",e);if(Gp(this.options))this.options.rotateBefore=!0;return this}var bS,xS,yS,$S,Kp,Tq,Nq,vS=(e)=>{Object.assign(e.prototype,{resize:Mq,extend:Lq,extract:Dq,trim:Jq}),e.gravity=bS,e.strategy=$S,e.kernel=Kp,e.fit=Tq,e.position=xS};var wS=L(()=>{gn();/*!
386
386
  Copyright 2013 Lovell Fuller and others.
387
387
  SPDX-License-Identifier: Apache-2.0
388
- */bS={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},xS={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},yS={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},$S={entropy:16,attention:17},zp={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},Oq={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},Cq={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function Lq(e){if(!Array.isArray(e))throw f.invalidParameterError("images to composite","array",e);return this.options.composite=e.map((t)=>{if(!f.object(t))throw f.invalidParameterError("image to composite","object",t);let r=this._inputOptionsFromObject(t),n={input:this._createInputDescriptor(t.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(t.blend))if(f.string(Gp[t.blend]))n.blend=Gp[t.blend];else throw f.invalidParameterError("blend","valid blend name",t.blend);if(f.defined(t.tile))if(f.bool(t.tile))n.tile=t.tile;else throw f.invalidParameterError("tile","boolean",t.tile);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,-1e8,1e8))n.left=t.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,-1e8,1e8))n.top=t.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(f.defined(t.top)!==f.defined(t.left))throw Error("Expected both left and top to be set");else n.hasOffset=f.integer(t.top)&&f.integer(t.left);if(f.defined(t.gravity))if(f.integer(t.gravity)&&f.inRange(t.gravity,0,8))n.gravity=t.gravity;else if(f.string(t.gravity)&&f.integer(this.constructor.gravity[t.gravity]))n.gravity=this.constructor.gravity[t.gravity];else throw f.invalidParameterError("gravity","valid gravity",t.gravity);if(f.defined(t.premultiplied))if(f.bool(t.premultiplied))n.premultiplied=t.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",t.premultiplied);return n}),this}var Gp,SS=(e)=>{e.prototype.composite=Lq,e.blend=Gp};var ES=L(()=>{gn();/*!
388
+ */bS={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},xS={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},yS={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},$S={entropy:16,attention:17},Kp={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},Tq={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},Nq={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function Fq(e){if(!Array.isArray(e))throw f.invalidParameterError("images to composite","array",e);return this.options.composite=e.map((t)=>{if(!f.object(t))throw f.invalidParameterError("image to composite","object",t);let r=this._inputOptionsFromObject(t),n={input:this._createInputDescriptor(t.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(t.blend))if(f.string(Yp[t.blend]))n.blend=Yp[t.blend];else throw f.invalidParameterError("blend","valid blend name",t.blend);if(f.defined(t.tile))if(f.bool(t.tile))n.tile=t.tile;else throw f.invalidParameterError("tile","boolean",t.tile);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,-1e8,1e8))n.left=t.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,-1e8,1e8))n.top=t.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(f.defined(t.top)!==f.defined(t.left))throw Error("Expected both left and top to be set");else n.hasOffset=f.integer(t.top)&&f.integer(t.left);if(f.defined(t.gravity))if(f.integer(t.gravity)&&f.inRange(t.gravity,0,8))n.gravity=t.gravity;else if(f.string(t.gravity)&&f.integer(this.constructor.gravity[t.gravity]))n.gravity=this.constructor.gravity[t.gravity];else throw f.invalidParameterError("gravity","valid gravity",t.gravity);if(f.defined(t.premultiplied))if(f.bool(t.premultiplied))n.premultiplied=t.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",t.premultiplied);return n}),this}var Yp,SS=(e)=>{e.prototype.composite=Fq,e.blend=Yp};var ES=L(()=>{gn();/*!
389
389
  Copyright 2013 Lovell Fuller and others.
390
390
  SPDX-License-Identifier: Apache-2.0
391
- */Gp={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function Dq(e,t){if(!f.defined(e))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(f.integer(e)&&!(e%90))this.options.angle=e;else if(f.number(e)){if(this.options.rotationAngle=e,f.object(t)&&t.background)this._setBackgroundColourOption("rotationBackground",t.background)}else throw f.invalidParameterError("angle","numeric",e);return this}function Jq(){return this.options.input.autoOrient=!0,this}function Fq(e){return this.options.flip=f.bool(e)?e:!0,this}function qq(e){return this.options.flop=f.bool(e)?e:!0,this}function Bq(e,t){let n=Array.isArray(e)&&(e.length===4&&e.every(f.number)||e.length===2&&e.every((i)=>Array.isArray(i)&&i.length===2))?e.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",e);if(f.defined(t))if(f.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),f.defined(t.idx))if(f.number(t.idx))this.options.affineIdx=t.idx;else throw f.invalidParameterError("options.idx","number",t.idx);if(f.defined(t.idy))if(f.number(t.idy))this.options.affineIdy=t.idy;else throw f.invalidParameterError("options.idy","number",t.idy);if(f.defined(t.odx))if(f.number(t.odx))this.options.affineOdx=t.odx;else throw f.invalidParameterError("options.odx","number",t.odx);if(f.defined(t.ody))if(f.number(t.ody))this.options.affineOdy=t.ody;else throw f.invalidParameterError("options.ody","number",t.ody);if(f.defined(t.interpolator))if(f.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw f.invalidParameterError("options","object",t);return this}function Hq(e){if(f.plainObject(e)){if(f.number(e.sigma)&&f.inRange(e.sigma,0.000001,10))this.options.sharpenSigma=e.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(f.defined(e.m1))if(f.number(e.m1)&&f.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(f.defined(e.m2))if(f.number(e.m2)&&f.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(f.defined(e.x1))if(f.number(e.x1)&&f.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(f.defined(e.y2))if(f.number(e.y2)&&f.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(f.defined(e.y3))if(f.number(e.y3)&&f.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else this.options.sharpenSigma=-1;return this}function Uq(e){if(!f.defined(e))this.options.medianSize=3;else if(f.integer(e)&&f.inRange(e,1,1000))this.options.medianSize=e;else throw f.invalidParameterError("size","integer between 1 and 1000",e);return this}function Vq(e){let t;if(f.number(e))t=e;else if(f.plainObject(e)){if(!f.number(e.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(f.string(_S[e.precision]))this.options.precision=_S[e.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(f.number(e.minAmplitude)&&f.inRange(e.minAmplitude,0.001,1))this.options.minAmpl=e.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!f.defined(e))this.options.blurSigma=-1;else if(f.bool(e))this.options.blurSigma=e?-1:0;else if(f.number(t)&&f.inRange(t,0.3,1000))this.options.blurSigma=t;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function Wq(e){if(!f.defined(e))this.options.dilateWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.dilateWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function zq(e){if(!f.defined(e))this.options.erodeWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.erodeWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function Kq(e){if(this.options.flatten=f.bool(e)?e:!0,f.object(e))this._setBackgroundColourOption("flattenBackground",e.background);return this}function Gq(){return this.options.unflatten=!0,this}function Yq(e,t){if(!f.defined(e))this.options.gamma=2.2;else if(f.number(e)&&f.inRange(e,1,3))this.options.gamma=e;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!f.defined(t))this.options.gammaOut=this.options.gamma;else if(f.number(t)&&f.inRange(t,1,3))this.options.gammaOut=t;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function Xq(e){if(this.options.negate=f.bool(e)?e:!0,f.plainObject(e)&&"alpha"in e)if(!f.bool(e.alpha))throw f.invalidParameterError("alpha","should be boolean value",e.alpha);else this.options.negateAlpha=e.alpha;return this}function Qq(e){if(f.plainObject(e)){if(f.defined(e.lower))if(f.number(e.lower)&&f.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw f.invalidParameterError("lower","number between 0 and 99",e.lower);if(f.defined(e.upper))if(f.number(e.upper)&&f.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw f.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw f.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function Zq(e){return this.normalise(e)}function e3(e){if(f.plainObject(e)){if(f.integer(e.width)&&f.inRange(e.width,1,65536))this.options.claheWidth=e.width;else throw f.invalidParameterError("width","integer between 1 and 65536",e.width);if(f.integer(e.height)&&f.inRange(e.height,1,65536))this.options.claheHeight=e.height;else throw f.invalidParameterError("height","integer between 1 and 65536",e.height);if(f.defined(e.maxSlope))if(f.integer(e.maxSlope)&&f.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw f.invalidParameterError("options","plain object",e);return this}function t3(e){if(!f.object(e)||!Array.isArray(e.kernel)||!f.integer(e.width)||!f.integer(e.height)||!f.inRange(e.width,3,1001)||!f.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length||!e.kernel.every(f.number))throw Error("Invalid convolution kernel");if(!f.integer(e.scale))e.scale=e.kernel.reduce((t,r)=>t+r,0);if(e.scale<1)e.scale=1;if(!f.integer(e.offset))e.offset=0;return this.options.convKernel=e,this}function r3(e,t){if(!f.defined(e))this.options.threshold=128;else if(f.bool(e))this.options.threshold=e?128:0;else if(f.integer(e)&&f.inRange(e,0,255))this.options.threshold=e;else throw f.invalidParameterError("threshold","integer between 0 and 255",e);if(!f.object(t)||t.greyscale===!0||t.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function n3(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw f.invalidParameterError("operator","one of: and, or, eor",t);return this}function i3(e,t){if(!f.defined(e)&&f.number(t))e=1;else if(f.number(e)&&!f.defined(t))t=0;if(!f.defined(e))this.options.linearA=[];else if(f.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearA=e;else throw f.invalidParameterError("a","number or array of numbers",e);if(!f.defined(t))this.options.linearB=[];else if(f.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearB=t;else throw f.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function s3(e){if(!Array.isArray(e))throw f.invalidParameterError("inputMatrix","array",e);let t=e.length;if(t!==3&&t!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!e.every((n)=>Array.isArray(n)&&n.length===t))throw f.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,e);let r=e.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function o3(e){if(!f.plainObject(e))throw f.invalidParameterError("options","plain object",e);if("brightness"in e)if(f.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw f.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(f.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw f.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(f.integer(e.hue))this.options.hue=e.hue%360;else throw f.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(f.number(e.lightness))this.options.lightness=e.lightness;else throw f.invalidParameterError("lightness","number",e.lightness);return this}var _S,PS=(e)=>{Object.assign(e.prototype,{autoOrient:Jq,rotate:Dq,flip:Fq,flop:qq,affine:Bq,sharpen:Hq,erode:zq,dilate:Wq,median:Uq,blur:Vq,flatten:Kq,unflatten:Gq,gamma:Yq,negate:Xq,normalise:Qq,normalize:Zq,clahe:e3,convolve:t3,threshold:r3,boolean:n3,linear:i3,recomb:s3,modulate:o3})};var kS=L(()=>{gn();/*!
391
+ */Yp={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function qq(e,t){if(!f.defined(e))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(f.integer(e)&&!(e%90))this.options.angle=e;else if(f.number(e)){if(this.options.rotationAngle=e,f.object(t)&&t.background)this._setBackgroundColourOption("rotationBackground",t.background)}else throw f.invalidParameterError("angle","numeric",e);return this}function Bq(){return this.options.input.autoOrient=!0,this}function Hq(e){return this.options.flip=f.bool(e)?e:!0,this}function Uq(e){return this.options.flop=f.bool(e)?e:!0,this}function Vq(e,t){let n=Array.isArray(e)&&(e.length===4&&e.every(f.number)||e.length===2&&e.every((i)=>Array.isArray(i)&&i.length===2))?e.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",e);if(f.defined(t))if(f.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),f.defined(t.idx))if(f.number(t.idx))this.options.affineIdx=t.idx;else throw f.invalidParameterError("options.idx","number",t.idx);if(f.defined(t.idy))if(f.number(t.idy))this.options.affineIdy=t.idy;else throw f.invalidParameterError("options.idy","number",t.idy);if(f.defined(t.odx))if(f.number(t.odx))this.options.affineOdx=t.odx;else throw f.invalidParameterError("options.odx","number",t.odx);if(f.defined(t.ody))if(f.number(t.ody))this.options.affineOdy=t.ody;else throw f.invalidParameterError("options.ody","number",t.ody);if(f.defined(t.interpolator))if(f.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw f.invalidParameterError("options","object",t);return this}function Wq(e){if(f.plainObject(e)){if(f.number(e.sigma)&&f.inRange(e.sigma,0.000001,10))this.options.sharpenSigma=e.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(f.defined(e.m1))if(f.number(e.m1)&&f.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(f.defined(e.m2))if(f.number(e.m2)&&f.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(f.defined(e.x1))if(f.number(e.x1)&&f.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(f.defined(e.y2))if(f.number(e.y2)&&f.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(f.defined(e.y3))if(f.number(e.y3)&&f.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else this.options.sharpenSigma=-1;return this}function zq(e){if(!f.defined(e))this.options.medianSize=3;else if(f.integer(e)&&f.inRange(e,1,1000))this.options.medianSize=e;else throw f.invalidParameterError("size","integer between 1 and 1000",e);return this}function Kq(e){let t;if(f.number(e))t=e;else if(f.plainObject(e)){if(!f.number(e.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(f.string(_S[e.precision]))this.options.precision=_S[e.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(f.number(e.minAmplitude)&&f.inRange(e.minAmplitude,0.001,1))this.options.minAmpl=e.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!f.defined(e))this.options.blurSigma=-1;else if(f.bool(e))this.options.blurSigma=e?-1:0;else if(f.number(t)&&f.inRange(t,0.3,1000))this.options.blurSigma=t;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function Gq(e){if(!f.defined(e))this.options.dilateWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.dilateWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function Yq(e){if(!f.defined(e))this.options.erodeWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.erodeWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function Xq(e){if(this.options.flatten=f.bool(e)?e:!0,f.object(e))this._setBackgroundColourOption("flattenBackground",e.background);return this}function Qq(){return this.options.unflatten=!0,this}function Zq(e,t){if(!f.defined(e))this.options.gamma=2.2;else if(f.number(e)&&f.inRange(e,1,3))this.options.gamma=e;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!f.defined(t))this.options.gammaOut=this.options.gamma;else if(f.number(t)&&f.inRange(t,1,3))this.options.gammaOut=t;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function e3(e){if(this.options.negate=f.bool(e)?e:!0,f.plainObject(e)&&"alpha"in e)if(!f.bool(e.alpha))throw f.invalidParameterError("alpha","should be boolean value",e.alpha);else this.options.negateAlpha=e.alpha;return this}function t3(e){if(f.plainObject(e)){if(f.defined(e.lower))if(f.number(e.lower)&&f.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw f.invalidParameterError("lower","number between 0 and 99",e.lower);if(f.defined(e.upper))if(f.number(e.upper)&&f.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw f.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw f.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function r3(e){return this.normalise(e)}function n3(e){if(f.plainObject(e)){if(f.integer(e.width)&&f.inRange(e.width,1,65536))this.options.claheWidth=e.width;else throw f.invalidParameterError("width","integer between 1 and 65536",e.width);if(f.integer(e.height)&&f.inRange(e.height,1,65536))this.options.claheHeight=e.height;else throw f.invalidParameterError("height","integer between 1 and 65536",e.height);if(f.defined(e.maxSlope))if(f.integer(e.maxSlope)&&f.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw f.invalidParameterError("options","plain object",e);return this}function i3(e){if(!f.object(e)||!Array.isArray(e.kernel)||!f.integer(e.width)||!f.integer(e.height)||!f.inRange(e.width,3,1001)||!f.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length||!e.kernel.every(f.number))throw Error("Invalid convolution kernel");if(!f.integer(e.scale))e.scale=e.kernel.reduce((t,r)=>t+r,0);if(e.scale<1)e.scale=1;if(!f.integer(e.offset))e.offset=0;return this.options.convKernel=e,this}function s3(e,t){if(!f.defined(e))this.options.threshold=128;else if(f.bool(e))this.options.threshold=e?128:0;else if(f.integer(e)&&f.inRange(e,0,255))this.options.threshold=e;else throw f.invalidParameterError("threshold","integer between 0 and 255",e);if(!f.object(t)||t.greyscale===!0||t.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function o3(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw f.invalidParameterError("operator","one of: and, or, eor",t);return this}function a3(e,t){if(!f.defined(e)&&f.number(t))e=1;else if(f.number(e)&&!f.defined(t))t=0;if(!f.defined(e))this.options.linearA=[];else if(f.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearA=e;else throw f.invalidParameterError("a","number or array of numbers",e);if(!f.defined(t))this.options.linearB=[];else if(f.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearB=t;else throw f.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function c3(e){if(!Array.isArray(e))throw f.invalidParameterError("inputMatrix","array",e);let t=e.length;if(t!==3&&t!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!e.every((n)=>Array.isArray(n)&&n.length===t))throw f.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,e);let r=e.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function l3(e){if(!f.plainObject(e))throw f.invalidParameterError("options","plain object",e);if("brightness"in e)if(f.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw f.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(f.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw f.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(f.integer(e.hue))this.options.hue=e.hue%360;else throw f.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(f.number(e.lightness))this.options.lightness=e.lightness;else throw f.invalidParameterError("lightness","number",e.lightness);return this}var _S,PS=(e)=>{Object.assign(e.prototype,{autoOrient:Bq,rotate:qq,flip:Hq,flop:Uq,affine:Vq,sharpen:Wq,erode:Yq,dilate:Gq,median:zq,blur:Kq,flatten:Xq,unflatten:Qq,gamma:Zq,negate:e3,normalise:t3,normalize:r3,clahe:n3,convolve:i3,threshold:s3,boolean:o3,linear:a3,recomb:c3,modulate:l3})};var kS=L(()=>{gn();/*!
392
392
  Copyright 2013 Lovell Fuller and others.
393
393
  SPDX-License-Identifier: Apache-2.0
394
- */_S={integer:"integer",float:"float",approximate:"approximate"}});var IS=C(function(iie,CS){var{defineProperty:em,getOwnPropertyDescriptor:a3,getOwnPropertyNames:c3}=Object,l3=Object.prototype.hasOwnProperty,u3=(e,t)=>{for(var r in t)em(e,r,{get:t[r],enumerable:!0})},f3=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of c3(t))if(!l3.call(e,i)&&i!==r)em(e,i,{get:()=>t[i],enumerable:!(n=a3(t,i))||n.enumerable})}return e},d3=(e)=>f3(em({},"__esModule",{value:!0}),e),AS={};u3(AS,{default:()=>P3});CS.exports=d3(AS);var Yp={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in Yp)Object.freeze(Yp[e]);var wn=Object.freeze(Yp),jS=Object.create(null);for(let e in wn)if(Object.hasOwn(wn,e))jS[wn[e]]=e;var ur={to:{},get:{}};ur.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=ur.get.hsl(e),n="hsl";break}case"hwb":{r=ur.get.hwb(e),n="hwb";break}default:{r=ur.get.rgb(e),n="rgb";break}}if(!r)return null;return{model:n,value:r}};ur.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,n=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,s=/^(\w+)$/,o=[0,0,0,1],a,c,l;if(a=e.match(r)){l=a[2],a=a[1];for(c=0;c<3;c++){let u=c*2;o[c]=Number.parseInt(a.slice(u,u+2),16)}if(l)o[3]=Number.parseInt(l,16)/255}else if(a=e.match(t)){a=a[1],l=a[3];for(c=0;c<3;c++)o[c]=Number.parseInt(a[c]+a[c],16);if(l)o[3]=Number.parseInt(l+l,16)/255}else if(a=e.match(n)){for(c=0;c<3;c++)o[c]=Number.parseFloat(a[c+1]);if(a[4])o[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.match(i)){for(c=0;c<3;c++)o[c]=Math.round(Number.parseFloat(a[c+1])*2.55);if(a[4])o[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.toLowerCase().match(s)){if(a[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(wn,a[1]))return null;return o=wn[a[1]].slice(),o[3]=1,o}else return null;for(c=0;c<3;c++)o[c]=bi(o[c],0,255);return o[3]=bi(o[3],0,1),o};ur.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,s=bi(Number.parseFloat(r[2]),0,100),o=bi(Number.parseFloat(r[3]),0,100),a=bi(Number.isNaN(n)?1:n,0,1);return[i,s,o,a]}return null};ur.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,s=bi(Number.parseFloat(r[2]),0,100),o=bi(Number.parseFloat(r[3]),0,100),a=bi(Number.isNaN(n)?1:n,0,1);return[i,s,o,a]}return null};ur.to.hex=function(...e){return"#"+tu(e[0])+tu(e[1])+tu(e[2])+(e[3]<1?tu(Math.round(e[3]*255)):"")};ur.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};ur.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"};ur.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};ur.to.hwb=function(...e){let t="";if(e.length>=4&&e[3]!==1)t=", "+e[3];return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};ur.to.keyword=function(...e){return jS[e.slice(0,3)]};function bi(e,t,r){return Math.min(Math.max(t,e),r)}function tu(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var uo=ur,RS={};for(let e of Object.keys(wn))RS[wn[e]]=e;var K={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},as=K,Wn=0.008856451679035631;function po(e){let t=e>0.0031308?1.055*e**0.4166666666666667-0.055:e*12.92;return Math.min(Math.max(0,t),1)}function mo(e){return e>0.04045?((e+0.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(K)){if(!("channels"in K[e]))throw Error("missing channels property: "+e);if(!("labels"in K[e]))throw Error("missing channel labels property: "+e);if(K[e].labels.length!==K[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=K[e];delete K[e].channels,delete K[e].labels,Object.defineProperty(K[e],"channels",{value:t}),Object.defineProperty(K[e],"labels",{value:r})}K.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=s-i,a,c;switch(s){case i:{a=0;break}case t:{a=(r-n)/o;break}case r:{a=2+(n-t)/o;break}case n:{a=4+(t-r)/o;break}}if(a=Math.min(a*60,360),a<0)a+=360;let l=(i+s)/2;if(s===i)c=0;else if(l<=0.5)c=o/(s+i);else c=o/(2-s-i);return[a,c*100,l*100]};K.rgb.hsv=function(e){let t,r,n,i,s,o=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(o,a,c),u=l-Math.min(o,a,c),d=function(h){return(l-h)/6/u+0.5};if(u===0)i=0,s=0;else{switch(s=u/l,t=d(o),r=d(a),n=d(c),l){case o:{i=n-r;break}case a:{i=0.3333333333333333+t-n;break}case c:{i=0.6666666666666666+r-t;break}}if(i<0)i+=1;else if(i>1)i-=1}return[i*360,s*100,l*100]};K.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],i=K.rgb.hsl(e)[0],s=0.00392156862745098*Math.min(t,Math.min(r,n));return n=1-0.00392156862745098*Math.max(t,Math.max(r,n)),[i,s*100,n*100]};K.rgb.oklab=function(e){let t=mo(e[0]/255),r=mo(e[1]/255),n=mo(e[2]/255),i=Math.cbrt(0.4122214708*t+0.5363325363*r+0.0514459929*n),s=Math.cbrt(0.2119034982*t+0.6806995451*r+0.1073969566*n),o=Math.cbrt(0.0883024619*t+0.2817188376*r+0.6299787005*n),a=0.2104542553*i+0.793617785*s-0.0040720468*o,c=1.9779984951*i-2.428592205*s+0.4505937099*o,l=0.0259040371*i+0.7827717662*s-0.808675766*o;return[a*100,c*100,l*100]};K.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n),s=(1-t-i)/(1-i)||0,o=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function p3(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}K.rgb.keyword=function(e){let t=RS[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(wn)){let s=wn[i],o=p3(e,s);if(o<r)r=o,n=i}return n};K.keyword.rgb=function(e){return[...wn[e]]};K.rgb.xyz=function(e){let t=mo(e[0]/255),r=mo(e[1]/255),n=mo(e[2]/255),i=t*0.4124564+r*0.3575761+n*0.1804375,s=t*0.2126729+r*0.7151522+n*0.072175,o=t*0.0193339+r*0.119192+n*0.9503041;return[i*100,s*100,o*100]};K.rgb.lab=function(e){let t=K.rgb.xyz(e),r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>Wn?r**0.3333333333333333:7.787*r+0.13793103448275862,n=n>Wn?n**0.3333333333333333:7.787*n+0.13793103448275862,i=i>Wn?i**0.3333333333333333:7.787*i+0.13793103448275862;let s=116*n-16,o=500*(r-n),a=200*(n-i);return[s,o,a]};K.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i,s;if(r===0)return s=n*255,[s,s,s];let o=n<0.5?n*(1+r):n+r-n*r,a=2*n-o,c=[0,0,0];for(let l=0;l<3;l++){if(i=t+0.3333333333333333*-(l-1),i<0)i++;if(i>1)i--;if(6*i<1)s=a+(o-a)*6*i;else if(2*i<1)s=o;else if(3*i<2)s=a+(o-a)*(0.6666666666666666-i)*6;else s=a;c[l]=s*255}return c};K.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=r,s=Math.max(n,0.01);n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s;let o=(n+r)/2,a=n===0?2*i/(s+i):2*r/(n+r);return[t,a*100,o*100]};K.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,s=t-Math.floor(t),o=255*n*(1-r),a=255*n*(1-r*s),c=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,c,o];case 1:return[a,n,o];case 2:return[o,n,c];case 3:return[o,a,n];case 4:return[c,o,n];case 5:return[n,o,a]}};K.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,0.01),s,o;o=(2-r)*n;let a=(2-r)*i;return s=r*i,s/=a<=1?a:2-a,s=s||0,o/=2,[t,s*100,o*100]};K.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i=r+n,s;if(i>1)r/=i,n/=i;let o=Math.floor(6*t),a=1-n;if(s=6*t-o,(o&1)!==0)s=1-s;let c=r+s*(a-r),l,u,d;switch(o){default:case 6:case 0:{l=a,u=c,d=r;break}case 1:{l=c,u=a,d=r;break}case 2:{l=r,u=a,d=c;break}case 3:{l=r,u=c,d=a;break}case 4:{l=c,u=r,d=a;break}case 5:{l=a,u=r,d=c;break}}return[l*255,u*255,d*255]};K.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100,s=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[s*255,o*255,a*255]};K.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i,s,o;return i=t*3.2404542+r*-1.5371385+n*-0.4985314,s=t*-0.969266+r*1.8760108+n*0.041556,o=t*0.0556434+r*-0.2040259+n*1.0572252,i=po(i),s=po(s),o=po(o),[i*255,s*255,o*255]};K.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>Wn?t**0.3333333333333333:7.787*t+0.13793103448275862,r=r>Wn?r**0.3333333333333333:7.787*r+0.13793103448275862,n=n>Wn?n**0.3333333333333333:7.787*n+0.13793103448275862;let i=116*r-16,s=500*(t-r),o=200*(r-n);return[i,s,o]};K.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=Math.cbrt(0.8189330101*t+0.3618667424*r-0.1288597137*n),s=Math.cbrt(0.0329845436*t+0.9293118715*r+0.0361456387*n),o=Math.cbrt(0.0482003018*t+0.2643662691*r+0.633851707*n),a=0.2104542553*i+0.793617785*s-0.0040720468*o,c=1.9779984951*i-2.428592205*s+0.4505937099*o,l=0.0259040371*i+0.7827717662*s-0.808675766*o;return[a*100,c*100,l*100]};K.oklab.oklch=function(e){return K.lab.lch(e)};K.oklab.xyz=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(0.999999998*t+0.396337792*r+0.215803758*n)**3,s=(1.000000008*t-0.105561342*r-0.063854175*n)**3,o=(1.000000055*t-0.089484182*r-1.291485538*n)**3,a=1.227013851*i-0.55779998*s+0.281256149*o,c=-0.040580178*i+1.11225687*s-0.071676679*o,l=-0.076381285*i-0.421481978*s+1.58616322*o;return[a*100,c*100,l*100]};K.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(t+0.3963377774*r+0.2158037573*n)**3,s=(t-0.1055613458*r-0.0638541728*n)**3,o=(t-0.0894841775*r-1.291485548*n)**3,a=po(4.0767416621*i-3.3077115913*s+0.2309699292*o),c=po(-1.2684380046*i+2.6097574011*s-0.3413193965*o),l=po(-0.0041960863*i-0.7034186147*s+1.707614701*o);return[a*255,c*255,l*255]};K.oklch.oklab=function(e){return K.lch.lab(e)};K.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],i,s,o;s=(t+16)/116,i=r/500+s,o=s-n/200;let a=s**3,c=i**3,l=o**3;return s=a>Wn?a:(s-0.13793103448275862)/7.787,i=c>Wn?c:(i-0.13793103448275862)/7.787,o=l>Wn?l:(o-0.13793103448275862)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};K.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],i;if(i=Math.atan2(n,r)*360/2/Math.PI,i<0)i+=360;let o=Math.sqrt(r*r+n*n);return[t,o,i]};K.lch.lab=function(e){let t=e[0],r=e[1],i=e[2]/360*2*Math.PI,s=r*Math.cos(i),o=r*Math.sin(i);return[t,s,o]};K.rgb.ansi16=function(e,t=null){let[r,n,i]=e,s=t===null?K.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));if(s===2)o+=60;return o};K.hsv.ansi16=function(e){return K.rgb.ansi16(K.hsv.rgb(e),e[2])};K.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];if(t>>4===r>>4&&r>>4===n>>4){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};K.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7){if(e>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let r=(Math.trunc(e>50)+1)*0.5,n=(t&1)*r*255,i=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,i,s]};K.ansi256.rgb=function(e){if(e=e[0],e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[r,n,i]};K.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};K.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];if(t[0].length===3)r=[...r].map((a)=>a+a).join("");let n=Number.parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};K.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),o=i-s,a,c=o<1?s/(1-o):0;if(o<=0)a=0;else if(i===t)a=(r-n)/o%6;else if(i===r)a=2+(n-t)/o;else a=4+(t-r)/o;return a/=6,a%=1,[a*360,o*100,c*100]};K.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<0.5?2*t*r:2*t*(1-r),i=0;if(n<1)i=(r-0.5*n)/(1-n);return[e[0],n*100,i*100]};K.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,i=0;if(n<1)i=(r-n)/(1-n);return[e[0],n*100,i*100]};K.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],s=t%1*6,o=s%1,a=1-o,c=0;switch(Math.floor(s)){case 0:{i[0]=1,i[1]=o,i[2]=0;break}case 1:{i[0]=a,i[1]=1,i[2]=0;break}case 2:{i[0]=0,i[1]=1,i[2]=o;break}case 3:{i[0]=0,i[1]=a,i[2]=1;break}case 4:{i[0]=o,i[1]=0,i[2]=1;break}default:i[0]=1,i[1]=0,i[2]=a}return c=(1-r)*n,[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};K.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),i=0;if(n>0)i=t/n;return[e[0],i*100,n*100]};K.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+0.5*t,i=0;if(n>0&&n<0.5)i=t/(2*n);else if(n>=0.5&&n<1)i=t/(2*(1-n));return[e[0],i*100,n*100]};K.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};K.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,i=n-t,s=0;if(i<1)s=(n-i)/(1-i);return[e[0],i*100,s*100]};K.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};K.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};K.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};K.gray.hsl=function(e){return[0,0,e[0]]};K.gray.hsv=K.gray.hsl;K.gray.hwb=function(e){return[0,100,e[0]]};K.gray.cmyk=function(e){return[0,0,0,e[0]]};K.gray.lab=function(e){return[e[0],0,0]};K.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n};K.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function m3(){let e={},t=Object.keys(as);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function h3(e){let t=m3(),r=[e];t[e].distance=0;while(r.length>0){let n=r.pop(),i=Object.keys(as[n]);for(let{length:s}=i,o=0;o<s;o++){let a=i[o],c=t[a];if(c.distance===-1)c.distance=t[n].distance+1,c.parent=n,r.unshift(a)}}return t}function g3(e,t){return function(r){return t(e(r))}}function y3(e,t){let r=[t[e].parent,e],n=as[t[e].parent][e],i=t[e].parent;while(t[i].parent)r.unshift(t[i].parent),n=g3(as[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}function b3(e){let t=h3(e),r={},n=Object.keys(t);for(let{length:i}=n,s=0;s<i;s++){let o=n[s];if(t[o].parent===null)continue;r[o]=y3(o,t)}return r}var x3=b3,fo={},$3=Object.keys(as);function v3(e){let t=function(...r){let n=r[0];if(n===void 0||n===null)return n;if(n.length>1)r=n;return e(r)};if("conversion"in e)t.conversion=e.conversion;return t}function w3(e){let t=function(...r){let n=r[0];if(n===void 0||n===null)return n;if(n.length>1)r=n;let i=e(r);if(typeof i==="object")for(let{length:s}=i,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};if("conversion"in e)t.conversion=e.conversion;return t}for(let e of $3){fo[e]={},Object.defineProperty(fo[e],"channels",{value:as[e].channels}),Object.defineProperty(fo[e],"labels",{value:as[e].labels});let t=x3(e),r=Object.keys(t);for(let n of r){let i=t[n];fo[e][n]=w3(i),fo[e][n].raw=v3(i)}}var Or=fo,OS=["keyword","gray","hex"],Xp={};for(let e of Object.keys(Or))Xp[[...Or[e].labels].sort().join("")]=e;var Qp={};function St(e,t){if(!(this instanceof St))return new St(e,t);if(t&&t in OS)t=null;if(t&&!(t in Or))throw Error("Unknown model: "+t);let r,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof St)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let i=uo.get(e);if(i===null)throw Error("Unable to parse color from string: "+e);this.model=i.model,n=Or[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]==="number"?i.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Or[this.model].channels;let i=Array.prototype.slice.call(e,0,n);this.color=Zp(i,n),this.valpha=typeof e[n]==="number"?e[n]:1}else if(typeof e==="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(e);if("alpha"in e)i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let s=i.sort().join("");if(!(s in Xp))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Xp[s];let{labels:o}=Or[this.model],a=[];for(r=0;r<o.length;r++)a.push(e[o[r]]);this.color=Zp(a)}if(Qp[this.model]){n=Or[this.model].channels;for(r=0;r<n;r++){let i=Qp[this.model][r];if(i)this.color[r]=i(this.color[r])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}St.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in uo.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return uo.to[t.model](...r)},percentString(e){let t=this.rgb().round(typeof e==="number"?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return uo.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Or[this.model],{labels:r}=Or[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];if(this.valpha!==1)e.alpha=this.valpha;return e},unitArray(){let e=this.rgb().color;if(e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1)e.push(this.valpha);return e},unitObject(){let e=this.rgb().object();if(e.r/=255,e.g/=255,e.b/=255,this.valpha!==1)e.alpha=this.valpha;return e},round(e){return e=Math.max(e||0,0),new St([...this.color.map(E3(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new St([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:ft("rgb",0,vt(255)),green:ft("rgb",1,vt(255)),blue:ft("rgb",2,vt(255)),hue:ft(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:ft("hsl",1,vt(100)),lightness:ft("hsl",2,vt(100)),saturationv:ft("hsv",1,vt(100)),value:ft("hsv",2,vt(100)),chroma:ft("hcg",1,vt(100)),gray:ft("hcg",2,vt(100)),white:ft("hwb",1,vt(100)),wblack:ft("hwb",2,vt(100)),cyan:ft("cmyk",0,vt(100)),magenta:ft("cmyk",1,vt(100)),yellow:ft("cmyk",2,vt(100)),black:ft("cmyk",3,vt(100)),x:ft("xyz",0,vt(95.047)),y:ft("xyz",1,vt(100)),z:ft("xyz",2,vt(108.833)),l:ft("lab",0,vt(100)),a:ft("lab",1),b:ft("lab",2),keyword(e){if(e!==void 0)return new St(e);return Or[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new St(e);return uo.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new St(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();if(r.length===1)r="0"+r;return uo.to.hex(...t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[r,n]of e.entries()){let i=n/255;t[r]=i<=0.04045?i/12.92:((i+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(e){let t=this.luminosity(),r=e.luminosity();if(t>r)return(t+0.05)/(r+0.05);return(r+0.05)/(t+0.05)},level(e){let t=this.contrast(e);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*0.3+e[1]*0.59+e[2]*0.11;return St.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let r=e.rgb(),n=this.rgb(),i=t===void 0?0.5:t,s=2*i-1,o=r.alpha()-n.alpha(),a=((s*o===-1?s:(s+o)/(1+s*o))+1)/2,c=1-a;return St.rgb(a*r.red()+c*n.red(),a*r.green()+c*n.green(),a*r.blue()+c*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(let e of Object.keys(Or)){if(OS.includes(e))continue;let{channels:t}=Or[e];St.prototype[e]=function(...r){if(this.model===e)return new St(this);if(r.length>0)return new St(r,e);return new St([..._3(Or[this.model][e].raw(this.color)),this.valpha],e)},St[e]=function(...r){let n=r[0];if(typeof n==="number")n=Zp(r,t);return new St(n,e)}}function S3(e,t){return Number(e.toFixed(t))}function E3(e){return function(t){return S3(t,e)}}function ft(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(Qp[n]||=[])[t]=r;return e=e[0],function(n){let i;if(n!==void 0){if(r)n=r(n);return i=this[e](),i.color[t]=n,i}if(i=this[e]().color[t],r)i=r(i);return i}}function vt(e){return function(t){return Math.max(0,Math.min(e,t))}}function _3(e){return Array.isArray(e)?e:[e]}function Zp(e,t){for(let r=0;r<t;r++)if(typeof e[r]!=="number")e[r]=0;return e}var P3=St});var NS=C(function(sie,TS){TS.exports=IS().default});function k3(e){return this._setBackgroundColourOption("tint",e),this}function A3(e){return this.options.greyscale=f.bool(e)?e:!0,this}function j3(e){return this.greyscale(e)}function R3(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function O3(e){return this.pipelineColourspace(e)}function C3(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function I3(e){return this.toColourspace(e)}function DS(e){if(f.object(e)||f.string(e)&&e.length>=3&&e.length<=200){let t=LS.default(e),r=t.red(),n=t.green(),i=t.blue(),s=Math.round(t.alpha()*255);for(let[o,a]of[["red",r],["green",n],["blue",i],["alpha",s]])if(!f.number(a))throw f.invalidParameterError(`background.${o}`,"number",a);return[r,n,i,s]}else throw f.invalidParameterError("background","object or string",e)}function T3(e,t){if(f.defined(t))this.options[e]=DS(t)}var LS,MS,JS=(e)=>{Object.assign(e.prototype,{tint:k3,greyscale:A3,grayscale:j3,pipelineColourspace:R3,pipelineColorspace:O3,toColourspace:C3,toColorspace:I3,_getBackgroundColourOption:DS,_setBackgroundColourOption:T3}),e.colourspace=MS,e.colorspace=MS};var FS=L(()=>{gn();LS=Bt(NS(),1);/*!
394
+ */_S={integer:"integer",float:"float",approximate:"approximate"}});var IS=C(function(lie,CS){var{defineProperty:tm,getOwnPropertyDescriptor:u3,getOwnPropertyNames:f3}=Object,d3=Object.prototype.hasOwnProperty,p3=(e,t)=>{for(var r in t)tm(e,r,{get:t[r],enumerable:!0})},m3=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of f3(t))if(!d3.call(e,i)&&i!==r)tm(e,i,{get:()=>t[i],enumerable:!(n=u3(t,i))||n.enumerable})}return e},h3=(e)=>m3(tm({},"__esModule",{value:!0}),e),AS={};p3(AS,{default:()=>j3});CS.exports=h3(AS);var Xp={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in Xp)Object.freeze(Xp[e]);var wn=Object.freeze(Xp),jS=Object.create(null);for(let e in wn)if(Object.hasOwn(wn,e))jS[wn[e]]=e;var ur={to:{},get:{}};ur.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=ur.get.hsl(e),n="hsl";break}case"hwb":{r=ur.get.hwb(e),n="hwb";break}default:{r=ur.get.rgb(e),n="rgb";break}}if(!r)return null;return{model:n,value:r}};ur.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,n=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,s=/^(\w+)$/,o=[0,0,0,1],a,c,l;if(a=e.match(r)){l=a[2],a=a[1];for(c=0;c<3;c++){let u=c*2;o[c]=Number.parseInt(a.slice(u,u+2),16)}if(l)o[3]=Number.parseInt(l,16)/255}else if(a=e.match(t)){a=a[1],l=a[3];for(c=0;c<3;c++)o[c]=Number.parseInt(a[c]+a[c],16);if(l)o[3]=Number.parseInt(l+l,16)/255}else if(a=e.match(n)){for(c=0;c<3;c++)o[c]=Number.parseFloat(a[c+1]);if(a[4])o[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.match(i)){for(c=0;c<3;c++)o[c]=Math.round(Number.parseFloat(a[c+1])*2.55);if(a[4])o[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.toLowerCase().match(s)){if(a[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(wn,a[1]))return null;return o=wn[a[1]].slice(),o[3]=1,o}else return null;for(c=0;c<3;c++)o[c]=bi(o[c],0,255);return o[3]=bi(o[3],0,1),o};ur.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,s=bi(Number.parseFloat(r[2]),0,100),o=bi(Number.parseFloat(r[3]),0,100),a=bi(Number.isNaN(n)?1:n,0,1);return[i,s,o,a]}return null};ur.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,s=bi(Number.parseFloat(r[2]),0,100),o=bi(Number.parseFloat(r[3]),0,100),a=bi(Number.isNaN(n)?1:n,0,1);return[i,s,o,a]}return null};ur.to.hex=function(...e){return"#"+tu(e[0])+tu(e[1])+tu(e[2])+(e[3]<1?tu(Math.round(e[3]*255)):"")};ur.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};ur.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"};ur.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};ur.to.hwb=function(...e){let t="";if(e.length>=4&&e[3]!==1)t=", "+e[3];return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};ur.to.keyword=function(...e){return jS[e.slice(0,3)]};function bi(e,t,r){return Math.min(Math.max(t,e),r)}function tu(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var uo=ur,RS={};for(let e of Object.keys(wn))RS[wn[e]]=e;var K={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},as=K,Wn=0.008856451679035631;function po(e){let t=e>0.0031308?1.055*e**0.4166666666666667-0.055:e*12.92;return Math.min(Math.max(0,t),1)}function mo(e){return e>0.04045?((e+0.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(K)){if(!("channels"in K[e]))throw Error("missing channels property: "+e);if(!("labels"in K[e]))throw Error("missing channel labels property: "+e);if(K[e].labels.length!==K[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=K[e];delete K[e].channels,delete K[e].labels,Object.defineProperty(K[e],"channels",{value:t}),Object.defineProperty(K[e],"labels",{value:r})}K.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=s-i,a,c;switch(s){case i:{a=0;break}case t:{a=(r-n)/o;break}case r:{a=2+(n-t)/o;break}case n:{a=4+(t-r)/o;break}}if(a=Math.min(a*60,360),a<0)a+=360;let l=(i+s)/2;if(s===i)c=0;else if(l<=0.5)c=o/(s+i);else c=o/(2-s-i);return[a,c*100,l*100]};K.rgb.hsv=function(e){let t,r,n,i,s,o=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(o,a,c),u=l-Math.min(o,a,c),d=function(h){return(l-h)/6/u+0.5};if(u===0)i=0,s=0;else{switch(s=u/l,t=d(o),r=d(a),n=d(c),l){case o:{i=n-r;break}case a:{i=0.3333333333333333+t-n;break}case c:{i=0.6666666666666666+r-t;break}}if(i<0)i+=1;else if(i>1)i-=1}return[i*360,s*100,l*100]};K.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],i=K.rgb.hsl(e)[0],s=0.00392156862745098*Math.min(t,Math.min(r,n));return n=1-0.00392156862745098*Math.max(t,Math.max(r,n)),[i,s*100,n*100]};K.rgb.oklab=function(e){let t=mo(e[0]/255),r=mo(e[1]/255),n=mo(e[2]/255),i=Math.cbrt(0.4122214708*t+0.5363325363*r+0.0514459929*n),s=Math.cbrt(0.2119034982*t+0.6806995451*r+0.1073969566*n),o=Math.cbrt(0.0883024619*t+0.2817188376*r+0.6299787005*n),a=0.2104542553*i+0.793617785*s-0.0040720468*o,c=1.9779984951*i-2.428592205*s+0.4505937099*o,l=0.0259040371*i+0.7827717662*s-0.808675766*o;return[a*100,c*100,l*100]};K.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n),s=(1-t-i)/(1-i)||0,o=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function g3(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}K.rgb.keyword=function(e){let t=RS[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(wn)){let s=wn[i],o=g3(e,s);if(o<r)r=o,n=i}return n};K.keyword.rgb=function(e){return[...wn[e]]};K.rgb.xyz=function(e){let t=mo(e[0]/255),r=mo(e[1]/255),n=mo(e[2]/255),i=t*0.4124564+r*0.3575761+n*0.1804375,s=t*0.2126729+r*0.7151522+n*0.072175,o=t*0.0193339+r*0.119192+n*0.9503041;return[i*100,s*100,o*100]};K.rgb.lab=function(e){let t=K.rgb.xyz(e),r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>Wn?r**0.3333333333333333:7.787*r+0.13793103448275862,n=n>Wn?n**0.3333333333333333:7.787*n+0.13793103448275862,i=i>Wn?i**0.3333333333333333:7.787*i+0.13793103448275862;let s=116*n-16,o=500*(r-n),a=200*(n-i);return[s,o,a]};K.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i,s;if(r===0)return s=n*255,[s,s,s];let o=n<0.5?n*(1+r):n+r-n*r,a=2*n-o,c=[0,0,0];for(let l=0;l<3;l++){if(i=t+0.3333333333333333*-(l-1),i<0)i++;if(i>1)i--;if(6*i<1)s=a+(o-a)*6*i;else if(2*i<1)s=o;else if(3*i<2)s=a+(o-a)*(0.6666666666666666-i)*6;else s=a;c[l]=s*255}return c};K.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=r,s=Math.max(n,0.01);n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s;let o=(n+r)/2,a=n===0?2*i/(s+i):2*r/(n+r);return[t,a*100,o*100]};K.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,s=t-Math.floor(t),o=255*n*(1-r),a=255*n*(1-r*s),c=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,c,o];case 1:return[a,n,o];case 2:return[o,n,c];case 3:return[o,a,n];case 4:return[c,o,n];case 5:return[n,o,a]}};K.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,0.01),s,o;o=(2-r)*n;let a=(2-r)*i;return s=r*i,s/=a<=1?a:2-a,s=s||0,o/=2,[t,s*100,o*100]};K.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i=r+n,s;if(i>1)r/=i,n/=i;let o=Math.floor(6*t),a=1-n;if(s=6*t-o,(o&1)!==0)s=1-s;let c=r+s*(a-r),l,u,d;switch(o){default:case 6:case 0:{l=a,u=c,d=r;break}case 1:{l=c,u=a,d=r;break}case 2:{l=r,u=a,d=c;break}case 3:{l=r,u=c,d=a;break}case 4:{l=c,u=r,d=a;break}case 5:{l=a,u=r,d=c;break}}return[l*255,u*255,d*255]};K.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100,s=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[s*255,o*255,a*255]};K.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i,s,o;return i=t*3.2404542+r*-1.5371385+n*-0.4985314,s=t*-0.969266+r*1.8760108+n*0.041556,o=t*0.0556434+r*-0.2040259+n*1.0572252,i=po(i),s=po(s),o=po(o),[i*255,s*255,o*255]};K.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>Wn?t**0.3333333333333333:7.787*t+0.13793103448275862,r=r>Wn?r**0.3333333333333333:7.787*r+0.13793103448275862,n=n>Wn?n**0.3333333333333333:7.787*n+0.13793103448275862;let i=116*r-16,s=500*(t-r),o=200*(r-n);return[i,s,o]};K.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=Math.cbrt(0.8189330101*t+0.3618667424*r-0.1288597137*n),s=Math.cbrt(0.0329845436*t+0.9293118715*r+0.0361456387*n),o=Math.cbrt(0.0482003018*t+0.2643662691*r+0.633851707*n),a=0.2104542553*i+0.793617785*s-0.0040720468*o,c=1.9779984951*i-2.428592205*s+0.4505937099*o,l=0.0259040371*i+0.7827717662*s-0.808675766*o;return[a*100,c*100,l*100]};K.oklab.oklch=function(e){return K.lab.lch(e)};K.oklab.xyz=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(0.999999998*t+0.396337792*r+0.215803758*n)**3,s=(1.000000008*t-0.105561342*r-0.063854175*n)**3,o=(1.000000055*t-0.089484182*r-1.291485538*n)**3,a=1.227013851*i-0.55779998*s+0.281256149*o,c=-0.040580178*i+1.11225687*s-0.071676679*o,l=-0.076381285*i-0.421481978*s+1.58616322*o;return[a*100,c*100,l*100]};K.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(t+0.3963377774*r+0.2158037573*n)**3,s=(t-0.1055613458*r-0.0638541728*n)**3,o=(t-0.0894841775*r-1.291485548*n)**3,a=po(4.0767416621*i-3.3077115913*s+0.2309699292*o),c=po(-1.2684380046*i+2.6097574011*s-0.3413193965*o),l=po(-0.0041960863*i-0.7034186147*s+1.707614701*o);return[a*255,c*255,l*255]};K.oklch.oklab=function(e){return K.lch.lab(e)};K.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],i,s,o;s=(t+16)/116,i=r/500+s,o=s-n/200;let a=s**3,c=i**3,l=o**3;return s=a>Wn?a:(s-0.13793103448275862)/7.787,i=c>Wn?c:(i-0.13793103448275862)/7.787,o=l>Wn?l:(o-0.13793103448275862)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};K.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],i;if(i=Math.atan2(n,r)*360/2/Math.PI,i<0)i+=360;let o=Math.sqrt(r*r+n*n);return[t,o,i]};K.lch.lab=function(e){let t=e[0],r=e[1],i=e[2]/360*2*Math.PI,s=r*Math.cos(i),o=r*Math.sin(i);return[t,s,o]};K.rgb.ansi16=function(e,t=null){let[r,n,i]=e,s=t===null?K.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));if(s===2)o+=60;return o};K.hsv.ansi16=function(e){return K.rgb.ansi16(K.hsv.rgb(e),e[2])};K.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];if(t>>4===r>>4&&r>>4===n>>4){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};K.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7){if(e>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let r=(Math.trunc(e>50)+1)*0.5,n=(t&1)*r*255,i=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,i,s]};K.ansi256.rgb=function(e){if(e=e[0],e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[r,n,i]};K.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};K.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];if(t[0].length===3)r=[...r].map((a)=>a+a).join("");let n=Number.parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};K.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),o=i-s,a,c=o<1?s/(1-o):0;if(o<=0)a=0;else if(i===t)a=(r-n)/o%6;else if(i===r)a=2+(n-t)/o;else a=4+(t-r)/o;return a/=6,a%=1,[a*360,o*100,c*100]};K.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<0.5?2*t*r:2*t*(1-r),i=0;if(n<1)i=(r-0.5*n)/(1-n);return[e[0],n*100,i*100]};K.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,i=0;if(n<1)i=(r-n)/(1-n);return[e[0],n*100,i*100]};K.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],s=t%1*6,o=s%1,a=1-o,c=0;switch(Math.floor(s)){case 0:{i[0]=1,i[1]=o,i[2]=0;break}case 1:{i[0]=a,i[1]=1,i[2]=0;break}case 2:{i[0]=0,i[1]=1,i[2]=o;break}case 3:{i[0]=0,i[1]=a,i[2]=1;break}case 4:{i[0]=o,i[1]=0,i[2]=1;break}default:i[0]=1,i[1]=0,i[2]=a}return c=(1-r)*n,[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};K.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),i=0;if(n>0)i=t/n;return[e[0],i*100,n*100]};K.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+0.5*t,i=0;if(n>0&&n<0.5)i=t/(2*n);else if(n>=0.5&&n<1)i=t/(2*(1-n));return[e[0],i*100,n*100]};K.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};K.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,i=n-t,s=0;if(i<1)s=(n-i)/(1-i);return[e[0],i*100,s*100]};K.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};K.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};K.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};K.gray.hsl=function(e){return[0,0,e[0]]};K.gray.hsv=K.gray.hsl;K.gray.hwb=function(e){return[0,100,e[0]]};K.gray.cmyk=function(e){return[0,0,0,e[0]]};K.gray.lab=function(e){return[e[0],0,0]};K.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n};K.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function y3(){let e={},t=Object.keys(as);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function b3(e){let t=y3(),r=[e];t[e].distance=0;while(r.length>0){let n=r.pop(),i=Object.keys(as[n]);for(let{length:s}=i,o=0;o<s;o++){let a=i[o],c=t[a];if(c.distance===-1)c.distance=t[n].distance+1,c.parent=n,r.unshift(a)}}return t}function x3(e,t){return function(r){return t(e(r))}}function $3(e,t){let r=[t[e].parent,e],n=as[t[e].parent][e],i=t[e].parent;while(t[i].parent)r.unshift(t[i].parent),n=x3(as[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}function v3(e){let t=b3(e),r={},n=Object.keys(t);for(let{length:i}=n,s=0;s<i;s++){let o=n[s];if(t[o].parent===null)continue;r[o]=$3(o,t)}return r}var w3=v3,fo={},S3=Object.keys(as);function E3(e){let t=function(...r){let n=r[0];if(n===void 0||n===null)return n;if(n.length>1)r=n;return e(r)};if("conversion"in e)t.conversion=e.conversion;return t}function _3(e){let t=function(...r){let n=r[0];if(n===void 0||n===null)return n;if(n.length>1)r=n;let i=e(r);if(typeof i==="object")for(let{length:s}=i,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};if("conversion"in e)t.conversion=e.conversion;return t}for(let e of S3){fo[e]={},Object.defineProperty(fo[e],"channels",{value:as[e].channels}),Object.defineProperty(fo[e],"labels",{value:as[e].labels});let t=w3(e),r=Object.keys(t);for(let n of r){let i=t[n];fo[e][n]=_3(i),fo[e][n].raw=E3(i)}}var Or=fo,OS=["keyword","gray","hex"],Qp={};for(let e of Object.keys(Or))Qp[[...Or[e].labels].sort().join("")]=e;var Zp={};function St(e,t){if(!(this instanceof St))return new St(e,t);if(t&&t in OS)t=null;if(t&&!(t in Or))throw Error("Unknown model: "+t);let r,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof St)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let i=uo.get(e);if(i===null)throw Error("Unable to parse color from string: "+e);this.model=i.model,n=Or[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]==="number"?i.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Or[this.model].channels;let i=Array.prototype.slice.call(e,0,n);this.color=em(i,n),this.valpha=typeof e[n]==="number"?e[n]:1}else if(typeof e==="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(e);if("alpha"in e)i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let s=i.sort().join("");if(!(s in Qp))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Qp[s];let{labels:o}=Or[this.model],a=[];for(r=0;r<o.length;r++)a.push(e[o[r]]);this.color=em(a)}if(Zp[this.model]){n=Or[this.model].channels;for(r=0;r<n;r++){let i=Zp[this.model][r];if(i)this.color[r]=i(this.color[r])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}St.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in uo.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return uo.to[t.model](...r)},percentString(e){let t=this.rgb().round(typeof e==="number"?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return uo.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Or[this.model],{labels:r}=Or[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];if(this.valpha!==1)e.alpha=this.valpha;return e},unitArray(){let e=this.rgb().color;if(e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1)e.push(this.valpha);return e},unitObject(){let e=this.rgb().object();if(e.r/=255,e.g/=255,e.b/=255,this.valpha!==1)e.alpha=this.valpha;return e},round(e){return e=Math.max(e||0,0),new St([...this.color.map(k3(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new St([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:ft("rgb",0,vt(255)),green:ft("rgb",1,vt(255)),blue:ft("rgb",2,vt(255)),hue:ft(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:ft("hsl",1,vt(100)),lightness:ft("hsl",2,vt(100)),saturationv:ft("hsv",1,vt(100)),value:ft("hsv",2,vt(100)),chroma:ft("hcg",1,vt(100)),gray:ft("hcg",2,vt(100)),white:ft("hwb",1,vt(100)),wblack:ft("hwb",2,vt(100)),cyan:ft("cmyk",0,vt(100)),magenta:ft("cmyk",1,vt(100)),yellow:ft("cmyk",2,vt(100)),black:ft("cmyk",3,vt(100)),x:ft("xyz",0,vt(95.047)),y:ft("xyz",1,vt(100)),z:ft("xyz",2,vt(108.833)),l:ft("lab",0,vt(100)),a:ft("lab",1),b:ft("lab",2),keyword(e){if(e!==void 0)return new St(e);return Or[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new St(e);return uo.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new St(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();if(r.length===1)r="0"+r;return uo.to.hex(...t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[r,n]of e.entries()){let i=n/255;t[r]=i<=0.04045?i/12.92:((i+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(e){let t=this.luminosity(),r=e.luminosity();if(t>r)return(t+0.05)/(r+0.05);return(r+0.05)/(t+0.05)},level(e){let t=this.contrast(e);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*0.3+e[1]*0.59+e[2]*0.11;return St.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let r=e.rgb(),n=this.rgb(),i=t===void 0?0.5:t,s=2*i-1,o=r.alpha()-n.alpha(),a=((s*o===-1?s:(s+o)/(1+s*o))+1)/2,c=1-a;return St.rgb(a*r.red()+c*n.red(),a*r.green()+c*n.green(),a*r.blue()+c*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(let e of Object.keys(Or)){if(OS.includes(e))continue;let{channels:t}=Or[e];St.prototype[e]=function(...r){if(this.model===e)return new St(this);if(r.length>0)return new St(r,e);return new St([...A3(Or[this.model][e].raw(this.color)),this.valpha],e)},St[e]=function(...r){let n=r[0];if(typeof n==="number")n=em(r,t);return new St(n,e)}}function P3(e,t){return Number(e.toFixed(t))}function k3(e){return function(t){return P3(t,e)}}function ft(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(Zp[n]||=[])[t]=r;return e=e[0],function(n){let i;if(n!==void 0){if(r)n=r(n);return i=this[e](),i.color[t]=n,i}if(i=this[e]().color[t],r)i=r(i);return i}}function vt(e){return function(t){return Math.max(0,Math.min(e,t))}}function A3(e){return Array.isArray(e)?e:[e]}function em(e,t){for(let r=0;r<t;r++)if(typeof e[r]!=="number")e[r]=0;return e}var j3=St});var NS=C(function(uie,TS){TS.exports=IS().default});function R3(e){return this._setBackgroundColourOption("tint",e),this}function O3(e){return this.options.greyscale=f.bool(e)?e:!0,this}function C3(e){return this.greyscale(e)}function I3(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function T3(e){return this.pipelineColourspace(e)}function N3(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function M3(e){return this.toColourspace(e)}function DS(e){if(f.object(e)||f.string(e)&&e.length>=3&&e.length<=200){let t=LS.default(e),r=t.red(),n=t.green(),i=t.blue(),s=Math.round(t.alpha()*255);for(let[o,a]of[["red",r],["green",n],["blue",i],["alpha",s]])if(!f.number(a))throw f.invalidParameterError(`background.${o}`,"number",a);return[r,n,i,s]}else throw f.invalidParameterError("background","object or string",e)}function L3(e,t){if(f.defined(t))this.options[e]=DS(t)}var LS,MS,JS=(e)=>{Object.assign(e.prototype,{tint:R3,greyscale:O3,grayscale:C3,pipelineColourspace:I3,pipelineColorspace:T3,toColourspace:N3,toColorspace:M3,_getBackgroundColourOption:DS,_setBackgroundColourOption:L3}),e.colourspace=MS,e.colorspace=MS};var FS=L(()=>{gn();LS=Bt(NS(),1);/*!
395
395
  Copyright 2013 Lovell Fuller and others.
396
396
  SPDX-License-Identifier: Apache-2.0
397
- */MS={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function M3(){return this.options.removeAlpha=!0,this}function L3(e){if(f.defined(e))if(f.number(e)&&f.inRange(e,0,1))this.options.ensureAlpha=e;else throw f.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function D3(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e))e=t[e];if(f.integer(e)&&f.inRange(e,0,4))this.options.extractChannel=e;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function J3(e,t){if(Array.isArray(e))e.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,t))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(e,t));return this}function F3(e){if(f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw f.invalidParameterError("boolOp","one of: and, or, eor",e);return this}var N3,qS=(e)=>{Object.assign(e.prototype,{removeAlpha:M3,ensureAlpha:L3,extractChannel:D3,joinChannel:J3,bandbool:F3}),e.bool=N3};var BS=L(()=>{gn();/*!
397
+ */MS={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function J3(){return this.options.removeAlpha=!0,this}function F3(e){if(f.defined(e))if(f.number(e)&&f.inRange(e,0,1))this.options.ensureAlpha=e;else throw f.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function q3(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e))e=t[e];if(f.integer(e)&&f.inRange(e,0,4))this.options.extractChannel=e;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function B3(e,t){if(Array.isArray(e))e.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,t))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(e,t));return this}function H3(e){if(f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw f.invalidParameterError("boolOp","one of: and, or, eor",e);return this}var D3,qS=(e)=>{Object.assign(e.prototype,{removeAlpha:J3,ensureAlpha:F3,extractChannel:q3,joinChannel:B3,bandbool:H3}),e.bool=D3};var BS=L(()=>{gn();/*!
398
398
  Copyright 2013 Lovell Fuller and others.
399
399
  SPDX-License-Identifier: Apache-2.0
400
- */N3={and:"and",or:"or",eor:"eor"}});import tm from"node:path";function B3(e,t){let r;if(!f.string(e))r=Error("Missing output file path");else if(f.string(this.options.input.file)&&tm.resolve(this.options.input.file)===tm.resolve(e))r=Error("Cannot use same file for input and output");else if(q3.test(tm.extname(e))&&!this.constructor.format.jp2.output.file)r=US();if(r)if(f.fn(t))t(r);else return Promise.reject(r);else{this.options.fileOut=e;let n=Error();return this._pipeline(t,n)}return this}function H3(e,t){if(f.object(e))this._setBooleanOption("resolveWithObject",e.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let r=Error();return this._pipeline(f.fn(e)?e:t,r)}function U3(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function V3(e){if(f.number(e)&&e>0)this.options.withMetadataDensity=e;else throw f.invalidParameterError("density","positive number",e);return this.keepExif()}function W3(){return this.options.keepMetadata|=1,this}function z3(e){if(f.object(e))for(let[t,r]of Object.entries(e))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${t.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${t}.${n}`,"string",i);else throw f.invalidParameterError(t,"object",r);else throw f.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function K3(e){return this.withExif(e),this.options.withExifMerge=!0,this}function G3(){return this.options.keepMetadata|=8,this}function Y3(e,t){if(f.string(e))this.options.withIccProfile=e;else throw f.invalidParameterError("icc","string",e);if(this.keepIccProfile(),f.object(t)){if(f.defined(t.attach))if(f.bool(t.attach)){if(!t.attach)this.options.keepMetadata&=-9}else throw f.invalidParameterError("attach","boolean",t.attach)}return this}function X3(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function Q3(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function Z3(){return this.options.keepMetadata|=2,this}function eB(e){if(f.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",e);return this}function tB(){return this.options.keepMetadata|=31,this}function rB(e){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(e)){if(f.defined(e.orientation))if(f.integer(e.orientation)&&f.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(f.defined(e.density))if(f.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw f.invalidParameterError("density","positive number",e.density);if(f.defined(e.icc))this.withIccProfile(e.icc);if(f.defined(e.exif))this.withExifMerge(e.exif)}return this}function nB(e,t){let r=HS.get((f.object(e)&&f.string(e.id)?e.id:e).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...HS.keys()].join(", ")}`,e);return this[r](t)}function iB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.progressive))this._setBooleanOption("jpegProgressive",e.progressive);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=f.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(f.defined(t))this._setBooleanOption("jpegOptimiseCoding",t);if(f.defined(e.mozjpeg))if(f.bool(e.mozjpeg)){if(e.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw f.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=f.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;if(f.defined(r))this._setBooleanOption("jpegTrellisQuantisation",r);if(f.defined(e.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let n=f.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;if(f.defined(n)){if(this._setBooleanOption("jpegOptimiseScans",n),n)this.options.jpegProgressive=!0}let i=f.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(f.defined(i))if(f.integer(i)&&f.inRange(i,0,8))this.options.jpegQuantisationTable=i;else throw f.invalidParameterError("quantisationTable","integer between 0 and 8",i)}return this._updateFormatOut("jpeg",e)}function sB(e){if(f.object(e)){if(f.defined(e.progressive))this._setBooleanOption("pngProgressive",e.progressive);if(f.defined(e.compressionLevel))if(f.integer(e.compressionLevel)&&f.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);if(f.defined(e.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.pngBitdepth=VS(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.palette))this._setBooleanOption("pngPalette",e.palette);else if([e.quality,e.effort,e.colours,e.colors,e.dither].some(f.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",e.quality);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function oB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.alphaQuality))if(f.integer(e.alphaQuality)&&f.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(f.defined(e.lossless))this._setBooleanOption("webpLossless",e.lossless);if(f.defined(e.nearLossless))this._setBooleanOption("webpNearLossless",e.nearLossless);if(f.defined(e.smartSubsample))this._setBooleanOption("webpSmartSubsample",e.smartSubsample);if(f.defined(e.smartDeblock))this._setBooleanOption("webpSmartDeblock",e.smartDeblock);if(f.defined(e.preset))if(f.string(e.preset)&&f.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",e.effort);if(f.defined(e.minSize))this._setBooleanOption("webpMinSize",e.minSize);if(f.defined(e.mixed))this._setBooleanOption("webpMixed",e.mixed);if(f.defined(e.exact))this._setBooleanOption("webpExact",e.exact)}return rm(e,this.options),this._updateFormatOut("webp",e)}function aB(e){if(f.object(e)){if(f.defined(e.reuse))this._setBooleanOption("gifReuse",e.reuse);if(f.defined(e.progressive))this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.gifBitdepth=VS(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(f.defined(e.interFrameMaxError))if(f.number(e.interFrameMaxError)&&f.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(f.defined(e.interPaletteMaxError))if(f.number(e.interPaletteMaxError)&&f.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(f.defined(e.keepDuplicateFrames))if(f.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return rm(e,this.options),this._updateFormatOut("gif",e)}function cB(e){if(!this.constructor.format.jp2.output.buffer)throw US();if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function rm(e,t){if(f.object(e)&&f.defined(e.loop))if(f.integer(e.loop)&&f.inRange(e.loop,0,65535))t.loop=e.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(f.object(e)&&f.defined(e.delay))if(f.integer(e.delay)&&f.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&f.inRange(e.delay.length,1,1e6)&&e.delay.every(f.integer)&&e.delay.every((r)=>f.inRange(r,0,65535)))t.delay=e.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function lB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[1,2,4]))this.options.tiffBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",e.bitdepth);if(f.defined(e.tile))this._setBooleanOption("tiffTile",e.tile);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.tiffTileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.tiffTileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.miniswhite))this._setBooleanOption("tiffMiniswhite",e.miniswhite);if(f.defined(e.pyramid))this._setBooleanOption("tiffPyramid",e.pyramid);if(f.defined(e.xres))if(f.number(e.xres)&&f.inRange(e.xres,0.001,1e6))this.options.tiffXres=e.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",e.xres);if(f.defined(e.yres))if(f.number(e.yres)&&f.inRange(e.yres,0.001,1e6))this.options.tiffYres=e.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",e.yres);if(f.defined(e.compression))if(f.string(e.compression)&&f.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(f.defined(e.bigtiff))this._setBooleanOption("tiffBigtiff",e.bigtiff);if(f.defined(e.predictor))if(f.string(e.predictor)&&f.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(f.defined(e.resolutionUnit))if(f.string(e.resolutionUnit)&&f.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function uB(e){return this.heif({...e,compression:"av1"})}function fB(e){if(f.object(e)){if(f.string(e.compression)&&f.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",e.compression);if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.heifLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",e.effort);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[8,10,12]))this.options.heifBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth);if(f.defined(e.tune))if(f.string(e.tune)&&f.inArray(e.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&e.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=e.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",e.tune)}else throw f.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function dB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?0.1+(100-e.quality)*0.09:0.017666666666666667*e.quality*e.quality-1.15*e.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(f.defined(e.distance))if(f.number(e.distance)&&f.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(f.defined(e.decodingTier))if(f.integer(e.decodingTier)&&f.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",e.effort)}return rm(e,this.options),this._updateFormatOut("jxl",e)}function pB(e){if(f.object(e)){if(f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth)}return this._updateFormatOut("raw")}function mB(e){if(f.object(e)){if(f.defined(e.size))if(f.integer(e.size)&&f.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw f.invalidParameterError("size","integer between 1 and 8192",e.size);if(f.defined(e.overlap))if(f.integer(e.overlap)&&f.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(f.defined(e.container))if(f.string(e.container)&&f.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw f.invalidParameterError("container","one of: fs, zip",e.container);if(f.defined(e.layout))if(f.string(e.layout)&&f.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(f.defined(e.angle))if(f.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(f.defined(e.skipBlanks))if(f.integer(e.skipBlanks)&&f.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else if(f.defined(e.layout)&&e.layout==="google")this.options.tileSkipBlanks=5;let t=f.bool(e.center)?e.center:e.centre;if(f.defined(t))this._setBooleanOption("tileCentre",t);if(f.defined(e.id))if(f.string(e.id))this.options.tileId=e.id;else throw f.invalidParameterError("id","string",e.id);if(f.defined(e.basename))if(f.string(e.basename))this.options.tileBasename=e.basename;else throw f.invalidParameterError("basename","string",e.basename)}if(f.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw f.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function hB(e){if(!f.plainObject(e))throw f.invalidParameterError("options","object",e);if(f.integer(e.seconds)&&f.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function gB(e,t){if(!(f.object(t)&&t.force===!1))this.options.formatOut=e;return this}function yB(e,t){if(f.bool(t))this.options[e]=t;else throw f.invalidParameterError(e,"boolean",t)}function bB(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function xB(e,t){if(typeof e==="function"){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(r,n,i)=>{if(r)e(f.nativeError(r,t));else e(null,n,i)})});else Le.pipeline(this.options,(r,n,i)=>{if(r)e(f.nativeError(r,t));else e(null,n,i)});return this}else if(this.options.streamOut){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(r,n,i)=>{if(r)this.emit("error",f.nativeError(r,t));else this.emit("info",i),this.push(n);this.push(null),this.on("end",()=>this.emit("close"))})});else Le.pipeline(this.options,(r,n,i)=>{if(r)this.emit("error",f.nativeError(r,t));else this.emit("info",i),this.push(n);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(i,s,o)=>{if(i)n(f.nativeError(i,t));else if(this.options.resolveWithObject)r({data:s,info:o});else r(s)})})});else return new Promise((r,n)=>{Le.pipeline(this.options,(i,s,o)=>{if(i)n(f.nativeError(i,t));else if(this.options.resolveWithObject)r({data:s,info:o});else r(s)})})}var HS,q3,US=()=>Error("JP2 output requires libvips with support for OpenJPEG"),VS=(e)=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1),WS=(e)=>{Object.assign(e.prototype,{toFile:B3,toBuffer:H3,toUint8Array:U3,withDensity:V3,keepExif:W3,withExif:z3,withExifMerge:K3,keepIccProfile:G3,withIccProfile:Y3,keepGainMap:X3,withGainMap:Q3,keepXmp:Z3,withXmp:eB,keepMetadata:tB,withMetadata:rB,toFormat:nB,jpeg:iB,jp2:cB,png:sB,webp:oB,tiff:lB,avif:uB,heif:fB,jxl:dB,gif:aB,raw:pB,tile:mB,timeout:hB,_updateFormatOut:gB,_setBooleanOption:yB,_read:bB,_pipeline:xB})};var zS=L(()=>{gn();Oa();/*!
400
+ */D3={and:"and",or:"or",eor:"eor"}});import rm from"node:path";function V3(e,t){let r;if(!f.string(e))r=Error("Missing output file path");else if(f.string(this.options.input.file)&&rm.resolve(this.options.input.file)===rm.resolve(e))r=Error("Cannot use same file for input and output");else if(U3.test(rm.extname(e))&&!this.constructor.format.jp2.output.file)r=US();if(r)if(f.fn(t))t(r);else return Promise.reject(r);else{this.options.fileOut=e;let n=Error();return this._pipeline(t,n)}return this}function W3(e,t){if(f.object(e))this._setBooleanOption("resolveWithObject",e.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let r=Error();return this._pipeline(f.fn(e)?e:t,r)}function z3(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function K3(e){if(f.number(e)&&e>0)this.options.withMetadataDensity=e;else throw f.invalidParameterError("density","positive number",e);return this.keepExif()}function G3(){return this.options.keepMetadata|=1,this}function Y3(e){if(f.object(e))for(let[t,r]of Object.entries(e))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${t.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${t}.${n}`,"string",i);else throw f.invalidParameterError(t,"object",r);else throw f.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function X3(e){return this.withExif(e),this.options.withExifMerge=!0,this}function Q3(){return this.options.keepMetadata|=8,this}function Z3(e,t){if(f.string(e))this.options.withIccProfile=e;else throw f.invalidParameterError("icc","string",e);if(this.keepIccProfile(),f.object(t)){if(f.defined(t.attach))if(f.bool(t.attach)){if(!t.attach)this.options.keepMetadata&=-9}else throw f.invalidParameterError("attach","boolean",t.attach)}return this}function eB(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function tB(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function rB(){return this.options.keepMetadata|=2,this}function nB(e){if(f.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",e);return this}function iB(){return this.options.keepMetadata|=31,this}function sB(e){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(e)){if(f.defined(e.orientation))if(f.integer(e.orientation)&&f.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(f.defined(e.density))if(f.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw f.invalidParameterError("density","positive number",e.density);if(f.defined(e.icc))this.withIccProfile(e.icc);if(f.defined(e.exif))this.withExifMerge(e.exif)}return this}function oB(e,t){let r=HS.get((f.object(e)&&f.string(e.id)?e.id:e).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...HS.keys()].join(", ")}`,e);return this[r](t)}function aB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.progressive))this._setBooleanOption("jpegProgressive",e.progressive);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=f.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(f.defined(t))this._setBooleanOption("jpegOptimiseCoding",t);if(f.defined(e.mozjpeg))if(f.bool(e.mozjpeg)){if(e.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw f.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=f.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;if(f.defined(r))this._setBooleanOption("jpegTrellisQuantisation",r);if(f.defined(e.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let n=f.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;if(f.defined(n)){if(this._setBooleanOption("jpegOptimiseScans",n),n)this.options.jpegProgressive=!0}let i=f.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(f.defined(i))if(f.integer(i)&&f.inRange(i,0,8))this.options.jpegQuantisationTable=i;else throw f.invalidParameterError("quantisationTable","integer between 0 and 8",i)}return this._updateFormatOut("jpeg",e)}function cB(e){if(f.object(e)){if(f.defined(e.progressive))this._setBooleanOption("pngProgressive",e.progressive);if(f.defined(e.compressionLevel))if(f.integer(e.compressionLevel)&&f.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);if(f.defined(e.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.pngBitdepth=VS(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.palette))this._setBooleanOption("pngPalette",e.palette);else if([e.quality,e.effort,e.colours,e.colors,e.dither].some(f.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",e.quality);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function lB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.alphaQuality))if(f.integer(e.alphaQuality)&&f.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(f.defined(e.lossless))this._setBooleanOption("webpLossless",e.lossless);if(f.defined(e.nearLossless))this._setBooleanOption("webpNearLossless",e.nearLossless);if(f.defined(e.smartSubsample))this._setBooleanOption("webpSmartSubsample",e.smartSubsample);if(f.defined(e.smartDeblock))this._setBooleanOption("webpSmartDeblock",e.smartDeblock);if(f.defined(e.preset))if(f.string(e.preset)&&f.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",e.effort);if(f.defined(e.minSize))this._setBooleanOption("webpMinSize",e.minSize);if(f.defined(e.mixed))this._setBooleanOption("webpMixed",e.mixed);if(f.defined(e.exact))this._setBooleanOption("webpExact",e.exact)}return nm(e,this.options),this._updateFormatOut("webp",e)}function uB(e){if(f.object(e)){if(f.defined(e.reuse))this._setBooleanOption("gifReuse",e.reuse);if(f.defined(e.progressive))this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.gifBitdepth=VS(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(f.defined(e.interFrameMaxError))if(f.number(e.interFrameMaxError)&&f.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(f.defined(e.interPaletteMaxError))if(f.number(e.interPaletteMaxError)&&f.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(f.defined(e.keepDuplicateFrames))if(f.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return nm(e,this.options),this._updateFormatOut("gif",e)}function fB(e){if(!this.constructor.format.jp2.output.buffer)throw US();if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function nm(e,t){if(f.object(e)&&f.defined(e.loop))if(f.integer(e.loop)&&f.inRange(e.loop,0,65535))t.loop=e.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(f.object(e)&&f.defined(e.delay))if(f.integer(e.delay)&&f.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&f.inRange(e.delay.length,1,1e6)&&e.delay.every(f.integer)&&e.delay.every((r)=>f.inRange(r,0,65535)))t.delay=e.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function dB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[1,2,4]))this.options.tiffBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",e.bitdepth);if(f.defined(e.tile))this._setBooleanOption("tiffTile",e.tile);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.tiffTileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.tiffTileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.miniswhite))this._setBooleanOption("tiffMiniswhite",e.miniswhite);if(f.defined(e.pyramid))this._setBooleanOption("tiffPyramid",e.pyramid);if(f.defined(e.xres))if(f.number(e.xres)&&f.inRange(e.xres,0.001,1e6))this.options.tiffXres=e.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",e.xres);if(f.defined(e.yres))if(f.number(e.yres)&&f.inRange(e.yres,0.001,1e6))this.options.tiffYres=e.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",e.yres);if(f.defined(e.compression))if(f.string(e.compression)&&f.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(f.defined(e.bigtiff))this._setBooleanOption("tiffBigtiff",e.bigtiff);if(f.defined(e.predictor))if(f.string(e.predictor)&&f.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(f.defined(e.resolutionUnit))if(f.string(e.resolutionUnit)&&f.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function pB(e){return this.heif({...e,compression:"av1"})}function mB(e){if(f.object(e)){if(f.string(e.compression)&&f.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",e.compression);if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.heifLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",e.effort);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[8,10,12]))this.options.heifBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth);if(f.defined(e.tune))if(f.string(e.tune)&&f.inArray(e.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&e.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=e.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",e.tune)}else throw f.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function hB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?0.1+(100-e.quality)*0.09:0.017666666666666667*e.quality*e.quality-1.15*e.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(f.defined(e.distance))if(f.number(e.distance)&&f.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(f.defined(e.decodingTier))if(f.integer(e.decodingTier)&&f.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",e.effort)}return nm(e,this.options),this._updateFormatOut("jxl",e)}function gB(e){if(f.object(e)){if(f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth)}return this._updateFormatOut("raw")}function yB(e){if(f.object(e)){if(f.defined(e.size))if(f.integer(e.size)&&f.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw f.invalidParameterError("size","integer between 1 and 8192",e.size);if(f.defined(e.overlap))if(f.integer(e.overlap)&&f.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(f.defined(e.container))if(f.string(e.container)&&f.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw f.invalidParameterError("container","one of: fs, zip",e.container);if(f.defined(e.layout))if(f.string(e.layout)&&f.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(f.defined(e.angle))if(f.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(f.defined(e.skipBlanks))if(f.integer(e.skipBlanks)&&f.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else if(f.defined(e.layout)&&e.layout==="google")this.options.tileSkipBlanks=5;let t=f.bool(e.center)?e.center:e.centre;if(f.defined(t))this._setBooleanOption("tileCentre",t);if(f.defined(e.id))if(f.string(e.id))this.options.tileId=e.id;else throw f.invalidParameterError("id","string",e.id);if(f.defined(e.basename))if(f.string(e.basename))this.options.tileBasename=e.basename;else throw f.invalidParameterError("basename","string",e.basename)}if(f.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw f.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function bB(e){if(!f.plainObject(e))throw f.invalidParameterError("options","object",e);if(f.integer(e.seconds)&&f.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function xB(e,t){if(!(f.object(t)&&t.force===!1))this.options.formatOut=e;return this}function $B(e,t){if(f.bool(t))this.options[e]=t;else throw f.invalidParameterError(e,"boolean",t)}function vB(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function wB(e,t){if(typeof e==="function"){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(r,n,i)=>{if(r)e(f.nativeError(r,t));else e(null,n,i)})});else Le.pipeline(this.options,(r,n,i)=>{if(r)e(f.nativeError(r,t));else e(null,n,i)});return this}else if(this.options.streamOut){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(r,n,i)=>{if(r)this.emit("error",f.nativeError(r,t));else this.emit("info",i),this.push(n);this.push(null),this.on("end",()=>this.emit("close"))})});else Le.pipeline(this.options,(r,n,i)=>{if(r)this.emit("error",f.nativeError(r,t));else this.emit("info",i),this.push(n);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(i,s,o)=>{if(i)n(f.nativeError(i,t));else if(this.options.resolveWithObject)r({data:s,info:o});else r(s)})})});else return new Promise((r,n)=>{Le.pipeline(this.options,(i,s,o)=>{if(i)n(f.nativeError(i,t));else if(this.options.resolveWithObject)r({data:s,info:o});else r(s)})})}var HS,U3,US=()=>Error("JP2 output requires libvips with support for OpenJPEG"),VS=(e)=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1),WS=(e)=>{Object.assign(e.prototype,{toFile:V3,toBuffer:W3,toUint8Array:z3,withDensity:K3,keepExif:G3,withExif:Y3,withExifMerge:X3,keepIccProfile:Q3,withIccProfile:Z3,keepGainMap:eB,withGainMap:tB,keepXmp:rB,withXmp:nB,keepMetadata:iB,withMetadata:sB,toFormat:oB,jpeg:aB,jp2:fB,png:cB,webp:lB,tiff:dB,avif:pB,heif:mB,jxl:hB,gif:uB,raw:gB,tile:yB,timeout:bB,_updateFormatOut:xB,_setBooleanOption:$B,_read:vB,_pipeline:wB})};var zS=L(()=>{gn();Oa();/*!
401
401
  Copyright 2013 Lovell Fuller and others.
402
402
  SPDX-License-Identifier: Apache-2.0
403
- */HS=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),q3=/\.(jp[2x]|j2[kc])$/i});import $B from"node:events";import{createRequire as vB}from"node:module";import{availableParallelism as wB}from"node:os";function GS(e){if(f.bool(e))if(e)return Le.cache(50,20,100);else return Le.cache(0,0,0);else if(f.object(e)){for(let t of["memory","files","items"]){let r=e[t];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(t,"a positive integer",r)}return Le.cache(e.memory,e.files,e.items)}else return Le.cache()}function EB(e){return Le.concurrency(f.integer(e)?e:null)}function PB(){return Le.counters()}function kB(e){return Le.simd(f.bool(e)?e:null)}function AB(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))Le.block(e.operation,!0);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}function jB(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))Le.block(e.operation,!1);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}var Ca,nm,KS,im,xi,SB,ho,_B,YS=(e)=>{e.cache=GS,e.concurrency=EB,e.counters=PB,e.simd=kB,e.format=xi,e.interpolators=SB,e.versions=ho,e.queue=_B,e.block=AB,e.unblock=jB};var XS=L(()=>{gn();Vp();Oa();Xl();Ca=Bt(Ll(),1);/*!
403
+ */HS=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),U3=/\.(jp[2x]|j2[kc])$/i});import SB from"node:events";import{createRequire as EB}from"node:module";import{availableParallelism as _B}from"node:os";function GS(e){if(f.bool(e))if(e)return Le.cache(50,20,100);else return Le.cache(0,0,0);else if(f.object(e)){for(let t of["memory","files","items"]){let r=e[t];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(t,"a positive integer",r)}return Le.cache(e.memory,e.files,e.items)}else return Le.cache()}function kB(e){return Le.concurrency(f.integer(e)?e:null)}function jB(){return Le.counters()}function RB(e){return Le.simd(f.bool(e)?e:null)}function OB(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))Le.block(e.operation,!0);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}function CB(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))Le.block(e.operation,!1);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}var Ca,im,KS,sm,xi,PB,ho,AB,YS=(e)=>{e.cache=GS,e.concurrency=kB,e.counters=jB,e.simd=RB,e.format=xi,e.interpolators=PB,e.versions=ho,e.queue=AB,e.block=OB,e.unblock=CB};var XS=L(()=>{gn();Wp();Oa();Xl();Ca=Bt(Ll(),1);/*!
404
404
  Copyright 2013 Lovell Fuller and others.
405
405
  SPDX-License-Identifier: Apache-2.0
406
- */nm=vB(import.meta.url),KS=Ql.runtimePlatformArch(),im=Le.libvipsVersion(),xi=Le.format();xi.heif.output.alias=["avif","heic"];xi.jpeg.output.alias=["jpe","jpg"];xi.tiff.output.alias=["tif"];xi.jp2.output.alias=["j2c","j2k","jp2","jpx"];SB={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},ho={vips:im.semver};if(!im.isGlobal)if(!im.isWasm)try{ho=nm(`@img/sharp-${KS}/versions`)}catch(e){try{ho=nm(`@img/sharp-libvips-${KS}/versions`)}catch(t){}}else try{ho=nm("@img/sharp-wasm32/versions")}catch(e){}ho.sharp=Un.version;if(ho.heif&&xi.heif)xi.heif.input.fileSuffix=[".avif"],xi.heif.output.alias=["avif"];GS(!0);if(!process.env.MALLOC_ARENA_MAX&&Ca.default.familySync()===Ca.default.GLIBC&&!Le._isUsingJemalloc())Le.concurrency(1);else if(Ca.default.familySync()===Ca.default.MUSL&&Le.concurrency()===1024)Le.concurrency(wB());_B=new $B.EventEmitter});var RB;var QS=L(()=>{pS();gS();wS();ES();kS();FS();BS();zS();XS();/*!
406
+ */im=EB(import.meta.url),KS=Ql.runtimePlatformArch(),sm=Le.libvipsVersion(),xi=Le.format();xi.heif.output.alias=["avif","heic"];xi.jpeg.output.alias=["jpe","jpg"];xi.tiff.output.alias=["tif"];xi.jp2.output.alias=["j2c","j2k","jp2","jpx"];PB={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},ho={vips:sm.semver};if(!sm.isGlobal)if(!sm.isWasm)try{ho=im(`@img/sharp-${KS}/versions`)}catch(e){try{ho=im(`@img/sharp-libvips-${KS}/versions`)}catch(t){}}else try{ho=im("@img/sharp-wasm32/versions")}catch(e){}ho.sharp=Un.version;if(ho.heif&&xi.heif)xi.heif.input.fileSuffix=[".avif"],xi.heif.output.alias=["avif"];GS(!0);if(!process.env.MALLOC_ARENA_MAX&&Ca.default.familySync()===Ca.default.GLIBC&&!Le._isUsingJemalloc())Le.concurrency(1);else if(Ca.default.familySync()===Ca.default.MUSL&&Le.concurrency()===1024)Le.concurrency(_B());AB=new SB.EventEmitter});var IB;var QS=L(()=>{pS();gS();wS();ES();kS();FS();BS();zS();XS();/*!
407
407
  Copyright 2013 Lovell Fuller and others.
408
408
  SPDX-License-Identifier: Apache-2.0
409
- */hS(vn);vS(vn);SS(vn);PS(vn);JS(vn);qS(vn);WS(vn);YS(vn);RB=vn});import{createHash as ZS}from"node:crypto";import{existsSync as OB,mkdirSync as CB,readFileSync as IB}from"node:fs";import{basename as TB,extname as NB,resolve as sm}from"node:path";import{createRequire as MB}from"node:module";async function eE(){if(go)return go;try{let e=await Promise.resolve().then(() => (QS(),{}));return go=RB,go}catch{}try{return go=MB(sm(process.cwd(),"package.json"))("sharp"),go}catch(e){throw Error(`Sharp is required for image optimization but failed to load: ${Pe(e)}`,{cause:e})}}async function om(e){let r=await(await eE())(e).metadata();return{format:r.format??"unknown",height:r.height??0,width:r.width??0}}function Ia(e){let t=IB(e);return ZS("md5").update(t).digest("hex").slice(0,8)}function am(e){let t=JSON.stringify({formats:e.formats,quality:e.quality,v:DB,widths:e.widths});return ZS("md5").update(t).digest("hex").slice(0,8)}function JB(e,t,r,n){return`${e}-${t}-${r}.${n}`}async function tE(e,t,r){let n=await eE(),i=await om(e),s=Ia(e),o=TB(e,NB(e)),a=sm(t,"_optimized");CB(a,{recursive:!0});let c=[],l=r.widths.length>0?Math.max(...r.widths):i.width,u=r.widths.filter((m)=>m<=i.width);if(i.width<l&&!u.includes(i.width))u.push(i.width);if(u.length===0)u.push(i.width);u.sort((m,y)=>m-y);let d=[];for(let m of u)for(let y of r.formats){let g=JB(o,m,s,y),b=`/${LB}/${g}`,x=sm(a,g);if(c.push({absolutePath:x,format:y,outputPath:b,width:m}),OB(x))continue;let _=r.quality[y]??80,k=n(e).resize(m).toFormat(y,{quality:_}).toFile(x).then(()=>{});d.push(k)}let h=4;for(let m=0;m<d.length;m+=h)await Promise.all(d.slice(m,m+h));return{contentHash:s,original:{format:i.format,height:i.height,width:i.width},variants:c}}function rE(e,t){return e.flatMap((r)=>r.format===t?[`${r.outputPath} ${r.width}w`]:[]).join(", ")}var go=null,LB="images/_optimized",DB=2;var cm=L(()=>{vr()});import{existsSync as FB,mkdirSync as qB,readFileSync as BB,rmSync as HB,writeFileSync as UB}from"node:fs";import{basename as VB,resolve as ru}from"node:path";import{execSync as WB}from"node:child_process";import{tmpdir as zB}from"node:os";function yo(e){if(Ta===void 0)try{let t=WB("npm config get cache",{cwd:zB(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();Ta=t&&t!=="undefined"?t:null}catch{Ta=null}if(Ta)return ru(Ta,"jxsuite-images",VB(e));return ru(e,".cache/images")}function nE(e){let t=ru(yo(e),"manifest.json");if(!FB(t))return{entries:{},touched:new Set,version:1};try{let r=JSON.parse(BB(t,"utf8"));return r.touched=new Set,r}catch{return{entries:{},touched:new Set,version:1}}}function iE(e,t,r={}){if(r.prune&&t.touched)KB(t,t.touched);let n=yo(e);qB(n,{recursive:!0}),UB(ru(n,"manifest.json"),JSON.stringify({entries:t.entries,version:t.version},null,2),"utf8")}function KB(e,t){let r=new Set,n=Object.entries(e.entries);for(let[i,s]of n)if(t.has(i))for(let o of s.manifest.variants??[])r.add(o.absolutePath);for(let[i,s]of n){if(t.has(i))continue;for(let o of s.manifest.variants??[])if(!r.has(o.absolutePath))HB(o.absolutePath,{force:!0});delete e.entries[i]}}function sE(e,t){e.touched?.add(t);let r=e.entries[t];if(!r)return null;return r.manifest}function oE(e,t,r,n){e.touched?.add(t),e.entries[t]={manifest:n,source:r,timestamp:Date.now()}}var Ta;var lm=L(()=>{cm()});function um(e,t){if(!t||aE(e.loading))return{};if(String(e.fetchpriority??"").toLowerCase()==="high")return{};return aE(e.decoding)?{loading:"lazy"}:{decoding:"async",loading:"lazy"}}var aE=(e)=>e!==void 0&&e!==null&&e!=="";import{existsSync as pE}from"node:fs";import{basename as GB,extname as mE,resolve as cE}from"node:path";async function XB(e,t){let r=t.get(e);if(!r){let n=Ia(e);try{let i=await om(e);r={width:i.width,height:i.height,hash:n}}catch(i){if(!lE)lE=!0,console.warn(`Could not read image dimensions (${Pe(i)}) — `+"emitting srcsets without width/height attributes.");r={width:null,height:null,hash:n}}t.set(e,r)}return r}function uE(e,t,r,n){let i=t.quality.webp??80,s=e.startsWith("/")?"":"/",o=n?`?v=${n}`:"";return t.widths.filter((a)=>a<=r).toSorted((a,c)=>a-c).map((a)=>`/cdn-cgi/image/width=${a},quality=${i},fit=scale-down,format=auto${s}${e}${o} ${a}w`).join(", ")}async function QB(e,t,r,n,i){let s=`${Ia(e)}:${am(r)}`,o=sE(i,s);if(o){if(o.variants.every((l)=>pE(l.absolutePath)))return o}if(!o)console.log(` Optimizing ${GB(e)}...`);let a=await tE(e,yo(n),r);return oE(i,s,t,a),a}function ZB(e){if(!e)return!0;if(e.includes("${"))return!0;if(YB.some((t)=>e.startsWith(t)))return!0;if(hE.has(mE(e).toLowerCase()))return!0;return!1}function eH(e,t){if(t.service!=="cloudflare")return!1;if(!t.remoteDomains?.length)return!1;if(!e.startsWith("https://"))return!1;if(e.includes("${"))return!1;try{let r=new URL(e);if(hE.has(mE(r.pathname).toLowerCase()))return!1;return t.remoteDomains.includes(r.hostname)}catch{return!1}}function tH(e,t,r){let n=r?.length?Ac(r,e):null;if(n)return n;if(e.startsWith("/"))return cE(t,"public",e.slice(1));return cE(t,e)}async function gE(e,t,r,n,i,s=[]){let o=new Map;return await yE(e,t,r,n,i??new Map,o,s),{imageRefs:o}}async function yE(e,t,r,n,i,s,o,a=null){if(e.tagName==="img"){if(await aH(e,t,r,n,i,s,o,a))return}if(T(e.innerHTML)&&e.innerHTML.includes("<img"))e.innerHTML=await dH(e.innerHTML,t,r,n,i,s,o);if(Array.isArray(e.children)){let c=xE(e,a);for(let l of e.children){if(!ir(l))continue;await yE(l,t,r,n,i,s,o,c)}}}async function bE(e,t,r,n,i,s,o,a){if(!T(e)||t)return null;let c=eH(e,r);if(!c&&ZB(e))return null;if(c)return{dims:null,sources:[],srcset:uE(e,r,1/0,null)};let l=tH(e,n,a);if(!pE(l))return null;if(r.service==="cloudflare"){let g=await XB(l,s),b=uE(e,r,g.width??1/0,g.hash);return{dims:g.width&&g.height?{height:g.height,width:g.width}:null,sources:[],srcset:b}}let u=o.get(l);if(!u)u=await QB(l,e,r,n,i),o.set(l,u);let h=[...fE.filter((g)=>r.formats.includes(g)),...r.formats.filter((g)=>!fE.includes(g))].flatMap((g)=>{let b=rE(u.variants,g);return b===""?[]:[{srcset:b,type:rH.get(g)??`image/${g}`}]}),m=u.original?.width&&u.original.height?{height:u.original.height,width:u.original.width}:null,y=r.picture!==!1&&h.length>1;return{dims:m,fallbackSrc:iH(u.variants,r.formats),sources:y?h:[],srcset:h[0]?.srcset??""}}function iH(e,t){let r=nH.find((i)=>t.includes(i));if(r===void 0)return;let n;for(let i of e)if(i.format===r&&(n===void 0||i.width>n.width))n=i;return n?.outputPath}function dE(e){if(!T(e))return null;let t=sH.exec(e.trim());if(!t)return null;let r=Number(t[1]);return t[2]==="rem"?r*16:r}function xE(e,t){let{style:r}=e;if(!J(r))return t;let n=dE(r.maxWidth)??dE(r.width);if(n===null)return t;return t===null?n:Math.min(t,n)}function oH(e){if(e===null)return;let t=Math.round(e);return`(max-width: ${t}px) 100vw, ${t}px`}async function aH(e,t,r,n,i,s,o,a=null){if(!e.attributes)e.attributes={};let c=e.attributes;if(c.src===void 0&&T(e.src))c.src=e.src,delete e.src;let l=t.optimize?await bE(c.src,c["data-no-optimize"]!==void 0,t,r,n,i,s,o):null,u=xE(e,a),d=c.sizes??oH(u)??t.sizes;if(l){if(l.srcset!==""){if(c.srcset=l.srcset,c.sizes=d,l.fallbackSrc!==void 0)c.src=l.fallbackSrc}if(l.dims&&c.width===void 0&&c.height===void 0)c.width=String(l.dims.width),c.height=String(l.dims.height)}if(Object.assign(c,um(c,t.lazyLoad)),l&&l.sources.length>0)return cH(e,l.sources,d),!0;return!1}function cH(e,t,r){let n={...e.attributes},i=n.sizes??r;delete n.srcset,delete n.sizes;let s={attributes:n,tagName:"img"};if(e.style!==void 0)s.style=e.style,delete e.style;let o=t.map((a)=>{let c={};if(i!=="")c.sizes=i;return c.srcset=a.srcset,c.type=a.type,{attributes:c,tagName:"source"}});o.push(s),e.tagName="picture",e.attributes={},e.children=o}async function dH(e,t,r,n,i,s,o){let a=[];for(let l of e.matchAll(lH)){let u=l[0],d=l[1],h=(Na(d,"src")??"").replaceAll("&amp;","&"),m=uH.test(d),y=t.optimize&&h!==""&&!m?await bE(h,fH.test(d),t,r,n,i,s,o):null,g="";if(y&&y.srcset!=="")g+=` srcset="${y.srcset}" sizes="${t.sizes}"`;if(y?.dims&&!/\bwidth=/.test(d)&&!/\bheight=/.test(d))g+=` width="${y.dims.width}" height="${y.dims.height}"`;let b=um({decoding:Na(d,"decoding"),fetchpriority:Na(d,"fetchpriority"),loading:Na(d,"loading")},t.lazyLoad);for(let[_,k]of Object.entries(b))g+=` ${_}="${k}"`;if(g==="")continue;let x=y&&y.sources.length>0?pH(d,y.sources,t.sizes,g):`<img${d}${g}>`;a.push({match:u,replacement:x})}let c=e;for(let{match:l,replacement:u}of a)c=c.replace(l,u);return c}function pH(e,t,r,n){let i=Na(e,"sizes")??r,s=n.replace(/ srcset="[^"]*"/,"").replace(/ sizes="[^"]*"/,"");return`<picture>${t.map((a)=>`<source type="${a.type}" srcset="${a.srcset}" sizes="${i}">`).join("")}<img${e}${s}></picture>`}function Na(e,t){return new RegExp(`\\b${t}="([^"]*)"`,"i").exec(e)?.[1]}var hE,YB,lE=!1,fE,rH,nH,sH,lH,uH,fH;var $E=L(()=>{cm();lm();wr();Ee();vr();hE=new Set([".svg",".gif"]),YB=["http://","https://","data:","//"];fE=["avif","webp","jpeg","png"],rH=new Map([["avif","image/avif"],["jpeg","image/jpeg"],["png","image/png"],["webp","image/webp"]]);nH=["jpeg","png"];sH=/^(\d+(?:\.\d+)?)(px|rem)$/;lH=/<img\b([^>]*)>/gi,uH=/\bsrcset="/,fH=/\bdata-no-optimize\b/});import{createHash as mH}from"node:crypto";import{existsSync as hH}from"node:fs";import{join as vE}from"node:path";function yH(e,t){let r=e.replace(/^\//,"");return e.endsWith("/")||r===""?vE(t,r,"index.html"):vE(t,r)}function dm(e){if(e===void 0)return null;if(e===!1)return!1;if(e===!0)return{};return e.enabled===!1?!1:e}function bH(e){let t=JSON.stringify({fallback:e.offlineFallback??null,precache:[...e.precache??[]].toSorted(),scope:e.scope??"/"});return mH("sha256").update(t,"utf8").digest("hex").slice(0,8)}function wE(e,t,r=""){let n=[],i=[],s=[...e.precache??[]],o=e.offlineFallback;if(o!==void 0&&!s.includes(o))s.push(o),n.push(`serviceWorker: "${o}" is the offline fallback but was not in \`precache\` — `+"added, since a page that was never cached cannot be served offline.");if(t!==void 0){for(let h of s)if(!h.startsWith("/"))i.push(`serviceWorker.precache: "${h}" must be a site-absolute URL starting with /.`);else if(!hH(yH(h,t)))i.push(`serviceWorker.precache: "${h}" is not a file this build produced — `+"`cache.addAll()` is all-or-nothing, so one bad entry stops the worker installing.")}let a=s.map((h)=>ze(r,h)),c=ze(r,gH),l=o===void 0?null:ze(r,o),u=`jx-${bH(e)}`,d=`/*
409
+ */hS(vn);vS(vn);SS(vn);PS(vn);JS(vn);qS(vn);WS(vn);YS(vn);IB=vn});import{createHash as ZS}from"node:crypto";import{existsSync as TB,mkdirSync as NB,readFileSync as MB}from"node:fs";import{basename as LB,extname as DB,resolve as om}from"node:path";import{createRequire as JB}from"node:module";async function eE(){if(go)return go;try{let e=await Promise.resolve().then(() => (QS(),{}));return go=IB,go}catch{}try{return go=JB(om(process.cwd(),"package.json"))("sharp"),go}catch(e){throw Error(`Sharp is required for image optimization but failed to load: ${Pe(e)}`,{cause:e})}}async function am(e){let r=await(await eE())(e).metadata();return{format:r.format??"unknown",height:r.height??0,width:r.width??0}}function Ia(e){let t=MB(e);return ZS("md5").update(t).digest("hex").slice(0,8)}function cm(e){let t=JSON.stringify({formats:e.formats,quality:e.quality,v:qB,widths:e.widths});return ZS("md5").update(t).digest("hex").slice(0,8)}function BB(e,t,r,n){return`${e}-${t}-${r}.${n}`}async function tE(e,t,r){let n=await eE(),i=await am(e),s=Ia(e),o=LB(e,DB(e)),a=om(t,"_optimized");NB(a,{recursive:!0});let c=[],l=r.widths.length>0?Math.max(...r.widths):i.width,u=r.widths.filter((m)=>m<=i.width);if(i.width<l&&!u.includes(i.width))u.push(i.width);if(u.length===0)u.push(i.width);u.sort((m,y)=>m-y);let d=[];for(let m of u)for(let y of r.formats){let g=BB(o,m,s,y),b=`/${FB}/${g}`,x=om(a,g);if(c.push({absolutePath:x,format:y,outputPath:b,width:m}),TB(x))continue;let _=r.quality[y]??80,P=n(e).resize(m).toFormat(y,{quality:_}).toFile(x).then(()=>{});d.push(P)}let h=4;for(let m=0;m<d.length;m+=h)await Promise.all(d.slice(m,m+h));return{contentHash:s,original:{format:i.format,height:i.height,width:i.width},variants:c}}function rE(e,t){return e.flatMap((r)=>r.format===t?[`${r.outputPath} ${r.width}w`]:[]).join(", ")}var go=null,FB="images/_optimized",qB=2;var lm=L(()=>{vr()});import{existsSync as HB,mkdirSync as UB,readFileSync as VB,rmSync as WB,writeFileSync as zB}from"node:fs";import{basename as KB,resolve as ru}from"node:path";import{execSync as GB}from"node:child_process";import{tmpdir as YB}from"node:os";function yo(e){if(Ta===void 0)try{let t=GB("npm config get cache",{cwd:YB(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();Ta=t&&t!=="undefined"?t:null}catch{Ta=null}if(Ta)return ru(Ta,"jxsuite-images",KB(e));return ru(e,".cache/images")}function nE(e){let t=ru(yo(e),"manifest.json");if(!HB(t))return{entries:{},touched:new Set,version:1};try{let r=JSON.parse(VB(t,"utf8"));return r.touched=new Set,r}catch{return{entries:{},touched:new Set,version:1}}}function iE(e,t,r={}){if(r.prune&&t.touched)XB(t,t.touched);let n=yo(e);UB(n,{recursive:!0}),zB(ru(n,"manifest.json"),JSON.stringify({entries:t.entries,version:t.version},null,2),"utf8")}function XB(e,t){let r=new Set,n=Object.entries(e.entries);for(let[i,s]of n)if(t.has(i))for(let o of s.manifest.variants??[])r.add(o.absolutePath);for(let[i,s]of n){if(t.has(i))continue;for(let o of s.manifest.variants??[])if(!r.has(o.absolutePath))WB(o.absolutePath,{force:!0});delete e.entries[i]}}function sE(e,t){e.touched?.add(t);let r=e.entries[t];if(!r)return null;return r.manifest}function oE(e,t,r,n){e.touched?.add(t),e.entries[t]={manifest:n,source:r,timestamp:Date.now()}}var Ta;var um=L(()=>{lm()});function fm(e,t){if(!t||aE(e.loading))return{};if(String(e.fetchpriority??"").toLowerCase()==="high")return{};return aE(e.decoding)?{loading:"lazy"}:{decoding:"async",loading:"lazy"}}var aE=(e)=>e!==void 0&&e!==null&&e!=="";import{existsSync as pE}from"node:fs";import{basename as QB,extname as mE,resolve as cE}from"node:path";async function eH(e,t){let r=t.get(e);if(!r){let n=Ia(e);try{let i=await am(e);r={width:i.width,height:i.height,hash:n}}catch(i){if(!lE)lE=!0,console.warn(`Could not read image dimensions (${Pe(i)}) — `+"emitting srcsets without width/height attributes.");r={width:null,height:null,hash:n}}t.set(e,r)}return r}function uE(e,t,r,n){let i=t.quality.webp??80,s=e.startsWith("/")?"":"/",o=n?`?v=${n}`:"";return t.widths.filter((a)=>a<=r).toSorted((a,c)=>a-c).map((a)=>`/cdn-cgi/image/width=${a},quality=${i},fit=scale-down,format=auto${s}${e}${o} ${a}w`).join(", ")}async function tH(e,t,r,n,i){let s=`${Ia(e)}:${cm(r)}`,o=sE(i,s);if(o){if(o.variants.every((l)=>pE(l.absolutePath)))return o}if(!o)console.log(` Optimizing ${QB(e)}...`);let a=await tE(e,yo(n),r);return oE(i,s,t,a),a}function rH(e){if(!e)return!0;if(e.includes("${"))return!0;if(ZB.some((t)=>e.startsWith(t)))return!0;if(hE.has(mE(e).toLowerCase()))return!0;return!1}function nH(e,t){if(t.service!=="cloudflare")return!1;if(!t.remoteDomains?.length)return!1;if(!e.startsWith("https://"))return!1;if(e.includes("${"))return!1;try{let r=new URL(e);if(hE.has(mE(r.pathname).toLowerCase()))return!1;return t.remoteDomains.includes(r.hostname)}catch{return!1}}function iH(e,t,r){let n=r?.length?Ac(r,e):null;if(n)return n;if(e.startsWith("/"))return cE(t,"public",e.slice(1));return cE(t,e)}async function gE(e,t,r,n,i,s=[]){let o=new Map;return await yE(e,t,r,n,i??new Map,o,s),{imageRefs:o}}async function yE(e,t,r,n,i,s,o,a=null){if(e.tagName==="img"){if(await uH(e,t,r,n,i,s,o,a))return}if(T(e.innerHTML)&&e.innerHTML.includes("<img"))e.innerHTML=await hH(e.innerHTML,t,r,n,i,s,o);if(Array.isArray(e.children)){let c=xE(e,a);for(let l of e.children){if(!ir(l))continue;await yE(l,t,r,n,i,s,o,c)}}}async function bE(e,t,r,n,i,s,o,a){if(!T(e)||t)return null;let c=nH(e,r);if(!c&&rH(e))return null;if(c)return{dims:null,sources:[],srcset:uE(e,r,1/0,null)};let l=iH(e,n,a);if(!pE(l))return null;if(r.service==="cloudflare"){let g=await eH(l,s),b=uE(e,r,g.width??1/0,g.hash);return{dims:g.width&&g.height?{height:g.height,width:g.width}:null,sources:[],srcset:b}}let u=o.get(l);if(!u)u=await tH(l,e,r,n,i),o.set(l,u);let h=[...fE.filter((g)=>r.formats.includes(g)),...r.formats.filter((g)=>!fE.includes(g))].flatMap((g)=>{let b=rE(u.variants,g);return b===""?[]:[{srcset:b,type:sH.get(g)??`image/${g}`}]}),m=u.original?.width&&u.original.height?{height:u.original.height,width:u.original.width}:null,y=r.picture!==!1&&h.length>1;return{dims:m,fallbackSrc:aH(u.variants,r.formats),sources:y?h:[],srcset:h[0]?.srcset??""}}function aH(e,t){let r=oH.find((i)=>t.includes(i));if(r===void 0)return;let n;for(let i of e)if(i.format===r&&(n===void 0||i.width>n.width))n=i;return n?.outputPath}function dE(e){if(!T(e))return null;let t=cH.exec(e.trim());if(!t)return null;let r=Number(t[1]);return t[2]==="rem"?r*16:r}function xE(e,t){let{style:r}=e;if(!J(r))return t;let n=dE(r.maxWidth)??dE(r.width);if(n===null)return t;return t===null?n:Math.min(t,n)}function lH(e){if(e===null)return;let t=Math.round(e);return`(max-width: ${t}px) 100vw, ${t}px`}async function uH(e,t,r,n,i,s,o,a=null){if(!e.attributes)e.attributes={};let c=e.attributes;if(c.src===void 0&&T(e.src))c.src=e.src,delete e.src;let l=t.optimize?await bE(c.src,c["data-no-optimize"]!==void 0,t,r,n,i,s,o):null,u=xE(e,a),d=c.sizes??lH(u)??t.sizes;if(l){if(l.srcset!==""){if(c.srcset=l.srcset,c.sizes=d,l.fallbackSrc!==void 0)c.src=l.fallbackSrc}if(l.dims&&c.width===void 0&&c.height===void 0)c.width=String(l.dims.width),c.height=String(l.dims.height)}if(Object.assign(c,fm(c,t.lazyLoad)),l&&l.sources.length>0)return fH(e,l.sources,d),!0;return!1}function fH(e,t,r){let n={...e.attributes},i=n.sizes??r;delete n.srcset,delete n.sizes;let s={attributes:n,tagName:"img"};if(e.style!==void 0)s.style=e.style,delete e.style;let o=t.map((a)=>{let c={};if(i!=="")c.sizes=i;return c.srcset=a.srcset,c.type=a.type,{attributes:c,tagName:"source"}});o.push(s),e.tagName="picture",e.attributes={},e.children=o}async function hH(e,t,r,n,i,s,o){let a=[];for(let l of e.matchAll(dH)){let u=l[0],d=l[1],h=(Na(d,"src")??"").replaceAll("&amp;","&"),m=pH.test(d),y=t.optimize&&h!==""&&!m?await bE(h,mH.test(d),t,r,n,i,s,o):null,g="";if(y&&y.srcset!=="")g+=` srcset="${y.srcset}" sizes="${t.sizes}"`;if(y?.dims&&!/\bwidth=/.test(d)&&!/\bheight=/.test(d))g+=` width="${y.dims.width}" height="${y.dims.height}"`;let b=fm({decoding:Na(d,"decoding"),fetchpriority:Na(d,"fetchpriority"),loading:Na(d,"loading")},t.lazyLoad);for(let[_,P]of Object.entries(b))g+=` ${_}="${P}"`;if(g==="")continue;let x=y&&y.sources.length>0?gH(d,y.sources,t.sizes,g):`<img${d}${g}>`;a.push({match:u,replacement:x})}let c=e;for(let{match:l,replacement:u}of a)c=c.replace(l,u);return c}function gH(e,t,r,n){let i=Na(e,"sizes")??r,s=n.replace(/ srcset="[^"]*"/,"").replace(/ sizes="[^"]*"/,"");return`<picture>${t.map((a)=>`<source type="${a.type}" srcset="${a.srcset}" sizes="${i}">`).join("")}<img${e}${s}></picture>`}function Na(e,t){return new RegExp(`\\b${t}="([^"]*)"`,"i").exec(e)?.[1]}var hE,ZB,lE=!1,fE,sH,oH,cH,dH,pH,mH;var $E=L(()=>{lm();um();wr();Ee();vr();hE=new Set([".svg",".gif"]),ZB=["http://","https://","data:","//"];fE=["avif","webp","jpeg","png"],sH=new Map([["avif","image/avif"],["jpeg","image/jpeg"],["png","image/png"],["webp","image/webp"]]);oH=["jpeg","png"];cH=/^(\d+(?:\.\d+)?)(px|rem)$/;dH=/<img\b([^>]*)>/gi,pH=/\bsrcset="/,mH=/\bdata-no-optimize\b/});import{createHash as yH}from"node:crypto";import{existsSync as bH}from"node:fs";import{join as vE}from"node:path";function $H(e,t){let r=e.replace(/^\//,"");return e.endsWith("/")||r===""?vE(t,r,"index.html"):vE(t,r)}function pm(e){if(e===void 0)return null;if(e===!1)return!1;if(e===!0)return{};return e.enabled===!1?!1:e}function vH(e){let t=JSON.stringify({fallback:e.offlineFallback??null,precache:[...e.precache??[]].toSorted(),scope:e.scope??"/"});return yH("sha256").update(t,"utf8").digest("hex").slice(0,8)}function wE(e,t,r=""){let n=[],i=[],s=[...e.precache??[]],o=e.offlineFallback;if(o!==void 0&&!s.includes(o))s.push(o),n.push(`serviceWorker: "${o}" is the offline fallback but was not in \`precache\` — `+"added, since a page that was never cached cannot be served offline.");if(t!==void 0){for(let h of s)if(!h.startsWith("/"))i.push(`serviceWorker.precache: "${h}" must be a site-absolute URL starting with /.`);else if(!bH($H(h,t)))i.push(`serviceWorker.precache: "${h}" is not a file this build produced — `+"`cache.addAll()` is all-or-nothing, so one bad entry stops the worker installing.")}let a=s.map((h)=>ze(r,h)),c=ze(r,xH),l=o===void 0?null:ze(r,o),u=`jx-${vH(e)}`,d=`/*
410
410
  * Generated by @jxsuite/compiler — configure via \`serviceWorker\` in project.json.
411
411
  * Set \`"serviceWorker": false\` to replace this with a worker that removes itself.
412
412
  */
@@ -496,7 +496,7 @@ self.addEventListener("fetch", (event) => {
496
496
  })(),
497
497
  );
498
498
  });
499
- `;return{errors:i,path:fm,source:d,warnings:n}}function SE(){return{errors:[],path:fm,source:`/*
499
+ `;return{errors:i,path:dm,source:d,warnings:n}}function SE(){return{errors:[],path:dm,source:`/*
500
500
  * Generated by @jxsuite/compiler. This site had a service worker and no longer does.
501
501
  *
502
502
  * A worker is sticky: removing the file would leave every previous visitor running the old one
@@ -519,95 +519,95 @@ self.addEventListener("activate", (event) => {
519
519
  })(),
520
520
  );
521
521
  });
522
- `,warnings:[]}}function EE(e,t=""){return`if('serviceWorker' in navigator){addEventListener('load',function(){navigator.serviceWorker.register('${ze(t,`/${fm}`)}',{scope:${JSON.stringify(ze(t,e))}}).catch(function(){})})}`}var fm="sw.js",gH="/images/_optimized/";var _E=L(()=>{wr()});import{mkdirSync as xH,writeFileSync as $H}from"node:fs";import{dirname as vH,join as wH}from"node:path";function $i(e,t,r){if(r!==void 0)e[t]=r}function PE(e){let t=e.manifest,r=[],n=[];if(t===void 0||t.enabled===!1)return{errors:r,files:[],warnings:n};let i=t.name??e.name??"Jx Site",s=Ji(e.url),o=[];for(let u of t.icons??[])o.push(T(u.src)?{...u,src:ze(s,u.src)}:u);let a={display:t.display??"standalone",icons:o,name:i,short_name:t.shortName??i,start_url:ze(s,t.startUrl??"/")};$i(a,"description",t.description),$i(a,"theme_color",t.themeColor),$i(a,"background_color",t.backgroundColor),$i(a,"scope",t.scope===void 0?void 0:ze(s,t.scope)),$i(a,"orientation",t.orientation),$i(a,"lang",t.lang),$i(a,"dir",t.dir),$i(a,"categories",t.categories);let c=new Set(o.flatMap((u)=>(u.sizes??"").split(/\s+/).map((d)=>Math.trunc(Number(d.split("x")[0]))))),l=SH.filter((u)=>!c.has(u));if(l.length>0)n.push(`manifest: no ${l.join("px and no ")}px icon declared — browsers will not offer to `+"install the site without one at each size.");return{errors:r,files:[{content:`${JSON.stringify(a,null,2)}
522
+ `,warnings:[]}}function EE(e,t=""){return`if('serviceWorker' in navigator){addEventListener('load',function(){navigator.serviceWorker.register('${ze(t,`/${dm}`)}',{scope:${JSON.stringify(ze(t,e))}}).catch(function(){})})}`}var dm="sw.js",xH="/images/_optimized/";var _E=L(()=>{wr()});import{mkdirSync as wH,writeFileSync as SH}from"node:fs";import{dirname as EH,join as _H}from"node:path";function $i(e,t,r){if(r!==void 0)e[t]=r}function PE(e){let t=e.manifest,r=[],n=[];if(t===void 0||t.enabled===!1)return{errors:r,files:[],warnings:n};let i=t.name??e.name??"Jx Site",s=Ji(e.url),o=[];for(let u of t.icons??[])o.push(T(u.src)?{...u,src:ze(s,u.src)}:u);let a={display:t.display??"standalone",icons:o,name:i,short_name:t.shortName??i,start_url:ze(s,t.startUrl??"/")};$i(a,"description",t.description),$i(a,"theme_color",t.themeColor),$i(a,"background_color",t.backgroundColor),$i(a,"scope",t.scope===void 0?void 0:ze(s,t.scope)),$i(a,"orientation",t.orientation),$i(a,"lang",t.lang),$i(a,"dir",t.dir),$i(a,"categories",t.categories);let c=new Set(o.flatMap((u)=>(u.sizes??"").split(/\s+/).map((d)=>Math.trunc(Number(d.split("x")[0]))))),l=PH.filter((u)=>!c.has(u));if(l.length>0)n.push(`manifest: no ${l.join("px and no ")}px icon declared — browsers will not offer to `+"install the site without one at each size.");return{errors:r,files:[{content:`${JSON.stringify(a,null,2)}
523
523
  `,path:"manifest.webmanifest"}],warnings:n}}function kE(e){let t=e.manifest;if(t===void 0||t.enabled===!1)return[];let r=[{attributes:{href:"/manifest.webmanifest",rel:"manifest"},tagName:"link"}];if(t.themeColor!==void 0)r.push({attributes:{content:t.themeColor,name:"theme-color"},tagName:"meta"});return r}function AE(e,t){let r=e.securityTxt,n=[],i=[];if(r===void 0||r.enabled===!1)return{errors:n,files:[],warnings:i};let s=r.contact??[];if(s.length===0)n.push("securityTxt: at least one `contact` is required (RFC 9116 §2.5.3).");if(r.expires===void 0)n.push("securityTxt: `expires` is required (RFC 9116 §2.5.5) — a security.txt with no expiry "+"never goes stale visibly, which is how they end up pointing at people who left.");else{let c=new Date(r.expires);if(Number.isNaN(c.getTime()))n.push(`securityTxt: \`expires\` is not a valid date: "${r.expires}".`);else if(c.getTime()<=t.getTime())n.push(`securityTxt: \`expires\` is in the past (${c.toISOString()}) — an expired `+"security.txt tells a reporter not to trust what it says.")}let o=[];for(let c of r.preferredLanguages??[]){let l=Mr(c);if(l===null)n.push(`securityTxt.preferredLanguages: "${c}" is not a well-formed language tag.`);else o.push(l)}if(n.length>0)return{errors:n,files:[],warnings:i};let a=["# Generated by @jxsuite/compiler — configure via securityTxt in project.json.",...s.map((c)=>`Contact: ${c}`),`Expires: ${new Date(r.expires).toISOString().replace(/\.\d{3}Z$/,"Z")}`,...(r.encryption??[]).map((c)=>`Encryption: ${c}`),...(r.acknowledgments??[]).map((c)=>`Acknowledgments: ${c}`),...o.length>0?[`Preferred-Languages: ${o.join(", ")}`]:[],...r.canonical===void 0?[]:[`Canonical: ${r.canonical}`],...(r.policy??[]).map((c)=>`Policy: ${c}`),...(r.hiring??[]).map((c)=>`Hiring: ${c}`)];return{errors:n,files:[{content:`${a.join(`
524
524
  `)}
525
- `,path:".well-known/security.txt"}],warnings:i}}function jE(e,t,r){let n=0,i=[];for(let s of e){let o=wH(t,s.path);if(r(o)){i.push(s.path);continue}xH(vH(o),{recursive:!0}),$H(o,s.content,"utf8"),n+=1}return{skipped:i,written:n}}var SH;var RE=L(()=>{wr();zi();Ee();SH=[192,512]});import{existsSync as EH,mkdirSync as mm,readFileSync as _H,readdirSync as PH,writeFileSync as kH}from"node:fs";import{createRequire as AH}from"node:module";import{dirname as Ma,join as CE,relative as jH,resolve as La}from"node:path";function RH(e){return e.endsWith("/")}function IE(e=hm){let t={},r=[],n=[];for(let i of nu)if(OH(i.specifier,e))t[i.specifier]=i.assetPath,t[`${i.specifier}/`]=i.assetDir,n.push(i.assetPath);else t[i.specifier]=i.fallback,r.push(`Could not resolve "${i.specifier}" — the import map falls back to ${i.fallback}. Interactive pages will load it from a third party, and a \`default-src 'self'\` policy will block them.`);return{assetPaths:n,imports:t,warnings:r}}async function TE(e,t,r=hm,n=!0){let i=[],s=0;for(let o of nu){if(!e.assetPaths.includes(o.assetPath))continue;let a=La(t,o.assetPath.replace(/^\//,""));mm(Ma(a),{recursive:!0});try{await Wi(`export * from ${JSON.stringify(o.specifier)};
526
- `,{outfile:a,resolveDir:r},{minify:n,target:"browser"}),s+=1}catch(c){i.push(`Bundling client runtime "${o.specifier}": ${Pe(c)}`)}}return{errors:i,written:s}}function gm(e){return Object.entries(e).filter(([t,r])=>!RH(t)&&r.startsWith("/")).map(([,t])=>t)}function NE(e){let t=[];for(let r of e.matchAll(/<script type="importmap">([\s\S]*?)<\/script>/g)){let n;try{n=JSON.parse(r[1])}catch{continue}let i=ee(n)?n.imports:void 0;if(!J(i))continue;let s=Object.entries(i).flatMap(([o,a])=>T(a)?[[o,a]]:[]);t.push(...gm(Object.fromEntries(s)))}return t}function ME(e){return`<script type="importmap">
525
+ `,path:".well-known/security.txt"}],warnings:i}}function jE(e,t,r){let n=0,i=[];for(let s of e){let o=_H(t,s.path);if(r(o)){i.push(s.path);continue}wH(EH(o),{recursive:!0}),SH(o,s.content,"utf8"),n+=1}return{skipped:i,written:n}}var PH;var RE=L(()=>{wr();zi();Ee();PH=[192,512]});import{existsSync as kH,mkdirSync as hm,readFileSync as AH,readdirSync as jH,writeFileSync as RH}from"node:fs";import{createRequire as OH}from"node:module";import{dirname as Ma,join as CE,relative as CH,resolve as La}from"node:path";function IH(e){return e.endsWith("/")}function IE(e=gm){let t={},r=[],n=[];for(let i of nu)if(TH(i.specifier,e))t[i.specifier]=i.assetPath,t[`${i.specifier}/`]=i.assetDir,n.push(i.assetPath);else t[i.specifier]=i.fallback,r.push(`Could not resolve "${i.specifier}" — the import map falls back to ${i.fallback}. Interactive pages will load it from a third party, and a \`default-src 'self'\` policy will block them.`);return{assetPaths:n,imports:t,warnings:r}}async function TE(e,t,r=gm,n=!0){let i=[],s=0;for(let o of nu){if(!e.assetPaths.includes(o.assetPath))continue;let a=La(t,o.assetPath.replace(/^\//,""));hm(Ma(a),{recursive:!0});try{await Wi(`export * from ${JSON.stringify(o.specifier)};
526
+ `,{outfile:a,resolveDir:r},{minify:n,target:"browser"}),s+=1}catch(c){i.push(`Bundling client runtime "${o.specifier}": ${Pe(c)}`)}}return{errors:i,written:s}}function ym(e){return Object.entries(e).filter(([t,r])=>!IH(t)&&r.startsWith("/")).map(([,t])=>t)}function NE(e){let t=[];for(let r of e.matchAll(/<script type="importmap">([\s\S]*?)<\/script>/g)){let n;try{n=JSON.parse(r[1])}catch{continue}let i=ee(n)?n.imports:void 0;if(!J(i))continue;let s=Object.entries(i).flatMap(([o,a])=>T(a)?[[o,a]]:[]);t.push(...ym(Object.fromEntries(s)))}return t}function ME(e){return`<script type="importmap">
527
527
  {
528
528
  "imports": {
529
529
  ${Object.entries(e).map(([r,n])=>` ${JSON.stringify(r)}: ${JSON.stringify(n)}`).join(`,
530
530
  `)}
531
531
  }
532
532
  }
533
- </script>`}function OH(e,t){try{if(Yo())AH(CE(t,"x.js")).resolve(e);else Bun.resolveSync(e,t);return!0}catch{return!1}}async function LE(e,t=hm,r=!0){let n=[],i=new Set,s=new Map,o=new Map,a=La(e,"assets"),c=0,l=async(d)=>{if(!o.has(d.specifier))o.set(d.specifier,await qy(d.specifier,t,{target:"browser"}));return o.get(d.specifier)},u=async(d)=>[..._H(d,"utf8").matchAll(/(?:from|import)\s*["']([^"']+)["']/g)].map((m)=>m[1]);for(let d=0;d<OE;d++){let h=0,m=[];try{m=PH(a,{recursive:!0}).map(String).filter((y)=>y.endsWith(".js")).map((y)=>CE(a,y))}catch{return pm(e,s,n,c)}for(let y of m){let g=[];try{g=await u(y)}catch{continue}for(let b of g){let x=nu.find((E)=>b.startsWith(`${E.specifier}/`));if(!x||i.has(b))continue;i.add(b);let _=b.slice(x.specifier.length+1),k=La(e,`${x.assetDir.replace(/^\//,"")}${_}`);mm(Ma(k),{recursive:!0});try{await Wi(`export * from ${JSON.stringify(b)};
534
- `,{outfile:k,resolveDir:t},{minify:r,resolver:CH(x,k,await l(x),s),target:"browser"}),c+=1,h+=1}catch(E){n.push(`Bundling runtime subpath "${b}": ${Pe(E)}`)}}}if(h===0)return pm(e,s,n,c)}return n.push(`Runtime subpath resolution did not settle in ${OE} passes — a package subpath `+"graph this deep is more likely a cycle in the scan than a real dependency chain."),pm(e,s,n,c)}function CH(e,t,r,n){return{filter:/.*/,resolve:({importer:i,path:s})=>{if(Af(i))return;if(nu.find((a)=>s===a.specifier||s.startsWith(`${a.specifier}/`))!==void 0)return{external:!0,path:s};if(r===void 0||!s.startsWith("."))return;if(La(Ma(i),s)!==r)return;return n.set(La(Ma(t),s),e.specifier),{external:!0,path:s}}}}function pm(e,t,r,n){let i=n;for(let[s,o]of t){if(EH(s))continue;try{mm(Ma(s),{recursive:!0}),kH(s,`export * from ${JSON.stringify(o)};
535
- `,"utf8"),i+=1}catch(a){r.push(`Writing shared core stub ${jH(e,s)}: ${Pe(a)}`)}}return{errors:r,written:i}}var nu,hm,OE=10;var DE=L(()=>{jf();mn();Ee();vr();nu=[{assetDir:"/assets/@vue/reactivity/",assetPath:"/assets/vue-reactivity.js",fallback:Ts,specifier:"@vue/reactivity"},{assetDir:"/assets/lit-html/",assetPath:"/assets/lit-html.js",fallback:Ns,specifier:"lit-html"}];hm=import.meta.dirname});import{cpSync as iu,existsSync as zn,mkdirSync as en,readFileSync as IH,readdirSync as TH,rmSync as NH,statSync as MH,writeFileSync as Cr}from"node:fs";import{createHash as LH}from"node:crypto";import{basename as DH,dirname as tn,join as vi,relative as JH,resolve as rt,sep as FH}from"node:path";async function qE(e,t={}){let{clean:r=!0,verbose:n=!1}=t,i=[],s=n?console.log.bind(console):()=>{};s("Loading project.json...");let{config:o}=ni(e);if("contentTypes"in o)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let a=rt(e,o.build.outDir),c=rt(e,"pages"),l=rt(e,"public"),u=o.build.trailingSlash??"always",d=o.build.minify!==!1,h=new Map,m=new Map,y=new Map,g=(M)=>{let H=M.toSorted(),ae=`/assets/elements-${LH("sha1").update(H.join("\x00")).digest("hex").slice(0,12)}.js`;return y.set(ae,H),ae},b=IE(),x=b.imports,_=new Set,k=Vb(),{errors:E,i18n:w}=Rf(o);for(let M of E)i.push(M),console.error(M);for(let M of b.warnings)console.warn(M);let P=new Map,R=(M,H,B)=>{let ae=P.get(M);if(ae!==void 0&&ae.entryPath!==H)throw Error(`"${B}" and "${ae.specifier}" both map to ${M} — rename one`);P.set(M,{entryPath:H,specifier:B})},j=(M,H)=>{if(!Dy(M))return M;try{let B=Pf(M,H??e,e);if(!Di(M)&&!zn(B))return console.warn(`Sidecar "${M}" not found at ${B} — emitting unbundled`),M;let ae=Di(M)?M:`./${JH(e,B)}`,we=ny(ae);return R(we,B,M),h.set(we,{entryPath:B,specifier:M}),we}catch(B){return i.push(`Sidecar "${M}": ${Pe(B)}`),M}},D=(M)=>{let H=iy(M);try{let B=Pf(`npm:${M}`,e,e);return R(H,B,M),m.set(H,B),H}catch(B){return i.push(`$head specifier "${M}": ${Pe(B)}`),M}},F=await ri(e,o),N=F.formats;if(N.entries.length>0)s(` Registered ${N.entries.length} format(s): ${N.entries.map((M)=>M.name).join(", ")}`);let q=F.serverMounts().filter((M)=>{if(!M.project)return!0;let H=o[M.project.key];return J(H)&&Object.keys(H).length>0});if(q.length>0&&!o.build.adapter){let M=q.map((H)=>H.project?`"${H.project.key}"`:`"${H.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${M} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(r&&zn(a))NH(a,{force:!0,recursive:!0});if(en(a,{recursive:!0}),!zn(c))throw Error(`pages/ directory not found in ${e}`);s("Discovering pages...");let U=await Fb(c,N);s(` Found ${U.length} page(s)`),s("Loading project sections...");let ne=await nx(e,o,F),ue=Object.keys(ne);if(ue.length>0)s(` Loaded ${ue.length} section(s): ${ue.join(", ")}`);let{errors:ie,mounts:te}=await sx(F,o,e);i.push(...ie);for(let M of ie)console.error(M);if(te.length>0)s(` Mounted ${te.length} asset dir(s): ${te.map((M)=>M.urlPrefix).join(", ")}`);let le=new Set,Ce=await HH(F,o,e),oe=(await Hb(U,e,ne,F,o,w)).map((M)=>Object.assign(M,{locale:dn(M.urlPattern,w)}));s(` ${oe.length} route(s) after expansion`);let Q=0,Z=rt(e,"components"),Ve=[],pe=new Map,Qe=new Map;if(zn(Z)){s("Compiling components...");let M=[".json",...N.documentExtensions("component")],H=TH(Z).filter((gt)=>M.some((st)=>gt.endsWith(st))),B=rt(a,"components");en(B,{recursive:!0});let ae=new Map;for(let gt of H){let st=rt(Z,gt);try{let{tagName:jt}=await Qi(st,N);if(jt)ae.set(st,jt)}catch{}}let we=Ji(o.url);for(let gt of H)try{let st=rt(Z,gt),jt={formats:N,resolveElementPath:(We,Ft)=>{let rf=Ft?rt(Ft,We):rt(We),vc=ae.get(rf);return vc?`./${vc}.js`:We.replace(/\.json$/,".js")},rewriteSrc:(We,Ft)=>ze(we,j(We,Ft))};if(o.$media)jt.$media=o.$media;let me=await Cl(st,jt);for(let We of me.files){let Ft=We.tagName?`${We.tagName}.js`:DH(We.path);if(!Ve.includes(We.tagName))Cr(rt(B,Ft),We.content,"utf8"),Ve.push(We.tagName),Q+=1}let ot=await Qi(st,N);if(ot.tagName){Qe.set(ot.tagName,ot);let We=Yi(ot,o.defaults),Ft=jb(ot.tagName,ot.style,ot,o.$media??{},We);if(Ft){if(We===null)pe.set(ot.tagName,Ft);dd(Ft,te,le),Cr(rt(B,`${ot.tagName}.css`),Ft,"utf8"),Q+=1}}}catch(st){let jt=Pe(st);i.push(`Error compiling component ${gt}: ${jt}`),console.error(`Error compiling component ${gt}: ${jt}`)}s(` Compiled ${Ve.length} component(s): ${Ve.join(", ")}`)}let z=[];if(o.build.adapter)for(let[,M]of Qe){let H=nl(M);for(let B of H){let ae=`./components/${B.src.replace(/^\.\//,"")}`;z.push({exportName:B.exportName,src:ae})}}let dt=o.images.optimize&&o.images.service==="cloudflare",Ze=o.images.optimize&&!dt?nE(e):null,er=dt?new Map:null;if(dt)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");let nt=o.url,it=Ji(nt),yr=Boolean(nt)&&o.build.sitemap!==!1,tr=[],Xn=oe.filter((M)=>!M.urlPattern.includes(":")&&!M.urlPattern.includes("*")),Ii=w===null?new Map:await Jb(Xn,N),bs=Xn.map((M)=>({translationKey:Ii.get(M.urlPattern),urlPattern:M.urlPattern})),rr=Mb(bs,w,nt,u),{conflicts:Qn,sets:Lo}=ad(bs,w);for(let M of Qn){let[H,B]=M.urlPatterns,ae=M.declared?"Give one of them a different $translationKey.":"Move one out of the locale tree, or give it its own $translationKey.",we=`${B} and ${H} are both the "${M.locale}" version of "${M.key}". A translation set names one URL per language, so ${B} is `+`dropped from it — it carries no alternates and no switcher. ${ae}`;if(M.declared)i.push(we),console.error(we);else console.warn(we)}let ln=Tb(oe,w);if(ln.length>0)console.warn(`i18n.routing is "prefix-always", but ${ln.length} route(s) sit outside the locale tree and are served as "${w?.defaultLocale}": ${ln.slice(0,10).join(", ")}${ln.length>10?`, and ${ln.length-10} more`:""}. Move them under a locale directory, or use "prefix-except-default".`);if(w!==null&&w.routing==="prefix-always"&&!o.build.adapter&&!oe.some((M)=>M.urlPattern==="/"))console.warn('i18n.routing is "prefix-always" and no page claims "/", so the site root is a 404. '+'Locale negotiation answers "/" only when build.adapter is set — a static deployment has '+`no runtime to read Accept-Language. Add a redirect from "/" to "/${w.defaultLocale.toLowerCase()}/", set build.adapter, or use "prefix-except-default".`);let $c=new Set,xs=new Set;for(let M of oe){let H=Nb(M.urlPattern,w);if(H&&!$c.has(H.segment))$c.add(H.segment),console.warn(`Routes under /${H.segment}/ are served as "${w?.defaultLocale}" — `+`i18n.locales declares "${H.meant}", not "${H.segment}". Rename the directory to "${H.meant.toLowerCase()}" or declare the shorter tag.`);try{s(` Compiling ${M.urlPattern} ...`);let B=await qH(M,o,e,ne,Ze,Qe,er,N,F,j,te,Ce,D,{alternates:rr.get(M.urlPattern)??[],i18n:w,translations:Lo.get(M.urlPattern)??[]},x,g);for(let me of B.unregisteredRelations)if(!xs.has(me))xs.add(me),console.warn(`<link rel="${me}"> — "${me}" is not an IANA link relation, and a relation nobody recognizes does nothing. Check the spelling, or use an absolute `+"URI if it is an extension relation (RFC 8288 §2.1.2).");let ae=new Set;for(let[me,ot]of Qe)if(sl(ot))ae.add(me);if(Ve.length>0)B.html=WH(B.html,Ve,pe,ae,B.files.map((me)=>me.content).join(`
536
- `),x);for(let me of NE(B.html))_.add(me);dd(B.html,te,le),Wb(B.html,k);let we=VE(M.urlPattern,a,u);en(tn(we),{recursive:!0});let gt=!M.urlPattern.includes(":")&&!M.urlPattern.includes("*"),st=!aa(M.urlPattern)&&!Rb(B.html);if(yr&&!B.excludeFromSitemap&&st&&gt){let me=rr.get(M.urlPattern)??[];tr.push({lastmod:T(M.sourceMtime)&&M.sourceMtime!==""?M.sourceMtime:YH(MH(M.sourcePath).mtime),loc:ii(qs(M.urlPattern,u),nt),...me.length>0&&{alternates:me}})}let jt=[];for(let me of N.withCapability("serialize")){if(!me.exportTarget||aa(M.urlPattern))continue;try{let ot=await me.call("serialize",B.doc,{buildScope:(We)=>Cs(We,null),componentDefs:Qe,evaluateTemplate:(We,Ft)=>{if(!he(We))return;return It(We,Ft)??We},mode:"export"});if(ot){let We=we.replace(/\.html$/,me.extensions[0]);jt.push({content:ot,path:We,type:me.mediaTypeEssence})}}catch(ot){i.push(`Error exporting ${me.name} for ${M.urlPattern}: ${Pe(ot)}`)}}for(let me of jt)if(me.type!==null)B.html=Cb(B.html,{href:Ib(a,me.path),type:me.type});Cr(we,cy(B.html,it),"utf8"),Q+=1;for(let me of jt)Cr(me.path,me.content,"utf8"),Q+=1;for(let me of B.files){let ot=rt(tn(we),me.path);en(tn(ot),{recursive:!0}),Cr(ot,me.content,"utf8"),Q+=1}if(B.serverHandler){let me=rt(tn(we),"_server.js");Cr(me,B.serverHandler,"utf8"),Q+=1}}catch(B){let ae=`Error compiling ${M.urlPattern}: ${Pe(B)}`;i.push(ae),console.error(ae)}}if(Ze&&o.images.optimize){iE(e,Ze,{prune:i.length===0});let M=rt(yo(e),"_optimized");if(zn(M)){let B=rt(a,"images/_optimized");en(B,{recursive:!0}),iu(M,B,{recursive:!0})}let H=Object.keys(Ze.entries).length;if(H>0)s(` Optimized ${H} image(s)`)}if(o.build.adapter){let{adapter:M}=o.build;s("Generating site-wide server worker...");let H=new Map;for(let st of z)if(!H.has(st.exportName))H.set(st.exportName,st);let{mounts:B,connectors:ae}=BH(q,F,o);if(B.length>0)s(` Mounting ${B.length} extension route(s): ${B.map((st)=>st.basePath).join(", ")}`);let gt=M==="cloudflare-pages"&&H.size===0&&B.length===0?null:pp([...H.values()],{adapter:M,base:it,connectors:ae,i18n:w,mounts:B});if(gt){let st=M==="cloudflare-pages"?"_worker.js":"worker.js";try{await By(gt,{adapter:M,outfile:rt(a,st),projectRoot:e}),Q+=1,s(` Generated dist/${st} (bundled, ${H.size} server function(s))`)}catch(jt){let me=`Error bundling dist/${st}: ${Pe(jt)}`;i.push(me),console.error(me)}if(M==="cloudflare-pages")Cr(rt(a,"_routes.json"),`${JSON.stringify({exclude:[],include:w&&w.locales.length>1?["/","/_jx/*"]:["/_jx/*"],version:1},null,2)}
537
- `,"utf8"),Q+=1}}if(_.size>0){s(`Bundling ${_.size} client runtime module(s)...`);let M=await TE({...b,assetPaths:[..._]},a,void 0,d);Q+=M.written;for(let H of M.errors)i.push(H),console.error(H)}if(m.size>0){s(`Copying ${m.size} package asset(s)...`);for(let[M,H]of m){let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0}),iu(H,B),Q+=1,s(` ${H} → ${M}`)}}if(h.size>0){s(`Bundling ${h.size} client sidecar module(s)...`);for(let[M,H]of h)try{let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0}),await kf({entryPath:H.entryPath,outfile:B},{external:Ly,minify:d,target:"browser"}),Q+=1,s(` ${H.specifier} → ${M}`)}catch(B){let ae=`Error bundling sidecar "${H.specifier}": ${Pe(B)}`;i.push(ae),console.error(ae)}}if(y.size>0){s(`Bundling ${y.size} npm element set(s)...`);for(let[M,H]of y){let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0});try{await Wi(`${H.map((ae)=>`import ${JSON.stringify(ae)};`).join(`
533
+ </script>`}function TH(e,t){try{if(Yo())OH(CE(t,"x.js")).resolve(e);else Bun.resolveSync(e,t);return!0}catch{return!1}}async function LE(e,t=gm,r=!0){let n=[],i=new Set,s=new Map,o=new Map,a=La(e,"assets"),c=0,l=async(d)=>{if(!o.has(d.specifier))o.set(d.specifier,await qy(d.specifier,t,{target:"browser"}));return o.get(d.specifier)},u=async(d)=>[...AH(d,"utf8").matchAll(/(?:from|import)\s*["']([^"']+)["']/g)].map((m)=>m[1]);for(let d=0;d<OE;d++){let h=0,m=[];try{m=jH(a,{recursive:!0}).map(String).filter((y)=>y.endsWith(".js")).map((y)=>CE(a,y))}catch{return mm(e,s,n,c)}for(let y of m){let g=[];try{g=await u(y)}catch{continue}for(let b of g){let x=nu.find((E)=>b.startsWith(`${E.specifier}/`));if(!x||i.has(b))continue;i.add(b);let _=b.slice(x.specifier.length+1),P=La(e,`${x.assetDir.replace(/^\//,"")}${_}`);hm(Ma(P),{recursive:!0});try{await Wi(`export * from ${JSON.stringify(b)};
534
+ `,{outfile:P,resolveDir:t},{minify:r,resolver:NH(x,P,await l(x),s),target:"browser"}),c+=1,h+=1}catch(E){n.push(`Bundling runtime subpath "${b}": ${Pe(E)}`)}}}if(h===0)return mm(e,s,n,c)}return n.push(`Runtime subpath resolution did not settle in ${OE} passes — a package subpath `+"graph this deep is more likely a cycle in the scan than a real dependency chain."),mm(e,s,n,c)}function NH(e,t,r,n){return{filter:/.*/,resolve:({importer:i,path:s})=>{if(jf(i))return;if(nu.find((a)=>s===a.specifier||s.startsWith(`${a.specifier}/`))!==void 0)return{external:!0,path:s};if(r===void 0||!s.startsWith("."))return;if(La(Ma(i),s)!==r)return;return n.set(La(Ma(t),s),e.specifier),{external:!0,path:s}}}}function mm(e,t,r,n){let i=n;for(let[s,o]of t){if(kH(s))continue;try{hm(Ma(s),{recursive:!0}),RH(s,`export * from ${JSON.stringify(o)};
535
+ `,"utf8"),i+=1}catch(a){r.push(`Writing shared core stub ${CH(e,s)}: ${Pe(a)}`)}}return{errors:r,written:i}}var nu,gm,OE=10;var DE=L(()=>{Rf();mn();Ee();vr();nu=[{assetDir:"/assets/@vue/reactivity/",assetPath:"/assets/vue-reactivity.js",fallback:Ts,specifier:"@vue/reactivity"},{assetDir:"/assets/lit-html/",assetPath:"/assets/lit-html.js",fallback:Ns,specifier:"lit-html"}];gm=import.meta.dirname});import{cpSync as iu,existsSync as zn,mkdirSync as en,readFileSync as MH,readdirSync as LH,rmSync as DH,statSync as JH,writeFileSync as Cr}from"node:fs";import{createHash as FH}from"node:crypto";import{basename as qH,dirname as tn,join as vi,relative as BH,resolve as rt,sep as HH}from"node:path";async function qE(e,t={}){let{clean:r=!0,verbose:n=!1}=t,i=[],s=n?console.log.bind(console):()=>{};s("Loading project.json...");let{config:o}=ni(e);if("contentTypes"in o)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let a=rt(e,o.build.outDir),c=rt(e,"pages"),l=rt(e,"public"),u=o.build.trailingSlash??"always",d=o.build.minify!==!1,h=new Map,m=new Map,y=new Map,g=(M)=>{let H=M.toSorted(),ae=`/assets/elements-${FH("sha1").update(H.join("\x00")).digest("hex").slice(0,12)}.js`;return y.set(ae,H),ae},b=IE(),x=b.imports,_=new Set,P=Vb(),{errors:E,i18n:w}=Of(o);for(let M of E)i.push(M),console.error(M);for(let M of b.warnings)console.warn(M);let k=new Map,R=(M,H,B)=>{let ae=k.get(M);if(ae!==void 0&&ae.entryPath!==H)throw Error(`"${B}" and "${ae.specifier}" both map to ${M} — rename one`);k.set(M,{entryPath:H,specifier:B})},j=(M,H)=>{if(!Dy(M))return M;try{let B=kf(M,H??e,e);if(!Di(M)&&!zn(B))return console.warn(`Sidecar "${M}" not found at ${B} — emitting unbundled`),M;let ae=Di(M)?M:`./${BH(e,B)}`,we=ny(ae);return R(we,B,M),h.set(we,{entryPath:B,specifier:M}),we}catch(B){return i.push(`Sidecar "${M}": ${Pe(B)}`),M}},D=(M)=>{let H=iy(M);try{let B=kf(`npm:${M}`,e,e);return R(H,B,M),m.set(H,B),H}catch(B){return i.push(`$head specifier "${M}": ${Pe(B)}`),M}},F=await ri(e,o),N=F.formats;if(N.entries.length>0)s(` Registered ${N.entries.length} format(s): ${N.entries.map((M)=>M.name).join(", ")}`);let q=F.serverMounts().filter((M)=>{if(!M.project)return!0;let H=o[M.project.key];return J(H)&&Object.keys(H).length>0});if(q.length>0&&!o.build.adapter){let M=q.map((H)=>H.project?`"${H.project.key}"`:`"${H.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${M} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(r&&zn(a))DH(a,{force:!0,recursive:!0});if(en(a,{recursive:!0}),!zn(c))throw Error(`pages/ directory not found in ${e}`);s("Discovering pages...");let U=await Fb(c,N);s(` Found ${U.length} page(s)`),s("Loading project sections...");let ne=await nx(e,o,F),ue=Object.keys(ne);if(ue.length>0)s(` Loaded ${ue.length} section(s): ${ue.join(", ")}`);let{errors:ie,mounts:te}=await sx(F,o,e);i.push(...ie);for(let M of ie)console.error(M);if(te.length>0)s(` Mounted ${te.length} asset dir(s): ${te.map((M)=>M.urlPrefix).join(", ")}`);let le=new Set,Ce=await WH(F,o,e),oe=(await Hb(U,e,ne,F,o,w)).map((M)=>Object.assign(M,{locale:dn(M.urlPattern,w)}));s(` ${oe.length} route(s) after expansion`);let Q=0,Z=rt(e,"components"),Ve=[],pe=new Map,Qe=new Map;if(zn(Z)){s("Compiling components...");let M=[".json",...N.documentExtensions("component")],H=LH(Z).filter((gt)=>M.some((st)=>gt.endsWith(st))),B=rt(a,"components");en(B,{recursive:!0});let ae=new Map;for(let gt of H){let st=rt(Z,gt);try{let{tagName:jt}=await Qi(st,N);if(jt)ae.set(st,jt)}catch{}}let we=Ji(o.url);for(let gt of H)try{let st=rt(Z,gt),jt={formats:N,resolveElementPath:(We,Ft)=>{let nf=Ft?rt(Ft,We):rt(We),vc=ae.get(nf);return vc?`./${vc}.js`:We.replace(/\.json$/,".js")},rewriteSrc:(We,Ft)=>ze(we,j(We,Ft))};if(o.$media)jt.$media=o.$media;let me=await Cl(st,jt);for(let We of me.files){let Ft=We.tagName?`${We.tagName}.js`:qH(We.path);if(!Ve.includes(We.tagName))Cr(rt(B,Ft),We.content,"utf8"),Ve.push(We.tagName),Q+=1}let ot=await Qi(st,N);if(ot.tagName){Qe.set(ot.tagName,ot);let We=Yi(ot,o.defaults),Ft=jb(ot.tagName,ot.style,ot,o.$media??{},We);if(Ft){if(We===null)pe.set(ot.tagName,Ft);pd(Ft,te,le),Cr(rt(B,`${ot.tagName}.css`),Ft,"utf8"),Q+=1}}}catch(st){let jt=Pe(st);i.push(`Error compiling component ${gt}: ${jt}`),console.error(`Error compiling component ${gt}: ${jt}`)}s(` Compiled ${Ve.length} component(s): ${Ve.join(", ")}`)}let z=[];if(o.build.adapter)for(let[,M]of Qe){let H=nl(M);for(let B of H){let ae=`./components/${B.src.replace(/^\.\//,"")}`;z.push({exportName:B.exportName,src:ae})}}let dt=o.images.optimize&&o.images.service==="cloudflare",Ze=o.images.optimize&&!dt?nE(e):null,er=dt?new Map:null;if(dt)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");let nt=o.url,it=Ji(nt),yr=Boolean(nt)&&o.build.sitemap!==!1,tr=[],Xn=oe.filter((M)=>!M.urlPattern.includes(":")&&!M.urlPattern.includes("*")),Ii=w===null?new Map:await Jb(Xn,N),bs=Xn.map((M)=>({translationKey:Ii.get(M.urlPattern),urlPattern:M.urlPattern})),rr=Mb(bs,w,nt,u),{conflicts:Qn,sets:Lo}=cd(bs,w);for(let M of Qn){let[H,B]=M.urlPatterns,ae=M.declared?"Give one of them a different $translationKey.":"Move one out of the locale tree, or give it its own $translationKey.",we=`${B} and ${H} are both the "${M.locale}" version of "${M.key}". A translation set names one URL per language, so ${B} is `+`dropped from it — it carries no alternates and no switcher. ${ae}`;if(M.declared)i.push(we),console.error(we);else console.warn(we)}let ln=Tb(oe,w);if(ln.length>0)console.warn(`i18n.routing is "prefix-always", but ${ln.length} route(s) sit outside the locale tree and are served as "${w?.defaultLocale}": ${ln.slice(0,10).join(", ")}${ln.length>10?`, and ${ln.length-10} more`:""}. Move them under a locale directory, or use "prefix-except-default".`);if(w!==null&&w.routing==="prefix-always"&&!o.build.adapter&&!oe.some((M)=>M.urlPattern==="/"))console.warn('i18n.routing is "prefix-always" and no page claims "/", so the site root is a 404. '+'Locale negotiation answers "/" only when build.adapter is set — a static deployment has '+`no runtime to read Accept-Language. Add a redirect from "/" to "/${w.defaultLocale.toLowerCase()}/", set build.adapter, or use "prefix-except-default".`);let $c=new Set,xs=new Set;for(let M of oe){let H=Nb(M.urlPattern,w);if(H&&!$c.has(H.segment))$c.add(H.segment),console.warn(`Routes under /${H.segment}/ are served as "${w?.defaultLocale}" — `+`i18n.locales declares "${H.meant}", not "${H.segment}". Rename the directory to "${H.meant.toLowerCase()}" or declare the shorter tag.`);try{s(` Compiling ${M.urlPattern} ...`);let B=await UH(M,o,e,ne,Ze,Qe,er,N,F,j,te,Ce,D,{alternates:rr.get(M.urlPattern)??[],i18n:w,translations:Lo.get(M.urlPattern)??[]},x,g);for(let me of B.unregisteredRelations)if(!xs.has(me))xs.add(me),console.warn(`<link rel="${me}"> — "${me}" is not an IANA link relation, and a relation nobody recognizes does nothing. Check the spelling, or use an absolute `+"URI if it is an extension relation (RFC 8288 §2.1.2).");let ae=new Set;for(let[me,ot]of Qe)if(sl(ot))ae.add(me);if(Ve.length>0)B.html=GH(B.html,Ve,pe,ae,B.files.map((me)=>me.content).join(`
536
+ `),x);for(let me of NE(B.html))_.add(me);pd(B.html,te,le),Wb(B.html,P);let we=VE(M.urlPattern,a,u);en(tn(we),{recursive:!0});let gt=!M.urlPattern.includes(":")&&!M.urlPattern.includes("*"),st=!aa(M.urlPattern)&&!Rb(B.html);if(yr&&!B.excludeFromSitemap&&st&&gt){let me=rr.get(M.urlPattern)??[];tr.push({lastmod:T(M.sourceMtime)&&M.sourceMtime!==""?M.sourceMtime:ZH(JH(M.sourcePath).mtime),loc:ii(qs(M.urlPattern,u),nt),...me.length>0&&{alternates:me}})}let jt=[];for(let me of N.withCapability("serialize")){if(!me.exportTarget||aa(M.urlPattern))continue;try{let ot=await me.call("serialize",B.doc,{buildScope:(We)=>Cs(We,null),componentDefs:Qe,evaluateTemplate:(We,Ft)=>{if(!he(We))return;return It(We,Ft)??We},mode:"export"});if(ot){let We=we.replace(/\.html$/,me.extensions[0]);jt.push({content:ot,path:We,type:me.mediaTypeEssence})}}catch(ot){i.push(`Error exporting ${me.name} for ${M.urlPattern}: ${Pe(ot)}`)}}for(let me of jt)if(me.type!==null)B.html=Cb(B.html,{href:Ib(a,me.path),type:me.type});Cr(we,cy(B.html,it),"utf8"),Q+=1;for(let me of jt)Cr(me.path,me.content,"utf8"),Q+=1;for(let me of B.files){let ot=rt(tn(we),me.path);en(tn(ot),{recursive:!0}),Cr(ot,me.content,"utf8"),Q+=1}if(B.serverHandler){let me=rt(tn(we),"_server.js");Cr(me,B.serverHandler,"utf8"),Q+=1}}catch(B){let ae=`Error compiling ${M.urlPattern}: ${Pe(B)}`;i.push(ae),console.error(ae)}}if(Ze&&o.images.optimize){iE(e,Ze,{prune:i.length===0});let M=rt(yo(e),"_optimized");if(zn(M)){let B=rt(a,"images/_optimized");en(B,{recursive:!0}),iu(M,B,{recursive:!0})}let H=Object.keys(Ze.entries).length;if(H>0)s(` Optimized ${H} image(s)`)}if(o.build.adapter){let{adapter:M}=o.build;s("Generating site-wide server worker...");let H=new Map;for(let st of z)if(!H.has(st.exportName))H.set(st.exportName,st);let{mounts:B,connectors:ae}=VH(q,F,o);if(B.length>0)s(` Mounting ${B.length} extension route(s): ${B.map((st)=>st.basePath).join(", ")}`);let gt=M==="cloudflare-pages"&&H.size===0&&B.length===0?null:mp([...H.values()],{adapter:M,base:it,connectors:ae,i18n:w,mounts:B});if(gt){let st=M==="cloudflare-pages"?"_worker.js":"worker.js";try{await By(gt,{adapter:M,outfile:rt(a,st),projectRoot:e}),Q+=1,s(` Generated dist/${st} (bundled, ${H.size} server function(s))`)}catch(jt){let me=`Error bundling dist/${st}: ${Pe(jt)}`;i.push(me),console.error(me)}if(M==="cloudflare-pages")Cr(rt(a,"_routes.json"),`${JSON.stringify({exclude:[],include:w&&w.locales.length>1?["/","/_jx/*"]:["/_jx/*"],version:1},null,2)}
537
+ `,"utf8"),Q+=1}}if(_.size>0){s(`Bundling ${_.size} client runtime module(s)...`);let M=await TE({...b,assetPaths:[..._]},a,void 0,d);Q+=M.written;for(let H of M.errors)i.push(H),console.error(H)}if(m.size>0){s(`Copying ${m.size} package asset(s)...`);for(let[M,H]of m){let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0}),iu(H,B),Q+=1,s(` ${H} → ${M}`)}}if(h.size>0){s(`Bundling ${h.size} client sidecar module(s)...`);for(let[M,H]of h)try{let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0}),await Af({entryPath:H.entryPath,outfile:B},{external:Ly,minify:d,target:"browser"}),Q+=1,s(` ${H.specifier} → ${M}`)}catch(B){let ae=`Error bundling sidecar "${H.specifier}": ${Pe(B)}`;i.push(ae),console.error(ae)}}if(y.size>0){s(`Bundling ${y.size} npm element set(s)...`);for(let[M,H]of y){let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0});try{await Wi(`${H.map((ae)=>`import ${JSON.stringify(ae)};`).join(`
538
538
  `)}
539
- `,{outfile:B,resolveDir:e},{minify:d,target:"browser"}),Q+=1,s(` ${H.length} element(s) → ${M}`)}catch(ae){let we=`Error bundling npm $elements [${H.join(", ")}]: ${Pe(ae)}`;i.push(we),console.error(we)}}}if(_.size>0){let M=await LE(a,void 0,d);if(M.written>0)s(`Bundling ${M.written} runtime subpath module(s)...`);Q+=M.written;for(let H of M.errors)i.push(H),console.error(H)}for(let M of F.emitters()){let H=M.project?.key,B=H?o[H]:void 0;if(H&&(B==null||J(B)&&Object.keys(B).length===0))continue;try{let ae=await M.call("emit",B??null,{projectConfig:o,root:e,routes:oe,sections:ne});for(let we of ae??[]){let gt=rt(a,we.path.replace(/^\//,""));if(!gt.startsWith(a+FH))throw Error(`emit path escapes outDir: ${we.path}`);en(tn(gt),{recursive:!0}),Cr(gt,we.content),Q+=1,s(` ${M.name} emitted ${we.path}`)}}catch(ae){let we=`Error in ${M.name}.emit: ${Pe(ae)}`;i.push(we),console.error(we)}}if(o.redirects&&Object.keys(o.redirects).length>0){s("Generating redirects...");let M=new Set(oe.map((B)=>B.urlPattern)),H=GH(o.redirects,a,{basePath:it,compiledUrls:M,trailingSlash:o.build.trailingSlash});Q+=H.files,i.push(...H.errors)}if(yr)s(`Generating sitemap (${tr.length} URL(s))...`),Q+=QH(tr,a);else if(!nt&&o.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(le.size>0){let{copied:M,missing:H}=ox(le,te,a);Q+=M,s(`Copying ${M} mounted asset(s)...`);for(let B of H)console.warn(`Referenced asset not found: ${B}`)}if(zn(l))s("Copying public/ assets..."),iu(l,a,{recursive:!0});if(yr)Q+=ZH(a,nt);{let M=[PE(o),AE(o,new Date)];for(let ae of M){for(let we of ae.errors)i.push(we),console.error(we);for(let we of ae.warnings)console.warn(we)}let{skipped:H,written:B}=jE(M.flatMap((ae)=>ae.files),a,zn);Q+=B;for(let ae of H)s(` ${ae} — kept the copy from public/`)}{let M=dm(o.serviceWorker);if(M!==null){let H=M===!1?SE():wE(M,a,it);for(let B of H.warnings)console.warn(B);for(let B of H.errors)i.push(B),console.error(B);if(H.path!==null)Cr(vi(a,H.path),H.source,"utf8"),Q+=1,s(M===!1?" sw.js — tombstone (unregisters and clears)":" sw.js")}}{let{errors:M,rules:H}=Xb(o.build,k);i.push(...M);let B=Zb([...H,...Qb(a)],it);if(B.length>0){s("Writing response headers..."),Q+=ex(a,B);let{adapter:ae,deploy:we}=o.build;if(ae==="node"||ae==="bun")console.warn(`The "${ae}" adapter serves no static assets, so dist/_headers is documentation `+"rather than configuration — apply these headers at the reverse proxy in front of it.");else if(ae===void 0&&we===void 0)if(zn(rt(l,"CNAME")))console.warn("GitHub Pages ignores dist/_headers and serves its own Cache-Control: max-age=600, so the generated caching and security rules will not take effect. Deploy behind a host that reads _headers (Cloudflare Pages, Cloudflare Workers assets, Netlify) to apply them.");else s(" note: _headers is read by Cloudflare Pages, Cloudflare Workers assets and Netlify; other static hosts ignore it and serve their own Cache-Control.")}Q+=tx(a)}if(o.copy){s("Copying mapped files...");for(let[M,H]of Object.entries(o.copy)){if(!T(H))throw TypeError(`project.json copy["${M}"] must be a destination path string`);let B=rt(e,M),ae=rt(a,H);en(tn(ae),{recursive:!0}),iu(B,ae)}}if(s(`
540
- Build complete: ${oe.length} routes, ${Q} files`),i.length>0)s(` ${i.length} error(s)`);return{errors:i,files:Q,routes:oe.length}}async function qH(e,t,r,n,i,s,o,a,c,l,u,d,h,m,y,g){let b=Ji(t.url),x=await Qi(e.sourcePath,a),_=await ux(x,t,r),k=dx(x.$head??_._pageHead??[],x.description),E=_.$head??[],w=x.title??_._pageTitle??null;delete _._pageHead,delete _._pageTitle,$x(_,t,e,r,m.i18n,m.translations);let P=Lb({defaults:t.defaults,pageDir:T(x.$dir)?x.$dir:void 0,pageLang:T(x.$lang)?x.$lang:void 0,routeLocale:dn(e.urlPattern,m.i18n)});await F0(_,e,r,{config:t,registerBundle:(pe)=>{l(pe,null)},registry:c,sections:n});let R=Cs(_.state??{}),j=w??t.name;if(he(j))j=It(j,R)??j;let D=ym(JE(k,R),h),F=ym(JE(E,R),h);Da(_,R);let N={counter:{n:0},media:{...t.$media,..._.$media},rules:[]},q={n:0};if(wm(_,s,N,t.defaults,q),_.state){let pe=new Set;for(let[z,dt]of Object.entries(_.state)){if(z==="$site"||z==="$page")continue;if(ee(dt)&&dt.timing==="compiler")delete _.state[z];else if(Array.isArray(dt))pe.add(z)}let Qe=!0;while(Qe){Qe=!1;let z={..._.state};for(let Ze of pe)delete z[Ze];let dt=JSON.stringify({children:_.children,state:z});for(let Ze of pe)if(VH(dt,Ze))pe.delete(Ze),Qe=!0}for(let z of pe)delete _.state[z]}let U=dm(t.serviceWorker),ne=U===null||U===!1?[]:[{tagName:"script",textContent:EE(U.scope??"/",b)}],ue=[...kE(t),...ne,...d,...ym(t.$head??[],h)],ie=px(ue,F,D,{title:j,charset:t.defaults.charset??"utf8",siteName:t.name,siteUrl:t.url,...m.alternates.length>0&&{alternates:m.alternates},...!aa(e.urlPattern)&&{pageUrl:qs(e.urlPattern,t.build.trailingSlash)}});if(t.$media)_.$media={...t.$media,..._.$media};if(Object.values(_.$media??{}).some((pe)=>Wr(String(pe))!==null))ie.splice(2,0,{tagName:"script",textContent:Ls()});let te=t.images;await gE(_,te,r,i,o??void 0,u);let le={lang:P.lang,prePaintScheme:!1,projectStyle:t.style??null,rewriteSrc:(pe)=>ze(b,l(pe,tn(e.sourcePath))),title:j},Ce=y["@vue/reactivity"];if(Ce!==void 0)le.reactivitySrc=Ce;let W=y["lit-html"];if(W!==void 0)le.litHtmlSrc=W;let oe=await wp(_,le);if(N.rules.length>0)oe.html=oe.html.replace("</head>",`<style>
539
+ `,{outfile:B,resolveDir:e},{minify:d,target:"browser"}),Q+=1,s(` ${H.length} element(s) → ${M}`)}catch(ae){let we=`Error bundling npm $elements [${H.join(", ")}]: ${Pe(ae)}`;i.push(we),console.error(we)}}}if(_.size>0){let M=await LE(a,void 0,d);if(M.written>0)s(`Bundling ${M.written} runtime subpath module(s)...`);Q+=M.written;for(let H of M.errors)i.push(H),console.error(H)}for(let M of F.emitters()){let H=M.project?.key,B=H?o[H]:void 0;if(H&&(B==null||J(B)&&Object.keys(B).length===0))continue;try{let ae=await M.call("emit",B??null,{projectConfig:o,root:e,routes:oe,sections:ne});for(let we of ae??[]){let gt=rt(a,we.path.replace(/^\//,""));if(!gt.startsWith(a+HH))throw Error(`emit path escapes outDir: ${we.path}`);en(tn(gt),{recursive:!0}),Cr(gt,we.content),Q+=1,s(` ${M.name} emitted ${we.path}`)}}catch(ae){let we=`Error in ${M.name}.emit: ${Pe(ae)}`;i.push(we),console.error(we)}}if(o.redirects&&Object.keys(o.redirects).length>0){s("Generating redirects...");let M=new Set(oe.map((B)=>B.urlPattern)),H=QH(o.redirects,a,{basePath:it,compiledUrls:M,trailingSlash:o.build.trailingSlash});Q+=H.files,i.push(...H.errors)}if(yr)s(`Generating sitemap (${tr.length} URL(s))...`),Q+=tU(tr,a);else if(!nt&&o.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(le.size>0){let{copied:M,missing:H}=ox(le,te,a);Q+=M,s(`Copying ${M} mounted asset(s)...`);for(let B of H)console.warn(`Referenced asset not found: ${B}`)}if(zn(l))s("Copying public/ assets..."),iu(l,a,{recursive:!0});if(yr)Q+=rU(a,nt);{let M=[PE(o),AE(o,new Date)];for(let ae of M){for(let we of ae.errors)i.push(we),console.error(we);for(let we of ae.warnings)console.warn(we)}let{skipped:H,written:B}=jE(M.flatMap((ae)=>ae.files),a,zn);Q+=B;for(let ae of H)s(` ${ae} — kept the copy from public/`)}{let M=pm(o.serviceWorker);if(M!==null){let H=M===!1?SE():wE(M,a,it);for(let B of H.warnings)console.warn(B);for(let B of H.errors)i.push(B),console.error(B);if(H.path!==null)Cr(vi(a,H.path),H.source,"utf8"),Q+=1,s(M===!1?" sw.js — tombstone (unregisters and clears)":" sw.js")}}{let{errors:M,rules:H}=Xb(o.build,P);i.push(...M);let B=Zb([...H,...Qb(a)],it);if(B.length>0){s("Writing response headers..."),Q+=ex(a,B);let{adapter:ae,deploy:we}=o.build;if(ae==="node"||ae==="bun")console.warn(`The "${ae}" adapter serves no static assets, so dist/_headers is documentation `+"rather than configuration — apply these headers at the reverse proxy in front of it.");else if(ae===void 0&&we===void 0)if(zn(rt(l,"CNAME")))console.warn("GitHub Pages ignores dist/_headers and serves its own Cache-Control: max-age=600, so the generated caching and security rules will not take effect. Deploy behind a host that reads _headers (Cloudflare Pages, Cloudflare Workers assets, Netlify) to apply them.");else s(" note: _headers is read by Cloudflare Pages, Cloudflare Workers assets and Netlify; other static hosts ignore it and serve their own Cache-Control.")}Q+=tx(a)}if(o.copy){s("Copying mapped files...");for(let[M,H]of Object.entries(o.copy)){if(!T(H))throw TypeError(`project.json copy["${M}"] must be a destination path string`);let B=rt(e,M),ae=rt(a,H);en(tn(ae),{recursive:!0}),iu(B,ae)}}if(s(`
540
+ Build complete: ${oe.length} routes, ${Q} files`),i.length>0)s(` ${i.length} error(s)`);return{errors:i,files:Q,routes:oe.length}}async function UH(e,t,r,n,i,s,o,a,c,l,u,d,h,m,y,g){let b=Ji(t.url),x=await Qi(e.sourcePath,a),_=await ux(x,t,r),P=dx(x.$head??_._pageHead??[],x.description),E=_.$head??[],w=x.title??_._pageTitle??null;delete _._pageHead,delete _._pageTitle,$x(_,t,e,r,m.i18n,m.translations);let k=Lb({defaults:t.defaults,pageDir:T(x.$dir)?x.$dir:void 0,pageLang:T(x.$lang)?x.$lang:void 0,routeLocale:dn(e.urlPattern,m.i18n)});await F0(_,e,r,{config:t,registerBundle:(pe)=>{l(pe,null)},registry:c,sections:n});let R=Cs(_.state??{}),j=w??t.name;if(he(j))j=It(j,R)??j;let D=bm(JE(P,R),h),F=bm(JE(E,R),h);Da(_,R);let N={counter:{n:0},media:{...t.$media,..._.$media},rules:[]},q={n:0};if(Sm(_,s,N,t.defaults,q),_.state){let pe=new Set;for(let[z,dt]of Object.entries(_.state)){if(z==="$site"||z==="$page")continue;if(ee(dt)&&dt.timing==="compiler")delete _.state[z];else if(Array.isArray(dt))pe.add(z)}let Qe=!0;while(Qe){Qe=!1;let z={..._.state};for(let Ze of pe)delete z[Ze];let dt=JSON.stringify({children:_.children,state:z});for(let Ze of pe)if(KH(dt,Ze))pe.delete(Ze),Qe=!0}for(let z of pe)delete _.state[z]}let U=pm(t.serviceWorker),ne=U===null||U===!1?[]:[{tagName:"script",textContent:EE(U.scope??"/",b)}],ue=[...kE(t),...ne,...d,...bm(t.$head??[],h)],ie=px(ue,F,D,{title:j,charset:t.defaults.charset??"utf8",siteName:t.name,siteUrl:t.url,...m.alternates.length>0&&{alternates:m.alternates},...!aa(e.urlPattern)&&{pageUrl:qs(e.urlPattern,t.build.trailingSlash)}});if(t.$media)_.$media={...t.$media,..._.$media};if(Object.values(_.$media??{}).some((pe)=>Wr(String(pe))!==null))ie.splice(2,0,{tagName:"script",textContent:Ls()});let te=t.images;await gE(_,te,r,i,o??void 0,u);let le={lang:k.lang,prePaintScheme:!1,projectStyle:t.style??null,rewriteSrc:(pe)=>ze(b,l(pe,tn(e.sourcePath))),title:j},Ce=y["@vue/reactivity"];if(Ce!==void 0)le.reactivitySrc=Ce;let W=y["lit-html"];if(W!==void 0)le.litHtmlSrc=W;let oe=await Sp(_,le);if(N.rules.length>0)oe.html=oe.html.replace("</head>",`<style>
541
541
  ${tl(N.rules.join(`
542
542
  `))}
543
543
  </style>
544
- </head>`);oe.html=KH(oe.html,ie,P);let Q=(pe)=>typeof pe==="string"&&!pe.startsWith("./")&&!pe.startsWith("../"),Z=[...new Set([..._.$elements??[],...x.$elements??[]].filter((pe)=>Q(pe)))];if(Z.length>0)oe.html=zH(oe.html,g(Z));let Ve=null;if(!t.build.adapter)try{let pe=await $a(e.sourcePath);if(pe)Ve=pe}catch{}return{doc:_,excludeFromSitemap:x.$sitemap===!1,files:oe.files,html:oe.html,unregisteredRelations:gx(ie),serverHandler:Ve}}function BH(e,t,r){if(e.length===0)return{connectors:[],mounts:[]};let n=Ji(r.url),i={};for(let c of t.projectContributions()){let{key:l}=c.project;if(l in r)i[l]=r[l]}let s=e.map((c)=>{let l=c.server,{module:u}=l;if(!T(u)||u==="")throw Error(`Extension class "${c.name}": server.module (a bare import specifier) is required to generate a deployable worker`);let d=ze(n,l.basePath);return{basePath:d,className:c.classDef.title??c.name,module:u,options:{basePath:d,sections:i},order:l.order??100}}),o=new Set;for(let c of Object.values(i)){if(!ee(c))continue;for(let l of Object.values(c)){let u=ee(l)?l.provider:void 0;if(T(u))o.add(u)}}let a=[];for(let c of t.connectors()){let l=String(c.connector.provider);if(!o.has(l))continue;let{module:u}=c.connector;if(!T(u)||u==="")throw Error(`Connector class "${c.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);a.push({className:c.classDef.title??c.name,module:u,provider:l})}return{connectors:a,mounts:s}}async function HH(e,t,r){let n=[];for(let i of e.headProviders()){let s=i.project?.key,o=s===void 0?null:t[s];if(s!==void 0&&(o===void 0||o===null))continue;try{let a=await i.call("head",o??null,{projectConfig:t,root:r});n.push(...a??[])}catch(a){console.warn(`${i.name} head capability failed: ${Pe(a)}`)}}return n}function vm(e,t){if(Array.isArray(e))return e.map((r)=>vm(r,t));if(ee(e))return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,vm(n,t)]));if(he(e))return It(e,t)??e;return e}function JE(e,t){return e.map((r)=>{if(!J(r))return r;let n={...r};if(n.attributes){n.attributes={...n.attributes};for(let[i,s]of Object.entries(n.attributes))if(he(s))n.attributes[i]=It(s,t)??s}if(he(n.textContent))n.textContent=It(n.textContent,t)??n.textContent;else if(J(n.textContent))n.textContent=vm(n.textContent,t);return n})}function ym(e,t){return e.map((r)=>{if(!J(r)||!r.attributes)return r;let n={...r,attributes:{...r.attributes}};for(let i of["href","src"]){let s=n.attributes[i];if(T(s)&&UH(s))n.attributes[i]=t(s)}return n})}function UH(e){return!e.startsWith("/")&&!e.startsWith("./")&&!e.startsWith("../")&&!e.startsWith("http")&&!e.startsWith("data:")}function BE(e){return WE(e).replaceAll("${","&#36;{")}function HE(e){return e.replaceAll("${","$​{")}function UE(e,t){if(!J(e))return e;let r={};for(let[n,i]of Object.entries(e))if(n==="children"&&Array.isArray(e.children))r.children=e.children.map((s)=>{if(T(s))return s;return UE(s,t)});else if(n==="style"&&J(e.style)){let s={...e.style};for(let[o,a]of Object.entries(s))if(he(a))s[o]=su(a,t)??a;r.style=s}else if(n==="attributes"&&J(e.attributes)){let s={...e.attributes};for(let[o,a]of Object.entries(s))if(he(a)){let c=su(a,t);s[o]=T(c)&&c.includes("${")?HE(c):c??a}r.attributes=s}else if(n==="$props"&&J(e.$props)){let s={...e.$props};for(let[o,a]of Object.entries(s))if(he(a)){let c=su(a,t);s[o]=c!==null?c??null:a}r.$props=s}else if(he(i)){let s=su(i,t);if(n==="textContent"&&T(s)&&s.includes("${"))r.innerHTML=BE(s);else r[n]=s??i}else r[n]=i;return r}function su(e,t){try{let r=t.$map,n=J(r)&&"item"in r?r.item:void 0,i=J(r)&&"index"in r?r.index:void 0,s=Rs(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function("state","$map","item","index",s)(t,r,n,i)}catch{return null}}function Da(e,t){if(!J(e))return;if(he(e.innerHTML)){let i=It(e.innerHTML,t);if(i!=null)e.innerHTML=String(i).replaceAll("${","&#36;{")}let r=e.textContent;if(he(r)){let i=It(r,t);if(T(i)&&i.includes("${"))e.innerHTML=BE(i),delete e.textContent;else e.textContent=i??r}if(J(e.style)){for(let[i,s]of Object.entries(e.style))if(he(s))e.style[i]=It(s,t)??s}if(J(e.attributes)){for(let[i,s]of Object.entries(e.attributes))if(he(s)){let o=It(s,t);e.attributes[i]=T(o)&&o.includes("${")?HE(o):o??s}}if(J(e.$props)){let i=e.$props;for(let[s,o]of Object.entries(i))if(he(o))i[s]=It(o,t)??o}let n=e.children;if(lt(n)){let i=FE(n,t);if(i&&i.length>0){e.children=i;return}}if(he(n)){let i=It(n,t);if(Array.isArray(i)){let s=i;e.children=s;for(let o of s)Da(o,t)}}else if(Array.isArray(e.children)){let i=0;while(i<e.children.length){let s=e.children[i];if(he(s)){let o=It(s,t);if(Array.isArray(o)){let a=o;e.children.splice(i,1,...a);for(let c of a)Da(c,t);i+=a.length;continue}}if(lt(s)){let o=FE(s,t);if(o&&o.length>0){e.children.splice(i,1,...o),i+=o.length;continue}}Da(s,t),i+=1}}}function VH(e,t){let r=t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`);return new RegExp(String.raw`\bstate\.${r}\b|#/state/${r}(?=["/])`).test(e)}function FE(e,t){let r=e.items,n=Je(r)?Yf(r.$ref,t):r,i=e.map;if(!Array.isArray(n)||!i)return null;return n.map((o,a)=>{let c=Object.create(t);c.$map={index:a,item:o},c["$map/item"]=o,c["$map/index"]=a;let l=UE(i,c);return Da(l,c),l})}function wm(e,t,r,n,i){if(!J(e))return;if(Array.isArray(e)){for(let a of e)wm(a,t,r,n,i);return}if(Array.isArray(e.children))for(let a of e.children)wm(a,t,r,n,i);let{tagName:s}=e;if(!T(s))return;let o=t.get(s);if(o){if(e.attributes){let{lifted:x,rest:_}=id(e.attributes);if(x)e.attributes=_,e.$props={...x,...e.$props}}let a=(x)=>{if(r&&J(x)&&!Array.isArray(x))li(x,r.rules,r.media,"",r.counter,"jxs");return Is(x,{},null)},c=Yi(o,n),l=e.$props||null,u={componentDefs:t,defaults:n,path:[{key:JSON.stringify(l??{}),tag:s}],slotIds:i},d=sl(o),{children:h}=e,m=!c&&!d&&ci(o.children)?rd(u):null,y=c?(Array.isArray(h)?h:[]).map((x)=>a(x)).join(`
545
- `):null,g=Ab(o,l,c?null:nd(h,{},a,m),u);if(m!==null)e.attributes={...e.attributes,[na]:String(m)};e.innerHTML=c?`<template shadowrootmode="${c}"><link rel="stylesheet" href="/components/${s}.css">${g}</template>${y??""}`:g,delete e.children;let b=sd(o.style,il(o,l));if(Object.keys(b).length>0)e.style={...e.style,...b};if(!d&&e.$props&&Object.keys(e.$props).length>0)e.attributes={...e.attributes,"data-jx-props":JSON.stringify(e.$props)};if(delete e.$props,d)e.$static=!0;else e.$prerendered=!0}}function WH(e,t,r=new Map,n=new Set,i="",s={}){let o=(k)=>e.includes(`<${k}`),a=(k)=>i.includes(`<${k}`),c=t.filter((k)=>o(k)||a(k));if(c.length===0)return e;let l=c.flatMap((k)=>{let E=r.get(k);return E===void 0||E===""?[]:[E]}).join(`
544
+ </head>`);oe.html=XH(oe.html,ie,k);let Q=(pe)=>typeof pe==="string"&&!pe.startsWith("./")&&!pe.startsWith("../"),Z=[...new Set([..._.$elements??[],...x.$elements??[]].filter((pe)=>Q(pe)))];if(Z.length>0)oe.html=YH(oe.html,g(Z));let Ve=null;if(!t.build.adapter)try{let pe=await $a(e.sourcePath);if(pe)Ve=pe}catch{}return{doc:_,excludeFromSitemap:x.$sitemap===!1,files:oe.files,html:oe.html,unregisteredRelations:gx(ie),serverHandler:Ve}}function VH(e,t,r){if(e.length===0)return{connectors:[],mounts:[]};let n=Ji(r.url),i={};for(let c of t.projectContributions()){let{key:l}=c.project;if(l in r)i[l]=r[l]}let s=e.map((c)=>{let l=c.server,{module:u}=l;if(!T(u)||u==="")throw Error(`Extension class "${c.name}": server.module (a bare import specifier) is required to generate a deployable worker`);let d=ze(n,l.basePath);return{basePath:d,className:c.classDef.title??c.name,module:u,options:{basePath:d,sections:i},order:l.order??100}}),o=new Set;for(let c of Object.values(i)){if(!ee(c))continue;for(let l of Object.values(c)){let u=ee(l)?l.provider:void 0;if(T(u))o.add(u)}}let a=[];for(let c of t.connectors()){let l=String(c.connector.provider);if(!o.has(l))continue;let{module:u}=c.connector;if(!T(u)||u==="")throw Error(`Connector class "${c.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);a.push({className:c.classDef.title??c.name,module:u,provider:l})}return{connectors:a,mounts:s}}async function WH(e,t,r){let n=[];for(let i of e.headProviders()){let s=i.project?.key,o=s===void 0?null:t[s];if(s!==void 0&&(o===void 0||o===null))continue;try{let a=await i.call("head",o??null,{projectConfig:t,root:r});n.push(...a??[])}catch(a){console.warn(`${i.name} head capability failed: ${Pe(a)}`)}}return n}function wm(e,t){if(Array.isArray(e))return e.map((r)=>wm(r,t));if(ee(e))return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,wm(n,t)]));if(he(e))return It(e,t)??e;return e}function JE(e,t){return e.map((r)=>{if(!J(r))return r;let n={...r};if(n.attributes){n.attributes={...n.attributes};for(let[i,s]of Object.entries(n.attributes))if(he(s))n.attributes[i]=It(s,t)??s}if(he(n.textContent))n.textContent=It(n.textContent,t)??n.textContent;else if(J(n.textContent))n.textContent=wm(n.textContent,t);return n})}function bm(e,t){return e.map((r)=>{if(!J(r)||!r.attributes)return r;let n={...r,attributes:{...r.attributes}};for(let i of["href","src"]){let s=n.attributes[i];if(T(s)&&zH(s))n.attributes[i]=t(s)}return n})}function zH(e){return!e.startsWith("/")&&!e.startsWith("./")&&!e.startsWith("../")&&!e.startsWith("http")&&!e.startsWith("data:")}function BE(e){return WE(e).replaceAll("${","&#36;{")}function HE(e){return e.replaceAll("${","$​{")}function UE(e,t){if(!J(e))return e;let r={};for(let[n,i]of Object.entries(e))if(n==="children"&&Array.isArray(e.children))r.children=e.children.map((s)=>{if(T(s))return s;return UE(s,t)});else if(n==="style"&&J(e.style)){let s={...e.style};for(let[o,a]of Object.entries(s))if(he(a))s[o]=su(a,t)??a;r.style=s}else if(n==="attributes"&&J(e.attributes)){let s={...e.attributes};for(let[o,a]of Object.entries(s))if(he(a)){let c=su(a,t);s[o]=T(c)&&c.includes("${")?HE(c):c??a}r.attributes=s}else if(n==="$props"&&J(e.$props)){let s={...e.$props};for(let[o,a]of Object.entries(s))if(he(a)){let c=su(a,t);s[o]=c!==null?c??null:a}r.$props=s}else if(he(i)){let s=su(i,t);if(n==="textContent"&&T(s)&&s.includes("${"))r.innerHTML=BE(s);else r[n]=s??i}else r[n]=i;return r}function su(e,t){try{let r=t.$map,n=J(r)&&"item"in r?r.item:void 0,i=J(r)&&"index"in r?r.index:void 0,s=Rs(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function("state","$map","item","index",s)(t,r,n,i)}catch{return null}}function Da(e,t){if(!J(e))return;if(he(e.innerHTML)){let i=It(e.innerHTML,t);if(i!=null)e.innerHTML=String(i).replaceAll("${","&#36;{")}let r=e.textContent;if(he(r)){let i=It(r,t);if(T(i)&&i.includes("${"))e.innerHTML=BE(i),delete e.textContent;else e.textContent=i??r}if(J(e.style)){for(let[i,s]of Object.entries(e.style))if(he(s))e.style[i]=It(s,t)??s}if(J(e.attributes)){for(let[i,s]of Object.entries(e.attributes))if(he(s)){let o=It(s,t);e.attributes[i]=T(o)&&o.includes("${")?HE(o):o??s}}if(J(e.$props)){let i=e.$props;for(let[s,o]of Object.entries(i))if(he(o))i[s]=It(o,t)??o}let n=e.children;if(lt(n)){let i=FE(n,t);if(i&&i.length>0){e.children=i;return}}if(he(n)){let i=It(n,t);if(Array.isArray(i)){let s=i;e.children=s;for(let o of s)Da(o,t)}}else if(Array.isArray(e.children)){let i=0;while(i<e.children.length){let s=e.children[i];if(he(s)){let o=It(s,t);if(Array.isArray(o)){let a=o;e.children.splice(i,1,...a);for(let c of a)Da(c,t);i+=a.length;continue}}if(lt(s)){let o=FE(s,t);if(o&&o.length>0){e.children.splice(i,1,...o),i+=o.length;continue}}Da(s,t),i+=1}}}function KH(e,t){let r=t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`);return new RegExp(String.raw`\bstate\.${r}\b|#/state/${r}(?=["/])`).test(e)}function FE(e,t){let r=e.items,n=Je(r)?Xf(r.$ref,t):r,i=e.map;if(!Array.isArray(n)||!i)return null;return n.map((o,a)=>{let c=Object.create(t);c.$map={index:a,item:o},c["$map/item"]=o,c["$map/index"]=a;let l=UE(i,c);return Da(l,c),l})}function Sm(e,t,r,n,i){if(!J(e))return;if(Array.isArray(e)){for(let a of e)Sm(a,t,r,n,i);return}if(Array.isArray(e.children))for(let a of e.children)Sm(a,t,r,n,i);let{tagName:s}=e;if(!T(s))return;let o=t.get(s);if(o){if(e.attributes){let{lifted:x,rest:_}=sd(e.attributes);if(x)e.attributes=_,e.$props={...x,...e.$props}}let a=(x)=>{if(r&&J(x)&&!Array.isArray(x))li(x,r.rules,r.media,"",r.counter,"jxs");return Is(x,{},null)},c=Yi(o,n),l=e.$props||null,u={componentDefs:t,defaults:n,path:[{key:JSON.stringify(l??{}),tag:s}],slotIds:i},d=sl(o),{children:h}=e,m=!c&&!d&&ci(o.children)?nd(u):null,y=c?(Array.isArray(h)?h:[]).map((x)=>a(x)).join(`
545
+ `):null,g=Ab(o,l,c?null:id(h,{},a,m),u);if(m!==null)e.attributes={...e.attributes,[na]:String(m)};e.innerHTML=c?`<template shadowrootmode="${c}"><link rel="stylesheet" href="/components/${s}.css">${g}</template>${y??""}`:g,delete e.children;let b=od(o.style,il(o,l));if(Object.keys(b).length>0)e.style={...e.style,...b};if(!d&&e.$props&&Object.keys(e.$props).length>0)e.attributes={...e.attributes,"data-jx-props":JSON.stringify(e.$props)};if(delete e.$props,d)e.$static=!0;else e.$prerendered=!0}}function GH(e,t,r=new Map,n=new Set,i="",s={}){let o=(P)=>e.includes(`<${P}`),a=(P)=>i.includes(`<${P}`),c=t.filter((P)=>o(P)||a(P));if(c.length===0)return e;let l=c.flatMap((P)=>{let E=r.get(P);return E===void 0||E===""?[]:[E]}).join(`
546
546
  `),u=l===""?"":`<style>
547
547
  ${tl(l)}
548
- </style>`,d=(k)=>{let E=k.filter(Boolean).join(`
548
+ </style>`,d=(P)=>{let E=P.filter(Boolean).join(`
549
549
  `);return E===""?e:e.replace("</head>",` ${E}
550
- </head>`)},h=c.filter((k)=>a(k)||!n.has(k));if(h.length===0)return d([u]);let m=ME(s),g=[...gm(s),...h.map((k)=>`/components/${k}.js`)].map((k)=>`<link rel="modulepreload" href="${k}">`).join(`
551
- `),b=e.includes('<script type="importmap">'),x=d([b?"":m,g,u]),_=h.map((k)=>`<script type="module" src="/components/${k}.js"></script>`).join(`
550
+ </head>`)},h=c.filter((P)=>a(P)||!n.has(P));if(h.length===0)return d([u]);let m=ME(s),g=[...ym(s),...h.map((P)=>`/components/${P}.js`)].map((P)=>`<link rel="modulepreload" href="${P}">`).join(`
551
+ `),b=e.includes('<script type="importmap">'),x=d([b?"":m,g,u]),_=h.map((P)=>`<script type="module" src="/components/${P}.js"></script>`).join(`
552
552
  `);return x.replace("</body>",` ${_}
553
- </body>`)}function zH(e,t){return e.replace("</body>",` <script type="module" src="${t}"></script>
554
- </body>`)}function KH(e,t,r){let n=mx(t),i=/<head>([\s\S]*?)<\/head>/i,s=e.match(i),o="";if(s){let c=s[1].match(/<style>[\s\S]*?<\/style>/gi);if(c)o+=`
553
+ </body>`)}function YH(e,t){return e.replace("</body>",` <script type="module" src="${t}"></script>
554
+ </body>`)}function XH(e,t,r){let n=mx(t),i=/<head>([\s\S]*?)<\/head>/i,s=e.match(i),o="";if(s){let c=s[1].match(/<style>[\s\S]*?<\/style>/gi);if(c)o+=`
555
555
  ${c.join(`
556
556
  `)}`;let l=s[1].match(/<script[\s\S]*?<\/script>/gi);if(l)o+=`
557
557
  ${l.join(`
558
558
  `)}`}let a=e;if(i.test(a))a=a.replace(i,`<head>
559
559
  ${n}${o}
560
- </head>`);return a=a.replace(/<html\s[^>]*>/i,(c)=>{let l=/lang=/.test(c)?c.replace(/lang="[^"]*"/,`lang="${r.lang}"`):c.replace("<html",`<html lang="${r.lang}"`);if(r.dir!==void 0)l=/\sdir=/.test(l)?l.replace(/\sdir="[^"]*"/,` dir="${r.dir}"`):l.replace("<html",`<html dir="${r.dir}"`);return l}),a}function VE(e,t,r){if(e==="/")return vi(t,"index.html");if(aa(e))return vi(t,"404.html");let n=e.replace(/^\//,"");if(r==="always")return vi(t,n,"index.html");return vi(t,`${n}.html`)}function GH(e,t,r={}){let n=0,i=[],s=[],o=(l)=>l.length>1&&l.endsWith("/")?l.slice(0,-1):l,a=new Set([...r.compiledUrls??[]].map((l)=>o(l))),c=r.trailingSlash??"always";for(let[l,u]of Object.entries(e)){let d=T(u)?u:u.destination,h=!T(u)&&"rewrite"in u&&u.rewrite,m=h?200:!T(u)&&("status"in u)?u.status??301:301;if(!h&&!bm.has(String(m))){i.push(`Redirect "${l}" has status ${m}, which is not an RFC 9110 §15.4 redirection `+`status. Use one of ${[...bm.keys()].join(", ")}, or { destination, rewrite: true } for a proxy.`);continue}let y=r.basePath??"";if(s.push(`${ze(y,l)} ${ze(y,d)} ${m}`),l.includes(":")||l.includes("*"))continue;if(a.has(o(l)))console.warn(`The ${h?"rewrite":"redirect"} "${l}" collides with a compiled page at the same route — `+"remove one or the other.");if(h)continue;let g=bm.get(String(m));if(!g.html)continue;let b=VE(l,t,c),x=g.canonical?`
561
- <link rel="canonical" href="${xm(d)}">`:`
560
+ </head>`);return a=a.replace(/<html\s[^>]*>/i,(c)=>{let l=/lang=/.test(c)?c.replace(/lang="[^"]*"/,`lang="${r.lang}"`):c.replace("<html",`<html lang="${r.lang}"`);if(r.dir!==void 0)l=/\sdir=/.test(l)?l.replace(/\sdir="[^"]*"/,` dir="${r.dir}"`):l.replace("<html",`<html dir="${r.dir}"`);return l}),a}function VE(e,t,r){if(e==="/")return vi(t,"index.html");if(aa(e))return vi(t,"404.html");let n=e.replace(/^\//,"");if(r==="always")return vi(t,n,"index.html");return vi(t,`${n}.html`)}function QH(e,t,r={}){let n=0,i=[],s=[],o=(l)=>l.length>1&&l.endsWith("/")?l.slice(0,-1):l,a=new Set([...r.compiledUrls??[]].map((l)=>o(l))),c=r.trailingSlash??"always";for(let[l,u]of Object.entries(e)){let d=T(u)?u:u.destination,h=!T(u)&&"rewrite"in u&&u.rewrite,m=h?200:!T(u)&&("status"in u)?u.status??301:301;if(!h&&!xm.has(String(m))){i.push(`Redirect "${l}" has status ${m}, which is not an RFC 9110 §15.4 redirection `+`status. Use one of ${[...xm.keys()].join(", ")}, or { destination, rewrite: true } for a proxy.`);continue}let y=r.basePath??"";if(s.push(`${ze(y,l)} ${ze(y,d)} ${m}`),l.includes(":")||l.includes("*"))continue;if(a.has(o(l)))console.warn(`The ${h?"rewrite":"redirect"} "${l}" collides with a compiled page at the same route — `+"remove one or the other.");if(h)continue;let g=xm.get(String(m));if(!g.html)continue;let b=VE(l,t,c),x=g.canonical?`
561
+ <link rel="canonical" href="${$m(d)}">`:`
562
562
  <meta name="robots" content="noindex">`,_=`<!DOCTYPE html>
563
563
  <html>
564
564
  <head>
565
565
  <meta charset="utf-8">
566
- <meta http-equiv="refresh" content="0;url=${xm(d)}">${x}
566
+ <meta http-equiv="refresh" content="0;url=${$m(d)}">${x}
567
567
  <title>Redirecting...</title>
568
568
  </head>
569
569
  <body>
570
- <p>Redirecting to <a href="${xm(d)}">${WE(d)}</a>...</p>
570
+ <p>Redirecting to <a href="${$m(d)}">${WE(d)}</a>...</p>
571
571
  </body>
572
572
  </html>`;en(tn(b),{recursive:!0}),Cr(b,_,"utf8"),n+=1}if(s.length>0)Cr(vi(t,"_redirects"),`${s.join(`
573
573
  `)}
574
- `,"utf8"),n+=1;return{errors:i,files:n}}function WE(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function xm(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function $m(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function YH(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}function QH(e,t){if(e.length===0)return 0;let r=e.map((s)=>{let o=(s.alternates??[]).map((a)=>` <xhtml:link rel="alternate" hreflang="${$m(a.hreflang)}" href="${$m(a.href)}"/>`).join(`
574
+ `,"utf8"),n+=1;return{errors:i,files:n}}function WE(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function $m(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function vm(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function ZH(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}function tU(e,t){if(e.length===0)return 0;let r=e.map((s)=>{let o=(s.alternates??[]).map((a)=>` <xhtml:link rel="alternate" hreflang="${vm(a.hreflang)}" href="${vm(a.href)}"/>`).join(`
575
575
  `);return` <url>
576
- <loc>${$m(s.loc)}</loc>
576
+ <loc>${vm(s.loc)}</loc>
577
577
  <lastmod>${s.lastmod}</lastmod>
578
578
  ${o===""?"":`${o}
579
579
  `} </url>`}).join(`
580
580
  `),i=`<?xml version="1.0" encoding="UTF-8"?>
581
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((s)=>(s.alternates?.length??0)>0)?` xmlns:xhtml="${XH}"`:""}>
581
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((s)=>(s.alternates?.length??0)>0)?` xmlns:xhtml="${eU}"`:""}>
582
582
  ${r}
583
583
  </urlset>
584
- `;return Cr(vi(t,"sitemap.xml"),i,"utf8"),1}function ZH(e,t){let r=vi(e,"robots.txt"),n=zn(r),i=n?IH(r,"utf8"):`User-agent: *
584
+ `;return Cr(vi(t,"sitemap.xml"),i,"utf8"),1}function rU(e,t){let r=vi(e,"robots.txt"),n=zn(r),i=n?MH(r,"utf8"):`User-agent: *
585
585
  Allow: /
586
586
  `;if(/^Sitemap:/im.test(i))return 0;if(!i.endsWith(`
587
587
  `))i+=`
588
588
  `;return i+=`
589
589
  Sitemap: ${ii("/sitemap.xml",t)}
590
- `,Cr(r,i,"utf8"),n?0:1}var bm,XH="http://www.w3.org/1999/xhtml";var zE=L(()=>{Ee();vr();wr();ly();jf();Ho();Ub();rx();On();ix();ax();fx();hx();yx();vx();J0();wa();mn();Os();q0();$E();fd();_E();od();RE();cd();DE();lm();bm=new Map([["301",{canonical:!0,html:!0,why:""}],["302",{canonical:!1,html:!0,why:""}],["303",{canonical:!1,html:!0,why:""}],["307",{canonical:!1,html:!1,why:"307 preserves the request method and body; a meta-refresh silently converts POST to GET"}],["308",{canonical:!1,html:!1,why:"308 preserves the request method and body; a meta-refresh silently converts POST to GET"}]])});import{createRequire as eU}from"node:module";import{join as tU}from"node:path";import{spawn as rU}from"node:child_process";function nU(e){try{return eU(tU(e,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${e}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function KE(e,t,r=rU,n=process){let s=[nU(e),"--root",e];if(t!==void 0)s.push("--port",String(t));let o=r("bun",s,{stdio:"inherit"});return o.on("error",(a)=>{if(a.code==="ENOENT")console.error("The Jx dev server runs on Bun, which was not found on your PATH. Install it from https://bun.sh and retry.");else console.error(`Failed to start the dev server: ${a.message}`);n.exitCode=1}),n.on("SIGINT",()=>{o.kill("SIGINT")}),n.on("SIGTERM",()=>{o.kill("SIGTERM")}),o.on("exit",(a)=>{n.exitCode=a??0}),o}var GE=()=>{};import{createServer as iU}from"node:http";import{existsSync as ou,readFileSync as YE,statSync as sU}from"node:fs";import{extname as oU,join as Sm,normalize as aU,resolve as XE,sep as cU}from"node:path";function uU(e,t){let r=aU(t).replaceAll("\\","/"),n=XE(e,`.${r.startsWith("/")?r:`/${r}`}`);if(n!==e&&!n.startsWith(e+cU))return null;if(ou(n)){if(sU(n).isDirectory()){let s=Sm(n,"index.html");return ou(s)?s:null}return n}let i=Sm(n,"index.html");return ou(i)?i:null}function QE(e,t){let r=XE(e),n=iU((i,s)=>{let o=new URL(i.url??"/","http://localhost"),a=uU(r,decodeURIComponent(o.pathname));if(a){s.writeHead(200,{"Content-Type":lU.get(oU(a).toLowerCase())??"application/octet-stream"}),s.end(YE(a));return}let c=Sm(r,"404.html");if(ou(c)){s.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),s.end(YE(c));return}s.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),s.end("Not found")});return n.listen(t),n}var lU;var ZE=L(()=>{cf();lU=new Map(Object.entries({".avif":"image/avif",".css":"text/css; charset=utf-8",".gif":"image/gif",".html":"text/html; charset=utf-8",".ico":"image/x-icon",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".txt":"text/plain; charset=utf-8",".webp":"image/webp",".woff2":"font/woff2",".xml":"application/xml; charset=utf-8",...Hg}))});var Ja="https://jxsuite.com/schema/project/fields/v2",cs="https://jxsuite.com/schema/document/paths/v2",e1,t1,Fa,Em;var au=L(()=>{e1={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"},t1={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"},Fa=[{additionalProperties:!1,description:'Explicit value list: generates one page per value, bound to `param` (default "value").',properties:{param:{description:'Route parameter to fill (default "value").',type:"string"},values:{description:"The values to expand.",type:"array"}},required:["values"],type:"object"},{additionalProperties:!1,description:"JSON data-file source: loads a project-relative file that must contain an array, and generates one page per item.",properties:{$ref:{description:"Project-relative path to a .json file containing an array.",type:"string"},field:{description:'Item field providing the parameter value (default "id").',type:"string"},param:{description:'Route parameter to fill (default "id").',type:"string"}},required:["$ref"],type:"object"},{description:"Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",items:{additionalProperties:{type:"string"},type:"object"},type:"array"}],Em={description:"A source shape contributed by an extension this schema cannot see. The project's generated document.schema.json validates these exactly; enable the owning extension and regenerate with `jx schema` to get precise checking here.",minProperties:1,type:"object"}});function fU(e){let{corePath:t,fragments:r,fieldSchemaRefs:n=[]}=e;return{$comment:s1,$defs:{Fields:{$id:Ja,anyOf:[{$ref:`${r1}#/$defs/JxFieldSchema`},{$ref:`${r1}#/$defs/RelationshipRef`},...n.map((i)=>({$ref:i}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t},...r.map((i)=>({$ref:i}))],type:"object",unevaluatedProperties:!1}}async function Ba(e,t,r,n=[]){let i=structuredClone(e),s=new Map,o=new Set;_m(i,o);let a=0,c=async(u)=>{let d=qa(u),h=s.get(d);if(h!==void 0)return h;let m;try{m=structuredClone(await t(d))}catch(x){throw Error(`bundleSchema: cannot load $ref target "${d}": ${bU(x)}`,{cause:x})}let y=T(m.$id)&&wi(m.$id)?m.$id:null;a+=y===null?1:0;let g=y??`urn:jx:bundled:${a}`;if(s.set(d,g),o.has(g))return g;o.add(g),m.$id=g,await l(m,yU(d),!0);let b=i.$defs??={};return b[g]=m,g},l=async(u,d,h=!1)=>{if(Array.isArray(u)){for(let b of u)await l(b,d);return}if(!ee(u))return;let m=u,y=d;if(!h&&T(m.$id)&&wi(m.$id))y=null;let g=m.$ref;if(T(g)&&y!==null&&!g.startsWith("#")&&!wi(g)){let b=g.indexOf("#"),x=b===-1?g:g.slice(0,b),_=b===-1?"":g.slice(b);if(x){let k=await c(`${y}/${x}`);m.$ref=`${k}${_}`}}for(let b of Object.values(m))await l(b,y)};await l(i,qa(r),!0);for(let u of n)await c(`${qa(r)}/${u}`);return i}function hU(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function*n1(e,t){for(let r of dU){let n=e[r];if(Array.isArray(n)){for(let[i,s]of n.entries())if(ee(s))yield[s,`${t}/${r}/${i}`]}else if(ee(n))yield[n,`${t}/${r}`]}for(let r of pU){let n=e[r];if(!ee(n))continue;for(let[i,s]of Object.entries(n))if(ee(s))yield[s,`${t}/${r}/${hU(i)}`]}for(let r of mU){let n=e[r];if(!Array.isArray(n))continue;for(let[i,s]of n.entries())if(ee(s))yield[s,`${t}/${r}/${i}`]}}function gU(e,t){let r=e.replace(/^[a-zA-Z][a-zA-Z\d+.-]*:/,"");if(r.startsWith("//")){let s=r.indexOf("/",2);r=s===-1?"":r.slice(s+1)}r=r.replace(/^schema\//,"");let n=r.split(/[^a-zA-Z0-9]+/).filter(Boolean).join("-")||"resource",i=n;for(let s=2;t.has(i);s+=1)i=`${n}-${s}`;return t.add(i),i}function Ha(e){let t=structuredClone(e);if(ee(t.$defs)){let s=new Set(Object.keys(t.$defs).filter((a)=>!wi(a))),o={};for(let[a,c]of Object.entries(t.$defs)){let l=ee(c)&&T(c.$id)?c.$id:a;o[wi(a)?gU(l,s):a]=c}t.$defs=o}let r=new Map,n=(s,o)=>{let{$id:a}=s;if(T(a)&&wi(a)&&!r.has(a))r.set(a,o);for(let[c,l]of n1(s,o))n(c,l)};n(t,"#");let i=(s,o)=>{let a=o,{$id:c}=s;if(T(c)&&wi(c)){if(a=r.get(c)??o,a!=="#")delete s.$id}let l=s.$ref;if(T(l)){let u=l.indexOf("#"),d=u===-1?l:l.slice(0,u),h=u===-1?"":l.slice(u+1);if(d===""){if(h.startsWith("/"))s.$ref=`${a}${h}`}else{let m=r.get(d);if(m!==void 0)s.$ref=h?`${m}${h}`:m}}for(let[u]of n1(s,a))i(u,a)};return i(t,"#"),t}function _m(e,t){if(Array.isArray(e)){for(let n of e)_m(n,t);return}if(!ee(e))return;let r=e;if(T(r.$id)&&wi(r.$id))t.add(r.$id);for(let n of Object.values(r))_m(n,t)}function wi(e){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e)}function qa(e){let t=e.replaceAll("\\","/"),r=t.startsWith("/"),n=[];for(let i of t.split("/")){if(i===""||i===".")continue;if(i===".."){if(n.length>0&&n.at(-1)!=="..")n.pop();else if(!r)n.push("..");continue}n.push(i)}return(r?"/":"")+n.join("/")}function yU(e){let t=e.lastIndexOf("/");if(t===-1)return".";return t===0?"/":e.slice(0,t)}function bU(e){return e instanceof Error?e.message:String(e)}function xU(e){let{corePath:t,pathsValueRefs:r}=e;return{$comment:s1,$defs:{PathsValue:{$id:cs,anyOf:[...Fa,...r.map((n)=>({$ref:n}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t}]}}async function o1(e){let{baseDir:t,coreDocumentRef:r,coreProjectRef:n,extensions:i,loadJson:s}=e,o=[],a=[],c=[],l=[];for(let h of i){if(h.project)o.push(h.project);if(h.document){let m=await i1(h.document,s,t);if(a.push(...m),m.length>0)c.push(h.document)}if(h.fields)l.push(...await i1(h.fields,s,t)),o.push(h.fields)}let u=fU({corePath:n,fieldSchemaRefs:l,fragments:o}),d=xU({corePath:r,pathsValueRefs:a});return{document:Ha(await Ba(d,s,t,c)),project:Ha(await Ba(u,s,t))}}async function i1(e,t,r){let n;try{n=await t(qa(`${qa(r)}/${e}`))}catch{return[]}let{$id:i}=n;if(!T(i)||!n.$defs)return[];return Object.keys(n.$defs).map((s)=>`${i}#/$defs/${s}`)}var r1="https://jxsuite.com/schema/project/core/v2",s1="Generated by `jx schema` from project.json#/extensions — do not edit.",dU,pU,mU;var a1=L(()=>{au();Ee();au();dU=["additionalItems","additionalProperties","contains","contentSchema","else","if","items","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],pU=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"],mU=["allOf","anyOf","oneOf","prefixItems"]});import{existsSync as u1,readFileSync as $U,statSync as c1,writeFileSync as cu}from"node:fs";import{createRequire as Va}from"node:module";import{dirname as vU,isAbsolute as wU,relative as km,resolve as Sn,sep as Am}from"node:path";async function f1(e){let{config:t}=ni(e),r=await ri(e,t),n=Sn(e),{document:i,project:s}=await o1({baseDir:n,coreDocumentRef:l1(e,EU),coreProjectRef:l1(e,SU),extensions:r.extensions.map((o)=>({document:o.schemas.document&&Pm(e,o,o.schemas.document),fields:o.schemas.fields&&Pm(e,o,o.schemas.fields),project:o.schemas.project&&Pm(e,o,o.schemas.project)})),loadJson:m1(n)});return{documentSchema:i,projectSchema:s}}async function d1(e){let{documentSchema:t,projectSchema:r}=await f1(e),n=Sn(e,"project.schema.json"),i=Sn(e,"document.schema.json");return cu(n,`${JSON.stringify(r,null,2)}
590
+ `,Cr(r,i,"utf8"),n?0:1}var xm,eU="http://www.w3.org/1999/xhtml";var zE=L(()=>{Ee();vr();wr();ly();Rf();Ho();Ub();rx();On();ix();ax();fx();hx();yx();vx();J0();wa();mn();Os();q0();$E();dd();_E();ad();RE();ld();DE();um();xm=new Map([["301",{canonical:!0,html:!0,why:""}],["302",{canonical:!1,html:!0,why:""}],["303",{canonical:!1,html:!0,why:""}],["307",{canonical:!1,html:!1,why:"307 preserves the request method and body; a meta-refresh silently converts POST to GET"}],["308",{canonical:!1,html:!1,why:"308 preserves the request method and body; a meta-refresh silently converts POST to GET"}]])});import{createRequire as nU}from"node:module";import{join as iU}from"node:path";import{spawn as sU}from"node:child_process";function oU(e){try{return nU(iU(e,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${e}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function KE(e,t,r=sU,n=process){let s=[oU(e),"--root",e];if(t!==void 0)s.push("--port",String(t));let o=r("bun",s,{stdio:"inherit"});return o.on("error",(a)=>{if(a.code==="ENOENT")console.error("The Jx dev server runs on Bun, which was not found on your PATH. Install it from https://bun.sh and retry.");else console.error(`Failed to start the dev server: ${a.message}`);n.exitCode=1}),n.on("SIGINT",()=>{o.kill("SIGINT")}),n.on("SIGTERM",()=>{o.kill("SIGTERM")}),o.on("exit",(a)=>{n.exitCode=a??0}),o}var GE=()=>{};import{createServer as aU}from"node:http";import{existsSync as ou,readFileSync as YE,statSync as cU}from"node:fs";import{extname as lU,join as Em,normalize as uU,resolve as XE,sep as fU}from"node:path";function pU(e,t){let r=uU(t).replaceAll("\\","/"),n=XE(e,`.${r.startsWith("/")?r:`/${r}`}`);if(n!==e&&!n.startsWith(e+fU))return null;if(ou(n)){if(cU(n).isDirectory()){let s=Em(n,"index.html");return ou(s)?s:null}return n}let i=Em(n,"index.html");return ou(i)?i:null}function QE(e,t){let r=XE(e),n=aU((i,s)=>{let o=new URL(i.url??"/","http://localhost"),a=pU(r,decodeURIComponent(o.pathname));if(a){s.writeHead(200,{"Content-Type":dU.get(lU(a).toLowerCase())??"application/octet-stream"}),s.end(YE(a));return}let c=Em(r,"404.html");if(ou(c)){s.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),s.end(YE(c));return}s.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),s.end("Not found")});return n.listen(t),n}var dU;var ZE=L(()=>{lf();dU=new Map(Object.entries({".avif":"image/avif",".css":"text/css; charset=utf-8",".gif":"image/gif",".html":"text/html; charset=utf-8",".ico":"image/x-icon",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".txt":"text/plain; charset=utf-8",".webp":"image/webp",".woff2":"font/woff2",".xml":"application/xml; charset=utf-8",...Hg}))});var Ja="https://jxsuite.com/schema/project/fields/v2",cs="https://jxsuite.com/schema/document/paths/v2",e1,t1,Fa,_m;var au=L(()=>{e1={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"},t1={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"},Fa=[{additionalProperties:!1,description:'Explicit value list: generates one page per value, bound to `param` (default "value").',properties:{param:{description:'Route parameter to fill (default "value").',type:"string"},values:{description:"The values to expand.",type:"array"}},required:["values"],type:"object"},{additionalProperties:!1,description:"JSON data-file source: loads a project-relative file that must contain an array, and generates one page per item.",properties:{$ref:{description:"Project-relative path to a .json file containing an array.",type:"string"},field:{description:'Item field providing the parameter value (default "id").',type:"string"},param:{description:'Route parameter to fill (default "id").',type:"string"}},required:["$ref"],type:"object"},{description:"Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",items:{additionalProperties:{type:"string"},type:"object"},type:"array"}],_m={description:"A source shape contributed by an extension this schema cannot see. The project's generated document.schema.json validates these exactly; enable the owning extension and regenerate with `jx schema` to get precise checking here.",minProperties:1,type:"object"}});function mU(e){let{corePath:t,fragments:r,fieldSchemaRefs:n=[]}=e;return{$comment:s1,$defs:{Fields:{$id:Ja,anyOf:[{$ref:`${r1}#/$defs/JxFieldSchema`},{$ref:`${r1}#/$defs/RelationshipRef`},...n.map((i)=>({$ref:i}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t},...r.map((i)=>({$ref:i}))],type:"object",unevaluatedProperties:!1}}async function Ba(e,t,r,n=[]){let i=structuredClone(e),s=new Map,o=new Set;Pm(i,o);let a=0,c=async(u)=>{let d=qa(u),h=s.get(d);if(h!==void 0)return h;let m;try{m=structuredClone(await t(d))}catch(x){throw Error(`bundleSchema: cannot load $ref target "${d}": ${vU(x)}`,{cause:x})}let y=T(m.$id)&&wi(m.$id)?m.$id:null;a+=y===null?1:0;let g=y??`urn:jx:bundled:${a}`;if(s.set(d,g),o.has(g))return g;o.add(g),m.$id=g,await l(m,$U(d),!0);let b=i.$defs??={};return b[g]=m,g},l=async(u,d,h=!1)=>{if(Array.isArray(u)){for(let b of u)await l(b,d);return}if(!ee(u))return;let m=u,y=d;if(!h&&T(m.$id)&&wi(m.$id))y=null;let g=m.$ref;if(T(g)&&y!==null&&!g.startsWith("#")&&!wi(g)){let b=g.indexOf("#"),x=b===-1?g:g.slice(0,b),_=b===-1?"":g.slice(b);if(x){let P=await c(`${y}/${x}`);m.$ref=`${P}${_}`}}for(let b of Object.values(m))await l(b,y)};await l(i,qa(r),!0);for(let u of n)await c(`${qa(r)}/${u}`);return i}function bU(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function*n1(e,t){for(let r of hU){let n=e[r];if(Array.isArray(n)){for(let[i,s]of n.entries())if(ee(s))yield[s,`${t}/${r}/${i}`]}else if(ee(n))yield[n,`${t}/${r}`]}for(let r of gU){let n=e[r];if(!ee(n))continue;for(let[i,s]of Object.entries(n))if(ee(s))yield[s,`${t}/${r}/${bU(i)}`]}for(let r of yU){let n=e[r];if(!Array.isArray(n))continue;for(let[i,s]of n.entries())if(ee(s))yield[s,`${t}/${r}/${i}`]}}function xU(e,t){let r=e.replace(/^[a-zA-Z][a-zA-Z\d+.-]*:/,"");if(r.startsWith("//")){let s=r.indexOf("/",2);r=s===-1?"":r.slice(s+1)}r=r.replace(/^schema\//,"");let n=r.split(/[^a-zA-Z0-9]+/).filter(Boolean).join("-")||"resource",i=n;for(let s=2;t.has(i);s+=1)i=`${n}-${s}`;return t.add(i),i}function Ha(e){let t=structuredClone(e);if(ee(t.$defs)){let s=new Set(Object.keys(t.$defs).filter((a)=>!wi(a))),o={};for(let[a,c]of Object.entries(t.$defs)){let l=ee(c)&&T(c.$id)?c.$id:a;o[wi(a)?xU(l,s):a]=c}t.$defs=o}let r=new Map,n=(s,o)=>{let{$id:a}=s;if(T(a)&&wi(a)&&!r.has(a))r.set(a,o);for(let[c,l]of n1(s,o))n(c,l)};n(t,"#");let i=(s,o)=>{let a=o,{$id:c}=s;if(T(c)&&wi(c)){if(a=r.get(c)??o,a!=="#")delete s.$id}let l=s.$ref;if(T(l)){let u=l.indexOf("#"),d=u===-1?l:l.slice(0,u),h=u===-1?"":l.slice(u+1);if(d===""){if(h.startsWith("/"))s.$ref=`${a}${h}`}else{let m=r.get(d);if(m!==void 0)s.$ref=h?`${m}${h}`:m}}for(let[u]of n1(s,a))i(u,a)};return i(t,"#"),t}function Pm(e,t){if(Array.isArray(e)){for(let n of e)Pm(n,t);return}if(!ee(e))return;let r=e;if(T(r.$id)&&wi(r.$id))t.add(r.$id);for(let n of Object.values(r))Pm(n,t)}function wi(e){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e)}function qa(e){let t=e.replaceAll("\\","/"),r=t.startsWith("/"),n=[];for(let i of t.split("/")){if(i===""||i===".")continue;if(i===".."){if(n.length>0&&n.at(-1)!=="..")n.pop();else if(!r)n.push("..");continue}n.push(i)}return(r?"/":"")+n.join("/")}function $U(e){let t=e.lastIndexOf("/");if(t===-1)return".";return t===0?"/":e.slice(0,t)}function vU(e){return e instanceof Error?e.message:String(e)}function wU(e){let{corePath:t,pathsValueRefs:r}=e;return{$comment:s1,$defs:{PathsValue:{$id:cs,anyOf:[...Fa,...r.map((n)=>({$ref:n}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t}]}}async function o1(e){let{baseDir:t,coreDocumentRef:r,coreProjectRef:n,extensions:i,loadJson:s}=e,o=[],a=[],c=[],l=[];for(let h of i){if(h.project)o.push(h.project);if(h.document){let m=await i1(h.document,s,t);if(a.push(...m),m.length>0)c.push(h.document)}if(h.fields)l.push(...await i1(h.fields,s,t)),o.push(h.fields)}let u=mU({corePath:n,fieldSchemaRefs:l,fragments:o}),d=wU({corePath:r,pathsValueRefs:a});return{document:Ha(await Ba(d,s,t,c)),project:Ha(await Ba(u,s,t))}}async function i1(e,t,r){let n;try{n=await t(qa(`${qa(r)}/${e}`))}catch{return[]}let{$id:i}=n;if(!T(i)||!n.$defs)return[];return Object.keys(n.$defs).map((s)=>`${i}#/$defs/${s}`)}var r1="https://jxsuite.com/schema/project/core/v2",s1="Generated by `jx schema` from project.json#/extensions — do not edit.",hU,gU,yU;var a1=L(()=>{au();Ee();au();hU=["additionalItems","additionalProperties","contains","contentSchema","else","if","items","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],gU=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"],yU=["allOf","anyOf","oneOf","prefixItems"]});import{existsSync as u1,readFileSync as SU,statSync as c1,writeFileSync as cu}from"node:fs";import{createRequire as Va}from"node:module";import{dirname as EU,isAbsolute as _U,relative as Am,resolve as Sn,sep as jm}from"node:path";async function f1(e){let{config:t}=ni(e),r=await ri(e,t),n=Sn(e),{document:i,project:s}=await o1({baseDir:n,coreDocumentRef:l1(e,kU),coreProjectRef:l1(e,PU),extensions:r.extensions.map((o)=>({document:o.schemas.document&&km(e,o,o.schemas.document),fields:o.schemas.fields&&km(e,o,o.schemas.fields),project:o.schemas.project&&km(e,o,o.schemas.project)})),loadJson:m1(n)});return{documentSchema:i,projectSchema:s}}async function d1(e){let{documentSchema:t,projectSchema:r}=await f1(e),n=Sn(e,"project.schema.json"),i=Sn(e,"document.schema.json");return cu(n,`${JSON.stringify(r,null,2)}
591
591
  `,"utf8"),cu(i,`${JSON.stringify(t,null,2)}
592
592
  `,"utf8"),{documentSchemaPath:i,projectSchemaPath:n}}async function p1(e,t={}){let{write:r=!0}=t,n=Sn(e),i=Sn(n,"project.json"),s=Sn(n,"project.schema.json"),o=Sn(n,"document.schema.json"),a=(g)=>{if(!u1(g))return!0;try{return c1(i).mtimeMs>c1(g).mtimeMs}catch{return!1}},l=a(s)||a(o)?await f1(n):null;if(l&&r)cu(s,`${JSON.stringify(l.projectSchema,null,2)}
593
593
  `,"utf8"),cu(o,`${JSON.stringify(l.documentSchema,null,2)}
594
- `,"utf8");let u=m1(n),d=l?.projectSchema??Ua(s),h=l?.documentSchema??Ua(o),m=Ha(await Ba(d,u,n));return{document:Ha(await Ba(h,u,n)),project:m}}function Ua(e){let t=JSON.parse($U(e,"utf8"));if(!ee(t))throw TypeError(`Schema file "${e}" is not a JSON object`);return t}function PU(e){return e.startsWith(_U)&&e.endsWith(".json")}function kU(e,t){try{return Va(import.meta.url).resolve(e)}catch(r){throw Error(`Schema ref "${t}" names the first-party schema "${e}", which must resolve from the host workspace and does not. The project's own copy is deliberately not consulted, so the host install is missing "${e.split("/").slice(0,2).join("/")}" — check that `+"the package ships with this build",{cause:r})}}function m1(e){return async(t)=>{let r=Sn(t),n=km(e,r);if(n.startsWith("..")||wU(n))throw Error(`Schema ref "${t}" escapes the project root ${e}`);let i=n.split(Am).join("/"),s="node_modules/",o=i.lastIndexOf(s),a=o===-1?null:i.slice(o+s.length);if(a!==null&&PU(a))return Ua(kU(a,t));if(u1(r))return Ua(r);if(a===null)throw Error(`Schema ref "${t}" does not exist`);let c;try{c=Va(Sn(e,"package.json")).resolve(a)}catch{try{c=Va(import.meta.url).resolve(a)}catch(l){throw Error(`Schema ref "${t}" does not exist and "${a}" is not resolvable from the project or the host`,{cause:l})}}return Ua(c)}}function l1(e,t){let r=null;try{r=Va(Sn(e,"package.json")).resolve(t)}catch{try{r=Va(import.meta.url).resolve(t)}catch{r=null}}let n=`./node_modules/${t}`;return r?h1(e,r,n):n}function Pm(e,t,r){let n=km(vU(t.manifestPath),r).split(Am).join("/"),i=`./node_modules/${t.specifier}/${n}`;return h1(e,r,i)}function h1(e,t,r){let n=km(e,t).split(Am).join("/");if(n.startsWith(".."))return r;return n.startsWith("./")?n:`./${n}`}var SU="@jxsuite/schema/schemas/project.core.schema.json",EU="@jxsuite/schema/schema.json",_U="@jxsuite/";var jm=L(()=>{a1();Ee();On();Ho()});var x1=C(function($oe,b1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/elements",g1=De("fs").promises,y1=De("path");async function AU({folder:e=__dirname}={}){let t={},r=await g1.readdir(e);for(let n of r)if(n.endsWith(".json")&&n!=="package.json"){let i=await g1.readFile(y1.join(e,n),"utf8");t[y1.basename(n,".json")]=JSON.parse(i)}return t}b1.exports={listAll:AU}});var w1=C(function(voe,v1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/css",jU=De("fs").promises,RU=De("path");async function $1({folder:e=__dirname}={}){let t=await jU.readFile(RU.join(e,"css.json"),"utf8");return JSON.parse(t)}async function OU({folder:e=__dirname}={}){let t=await $1(e),r={};for(let[n,i]of Object.entries(t)){r[n]={};for(let s of i){let o=s.name,a=null;if(s.for)a=i.find((c)=>c!==s&&c.name===s.name);if(a)o+=" for "+s.for[0];if(r[n][o]=s,s.descriptors){let c=s.descriptors;s.descriptors={};for(let l of c)s.descriptors[l.name]=l}}}return r}v1.exports={listAll:$1,index:OU}});var S1=C(function(lu,Rm){(function(e,t){typeof lu=="object"&&typeof Rm=="object"?Rm.exports=t():typeof define=="function"&&define.amd?define([],t):typeof lu=="object"?lu.WebIDL2=t():e.WebIDL2=t()})(globalThis,()=>(()=>{var e={d:(p,v)=>{for(var S in v)e.o(v,S)&&!e.o(p,S)&&Object.defineProperty(p,S,{enumerable:!0,get:v[S]})},o:(p,v)=>Object.prototype.hasOwnProperty.call(p,v),r:(p)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})}},t={};function r(p,v,S,A,O,{level:V="error",autofix:G,ruleName:de}={}){function fe(br){return br>0?p.slice(v,v+br):p.slice(Math.max(v+br,0),v)}function ye(br,{precedes:Ti}={}){let jn=br.map((Fo)=>Fo.trivia+Fo.value).join(""),Jo=p[v];return Jo.type==="eof"?jn:Ti?jn+Jo.trivia:jn.slice(Jo.trivia.length)}let Ae=p[v].type!=="eof"?p[v].line:p.length>1?p[v-1].line:1,Ne=function(br){let Ti=br.split(`
594
+ `,"utf8");let u=m1(n),d=l?.projectSchema??Ua(s),h=l?.documentSchema??Ua(o),m=Ha(await Ba(d,u,n));return{document:Ha(await Ba(h,u,n)),project:m}}function Ua(e){let t=JSON.parse(SU(e,"utf8"));if(!ee(t))throw TypeError(`Schema file "${e}" is not a JSON object`);return t}function jU(e){return e.startsWith(AU)&&e.endsWith(".json")}function RU(e,t){try{return Va(import.meta.url).resolve(e)}catch(r){throw Error(`Schema ref "${t}" names the first-party schema "${e}", which must resolve from the host workspace and does not. The project's own copy is deliberately not consulted, so the host install is missing "${e.split("/").slice(0,2).join("/")}" — check that `+"the package ships with this build",{cause:r})}}function m1(e){return async(t)=>{let r=Sn(t),n=Am(e,r);if(n.startsWith("..")||_U(n))throw Error(`Schema ref "${t}" escapes the project root ${e}`);let i=n.split(jm).join("/"),s="node_modules/",o=i.lastIndexOf(s),a=o===-1?null:i.slice(o+s.length);if(a!==null&&jU(a))return Ua(RU(a,t));if(u1(r))return Ua(r);if(a===null)throw Error(`Schema ref "${t}" does not exist`);let c;try{c=Va(Sn(e,"package.json")).resolve(a)}catch{try{c=Va(import.meta.url).resolve(a)}catch(l){throw Error(`Schema ref "${t}" does not exist and "${a}" is not resolvable from the project or the host`,{cause:l})}}return Ua(c)}}function l1(e,t){let r=null;try{r=Va(Sn(e,"package.json")).resolve(t)}catch{try{r=Va(import.meta.url).resolve(t)}catch{r=null}}let n=`./node_modules/${t}`;return r?h1(e,r,n):n}function km(e,t,r){let n=Am(EU(t.manifestPath),r).split(jm).join("/"),i=`./node_modules/${t.specifier}/${n}`;return h1(e,r,i)}function h1(e,t,r){let n=Am(e,t).split(jm).join("/");if(n.startsWith(".."))return r;return n.startsWith("./")?n:`./${n}`}var PU="@jxsuite/schema/schemas/project.core.schema.json",kU="@jxsuite/schema/schema.json",AU="@jxsuite/";var Rm=L(()=>{a1();Ee();On();Ho()});var x1=C(function(_oe,b1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/elements",g1=De("fs").promises,y1=De("path");async function OU({folder:e=__dirname}={}){let t={},r=await g1.readdir(e);for(let n of r)if(n.endsWith(".json")&&n!=="package.json"){let i=await g1.readFile(y1.join(e,n),"utf8");t[y1.basename(n,".json")]=JSON.parse(i)}return t}b1.exports={listAll:OU}});var w1=C(function(Poe,v1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/css",CU=De("fs").promises,IU=De("path");async function $1({folder:e=__dirname}={}){let t=await CU.readFile(IU.join(e,"css.json"),"utf8");return JSON.parse(t)}async function TU({folder:e=__dirname}={}){let t=await $1(e),r={};for(let[n,i]of Object.entries(t)){r[n]={};for(let s of i){let o=s.name,a=null;if(s.for)a=i.find((c)=>c!==s&&c.name===s.name);if(a)o+=" for "+s.for[0];if(r[n][o]=s,s.descriptors){let c=s.descriptors;s.descriptors={};for(let l of c)s.descriptors[l.name]=l}}}return r}v1.exports={listAll:$1,index:TU}});var S1=C(function(lu,Om){(function(e,t){typeof lu=="object"&&typeof Om=="object"?Om.exports=t():typeof define=="function"&&define.amd?define([],t):typeof lu=="object"?lu.WebIDL2=t():e.WebIDL2=t()})(globalThis,()=>(()=>{var e={d:(p,v)=>{for(var S in v)e.o(v,S)&&!e.o(p,S)&&Object.defineProperty(p,S,{enumerable:!0,get:v[S]})},o:(p,v)=>Object.prototype.hasOwnProperty.call(p,v),r:(p)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})}},t={};function r(p,v,S,A,O,{level:V="error",autofix:G,ruleName:de}={}){function fe(br){return br>0?p.slice(v,v+br):p.slice(Math.max(v+br,0),v)}function ye(br,{precedes:Ti}={}){let jn=br.map((Fo)=>Fo.trivia+Fo.value).join(""),Jo=p[v];return Jo.type==="eof"?jn:Ti?jn+Jo.trivia:jn.slice(Jo.trivia.length)}let Ae=p[v].type!=="eof"?p[v].line:p.length>1?p[v-1].line:1,Ne=function(br){let Ti=br.split(`
595
595
  `);return Ti[Ti.length-1]}(ye(fe(-5),{precedes:!0})),qt=fe(5),nr=ye(qt),Do=Ne+nr.split(`
596
596
  `)[0]+`
597
- `+(" ".repeat(Ne.length)+"^"),nf=O==="Syntax"?"since":"inside",bg=`${O} error at line ${Ae}${p.name?` in ${p.name}`:""}${S&&S.name?`, ${nf} \`${S.partial?"partial ":""}${function(br){let Ti=[br];for(;br&&br.parent;){let{parent:jn}=br;Ti.unshift(jn),br=jn}return Ti.map((jn)=>function(Jo,Fo){let xg=Jo;return Fo&&(xg+=` ${Fo}`),xg}(jn.type,jn.name)).join(" -> ")}(S)}\``:""}:
598
- ${Do}`;return{message:`${bg} ${A}`,bareMessage:A,context:bg,line:Ae,sourceName:p.name,level:V,ruleName:de,autofix:G,input:nr,tokens:qt}}function n(p,v,S,A){return r(p,v,S,A,"Syntax")}function i(p,v,S,A,O={}){return O.ruleName=S,r(v.source,p.index,v,A,"Validation",O)}e.r(t),e.d(t,{WebIDLParseError:()=>it,parse:()=>jt,validate:()=>cC,write:()=>Ft});class s{constructor({source:p,tokens:v}){Object.defineProperties(this,{source:{value:p},tokens:{value:v,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){let p={type:void 0,name:void 0,inheritance:void 0},v=this;for(;v!==Object.prototype;){let S=Object.getOwnPropertyDescriptors(v);for(let[A,O]of Object.entries(S))(O.enumerable||O.get)&&(p[A]=this[A]);v=Object.getPrototypeOf(v)}return p}}function o(p,v,{useNullableInner:S}={}){if(!p.union){let A=v.unique.get(p.idlType);if(!A)return;if(A.type==="typedef"){let{typedefIncludesDictionary:O}=v.cache;if(O.has(A))return O.get(A);v.cache.typedefIncludesDictionary.set(A,void 0);let V=o(A.idlType,v);if(v.cache.typedefIncludesDictionary.set(A,V),V)return{reference:p,dictionary:V.dictionary}}if(A.type==="dictionary"&&(S||!p.nullable))return{reference:p,dictionary:A}}for(let A of p.subtype){let O=o(A,v);if(O)return A.union?O:{reference:A,dictionary:O.dictionary}}}function a(p,v){if(v.cache.dictionaryIncludesRequiredField.has(p))return v.cache.dictionaryIncludesRequiredField.get(p);v.cache.dictionaryIncludesRequiredField.set(p,void 0);let S=p.members.some((A)=>A.required);if(!S&&p.inheritance){let A=v.unique.get(p.inheritance);A?a(A,v)&&(S=!0):S=!0}return v.cache.dictionaryIncludesRequiredField.set(p,S),S}class c extends Array{constructor({source:p,tokens:v}){super(),Object.defineProperties(this,{source:{value:p},tokens:{value:v},parent:{value:null,writable:!0}})}}class l extends s{static parser(p,v){return()=>{let S=p.consumeKind(v);if(S)return new l({source:p.source,tokens:{value:S}})}}get value(){return N(this.tokens.value.value)}write(p){return p.ts.wrap([p.token(this.tokens.value),p.token(this.tokens.separator)])}}class u extends l{static parse(p){let v=p.consumeKind("eof");if(v)return new u({source:p.source,tokens:{value:v}})}get type(){return"eof"}}function d(p,v){return q(p,{parser:l.parser(p,v),listName:v+" list"})}let h=["identifier","decimal","integer","string"],m=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((p)=>[p,`Legacy${p}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function y(p){for(let v of h){let S=d(p,v);if(S.length)return S}p.error("Expected identifiers, strings, decimals, or integers but none found")}class g extends s{static parse(p){let v={assign:p.consume("=")},S=Z(new g({source:p.source,tokens:v}));if(S.list=[],v.assign){if(v.asterisk=p.consume("*"),v.asterisk)return S.this;v.secondaryName=p.consumeKind(...h)}return v.open=p.consume("("),v.open?(S.list=S.rhsIsList?y(p):ie(p),v.close=p.consume(")")||p.error("Unexpected token in extended attribute argument list")):v.assign&&!v.secondaryName&&p.error("No right hand side to extended attribute assignment"),S.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(p){let{rhsType:v}=this;return p.ts.wrap([p.token(this.tokens.assign),p.token(this.tokens.asterisk),p.reference_token(this.tokens.secondaryName,this.parent),p.token(this.tokens.open),...this.list.map((S)=>v==="identifier-list"?p.identifier(S,this.parent):S.write(p)),p.token(this.tokens.close)])}}class b extends s{static parse(p){let v=p.consumeKind("identifier");if(v)return new b({source:p.source,tokens:{name:v},params:g.parse(p)})}constructor({source:p,tokens:v,params:S}){super({source:p,tokens:v}),S.parent=this,Object.defineProperty(this,"params",{value:S})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){let{rhsType:p,tokens:v,list:S}=this.params;if(!p)return null;return{type:p,value:this.params.rhsIsList?S:this.params.tokens.secondaryName?N(v.secondaryName.value):null}}get arguments(){let{rhsIsList:p,list:v}=this.params;return!v||p?[]:v}*validate(p){let{name:v}=this;if(v==="LegacyNoInterfaceObject")yield i(this.tokens.name,this,"no-nointerfaceobject","`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.",{level:"warning"});else if(m.has(v)){let A=`\`[${v}]\` extended attribute is a legacy feature that is now renamed to \`[${m.get(v)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield i(this.tokens.name,this,"renamed-legacy",A,{level:"warning",autofix:(S=this,()=>{let{name:O}=S;S.tokens.name.value=m.get(O),O==="TreatNullAs"&&(S.params.tokens={})})})}var S;for(let A of this.arguments)yield*A.validate(p)}write(p){return p.ts.wrap([p.ts.trivia(this.tokens.name.trivia),p.ts.extendedAttribute(p.ts.wrap([p.ts.extendedAttributeReference(this.name),this.params.write(p)])),p.token(this.tokens.separator)])}}class x extends c{static parse(p){let v={};v.open=p.consume("[");let S=new x({source:p.source,tokens:v});return v.open?(S.push(...q(p,{parser:b.parse,listName:"extended attribute"})),v.close=p.consume("]")||p.error("Expected a closing token for the extended attribute list"),S.length||(p.unconsume(v.close.index),p.error("An extended attribute list must not be empty")),p.probe("[")&&p.error("Illegal double extended attribute lists, consider merging them"),S):S}*validate(p){for(let v of this)yield*v.validate(p)}write(p){return this.length?p.ts.wrap([p.token(this.tokens.open),...this.map((v)=>v.write(p)),p.token(this.tokens.close)]):""}}function _(p,v){let S=p.consume("?");S&&(v.tokens.nullable=S),p.probe("?")&&p.error("Can't nullable more than once")}function k(p,v){let S=function(A,O){let V=A.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!V)return;let G=Z(new E({source:A.source,tokens:{base:V}}));switch(G.tokens.open=A.consume("<")||A.error(`No opening bracket after ${V.value}`),V.value){case"Promise":{A.probe("[")&&A.error("Promise type cannot have extended attribute");let de=le(A,O)||A.error("Missing Promise subtype");G.subtype.push(de);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{let de=te(A,O)||A.error(`Missing ${V.value} subtype`);G.subtype.push(de);break}case"record":{A.probe("[")&&A.error("Record key cannot have extended attribute");let de=A.consume(...Qe)||A.error(`Record key must be one of: ${Qe.join(", ")}`),fe=new E({source:A.source,tokens:{base:de}});fe.tokens.separator=A.consume(",")||A.error("Missing comma after record key type"),fe.type=O;let ye=te(A,O)||A.error("Error parsing generic type record");G.subtype.push(fe,ye);break}}return G.idlType||A.error(`Error parsing generic type ${V.value}`),G.tokens.close=A.consume(">")||A.error(`Missing closing bracket after ${V.value}`),G.this}(p,v)||ue(p);if(!S){let A=p.consumeKind("identifier")||p.consume(...Qe,...pe);if(!A)return;S=new E({source:p.source,tokens:{base:A}}),p.probe("<")&&p.error(`Unsupported generic type ${A.value}`)}return S.generic==="Promise"&&p.probe("?")&&p.error("Promise type cannot be nullable"),S.type=v||null,_(p,S),S.nullable&&S.idlType==="any"&&p.error("Type `any` cannot be made nullable"),S}class E extends s{static parse(p,v){return k(p,v)||function(S,A){let O={};if(O.open=S.consume("("),!O.open)return;let V=Z(new E({source:S.source,tokens:O}));for(V.type=A||null;;){let G=te(S,A)||S.error("No type after open parenthesis or 'or' in union type");G.idlType==="any"&&S.error("Type `any` cannot be included in a union type"),G.generic==="Promise"&&S.error("Type `Promise` cannot be included in a union type"),V.subtype.push(G);let de=S.consume("or");if(!de)break;G.tokens.separator=de}return V.idlType.length<2&&S.error("At least two types are expected in a union type but found less"),O.close=S.consume(")")||S.error("Unterminated union type"),_(S,V),V.this}(p,v)}constructor({source:p,tokens:v}){super({source:p,tokens:v}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new x({source:p,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return N([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((p)=>p).map((p)=>p.value).join(" "))}*validate(p){if(yield*this.extAttrs.validate(p),this.idlType==="BufferSource")for(let O of[this.extAttrs,this.parent?.extAttrs])for(let V of O){if(V.name!=="AllowShared")continue;let G="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield i(this.tokens.base,this,"migrate-allowshared",G,{autofix:w(this,V,O)})}if(this.idlType==="void")yield i(this.tokens.base,this,"replace-void","`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.",{autofix:(v=this,()=>{v.tokens.base.value="undefined"})});var v;let S=!this.union&&p.unique.get(this.idlType),A=this.union?this:S&&S.type==="typedef"?S.idlType:void 0;if(A&&this.nullable){let{reference:O}=o(A,p)||{};if(O){let V=(this.union?O:this).tokens.base;yield i(V,this,"no-nullable-union-dict","Nullable union cannot include a dictionary type.")}}else for(let O of this.subtype)yield*O.validate(p)}write(p){return p.ts.wrap([this.extAttrs.write(p),(()=>{if(this.union||this.generic)return p.ts.wrap([p.token(this.tokens.base,p.ts.generic),p.token(this.tokens.open),...this.subtype.map((O)=>O.write(p)),p.token(this.tokens.close)]);let v=this.tokens.prefix||this.tokens.base,S=this.tokens.prefix?[this.tokens.prefix.value,p.ts.trivia(this.tokens.base.trivia)]:[],A=p.reference(p.ts.wrap([...S,this.tokens.base.value,p.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return p.ts.wrap([p.ts.trivia(v.trivia),A])})(),p.token(this.tokens.nullable),p.token(this.tokens.separator)])}}function w(p,v,S){return()=>{let A=S.indexOf(v);S.splice(A,1),!S.length&&p.tokens.base.trivia.match(/^\s$/)&&(p.tokens.base.trivia=""),p.tokens.base.value="AllowSharedBufferSource"}}class P extends s{static parse(p){let v=p.consume("=");if(!v)return null;let S=U(p)||p.consumeKind("string")||p.consume("null","[","{")||p.error("No value for default"),A=[S];if(S.value==="["){let O=p.consume("]")||p.error("Default sequence value must be empty");A.push(O)}else if(S.value==="{"){let O=p.consume("}")||p.error("Default dictionary value must be empty");A.push(O)}return new P({source:p.source,tokens:{assign:v},expression:A})}constructor({source:p,tokens:v,expression:S}){super({source:p,tokens:v}),S.parent=this,Object.defineProperty(this,"expression",{value:S})}get type(){return ne(this.expression[0]).type}get value(){return ne(this.expression[0]).value}get negative(){return ne(this.expression[0]).negative}write(p){return p.ts.wrap([p.token(this.tokens.assign),...this.expression.map((v)=>p.token(v))])}}class R extends s{static parse(p){let v=p.position,S={},A=Z(new R({source:p.source,tokens:S}));return A.extAttrs=x.parse(p),S.optional=p.consume("optional"),A.idlType=te(p,"argument-type"),A.idlType?(S.optional||(S.variadic=p.consume("...")),S.name=p.consumeKind("identifier")||p.consume(...z),S.name?(A.default=S.optional?P.parse(p):null,A.this):p.unconsume(v)):p.unconsume(v)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return N(this.tokens.name.value)}*validate(p){yield*this.extAttrs.validate(p),yield*this.idlType.validate(p);let v=o(this.idlType,p,{useNullableInner:!0});if(v){if(this.idlType.nullable)yield i(this.tokens.name,this,"no-nullable-dict-arg","Dictionary arguments cannot be nullable.");else if(this.optional){if(!this.default)yield i(this.tokens.name,this,"dict-arg-default","Optional dictionary arguments must have a default value of `{}`.",{autofix:j(this)})}else if(this.parent&&!a(v.dictionary,p)&&function(A){let O=A.parent.arguments||A.parent.list,V=O.indexOf(A);return!O.slice(V+1).some((de)=>!de.optional)}(this))yield i(this.tokens.name,this,"dict-arg-optional","Dictionary argument must be optional if it has no required fields",{autofix:(S=this,()=>{let O=Q(S.idlType);S.tokens.optional={...O,type:"optional",value:"optional"},O.trivia=" ",j(S)()})})}var S}write(p){return p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.optional),p.ts.type(this.idlType.write(p)),p.token(this.tokens.variadic),p.name_token(this.tokens.name,{data:this}),this.default?this.default.write(p):"",p.token(this.tokens.separator)])}}function j(p){return()=>{p.default=P.parse(new nt(" = {}"))}}class D extends s{static parse(p,{special:v,regular:S}={}){let A={special:v},O=Z(new D({source:p.source,tokens:A}));return v&&v.value==="stringifier"&&(A.termination=p.consume(";"),A.termination)?(O.arguments=[],O):(v||S||(A.special=p.consume("getter","setter","deleter")),O.idlType=le(p)||p.error("Missing return type"),A.name=p.consumeKind("identifier")||p.consume("includes"),A.open=p.consume("(")||p.error("Invalid operation"),O.arguments=ie(p),A.close=p.consume(")")||p.error("Unterminated operation"),A.termination=p.consume(";")||p.error("Unterminated operation, expected `;`"),O.this)}get type(){return"operation"}get name(){let{name:p}=this.tokens;return p?N(p.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(p){if(yield*this.extAttrs.validate(p),!this.name&&["","static"].includes(this.special))yield i(this.tokens.open,this,"incomplete-op","Regular or static operations must have both a return type and an identifier.");if(this.idlType){if(this.idlType.generic==="async_sequence")yield i(this.idlType.tokens.base,this,"async-sequence-idl-to-js","async_sequence types cannot be returned by an operation.");yield*this.idlType.validate(p)}for(let v of this.arguments)yield*v.validate(p)}write(p){let{parent:v}=this,S=this.idlType?[p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),p.token(this.tokens.open),p.ts.wrap(this.arguments.map((A)=>A.write(p))),p.token(this.tokens.close)]:[];return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),this.tokens.name?p.token(this.tokens.special):p.token(this.tokens.special,p.ts.nameless,{data:this,parent:v}),...S,p.token(this.tokens.termination)]),{data:this,parent:v})}}class F extends s{static parse(p,{special:v,noInherit:S=!1,readonly:A=!1}={}){let O=p.position,V={special:v},G=Z(new F({source:p.source,tokens:V}));if(v||S||(V.special=p.consume("inherit")),G.special==="inherit"&&p.probe("readonly")&&p.error("Inherited attributes cannot be read-only"),V.readonly=p.consume("readonly"),A&&!V.readonly&&p.probe("attribute")&&p.error("Attributes must be readonly in this context"),V.base=p.consume("attribute"),V.base)return G.idlType=te(p,"attribute-type")||p.error("Attribute lacks a type"),V.name=p.consumeKind("identifier")||p.consume("async","required")||p.error("Attribute lacks a name"),V.termination=p.consume(";")||p.error("Unterminated attribute, expected `;`"),G.this;p.unconsume(O)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return N(this.tokens.name.value)}*validate(p){if(yield*this.extAttrs.validate(p),yield*this.idlType.validate(p),["async_sequence","sequence","record"].includes(this.idlType.generic)){let v=`Attributes cannot accept ${this.idlType.generic} types.`;yield i(this.tokens.name,this,"attr-invalid-type",v)}{let{reference:v}=o(this.idlType,p)||{};if(v){let S=(this.idlType.union?v:this.idlType).tokens.base;yield i(S,this,"attr-invalid-type","Attributes cannot accept dictionary types.")}}if(this.readonly&&function(v,S){if(v.union)return!1;if(v.extAttrs.some((O)=>O.name==="EnforceRange"))return!0;let A=S.unique.get(v.idlType);return A?.type==="typedef"&&A.idlType.extAttrs.some((O)=>O.name==="EnforceRange")}(this.idlType,p)){let v=this.idlType.tokens.base;yield i(v,this,"attr-invalid-type","Readonly attributes cannot accept [EnforceRange] extended attribute.")}}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.special),p.token(this.tokens.readonly),p.token(this.tokens.base),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),p.token(this.tokens.termination)]),{data:this,parent:v})}}function N(p){return p.startsWith("_")?p.slice(1):p}function q(p,{parser:v,allowDangler:S,listName:A="list"}){let O=v(p);if(!O)return[];O.tokens.separator=p.consume(",");let V=[O];for(;O.tokens.separator;){let G=v(p);if(!G){S||p.error(`Trailing comma in ${A}`);break}if(G.tokens.separator=p.consume(","),V.push(G),!G.tokens.separator)break}return V}function U(p){return p.consumeKind("decimal","integer")||p.consume("true","false","Infinity","-Infinity","NaN")}function ne({type:p,value:v}){switch(p){case"decimal":case"integer":return{type:"number",value:v};case"string":return{type:"string",value:v.slice(1,-1)}}switch(v){case"true":case"false":return{type:"boolean",value:v==="true"};case"Infinity":case"-Infinity":return{type:"Infinity",negative:v.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:v}}}function ue(p){let{source:v}=p,S=function(){let O=p.consume("unsigned"),V=p.consume("short","long");if(V){let G=p.consume("long");return new E({source:v,tokens:{prefix:O,base:V,postfix:G}})}O&&p.error("Failed to parse integer type")}()||function(){let O=p.consume("unrestricted"),V=p.consume("float","double");if(V)return new E({source:v,tokens:{prefix:O,base:V}});O&&p.error("Failed to parse float type")}();if(S)return S;let A=p.consume("bigint","boolean","byte","octet","undefined");return A?new E({source:v,tokens:{base:A}}):void 0}function ie(p){return q(p,{parser:R.parse,listName:"arguments list"})}function te(p,v){let S=x.parse(p),A=E.parse(p,v);return A&&(Z(A).extAttrs=S),A}function le(p,v){let S=E.parse(p,v||"return-type");if(S)return S;let A=p.consume("void");if(A){let O=new E({source:p.source,tokens:{base:A}});return O.type="return-type",O}}function Ce(p){let v=p.consume("stringifier");if(!v)return;return F.parse(p,{special:v})||D.parse(p,{special:v})||p.error("Unterminated stringifier")}function W(p){let v=p.split(`
597
+ `+(" ".repeat(Ne.length)+"^"),sf=O==="Syntax"?"since":"inside",bg=`${O} error at line ${Ae}${p.name?` in ${p.name}`:""}${S&&S.name?`, ${sf} \`${S.partial?"partial ":""}${function(br){let Ti=[br];for(;br&&br.parent;){let{parent:jn}=br;Ti.unshift(jn),br=jn}return Ti.map((jn)=>function(Jo,Fo){let xg=Jo;return Fo&&(xg+=` ${Fo}`),xg}(jn.type,jn.name)).join(" -> ")}(S)}\``:""}:
598
+ ${Do}`;return{message:`${bg} ${A}`,bareMessage:A,context:bg,line:Ae,sourceName:p.name,level:V,ruleName:de,autofix:G,input:nr,tokens:qt}}function n(p,v,S,A){return r(p,v,S,A,"Syntax")}function i(p,v,S,A,O={}){return O.ruleName=S,r(v.source,p.index,v,A,"Validation",O)}e.r(t),e.d(t,{WebIDLParseError:()=>it,parse:()=>jt,validate:()=>fC,write:()=>Ft});class s{constructor({source:p,tokens:v}){Object.defineProperties(this,{source:{value:p},tokens:{value:v,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){let p={type:void 0,name:void 0,inheritance:void 0},v=this;for(;v!==Object.prototype;){let S=Object.getOwnPropertyDescriptors(v);for(let[A,O]of Object.entries(S))(O.enumerable||O.get)&&(p[A]=this[A]);v=Object.getPrototypeOf(v)}return p}}function o(p,v,{useNullableInner:S}={}){if(!p.union){let A=v.unique.get(p.idlType);if(!A)return;if(A.type==="typedef"){let{typedefIncludesDictionary:O}=v.cache;if(O.has(A))return O.get(A);v.cache.typedefIncludesDictionary.set(A,void 0);let V=o(A.idlType,v);if(v.cache.typedefIncludesDictionary.set(A,V),V)return{reference:p,dictionary:V.dictionary}}if(A.type==="dictionary"&&(S||!p.nullable))return{reference:p,dictionary:A}}for(let A of p.subtype){let O=o(A,v);if(O)return A.union?O:{reference:A,dictionary:O.dictionary}}}function a(p,v){if(v.cache.dictionaryIncludesRequiredField.has(p))return v.cache.dictionaryIncludesRequiredField.get(p);v.cache.dictionaryIncludesRequiredField.set(p,void 0);let S=p.members.some((A)=>A.required);if(!S&&p.inheritance){let A=v.unique.get(p.inheritance);A?a(A,v)&&(S=!0):S=!0}return v.cache.dictionaryIncludesRequiredField.set(p,S),S}class c extends Array{constructor({source:p,tokens:v}){super(),Object.defineProperties(this,{source:{value:p},tokens:{value:v},parent:{value:null,writable:!0}})}}class l extends s{static parser(p,v){return()=>{let S=p.consumeKind(v);if(S)return new l({source:p.source,tokens:{value:S}})}}get value(){return N(this.tokens.value.value)}write(p){return p.ts.wrap([p.token(this.tokens.value),p.token(this.tokens.separator)])}}class u extends l{static parse(p){let v=p.consumeKind("eof");if(v)return new u({source:p.source,tokens:{value:v}})}get type(){return"eof"}}function d(p,v){return q(p,{parser:l.parser(p,v),listName:v+" list"})}let h=["identifier","decimal","integer","string"],m=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((p)=>[p,`Legacy${p}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function y(p){for(let v of h){let S=d(p,v);if(S.length)return S}p.error("Expected identifiers, strings, decimals, or integers but none found")}class g extends s{static parse(p){let v={assign:p.consume("=")},S=Z(new g({source:p.source,tokens:v}));if(S.list=[],v.assign){if(v.asterisk=p.consume("*"),v.asterisk)return S.this;v.secondaryName=p.consumeKind(...h)}return v.open=p.consume("("),v.open?(S.list=S.rhsIsList?y(p):ie(p),v.close=p.consume(")")||p.error("Unexpected token in extended attribute argument list")):v.assign&&!v.secondaryName&&p.error("No right hand side to extended attribute assignment"),S.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(p){let{rhsType:v}=this;return p.ts.wrap([p.token(this.tokens.assign),p.token(this.tokens.asterisk),p.reference_token(this.tokens.secondaryName,this.parent),p.token(this.tokens.open),...this.list.map((S)=>v==="identifier-list"?p.identifier(S,this.parent):S.write(p)),p.token(this.tokens.close)])}}class b extends s{static parse(p){let v=p.consumeKind("identifier");if(v)return new b({source:p.source,tokens:{name:v},params:g.parse(p)})}constructor({source:p,tokens:v,params:S}){super({source:p,tokens:v}),S.parent=this,Object.defineProperty(this,"params",{value:S})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){let{rhsType:p,tokens:v,list:S}=this.params;if(!p)return null;return{type:p,value:this.params.rhsIsList?S:this.params.tokens.secondaryName?N(v.secondaryName.value):null}}get arguments(){let{rhsIsList:p,list:v}=this.params;return!v||p?[]:v}*validate(p){let{name:v}=this;if(v==="LegacyNoInterfaceObject")yield i(this.tokens.name,this,"no-nointerfaceobject","`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.",{level:"warning"});else if(m.has(v)){let A=`\`[${v}]\` extended attribute is a legacy feature that is now renamed to \`[${m.get(v)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield i(this.tokens.name,this,"renamed-legacy",A,{level:"warning",autofix:(S=this,()=>{let{name:O}=S;S.tokens.name.value=m.get(O),O==="TreatNullAs"&&(S.params.tokens={})})})}var S;for(let A of this.arguments)yield*A.validate(p)}write(p){return p.ts.wrap([p.ts.trivia(this.tokens.name.trivia),p.ts.extendedAttribute(p.ts.wrap([p.ts.extendedAttributeReference(this.name),this.params.write(p)])),p.token(this.tokens.separator)])}}class x extends c{static parse(p){let v={};v.open=p.consume("[");let S=new x({source:p.source,tokens:v});return v.open?(S.push(...q(p,{parser:b.parse,listName:"extended attribute"})),v.close=p.consume("]")||p.error("Expected a closing token for the extended attribute list"),S.length||(p.unconsume(v.close.index),p.error("An extended attribute list must not be empty")),p.probe("[")&&p.error("Illegal double extended attribute lists, consider merging them"),S):S}*validate(p){for(let v of this)yield*v.validate(p)}write(p){return this.length?p.ts.wrap([p.token(this.tokens.open),...this.map((v)=>v.write(p)),p.token(this.tokens.close)]):""}}function _(p,v){let S=p.consume("?");S&&(v.tokens.nullable=S),p.probe("?")&&p.error("Can't nullable more than once")}function P(p,v){let S=function(A,O){let V=A.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!V)return;let G=Z(new E({source:A.source,tokens:{base:V}}));switch(G.tokens.open=A.consume("<")||A.error(`No opening bracket after ${V.value}`),V.value){case"Promise":{A.probe("[")&&A.error("Promise type cannot have extended attribute");let de=le(A,O)||A.error("Missing Promise subtype");G.subtype.push(de);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{let de=te(A,O)||A.error(`Missing ${V.value} subtype`);G.subtype.push(de);break}case"record":{A.probe("[")&&A.error("Record key cannot have extended attribute");let de=A.consume(...Qe)||A.error(`Record key must be one of: ${Qe.join(", ")}`),fe=new E({source:A.source,tokens:{base:de}});fe.tokens.separator=A.consume(",")||A.error("Missing comma after record key type"),fe.type=O;let ye=te(A,O)||A.error("Error parsing generic type record");G.subtype.push(fe,ye);break}}return G.idlType||A.error(`Error parsing generic type ${V.value}`),G.tokens.close=A.consume(">")||A.error(`Missing closing bracket after ${V.value}`),G.this}(p,v)||ue(p);if(!S){let A=p.consumeKind("identifier")||p.consume(...Qe,...pe);if(!A)return;S=new E({source:p.source,tokens:{base:A}}),p.probe("<")&&p.error(`Unsupported generic type ${A.value}`)}return S.generic==="Promise"&&p.probe("?")&&p.error("Promise type cannot be nullable"),S.type=v||null,_(p,S),S.nullable&&S.idlType==="any"&&p.error("Type `any` cannot be made nullable"),S}class E extends s{static parse(p,v){return P(p,v)||function(S,A){let O={};if(O.open=S.consume("("),!O.open)return;let V=Z(new E({source:S.source,tokens:O}));for(V.type=A||null;;){let G=te(S,A)||S.error("No type after open parenthesis or 'or' in union type");G.idlType==="any"&&S.error("Type `any` cannot be included in a union type"),G.generic==="Promise"&&S.error("Type `Promise` cannot be included in a union type"),V.subtype.push(G);let de=S.consume("or");if(!de)break;G.tokens.separator=de}return V.idlType.length<2&&S.error("At least two types are expected in a union type but found less"),O.close=S.consume(")")||S.error("Unterminated union type"),_(S,V),V.this}(p,v)}constructor({source:p,tokens:v}){super({source:p,tokens:v}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new x({source:p,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return N([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((p)=>p).map((p)=>p.value).join(" "))}*validate(p){if(yield*this.extAttrs.validate(p),this.idlType==="BufferSource")for(let O of[this.extAttrs,this.parent?.extAttrs])for(let V of O){if(V.name!=="AllowShared")continue;let G="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield i(this.tokens.base,this,"migrate-allowshared",G,{autofix:w(this,V,O)})}if(this.idlType==="void")yield i(this.tokens.base,this,"replace-void","`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.",{autofix:(v=this,()=>{v.tokens.base.value="undefined"})});var v;let S=!this.union&&p.unique.get(this.idlType),A=this.union?this:S&&S.type==="typedef"?S.idlType:void 0;if(A&&this.nullable){let{reference:O}=o(A,p)||{};if(O){let V=(this.union?O:this).tokens.base;yield i(V,this,"no-nullable-union-dict","Nullable union cannot include a dictionary type.")}}else for(let O of this.subtype)yield*O.validate(p)}write(p){return p.ts.wrap([this.extAttrs.write(p),(()=>{if(this.union||this.generic)return p.ts.wrap([p.token(this.tokens.base,p.ts.generic),p.token(this.tokens.open),...this.subtype.map((O)=>O.write(p)),p.token(this.tokens.close)]);let v=this.tokens.prefix||this.tokens.base,S=this.tokens.prefix?[this.tokens.prefix.value,p.ts.trivia(this.tokens.base.trivia)]:[],A=p.reference(p.ts.wrap([...S,this.tokens.base.value,p.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return p.ts.wrap([p.ts.trivia(v.trivia),A])})(),p.token(this.tokens.nullable),p.token(this.tokens.separator)])}}function w(p,v,S){return()=>{let A=S.indexOf(v);S.splice(A,1),!S.length&&p.tokens.base.trivia.match(/^\s$/)&&(p.tokens.base.trivia=""),p.tokens.base.value="AllowSharedBufferSource"}}class k extends s{static parse(p){let v=p.consume("=");if(!v)return null;let S=U(p)||p.consumeKind("string")||p.consume("null","[","{")||p.error("No value for default"),A=[S];if(S.value==="["){let O=p.consume("]")||p.error("Default sequence value must be empty");A.push(O)}else if(S.value==="{"){let O=p.consume("}")||p.error("Default dictionary value must be empty");A.push(O)}return new k({source:p.source,tokens:{assign:v},expression:A})}constructor({source:p,tokens:v,expression:S}){super({source:p,tokens:v}),S.parent=this,Object.defineProperty(this,"expression",{value:S})}get type(){return ne(this.expression[0]).type}get value(){return ne(this.expression[0]).value}get negative(){return ne(this.expression[0]).negative}write(p){return p.ts.wrap([p.token(this.tokens.assign),...this.expression.map((v)=>p.token(v))])}}class R extends s{static parse(p){let v=p.position,S={},A=Z(new R({source:p.source,tokens:S}));return A.extAttrs=x.parse(p),S.optional=p.consume("optional"),A.idlType=te(p,"argument-type"),A.idlType?(S.optional||(S.variadic=p.consume("...")),S.name=p.consumeKind("identifier")||p.consume(...z),S.name?(A.default=S.optional?k.parse(p):null,A.this):p.unconsume(v)):p.unconsume(v)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return N(this.tokens.name.value)}*validate(p){yield*this.extAttrs.validate(p),yield*this.idlType.validate(p);let v=o(this.idlType,p,{useNullableInner:!0});if(v){if(this.idlType.nullable)yield i(this.tokens.name,this,"no-nullable-dict-arg","Dictionary arguments cannot be nullable.");else if(this.optional){if(!this.default)yield i(this.tokens.name,this,"dict-arg-default","Optional dictionary arguments must have a default value of `{}`.",{autofix:j(this)})}else if(this.parent&&!a(v.dictionary,p)&&function(A){let O=A.parent.arguments||A.parent.list,V=O.indexOf(A);return!O.slice(V+1).some((de)=>!de.optional)}(this))yield i(this.tokens.name,this,"dict-arg-optional","Dictionary argument must be optional if it has no required fields",{autofix:(S=this,()=>{let O=Q(S.idlType);S.tokens.optional={...O,type:"optional",value:"optional"},O.trivia=" ",j(S)()})})}var S}write(p){return p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.optional),p.ts.type(this.idlType.write(p)),p.token(this.tokens.variadic),p.name_token(this.tokens.name,{data:this}),this.default?this.default.write(p):"",p.token(this.tokens.separator)])}}function j(p){return()=>{p.default=k.parse(new nt(" = {}"))}}class D extends s{static parse(p,{special:v,regular:S}={}){let A={special:v},O=Z(new D({source:p.source,tokens:A}));return v&&v.value==="stringifier"&&(A.termination=p.consume(";"),A.termination)?(O.arguments=[],O):(v||S||(A.special=p.consume("getter","setter","deleter")),O.idlType=le(p)||p.error("Missing return type"),A.name=p.consumeKind("identifier")||p.consume("includes"),A.open=p.consume("(")||p.error("Invalid operation"),O.arguments=ie(p),A.close=p.consume(")")||p.error("Unterminated operation"),A.termination=p.consume(";")||p.error("Unterminated operation, expected `;`"),O.this)}get type(){return"operation"}get name(){let{name:p}=this.tokens;return p?N(p.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(p){if(yield*this.extAttrs.validate(p),!this.name&&["","static"].includes(this.special))yield i(this.tokens.open,this,"incomplete-op","Regular or static operations must have both a return type and an identifier.");if(this.idlType){if(this.idlType.generic==="async_sequence")yield i(this.idlType.tokens.base,this,"async-sequence-idl-to-js","async_sequence types cannot be returned by an operation.");yield*this.idlType.validate(p)}for(let v of this.arguments)yield*v.validate(p)}write(p){let{parent:v}=this,S=this.idlType?[p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),p.token(this.tokens.open),p.ts.wrap(this.arguments.map((A)=>A.write(p))),p.token(this.tokens.close)]:[];return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),this.tokens.name?p.token(this.tokens.special):p.token(this.tokens.special,p.ts.nameless,{data:this,parent:v}),...S,p.token(this.tokens.termination)]),{data:this,parent:v})}}class F extends s{static parse(p,{special:v,noInherit:S=!1,readonly:A=!1}={}){let O=p.position,V={special:v},G=Z(new F({source:p.source,tokens:V}));if(v||S||(V.special=p.consume("inherit")),G.special==="inherit"&&p.probe("readonly")&&p.error("Inherited attributes cannot be read-only"),V.readonly=p.consume("readonly"),A&&!V.readonly&&p.probe("attribute")&&p.error("Attributes must be readonly in this context"),V.base=p.consume("attribute"),V.base)return G.idlType=te(p,"attribute-type")||p.error("Attribute lacks a type"),V.name=p.consumeKind("identifier")||p.consume("async","required")||p.error("Attribute lacks a name"),V.termination=p.consume(";")||p.error("Unterminated attribute, expected `;`"),G.this;p.unconsume(O)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return N(this.tokens.name.value)}*validate(p){if(yield*this.extAttrs.validate(p),yield*this.idlType.validate(p),["async_sequence","sequence","record"].includes(this.idlType.generic)){let v=`Attributes cannot accept ${this.idlType.generic} types.`;yield i(this.tokens.name,this,"attr-invalid-type",v)}{let{reference:v}=o(this.idlType,p)||{};if(v){let S=(this.idlType.union?v:this.idlType).tokens.base;yield i(S,this,"attr-invalid-type","Attributes cannot accept dictionary types.")}}if(this.readonly&&function(v,S){if(v.union)return!1;if(v.extAttrs.some((O)=>O.name==="EnforceRange"))return!0;let A=S.unique.get(v.idlType);return A?.type==="typedef"&&A.idlType.extAttrs.some((O)=>O.name==="EnforceRange")}(this.idlType,p)){let v=this.idlType.tokens.base;yield i(v,this,"attr-invalid-type","Readonly attributes cannot accept [EnforceRange] extended attribute.")}}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.special),p.token(this.tokens.readonly),p.token(this.tokens.base),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),p.token(this.tokens.termination)]),{data:this,parent:v})}}function N(p){return p.startsWith("_")?p.slice(1):p}function q(p,{parser:v,allowDangler:S,listName:A="list"}){let O=v(p);if(!O)return[];O.tokens.separator=p.consume(",");let V=[O];for(;O.tokens.separator;){let G=v(p);if(!G){S||p.error(`Trailing comma in ${A}`);break}if(G.tokens.separator=p.consume(","),V.push(G),!G.tokens.separator)break}return V}function U(p){return p.consumeKind("decimal","integer")||p.consume("true","false","Infinity","-Infinity","NaN")}function ne({type:p,value:v}){switch(p){case"decimal":case"integer":return{type:"number",value:v};case"string":return{type:"string",value:v.slice(1,-1)}}switch(v){case"true":case"false":return{type:"boolean",value:v==="true"};case"Infinity":case"-Infinity":return{type:"Infinity",negative:v.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:v}}}function ue(p){let{source:v}=p,S=function(){let O=p.consume("unsigned"),V=p.consume("short","long");if(V){let G=p.consume("long");return new E({source:v,tokens:{prefix:O,base:V,postfix:G}})}O&&p.error("Failed to parse integer type")}()||function(){let O=p.consume("unrestricted"),V=p.consume("float","double");if(V)return new E({source:v,tokens:{prefix:O,base:V}});O&&p.error("Failed to parse float type")}();if(S)return S;let A=p.consume("bigint","boolean","byte","octet","undefined");return A?new E({source:v,tokens:{base:A}}):void 0}function ie(p){return q(p,{parser:R.parse,listName:"arguments list"})}function te(p,v){let S=x.parse(p),A=E.parse(p,v);return A&&(Z(A).extAttrs=S),A}function le(p,v){let S=E.parse(p,v||"return-type");if(S)return S;let A=p.consume("void");if(A){let O=new E({source:p.source,tokens:{base:A}});return O.type="return-type",O}}function Ce(p){let v=p.consume("stringifier");if(!v)return;return F.parse(p,{special:v})||D.parse(p,{special:v})||p.error("Unterminated stringifier")}function W(p){let v=p.split(`
599
599
  `);if(v.length){let S=v[v.length-1].match(/^\s+/);if(S)return S[0]}return""}function oe(p){return()=>{if(p.extAttrs.length){let v=new nt("Exposed=Window,"),S=b.parse(v);S.tokens.separator=v.consume(",");let A=p.extAttrs[0];/^\s/.test(A.tokens.name.trivia)||(A.tokens.name.trivia=` ${A.tokens.name.trivia}`),p.extAttrs.unshift(S)}else{Z(p).extAttrs=x.parse(new nt("[Exposed=Window]"));let v=p.tokens.base.trivia;p.extAttrs.tokens.open.trivia=v,p.tokens.base.trivia=`
600
- ${W(v)}`}}}function Q(p){if(p.extAttrs.length)return p.extAttrs.tokens.open;if(p.type==="operation"&&!p.special)return Q(p.idlType);return Object.values(p.tokens).sort((v,S)=>v.index-S.index)[0]}function Z(p,v){if(v||(v=p),!p)return p;return new Proxy(p,{get(S,A){let O=S[A];return Array.isArray(O)&&A!=="source"?Z(O,S):O},set(S,A,O){if(S[A]=O,!O)return!0;if(Array.isArray(O))for(let V of O)V.parent!==void 0&&(V.parent=v);else O.parent!==void 0&&(O.parent=v);return!0}})}let Ve={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},pe=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],Qe=["ByteString","DOMString","USVString"],z=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],dt=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(z,Qe,pe),Ze=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],er=["_constructor","toString","_toString"];class nt{constructor(p){this.source=function(v){let S=[],A=0,O="",V=1,G=0;for(;A<v.length;){let fe=v.charAt(A),ye=-1;if(/[\t\n\r ]/.test(fe)?ye=de("whitespace",{noFlushTrivia:!0}):fe==="/"&&(ye=de("comment",{noFlushTrivia:!0})),ye!==-1){let Ae=S.pop().value;V+=(Ae.match(/\n/g)||[]).length,O+=Ae,G-=1}else if(/[-0-9.A-Z_a-z]/.test(fe)){if(ye=de("decimal"),ye===-1&&(ye=de("integer")),ye===-1){ye=de("identifier");let Ae=S.length-1,Ne=S[Ae];if(ye!==-1){if(er.includes(Ne.value)){let qt=`${N(Ne.value)} is a reserved identifier and must not be used.`;throw new it(n(S,Ae,null,qt))}dt.includes(Ne.value)&&(Ne.type="inline")}}}else fe==='"'&&(ye=de("string"));for(let Ae of Ze)if(v.startsWith(Ae,A)){S.push({type:"inline",value:Ae,trivia:O,line:V,index:G}),O="",A+=Ae.length,ye=A;break}if(ye===-1&&(ye=de("other")),ye===-1)throw Error("Token stream not progressing");A=ye,G+=1}return S.push({type:"eof",value:"",trivia:O,line:V,index:G}),S;function de(fe,{noFlushTrivia:ye}={}){let Ae=Ve[fe];Ae.lastIndex=A;let Ne=Ae.exec(v);return Ne?(S.push({type:fe,value:Ne[0],trivia:O,line:V,index:G}),ye||(O=""),Ae.lastIndex):-1}}(p),this.position=0}error(p){throw new it(n(this.source,this.position,this.current,p))}probeKind(p){return this.source.length>this.position&&this.source[this.position].type===p}probe(p){return this.probeKind("inline")&&this.source[this.position].value===p}consumeKind(...p){for(let v of p){if(!this.probeKind(v))continue;let S=this.source[this.position];return this.position++,S}}consume(...p){if(!this.probeKind("inline"))return;let v=this.source[this.position];for(let S of p)if(v.value===S)return this.position++,v}consumeIdentifier(p){if(this.probeKind("identifier")&&this.source[this.position].value===p)return this.consumeKind("identifier")}unconsume(p){this.position=p}}class it extends Error{constructor({message:p,bareMessage:v,context:S,line:A,sourceName:O,input:V,tokens:G}){super(p),this.name="WebIDLParseError",this.bareMessage=v,this.context=S,this.line=A,this.sourceName=O,this.input=V,this.tokens=G}}class yr extends l{static parse(p){let v=p.consumeKind("string");if(v)return new yr({source:p.source,tokens:{value:v}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(p){let{parent:v}=this;return p.ts.wrap([p.ts.trivia(this.tokens.value.trivia),p.ts.definition(p.ts.wrap(['"',p.ts.name(this.value,{data:this,parent:v}),'"']),{data:this,parent:v}),p.token(this.tokens.separator)])}}class tr extends s{static parse(p){let v={};if(v.base=p.consume("enum"),!v.base)return;v.name=p.consumeKind("identifier")||p.error("No name for enum");let S=Z(new tr({source:p.source,tokens:v}));return p.current=S.this,v.open=p.consume("{")||p.error("Bodyless enum"),S.values=q(p,{parser:yr.parse,allowDangler:!0,listName:"enumeration"}),p.probeKind("string")&&p.error("No comma between enum values"),v.close=p.consume("}")||p.error("Unexpected value in enum"),S.values.length||p.error("No value in enum"),v.termination=p.consume(";")||p.error("No semicolon after enum"),S.this}get type(){return"enum"}get name(){return N(this.tokens.name.value)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base),p.name_token(this.tokens.name,{data:this}),p.token(this.tokens.open),p.ts.wrap(this.values.map((v)=>v.write(p))),p.token(this.tokens.close),p.token(this.tokens.termination)]),{data:this})}}class Xn extends s{static parse(p){let v=p.consumeKind("identifier");if(!v)return;let S={target:v};if(S.includes=p.consume("includes"),S.includes)return S.mixin=p.consumeKind("identifier")||p.error("Incomplete includes statement"),S.termination=p.consume(";")||p.error("No terminating ; for includes statement"),new Xn({source:p.source,tokens:S});p.unconsume(v.index)}get type(){return"includes"}get target(){return N(this.tokens.target.value)}get includes(){return N(this.tokens.mixin.value)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.reference_token(this.tokens.target,this),p.token(this.tokens.includes),p.reference_token(this.tokens.mixin,this),p.token(this.tokens.termination)]),{data:this})}}class Ii extends s{static parse(p){let v={},S=Z(new Ii({source:p.source,tokens:v}));if(v.base=p.consume("typedef"),v.base)return S.idlType=te(p,"typedef-type")||p.error("Typedef lacks a type"),v.name=p.consumeKind("identifier")||p.error("Typedef lacks a name"),p.current=S.this,v.termination=p.consume(";")||p.error("Unterminated typedef, expected `;`"),S.this}get type(){return"typedef"}get name(){return N(this.tokens.name.value)}*validate(p){yield*this.idlType.validate(p)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this}),p.token(this.tokens.termination)]),{data:this})}}class bs extends s{static parse(p,v){let S={base:v},A=Z(new bs({source:p.source,tokens:S}));return S.name=p.consumeKind("identifier")||p.error("Callback lacks a name"),p.current=A.this,S.assign=p.consume("=")||p.error("Callback lacks an assignment"),A.idlType=le(p)||p.error("Callback lacks a return type"),S.open=p.consume("(")||p.error("Callback lacks parentheses for arguments"),A.arguments=ie(p),S.close=p.consume(")")||p.error("Unterminated callback"),S.termination=p.consume(";")||p.error("Unterminated callback, expected `;`"),A.this}get type(){return"callback"}get name(){return N(this.tokens.name.value)}*validate(p){yield*this.extAttrs.validate(p);for(let v of this.arguments)if(yield*v.validate(p),v.idlType.generic==="async_sequence")yield i(v.tokens.name,v,"async-sequence-idl-to-js","async_sequence types cannot be returned as a callback argument.");yield*this.idlType.validate(p)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base),p.name_token(this.tokens.name,{data:this}),p.token(this.tokens.assign),p.ts.type(this.idlType.write(p)),p.token(this.tokens.open),...this.arguments.map((v)=>v.write(p)),p.token(this.tokens.close),p.token(this.tokens.termination)]),{data:this})}}class rr extends s{static parse(p,v,{inheritable:S,allowedMembers:A}){let{tokens:O,type:V}=v;for(O.name=p.consumeKind("identifier")||p.error(`Missing name in ${V}`),p.current=v,v=Z(v),S&&Object.assign(O,function(G){let de=G.consume(":");return de?{colon:de,inheritance:G.consumeKind("identifier")||G.error("Inheritance lacks a type")}:{}}(p)),O.open=p.consume("{")||p.error(`Bodyless ${V}`),v.members=[];;){if(O.close=p.consume("}"),O.close)return O.termination=p.consume(";")||p.error(`Missing semicolon after ${V}`),v.this;let G=x.parse(p),de;for(let[fe,...ye]of A)if(de=Z(fe(p,...ye)),de)break;de||p.error("Unknown member"),de.extAttrs=G,v.members.push(de.this)}}get partial(){return!!this.tokens.partial}get name(){return N(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?N(this.tokens.inheritance.value):null}*validate(p){for(let v of this.members)v.validate&&(yield*v.validate(p))}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.callback),p.token(this.tokens.partial),p.token(this.tokens.base),p.token(this.tokens.mixin),p.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?p.ts.wrap([p.token(this.tokens.colon),p.ts.trivia(this.tokens.inheritance.trivia),p.ts.inheritance(p.reference(this.tokens.inheritance.value,{context:this}))]):"")(),p.token(this.tokens.open),p.ts.wrap(this.members.map((v)=>v.write(p))),p.token(this.tokens.close),p.token(this.tokens.termination)]),{data:this})}}class Qn extends s{static parse(p){let v={};if(v.base=p.consume("const"),!v.base)return;let S=ue(p);if(!S){let O=p.consumeKind("identifier")||p.error("Const lacks a type");S=new E({source:p.source,tokens:{base:O}})}p.probe("?")&&p.error("Unexpected nullable constant type"),S.type="const-type",v.name=p.consumeKind("identifier")||p.error("Const lacks a name"),v.assign=p.consume("=")||p.error("Const lacks value assignment"),v.value=U(p)||p.error("Const lacks a value"),v.termination=p.consume(";")||p.error("Unterminated const, expected `;`");let A=new Qn({source:p.source,tokens:v});return Z(A).idlType=S,A}get type(){return"const"}get name(){return N(this.tokens.name.value)}get value(){return ne(this.tokens.value)}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),p.token(this.tokens.assign),p.token(this.tokens.value),p.token(this.tokens.termination)]),{data:this,parent:v})}}class Lo extends s{static parse(p){let v=p.position,S=Z(new Lo({source:p.source,tokens:{}})),{tokens:A}=S;if(A.readonly=p.consume("readonly"),A.readonly||(A.async=p.consume("async")),A.base=A.readonly?p.consume("maplike","setlike"):A.async?p.consume("iterable"):p.consume("iterable","async_iterable","maplike","setlike"),!A.base)return void p.unconsume(v);let{type:O}=S,V=O==="maplike",G=V||O==="iterable"||O==="async_iterable",de=O==="async_iterable"||S.async&&O==="iterable";A.open=p.consume("<")||p.error(`Missing less-than sign \`<\` in ${O} declaration`);let fe=te(p)||p.error(`Missing a type argument in ${O} declaration`);return S.idlType=[fe],S.arguments=[],G&&(fe.tokens.separator=p.consume(","),fe.tokens.separator?S.idlType.push(te(p)):V&&p.error(`Missing second type argument in ${O} declaration`)),A.close=p.consume(">")||p.error(`Missing greater-than sign \`>\` in ${O} declaration`),p.probe("(")&&(de?(A.argsOpen=p.consume("("),S.arguments.push(...ie(p)),A.argsClose=p.consume(")")||p.error("Unterminated async iterable argument list")):p.error("Arguments are only allowed for `async iterable`")),A.termination=p.consume(";")||p.error(`Missing semicolon after ${O} declaration`),S.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(p){if(this.async&&this.type==="iterable")yield i(this.tokens.async,this,"obsolete-async-iterable-syntax","`async iterable` is now changed to `async_iterable`.",{autofix:(v=this,()=>{let A=v.tokens.async;v.tokens.base={...A,type:"async_iterable",value:"async_iterable"},delete v.tokens.async})});var v;for(let S of this.idlType)yield*S.validate(p);for(let S of this.arguments)yield*S.validate(p)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.readonly),p.token(this.tokens.async),p.token(this.tokens.base,p.ts.generic),p.token(this.tokens.open),p.ts.wrap(this.idlType.map((v)=>v.write(p))),p.token(this.tokens.close),p.token(this.tokens.argsOpen),p.ts.wrap(this.arguments.map((v)=>v.write(p))),p.token(this.tokens.argsClose),p.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class ln extends s{static parse(p){let v=p.consume("constructor");if(!v)return;let S={base:v};S.open=p.consume("(")||p.error("No argument list in constructor");let A=ie(p);S.close=p.consume(")")||p.error("Unterminated constructor"),S.termination=p.consume(";")||p.error("No semicolon after constructor");let O=new ln({source:p.source,tokens:S});return Z(O).arguments=A,O}get type(){return"constructor"}*validate(p){for(let v of this.arguments)yield*v.validate(p)}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base,p.ts.nameless,{data:this,parent:v}),p.token(this.tokens.open),p.ts.wrap(this.arguments.map((S)=>S.write(p))),p.token(this.tokens.close),p.token(this.tokens.termination)]),{data:this,parent:v})}}function $c(p){let v=p.consume("static");if(!v)return;return F.parse(p,{special:v})||D.parse(p,{special:v})||p.error("No body in static member")}class xs extends rr{static parse(p,v,{extMembers:S=[],partial:A=null}={}){let O={partial:A,base:v};return rr.parse(p,new xs({source:p.source,tokens:O}),{inheritable:!A,allowedMembers:[...S,[Qn.parse],[ln.parse],[$c],[Ce],[Lo.parse],[F.parse],[D.parse]]})}get type(){return"interface"}*validate(p){if(yield*this.extAttrs.validate(p),!this.partial&&this.extAttrs.every((S)=>S.name!=="Exposed"))yield i(this.tokens.name,this,"require-exposed","Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:oe(this)});let v=this.extAttrs.filter((S)=>S.name==="Constructor");for(let S of v)yield i(S.tokens.name,this,"constructor-member","Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.",{autofix:M(this,S)});if(this.extAttrs.some((S)=>S.name==="Global")){let S=this.extAttrs.filter((O)=>O.name==="LegacyFactoryFunction");for(let O of S)yield i(O.tokens.name,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have factory functions.");let A=this.members.filter((O)=>O.type==="constructor");for(let O of A)yield i(O.tokens.base,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have constructors.")}yield*super.validate(p),this.partial||(yield*function*(S,A){let O=function(ye){let Ae=fe(ye);return{statics:new Set(Ae.filter((Ne)=>Ne.special==="static").map((Ne)=>Ne.name)),nonstatics:new Set(Ae.filter((Ne)=>Ne.special!=="static").map((Ne)=>Ne.name))}}(A),V=S.partials.get(A.name)||[],G=S.mixinMap.get(A.name)||[];for(let ye of[...V,...G]){let Ae=fe(ye),Ne=Ae.filter((nr)=>nr.special==="static"),qt=Ae.filter((nr)=>nr.special!=="static");yield*de(Ne,O.statics,ye,A),yield*de(qt,O.nonstatics,ye,A),Ne.forEach((nr)=>O.statics.add(nr.name)),qt.forEach((nr)=>O.nonstatics.add(nr.name))}function*de(ye,Ae,Ne,qt){for(let nr of ye){let{name:Do}=nr;if(Do&&Ae.has(Do)){let nf=`The ${nr.special==="static"?"static ":""}operation "${Do}" has already been defined for the base interface "${qt.name}" either in itself or in a mixin`;yield i(nr.tokens.name,Ne,"no-cross-overload",nf)}}}function fe(ye){return ye.members.filter(({type:Ae})=>Ae==="operation")}}(p,this))}}function M(p,v){return p=Z(p),()=>{let S=W(p.extAttrs.tokens.open.trivia),A=p.members.length?W(Q(p.members[0]).trivia):function(Ae){let Ne=W(Ae),qt=Ne.includes("\t")?"\t":" ";return Ne+qt}(S),O=ln.parse(new nt(`
600
+ ${W(v)}`}}}function Q(p){if(p.extAttrs.length)return p.extAttrs.tokens.open;if(p.type==="operation"&&!p.special)return Q(p.idlType);return Object.values(p.tokens).sort((v,S)=>v.index-S.index)[0]}function Z(p,v){if(v||(v=p),!p)return p;return new Proxy(p,{get(S,A){let O=S[A];return Array.isArray(O)&&A!=="source"?Z(O,S):O},set(S,A,O){if(S[A]=O,!O)return!0;if(Array.isArray(O))for(let V of O)V.parent!==void 0&&(V.parent=v);else O.parent!==void 0&&(O.parent=v);return!0}})}let Ve={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},pe=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],Qe=["ByteString","DOMString","USVString"],z=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],dt=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(z,Qe,pe),Ze=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],er=["_constructor","toString","_toString"];class nt{constructor(p){this.source=function(v){let S=[],A=0,O="",V=1,G=0;for(;A<v.length;){let fe=v.charAt(A),ye=-1;if(/[\t\n\r ]/.test(fe)?ye=de("whitespace",{noFlushTrivia:!0}):fe==="/"&&(ye=de("comment",{noFlushTrivia:!0})),ye!==-1){let Ae=S.pop().value;V+=(Ae.match(/\n/g)||[]).length,O+=Ae,G-=1}else if(/[-0-9.A-Z_a-z]/.test(fe)){if(ye=de("decimal"),ye===-1&&(ye=de("integer")),ye===-1){ye=de("identifier");let Ae=S.length-1,Ne=S[Ae];if(ye!==-1){if(er.includes(Ne.value)){let qt=`${N(Ne.value)} is a reserved identifier and must not be used.`;throw new it(n(S,Ae,null,qt))}dt.includes(Ne.value)&&(Ne.type="inline")}}}else fe==='"'&&(ye=de("string"));for(let Ae of Ze)if(v.startsWith(Ae,A)){S.push({type:"inline",value:Ae,trivia:O,line:V,index:G}),O="",A+=Ae.length,ye=A;break}if(ye===-1&&(ye=de("other")),ye===-1)throw Error("Token stream not progressing");A=ye,G+=1}return S.push({type:"eof",value:"",trivia:O,line:V,index:G}),S;function de(fe,{noFlushTrivia:ye}={}){let Ae=Ve[fe];Ae.lastIndex=A;let Ne=Ae.exec(v);return Ne?(S.push({type:fe,value:Ne[0],trivia:O,line:V,index:G}),ye||(O=""),Ae.lastIndex):-1}}(p),this.position=0}error(p){throw new it(n(this.source,this.position,this.current,p))}probeKind(p){return this.source.length>this.position&&this.source[this.position].type===p}probe(p){return this.probeKind("inline")&&this.source[this.position].value===p}consumeKind(...p){for(let v of p){if(!this.probeKind(v))continue;let S=this.source[this.position];return this.position++,S}}consume(...p){if(!this.probeKind("inline"))return;let v=this.source[this.position];for(let S of p)if(v.value===S)return this.position++,v}consumeIdentifier(p){if(this.probeKind("identifier")&&this.source[this.position].value===p)return this.consumeKind("identifier")}unconsume(p){this.position=p}}class it extends Error{constructor({message:p,bareMessage:v,context:S,line:A,sourceName:O,input:V,tokens:G}){super(p),this.name="WebIDLParseError",this.bareMessage=v,this.context=S,this.line=A,this.sourceName=O,this.input=V,this.tokens=G}}class yr extends l{static parse(p){let v=p.consumeKind("string");if(v)return new yr({source:p.source,tokens:{value:v}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(p){let{parent:v}=this;return p.ts.wrap([p.ts.trivia(this.tokens.value.trivia),p.ts.definition(p.ts.wrap(['"',p.ts.name(this.value,{data:this,parent:v}),'"']),{data:this,parent:v}),p.token(this.tokens.separator)])}}class tr extends s{static parse(p){let v={};if(v.base=p.consume("enum"),!v.base)return;v.name=p.consumeKind("identifier")||p.error("No name for enum");let S=Z(new tr({source:p.source,tokens:v}));return p.current=S.this,v.open=p.consume("{")||p.error("Bodyless enum"),S.values=q(p,{parser:yr.parse,allowDangler:!0,listName:"enumeration"}),p.probeKind("string")&&p.error("No comma between enum values"),v.close=p.consume("}")||p.error("Unexpected value in enum"),S.values.length||p.error("No value in enum"),v.termination=p.consume(";")||p.error("No semicolon after enum"),S.this}get type(){return"enum"}get name(){return N(this.tokens.name.value)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base),p.name_token(this.tokens.name,{data:this}),p.token(this.tokens.open),p.ts.wrap(this.values.map((v)=>v.write(p))),p.token(this.tokens.close),p.token(this.tokens.termination)]),{data:this})}}class Xn extends s{static parse(p){let v=p.consumeKind("identifier");if(!v)return;let S={target:v};if(S.includes=p.consume("includes"),S.includes)return S.mixin=p.consumeKind("identifier")||p.error("Incomplete includes statement"),S.termination=p.consume(";")||p.error("No terminating ; for includes statement"),new Xn({source:p.source,tokens:S});p.unconsume(v.index)}get type(){return"includes"}get target(){return N(this.tokens.target.value)}get includes(){return N(this.tokens.mixin.value)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.reference_token(this.tokens.target,this),p.token(this.tokens.includes),p.reference_token(this.tokens.mixin,this),p.token(this.tokens.termination)]),{data:this})}}class Ii extends s{static parse(p){let v={},S=Z(new Ii({source:p.source,tokens:v}));if(v.base=p.consume("typedef"),v.base)return S.idlType=te(p,"typedef-type")||p.error("Typedef lacks a type"),v.name=p.consumeKind("identifier")||p.error("Typedef lacks a name"),p.current=S.this,v.termination=p.consume(";")||p.error("Unterminated typedef, expected `;`"),S.this}get type(){return"typedef"}get name(){return N(this.tokens.name.value)}*validate(p){yield*this.idlType.validate(p)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this}),p.token(this.tokens.termination)]),{data:this})}}class bs extends s{static parse(p,v){let S={base:v},A=Z(new bs({source:p.source,tokens:S}));return S.name=p.consumeKind("identifier")||p.error("Callback lacks a name"),p.current=A.this,S.assign=p.consume("=")||p.error("Callback lacks an assignment"),A.idlType=le(p)||p.error("Callback lacks a return type"),S.open=p.consume("(")||p.error("Callback lacks parentheses for arguments"),A.arguments=ie(p),S.close=p.consume(")")||p.error("Unterminated callback"),S.termination=p.consume(";")||p.error("Unterminated callback, expected `;`"),A.this}get type(){return"callback"}get name(){return N(this.tokens.name.value)}*validate(p){yield*this.extAttrs.validate(p);for(let v of this.arguments)if(yield*v.validate(p),v.idlType.generic==="async_sequence")yield i(v.tokens.name,v,"async-sequence-idl-to-js","async_sequence types cannot be returned as a callback argument.");yield*this.idlType.validate(p)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base),p.name_token(this.tokens.name,{data:this}),p.token(this.tokens.assign),p.ts.type(this.idlType.write(p)),p.token(this.tokens.open),...this.arguments.map((v)=>v.write(p)),p.token(this.tokens.close),p.token(this.tokens.termination)]),{data:this})}}class rr extends s{static parse(p,v,{inheritable:S,allowedMembers:A}){let{tokens:O,type:V}=v;for(O.name=p.consumeKind("identifier")||p.error(`Missing name in ${V}`),p.current=v,v=Z(v),S&&Object.assign(O,function(G){let de=G.consume(":");return de?{colon:de,inheritance:G.consumeKind("identifier")||G.error("Inheritance lacks a type")}:{}}(p)),O.open=p.consume("{")||p.error(`Bodyless ${V}`),v.members=[];;){if(O.close=p.consume("}"),O.close)return O.termination=p.consume(";")||p.error(`Missing semicolon after ${V}`),v.this;let G=x.parse(p),de;for(let[fe,...ye]of A)if(de=Z(fe(p,...ye)),de)break;de||p.error("Unknown member"),de.extAttrs=G,v.members.push(de.this)}}get partial(){return!!this.tokens.partial}get name(){return N(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?N(this.tokens.inheritance.value):null}*validate(p){for(let v of this.members)v.validate&&(yield*v.validate(p))}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.callback),p.token(this.tokens.partial),p.token(this.tokens.base),p.token(this.tokens.mixin),p.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?p.ts.wrap([p.token(this.tokens.colon),p.ts.trivia(this.tokens.inheritance.trivia),p.ts.inheritance(p.reference(this.tokens.inheritance.value,{context:this}))]):"")(),p.token(this.tokens.open),p.ts.wrap(this.members.map((v)=>v.write(p))),p.token(this.tokens.close),p.token(this.tokens.termination)]),{data:this})}}class Qn extends s{static parse(p){let v={};if(v.base=p.consume("const"),!v.base)return;let S=ue(p);if(!S){let O=p.consumeKind("identifier")||p.error("Const lacks a type");S=new E({source:p.source,tokens:{base:O}})}p.probe("?")&&p.error("Unexpected nullable constant type"),S.type="const-type",v.name=p.consumeKind("identifier")||p.error("Const lacks a name"),v.assign=p.consume("=")||p.error("Const lacks value assignment"),v.value=U(p)||p.error("Const lacks a value"),v.termination=p.consume(";")||p.error("Unterminated const, expected `;`");let A=new Qn({source:p.source,tokens:v});return Z(A).idlType=S,A}get type(){return"const"}get name(){return N(this.tokens.name.value)}get value(){return ne(this.tokens.value)}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),p.token(this.tokens.assign),p.token(this.tokens.value),p.token(this.tokens.termination)]),{data:this,parent:v})}}class Lo extends s{static parse(p){let v=p.position,S=Z(new Lo({source:p.source,tokens:{}})),{tokens:A}=S;if(A.readonly=p.consume("readonly"),A.readonly||(A.async=p.consume("async")),A.base=A.readonly?p.consume("maplike","setlike"):A.async?p.consume("iterable"):p.consume("iterable","async_iterable","maplike","setlike"),!A.base)return void p.unconsume(v);let{type:O}=S,V=O==="maplike",G=V||O==="iterable"||O==="async_iterable",de=O==="async_iterable"||S.async&&O==="iterable";A.open=p.consume("<")||p.error(`Missing less-than sign \`<\` in ${O} declaration`);let fe=te(p)||p.error(`Missing a type argument in ${O} declaration`);return S.idlType=[fe],S.arguments=[],G&&(fe.tokens.separator=p.consume(","),fe.tokens.separator?S.idlType.push(te(p)):V&&p.error(`Missing second type argument in ${O} declaration`)),A.close=p.consume(">")||p.error(`Missing greater-than sign \`>\` in ${O} declaration`),p.probe("(")&&(de?(A.argsOpen=p.consume("("),S.arguments.push(...ie(p)),A.argsClose=p.consume(")")||p.error("Unterminated async iterable argument list")):p.error("Arguments are only allowed for `async iterable`")),A.termination=p.consume(";")||p.error(`Missing semicolon after ${O} declaration`),S.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(p){if(this.async&&this.type==="iterable")yield i(this.tokens.async,this,"obsolete-async-iterable-syntax","`async iterable` is now changed to `async_iterable`.",{autofix:(v=this,()=>{let A=v.tokens.async;v.tokens.base={...A,type:"async_iterable",value:"async_iterable"},delete v.tokens.async})});var v;for(let S of this.idlType)yield*S.validate(p);for(let S of this.arguments)yield*S.validate(p)}write(p){return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.readonly),p.token(this.tokens.async),p.token(this.tokens.base,p.ts.generic),p.token(this.tokens.open),p.ts.wrap(this.idlType.map((v)=>v.write(p))),p.token(this.tokens.close),p.token(this.tokens.argsOpen),p.ts.wrap(this.arguments.map((v)=>v.write(p))),p.token(this.tokens.argsClose),p.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class ln extends s{static parse(p){let v=p.consume("constructor");if(!v)return;let S={base:v};S.open=p.consume("(")||p.error("No argument list in constructor");let A=ie(p);S.close=p.consume(")")||p.error("Unterminated constructor"),S.termination=p.consume(";")||p.error("No semicolon after constructor");let O=new ln({source:p.source,tokens:S});return Z(O).arguments=A,O}get type(){return"constructor"}*validate(p){for(let v of this.arguments)yield*v.validate(p)}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.base,p.ts.nameless,{data:this,parent:v}),p.token(this.tokens.open),p.ts.wrap(this.arguments.map((S)=>S.write(p))),p.token(this.tokens.close),p.token(this.tokens.termination)]),{data:this,parent:v})}}function $c(p){let v=p.consume("static");if(!v)return;return F.parse(p,{special:v})||D.parse(p,{special:v})||p.error("No body in static member")}class xs extends rr{static parse(p,v,{extMembers:S=[],partial:A=null}={}){let O={partial:A,base:v};return rr.parse(p,new xs({source:p.source,tokens:O}),{inheritable:!A,allowedMembers:[...S,[Qn.parse],[ln.parse],[$c],[Ce],[Lo.parse],[F.parse],[D.parse]]})}get type(){return"interface"}*validate(p){if(yield*this.extAttrs.validate(p),!this.partial&&this.extAttrs.every((S)=>S.name!=="Exposed"))yield i(this.tokens.name,this,"require-exposed","Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:oe(this)});let v=this.extAttrs.filter((S)=>S.name==="Constructor");for(let S of v)yield i(S.tokens.name,this,"constructor-member","Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.",{autofix:M(this,S)});if(this.extAttrs.some((S)=>S.name==="Global")){let S=this.extAttrs.filter((O)=>O.name==="LegacyFactoryFunction");for(let O of S)yield i(O.tokens.name,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have factory functions.");let A=this.members.filter((O)=>O.type==="constructor");for(let O of A)yield i(O.tokens.base,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have constructors.")}yield*super.validate(p),this.partial||(yield*function*(S,A){let O=function(ye){let Ae=fe(ye);return{statics:new Set(Ae.filter((Ne)=>Ne.special==="static").map((Ne)=>Ne.name)),nonstatics:new Set(Ae.filter((Ne)=>Ne.special!=="static").map((Ne)=>Ne.name))}}(A),V=S.partials.get(A.name)||[],G=S.mixinMap.get(A.name)||[];for(let ye of[...V,...G]){let Ae=fe(ye),Ne=Ae.filter((nr)=>nr.special==="static"),qt=Ae.filter((nr)=>nr.special!=="static");yield*de(Ne,O.statics,ye,A),yield*de(qt,O.nonstatics,ye,A),Ne.forEach((nr)=>O.statics.add(nr.name)),qt.forEach((nr)=>O.nonstatics.add(nr.name))}function*de(ye,Ae,Ne,qt){for(let nr of ye){let{name:Do}=nr;if(Do&&Ae.has(Do)){let sf=`The ${nr.special==="static"?"static ":""}operation "${Do}" has already been defined for the base interface "${qt.name}" either in itself or in a mixin`;yield i(nr.tokens.name,Ne,"no-cross-overload",sf)}}}function fe(ye){return ye.members.filter(({type:Ae})=>Ae==="operation")}}(p,this))}}function M(p,v){return p=Z(p),()=>{let S=W(p.extAttrs.tokens.open.trivia),A=p.members.length?W(Q(p.members[0]).trivia):function(Ae){let Ne=W(Ae),qt=Ne.includes("\t")?"\t":" ";return Ne+qt}(S),O=ln.parse(new nt(`
601
601
  ${A}constructor();`));O.extAttrs=new x({source:p.source,tokens:{}}),Z(O).arguments=v.arguments;let V=function(Ae,Ne){let qt=Ae.slice().reverse().findIndex(Ne);return qt===-1?qt:Ae.length-qt-1}(p.members,(Ae)=>Ae.type==="constructor");p.members.splice(V+1,0,O);let{close:G}=p.tokens;G.trivia.includes(`
602
602
  `)||(G.trivia+=`
603
- ${S}`);let{extAttrs:de}=p,fe=de.indexOf(v),ye=de.splice(fe,1);de.length?de.length===fe?de[fe-1].tokens.separator=void 0:de[fe].tokens.name.trivia.trim()||(de[fe].tokens.name.trivia=ye[0].tokens.name.trivia):de.tokens.open=de.tokens.close=void 0}}class H extends rr{static parse(p,v,{extMembers:S=[],partial:A}={}){let O={partial:A,base:v};if(O.mixin=p.consume("mixin"),O.mixin)return rr.parse(p,new H({source:p.source,tokens:O}),{allowedMembers:[...S,[Qn.parse],[Ce],[F.parse,{noInherit:!0}],[D.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class B extends s{static parse(p){let v={},S=Z(new B({source:p.source,tokens:v}));return S.extAttrs=x.parse(p),v.required=p.consume("required"),S.idlType=te(p,"dictionary-type")||p.error("Dictionary member lacks a type"),v.name=p.consumeKind("identifier")||p.error("Dictionary member lacks a name"),S.default=P.parse(p),v.required&&S.default&&p.error("Required member must not have a default"),v.termination=p.consume(";")||p.error("Unterminated dictionary member, expected `;`"),S.this}get type(){return"field"}get name(){return N(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(p){yield*this.idlType.validate(p)}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.required),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),this.default?this.default.write(p):"",p.token(this.tokens.termination)]),{data:this,parent:v})}}class ae extends rr{static parse(p,{extMembers:v=[],partial:S}={}){let A={partial:S};if(A.base=p.consume("dictionary"),A.base)return rr.parse(p,new ae({source:p.source,tokens:A}),{inheritable:!S,allowedMembers:[...v,[B.parse]]})}get type(){return"dictionary"}}class we extends rr{static parse(p,{extMembers:v=[],partial:S}={}){let A={partial:S};if(A.base=p.consume("namespace"),A.base)return rr.parse(p,new we({source:p.source,tokens:A}),{allowedMembers:[...v,[F.parse,{noInherit:!0,readonly:!0}],[Qn.parse],[D.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(p){if(!this.partial&&this.extAttrs.every((v)=>v.name!=="Exposed"))yield i(this.tokens.name,this,"require-exposed","Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:oe(this)});yield*super.validate(p)}}class gt extends rr{static parse(p,v,{extMembers:S=[]}={}){let A={callback:v};if(A.base=p.consume("interface"),A.base)return rr.parse(p,new gt({source:p.source,tokens:A}),{allowedMembers:[...S,[Qn.parse],[D.parse,{regular:!0}]]})}get type(){return"callback interface"}}function st(p,v){let S=p.source;function A(fe){p.error(fe)}function O(...fe){return p.consume(...fe)}function V(fe){let ye=O("interface");if(ye)return H.parse(p,ye,{...fe,...v?.extensions?.mixin})||xs.parse(p,ye,{...fe,...v?.extensions?.interface})||A("Interface has no proper body")}function G(){if(v.productions)for(let fe of v.productions){let ye=fe(p);if(ye)return ye}return function(){let fe=O("callback");if(fe)return p.probe("interface")?gt.parse(p,fe,{...v?.extensions?.callbackInterface}):bs.parse(p,fe)}()||V()||function(){let fe=O("partial");if(fe)return ae.parse(p,{partial:fe,...v?.extensions?.dictionary})||V({partial:fe})||we.parse(p,{partial:fe,...v?.extensions?.namespace})||A("Partial doesn't apply to anything")}()||ae.parse(p,v?.extensions?.dictionary)||tr.parse(p)||Ii.parse(p)||Xn.parse(p)||we.parse(p,v?.extensions?.namespace)}let de=function(){if(!S.length)return[];let fe=[];for(;;){let Ae=x.parse(p),Ne=G();if(!Ne){Ae.length&&A("Stray extended attributes");break}Z(Ne).extAttrs=Ae,fe.push(Ne)}let ye=u.parse(p);return v.concrete&&fe.push(ye),fe}();return p.position<S.length&&A("Unrecognised tokens"),de}function jt(p,v={}){let S=new nt(p);return v.sourceName!==void 0&&(S.source.name=v.sourceName),st(S,v)}function me(p){return p}let ot={wrap:(p)=>p.join(""),trivia:me,name:me,reference:me,type:me,generic:me,nameless:me,inheritance:me,definition:me,extendedAttribute:me,extendedAttributeReference:me};class We{constructor(p){this.ts=Object.assign({},ot,p)}reference(p,{unescaped:v,context:S}){return v||(v=p.startsWith("_")?p.slice(1):p),this.ts.reference(p,v,S)}token(p,v=me,...S){if(!p)return"";let A=v(p.value,...S);return this.ts.wrap([this.ts.trivia(p.trivia),A])}reference_token(p,v){return this.token(p,this.reference.bind(this),{context:v})}name_token(p,v){return this.token(p,this.ts.name,v)}identifier(p,v){return this.ts.wrap([this.reference_token(p.tokens.value,v),this.token(p.tokens.separator)])}}function Ft(p,{templates:v=ot}={}){v=Object.assign({},ot,v);let S=new We(v);return v.wrap(p.map((A)=>A.write(S)))}function rf(p,v){let S=new Map,A=p.filter((O)=>O.type==="includes");for(let O of A){let V=v.get(O.includes);if(!V)continue;let G=S.get(O.target);G?G.push(V):S.set(O.target,[V])}return S}function*vc(p){let v=function(S){let A=new Map,O=new Set,V=new Map;for(let G of S)if(G.partial){let de=V.get(G.name);de?de.push(G):V.set(G.name,[G])}else G.name&&(A.has(G.name)?O.add(G):A.set(G.name,G));return{all:S,unique:A,partials:V,duplicates:O,mixinMap:rf(S,A),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(p);for(let S of v.all)S.validate&&(yield*S.validate(v));yield*function*({unique:S,duplicates:A}){for(let O of A){let{name:V}=O,G=`The name "${V}" of type "${S.get(V).type}" was already seen`;yield i(O.tokens.name,O,"no-duplicate",G)}}(v)}function cC(p){return[...vc((v=p,v.flat?v.flat():[].concat(...v)))];var v}return t})())});var j1=C(function(woe,A1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",E1=De("fs").promises,_1=De("path"),CU=S1();class P1{constructor(e,t){this.filename=t,this.shortname=_1.basename(t,".idl"),this.path=_1.join(e,t)}async text(){return await E1.readFile(this.path,"utf8")}async parse(){let e=await this.text();return CU.parse(e)}}async function k1({folder:e=__dirname}={}){let t={},r=await E1.readdir(e);for(let n of r)if(n.endsWith(".idl")){let i=new P1(e,n);t[i.shortname]=i}return t}async function IU(e){let t=await k1(e);for(let[r,n]of Object.entries(t))t[r]=await n.parse();return t}A1.exports={listAll:k1,parseAll:IU}});var R1,O1;var C1=L(()=>{R1={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},O1={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var I1;var T1=L(()=>{I1={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"}});var N1,M1,L1;var D1=L(()=>{N1={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},M1={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},L1={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var J1;var F1=L(()=>{J1={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"}});var q1,B1;var H1=L(()=>{q1={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},B1={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var U1;var V1=L(()=>{U1={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var W1,z1,K1,G1,Y1,X1,Q1,Z1,e_;var t_=L(()=>{W1={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:"^#/\\$defs/",type:"string"},z1={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},K1={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:"^(\\./|\\.\\./).*\\.json$|^https?://",type:"string"},G1={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Y1={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},X1={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:"^\\$map/(item|index)(/.*)?$",type:"string"},Q1={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Z1={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},e_={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var uu;var r_=L(()=>{uu={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"}});var n_,i_;var s_=L(()=>{n_={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item. A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:"^\\$map/item(/.+)?$",type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},i_={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:"\\$\\{",type:"string"}]}});var o_,a_,c_,l_,u_,Om;var f_=L(()=>{o_={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},a_={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},c_={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},l_={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"},u_={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},Om={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/ElementTagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var d_;var p_=L(()=>{d_={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var m_;var h_=L(()=>{m_={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: an opaque JS source string (first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var g_,y_;var b_=L(()=>{g_={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed), or the two WHATWG event verbs stopPropagation and preventDefault, each spelled as the member set to true.",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"},{additionalProperties:!1,properties:{stopPropagation:{const:!0,description:"Stop the handler's event at the current target (WHATWG DOM stopPropagation), so an ancestor's handler for the same event does not run. A body run without an event has nothing to stop."}},required:["stopPropagation"],title:"stopPropagation — stop the event here (WHATWG DOM)",type:"object"},{additionalProperties:!1,properties:{preventDefault:{const:!0,description:"Cancel the handler's event's default action (WHATWG DOM preventDefault): a link's navigation, a form's submission, a key's scroll."}},required:["preventDefault"],title:"preventDefault — cancel the event's default action (WHATWG DOM)",type:"object"}]},y_={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var x_;var $_=L(()=>{x_={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},filter:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single filter object, e.g. an equality shorthand.",type:"object"},{description:'Ordered filter rules, e.g. [{ field: "Slug", op: "not empty" }].',items:{type:"object"},type:"array"}],description:"Filter configuration: a reactive $ref binding, a single filter object, or an ordered array of rules."},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var v_;var w_=L(()=>{v_={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});var S_,E_,__,P_,k_,A_,j_,R_,O_,C_,I_,T_,N_,M_,L_,D_,J_;var F_=L(()=>{Nf();S_={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:"^(\\$map/|\\$reduce/|\\$args/|event#/|#/|parent#/|window#/|document#/)",type:"string"}},required:["$ref"],type:"object"},E_={anyOf:[{not:{pattern:"\\$\\{"},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},__={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},P_={enum:["!","-"]},k_={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},A_={const:"?:"},j_={const:"switch"},R_={const:"call"},O_={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]},C_={enum:["=","+=","-=","*=","/="]},I_={enum:["pop","shift"]},T_={enum:["push","unshift"]},N_={const:"splice"},M_={const:"reduce"},L_={enum:["map","filter"]},D_={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${Qy()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},J_={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var q_,B_,H_,U_;var V_=L(()=>{q_={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},B_={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},H_={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},U_={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var TU,Cm,Im,Tm,Nm,Mm,Lm,Dm,Jm,Fm,W_;var z_=L(()=>{TU=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],Cm={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},Im={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},Tm={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},Nm={description:"A class method or accessor definition. Capability roles (parse, serialize, rewrite, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:TU,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},Mm={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:"^\\.",type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},Lm={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Dm={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},Jm={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},Fm={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},W_={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});var K_;var G_=L(()=>{K_={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var fu;var Y_=L(()=>{fu={description:"Image optimization configuration for the project.",properties:{formats:{items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},picture:{description:"Wrap a multi-format image in a <picture> with one <source> per format (default true). With it off the <img> carries a srcset in the preferred format alone, which browsers that cannot decode that format will still select from.",type:"boolean"},quality:{properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" runs Sharp at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var NU,qm;var X_=L(()=>{zi();NU=[301,302,303,307,308],qm={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"Global type definitions available to all pages.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:"utf8",description:"Default charset for the page.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:Fc,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:Fc,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:Fc,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...NU],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});function MU(){return Q_??=LU(),Q_}async function LU(){let[e,t,r]=await Promise.all([eP.listAll(),tP.default.listAll(),rP.default.parseAll()]),n=new Set;for(let{elements:l}of Object.values(e))for(let u of l)if(!u.obsolete)n.add(u.name);let i=[...n].toSorted(),s=new Set;for(let l of t.properties)for(let u of l.styleDeclaration??[])s.add(u);let o=[...s].toSorted(),a=new Set;for(let l of Object.values(r))for(let u of l){if(u.type!=="interface"&&u.type!=="interface mixin")continue;if(!u.members)continue;for(let d of u.members)if(d.type==="attribute"&&d.name?.startsWith("on")&&d.idlType?.idlType==="EventHandler")a.add(d.name)}let c=[...a].toSorted();return{cssProps:o,eventHandlers:c,tagExamples:i}}function DU(e){let t={};for(let r of e)t[r]={description:`Event handler for the "${r.slice(2)}" event.`,oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]};return t}function JU(e){let t={...uu.properties};for(let r of e)t[r]={oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"}]};return t}async function FU(){let{tagExamples:e,cssProps:t,eventHandlers:r}=await MU();return{$defs:{DefsMap:H_,TypeDefEntry:U_,StateMap:B_,StateEntry:q_,TypedStateDef:d_,PureTypeDef:v_,FunctionDef:m_,ClassDef:W_,ClassParameterDef:Cm,ClassFieldDef:Im,ClassConstructorDef:Tm,ClassMethodDef:Nm,FormatDef:Mm,ProjectBlockDef:Lm,ServerBlockDef:Dm,ConnectorBlockDef:Jm,StudioHints:Fm,ExternalClassDef:x_,ExpressionPointer:S_,ExpressionLiteral:E_,ExpressionOperand:__,UnaryOperator:P_,BinaryOperator:k_,ConditionalOperator:A_,SwitchOperator:j_,CallOperator:R_,PureMethod:O_,AssignmentOperator:C_,NoArgMethod:I_,OneArgMethod:T_,SpliceMethod:N_,ReduceMethod:M_,MapFilterMethod:L_,ExpressionNode:D_,ExpressionEntry:J_,Statement:g_,StatementList:y_,ElementDef:{...Om,properties:{...Om.properties,...DU(r)}},ChildrenValue:i_,ArrayNamespace:n_,SwitchDef:l_,SwitchNode:u_,StyleObject:{...uu,properties:JU(t)},AttributesObject:o_,PropsObject:a_,RefObject:Z1,AnyRef:Q1,InternalRef:W1,StateRef:z1,ExternalRef:K1,ExternalComponentRef:e_,GlobalRef:G1,ParentRef:Y1,MapRef:X1,ElementPropertyValue:c_,StringOrRef:N1,BoolOrRef:M1,NumberOrRef:L1,CemParameter:q1,CemEvent:B1,TagName:{...I1,examples:[...e,"my-counter","todo-app","user-card"]},TagExpression:R1,ElementTagName:O1,JsonSchemaType:U1,HeadEntry:J1,ImageConfig:fu,PathsValue:{$id:cs,anyOf:[...Fa,Em],description:"Default $paths source union: the core shapes, plus a catch-all for source shapes contributed by extensions this schema cannot see. The project's generated document.schema.json replaces this with the exact set its extensions provide."}},$id:"https://jxsuite.com/schema/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"Schema for Jx component files. A Jx document is a JSON object that declaratively describes a reactive web component: its structure (DOM tree), styling, type definitions ($defs), runtime state, and inline or external functions. Reactivity is powered by @vue/reactivity.",properties:{$defs:{$ref:"#/$defs/DefsMap",description:"Pure JSON Schema type definitions for this component. "+"All entries are reusable type schemas — no runtime artifacts are produced. "+"Referenced from state entries via $ref. Naming convention: PascalCase."},$elements:{description:"Custom element dependencies. Items are either $ref objects pointing to JX element definitions, or bare npm package name strings for web component libraries.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{description:"npm package specifier (must declare customElements in package.json)",type:"string"}]},type:"array"},$head:{description:"Page-level <head> entries. Array of head entries for meta tags, link tags, script tags, etc. Merged with layout and site-level $head entries.",items:{$ref:"#/$defs/HeadEntry"},type:"array"},$id:{description:"Component identifier string. Used by tooling and the builder.",examples:["Counter","TodoApp","UserCard"],type:"string"},$dir:{description:"Base direction for this page's <html> element, overriding `defaults.dir`. Right-to-left content renders left-to-right without it.",enum:["ltr","rtl","auto"],type:"string"},$lang:{description:"Language tag for this page's <html> element, overriding `defaults.lang` "+"(site-architecture.md §8.4).",examples:["en","fr","ar-EG"],type:"string"},$translationKey:{description:"This page's identity across languages, overriding the one its path implies "+"(site-architecture.md §13.5). Two routes are translations when their keys match; "+"the default key is the path with the locale prefix removed, which is right whenever "+"the paths are parallel and wrong for a localized slug — /fr-ca/a-propos/ shares "+"nothing with /about/ until one of them says so.",examples:["about","blog/hello-world"],type:"string"},$layout:{description:"Layout reference for pages. String path to a layout JSON file, or false to opt out of the default layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{const:!1,type:"boolean"}]},$shadow:{description:"Render this component into a shadow root instead of the light DOM (spec.md §16.6). "+"Off unless set: a shadow root isolates the component's styles from the page and replaces the <slot> emulation with real slot distribution, so it changes how the "+"component composes. Overrides `defaults.shadow` in both directions — `false` opts "+"one component out of a project that opted in.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]},$sitemap:{description:"Set false to exclude this page from sitemap.xml (site-architecture.md §8.4.1). "+"Every other page with a URL is included.",type:"boolean"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Keys use the CSS custom property -- prefix. Pure color-scheme queries (e.g. "--dark": "(prefers-color-scheme: dark)") are dual-emitted so a data-color-scheme attribute on the root element forces the scheme '+"regardless of the OS preference (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$paths:{$ref:cs,description:"Dynamic route source for a page: expands one page per entry at build time. One of the core shapes (explicit `values`, a `$ref` data file, or a bare array of parameter objects) or a source shape contributed by an enabled extension, such as the parser's `contentType`."},$schema:{description:"URI identifying the Jx dialect version. Enables schema-aware IDE tooling.",examples:["https://jxsuite.com/schema/v1"],type:"string"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases object. Maps case values to element definitions or external component refs. Used alongside $switch for dynamic component rendering.",type:"object"},children:{$ref:"#/$defs/ChildrenValue"},imports:{additionalProperties:{type:"string"},description:"Import map: $prototype names to .class.json file paths. Allows state entries to reference external classes by name without $src.",type:"object"},observedAttributes:{description:"HTML attributes the custom element watches for changes. Follows the Web Components observedAttributes convention.",items:{type:"string"},type:"array"},state:{$ref:"#/$defs/StateMap",description:"Runtime variables for this component. All entries are reactive by default. Entry shape is determined by value type: "+"scalar/array → reactive property, string with ${} → computed, "+"object with $prototype → function or data source, "+"object with type and default → typed reactive property."},style:{$ref:"#/$defs/StyleObject"},tagName:{$ref:"#/$defs/TagName"},title:{$ref:"#/$defs/StringOrRef",description:"Page title. Can be a static string or a template string with ${} expressions."}},title:"Jx Document",type:"object"}}function qU(){return{$defs:{ImageConfig:fu,StyleObject:nP},$id:"https://jxsuite.com/schema/project/v1",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:qm.properties,title:"Jx Project",type:"object"}}function BU(){return{$defs:{ImageConfig:fu,JxFieldSchema:e1,RelationshipRef:t1,StyleObject:nP},$id:"https://jxsuite.com/schema/project/core/v2",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Core fragment of the Jx project.json schema. Open by design: extension fragments contribute their own top-level sections and the generated per-project entry document "+"(project.schema.json) closes the composition. See specs/extensions.md §5.",properties:qm.properties,title:"Jx Project Core",type:"object"}}function HU(){return{$id:Ja,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/JxFieldSchema"},{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/RelationshipRef"}],description:"Default field-schema union for section entry schemas: the core field shape plus relationship references. Per-project entry documents override this resource with the "+"effective union. See specs/extensions.md §5.3.",title:"Jx Project Field Union"}}function UU(){return{$id:cs,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[...Fa,Em],description:"Default $paths-value union for documents: the core source shapes. Per-project entry documents override this resource with those members PLUS every extension-contributed paths shape.",title:"Jx Document Paths Union"}}function VU(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...K_}}function Bm(){return{$defs:{ClassConstructorDef:Tm,ClassFieldDef:Im,ClassMethodDef:Nm,ClassParameterDef:Cm,ConnectorBlockDef:Jm,FormatDef:Mm,ProjectBlockDef:Lm,ServerBlockDef:Dm,StudioHints:Fm},$id:"https://jxsuite.com/schema/class/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Schema for Jx .class.json files. A class definition describes a schema-defined class with fields, constructor, methods, and type parameters. Optionally points to a JS module via $implementation for hybrid execution.",properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",examples:["./md.js","./lib/calculator.js"],type:"string"},$prototype:{const:"Class",description:'Must be "Class" for class definition files.',type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",examples:["MarkdownFile","DataSource","Calculator"],type:"string"}},required:["$prototype","title"],title:"Jx Class Definition",type:"object"}}async function WU(e){let{mkdirSync:t,writeFileSync:r}=await import("node:fs"),{resolve:n,dirname:i}=await import("node:path"),s=i(n(e,"..")),o=await FU(),a=qU(),c=Bm(),l=BU(),u=VU(),d=HU(),h=UU(),m=JSON.stringify(o,null,2),y=JSON.stringify(a,null,2),g=JSON.stringify(c,null,2),b=JSON.stringify(l,null,2),x=JSON.stringify(u,null,2),_=JSON.stringify(d,null,2),k=JSON.stringify(h,null,2),[E]=process.argv.slice(2);if(E)r(E,m,"utf8"),console.error(`Jx component schema written to ${E}`);else{r(n(s,"schema.json"),m,"utf8"),r(n(s,"project-schema.json"),y,"utf8"),r(n(s,"class-schema.json"),g,"utf8"),t(n(s,"schemas"),{recursive:!0}),r(n(s,"schemas","project.core.schema.json"),b,"utf8"),r(n(s,"schemas","project.fields.schema.json"),_,"utf8"),r(n(s,"schemas","document.paths.schema.json"),k,"utf8"),r(n(s,"extension-manifest.schema.json"),x,"utf8");let w=Bun.spawnSync(["bunx","oxfmt",n(s,"schemas","project.core.schema.json"),n(s,"schemas","project.fields.schema.json"),n(s,"schemas","document.paths.schema.json")],{cwd:s});if(w.exitCode!==0){let P=w.stderr.toString()||w.stdout.toString()||`exit ${w.exitCode}${w.signalCode?`, signal ${w.signalCode}`:""}`;console.error(`Warning: skipped oxfmt reformat of generated schemas (${P})`)}console.error("Generated:"),console.error(" schema.json (component)"),console.error(" project-schema.json"),console.error(" class-schema.json"),console.error(" schemas/project.core.schema.json"),console.error(" schemas/project.fields.schema.json"),console.error(" schemas/document.paths.schema.json"),console.error(" extension-manifest.schema.json")}}var eP,tP,rP,Q_=null,nP,Z_,mae;var iP=L(()=>{C1();T1();D1();F1();H1();V1();t_();r_();s_();f_();p_();h_();b_();$_();w_();F_();V_();z_();G_();au();Y_();X_();eP=Bt(x1(),1),tP=Bt(w1(),1),rP=Bt(j1(),1);nP={...uu,additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]}};[,Z_]=process.argv,mae=Z_?.endsWith("schema.ts")?WU(Z_):void 0});var za=C(function(aP){Object.defineProperty(aP,"__esModule",{value:!0});aP.regexpCode=aP.getEsmExportName=aP.getProperty=aP.safeStringify=aP.stringify=aP.strConcat=aP.addCodeArg=aP.str=aP._=aP.nil=aP._Code=aP.Name=aP.IDENTIFIER=aP._CodeOrName=void 0;class du{}aP._CodeOrName=du;aP.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class bo extends du{constructor(e){super();if(!aP.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}aP.Name=bo;class rn extends du{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((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof bo)t[r.str]=(t[r.str]||0)+1;return t},{})}}aP._Code=rn;aP.nil=new rn("");function sP(e,...t){let r=[e[0]],n=0;while(n<t.length)Um(r,t[n]),r.push(e[++n]);return new rn(r)}aP._=sP;var Hm=new rn("+");function oP(e,...t){let r=[Wa(e[0])],n=0;while(n<t.length)r.push(Hm),Um(r,t[n]),r.push(Hm,Wa(e[++n]));return zU(r),new rn(r)}aP.str=oP;function Um(e,t){if(t instanceof rn)e.push(...t._items);else if(t instanceof bo)e.push(t);else e.push(YU(t))}aP.addCodeArg=Um;function zU(e){let t=1;while(t<e.length-1){if(e[t]===Hm){let r=KU(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function KU(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof bo||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof bo))return`"${e}${t.slice(1)}`;return}function GU(e,t){return t.emptyStr()?e:e.emptyStr()?t:oP`${e}${t}`}aP.strConcat=GU;function YU(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Wa(Array.isArray(e)?e.join(","):e)}function XU(e){return new rn(Wa(e))}aP.stringify=XU;function Wa(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}aP.safeStringify=Wa;function QU(e){return typeof e=="string"&&aP.IDENTIFIER.test(e)?new rn(`.${e}`):sP`[${e}]`}aP.getProperty=QU;function ZU(e){if(typeof e=="string"&&aP.IDENTIFIER.test(e))return new rn(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}aP.getEsmExportName=ZU;function e4(e){return new rn(e.toString())}aP.regexpCode=e4});var Km=C(function(fP){Object.defineProperty(fP,"__esModule",{value:!0});fP.ValueScope=fP.ValueScopeName=fP.Scope=fP.varKinds=fP.UsedValueState=void 0;var fr=za();class lP extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var mu;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(mu||(fP.UsedValueState=mu={}));fP.varKinds={const:new fr.Name("const"),let:new fr.Name("let"),var:new fr.Name("var")};class Wm{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof fr.Name?e:this.name(e)}name(e){return new fr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}fP.Scope=Wm;class zm extends fr.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=fr._`.${new fr.Name(t)}[${r}]`}}fP.ValueScopeName=zm;var p4=fr._`\n`;class uP extends Wm{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?p4:fr.nil}}get(){return this._scope}name(e){return new zm(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,s=(r=t.key)!==null&&r!==void 0?r:t.ref,o=this._values[i];if(o){let l=o.get(s);if(l)return l}else o=this._values[i]=new Map;o.set(s,n);let a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return fr._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let i=fr.nil;for(let s in e){let o=e[s];if(!o)continue;let a=r[s]=r[s]||new Map;o.forEach((c)=>{if(a.has(c))return;a.set(c,mu.Started);let l=t(c);if(l){let u=this.opts.es5?fP.varKinds.var:fP.varKinds.const;i=fr._`${i}${u} ${c} = ${l};${this.opts._n}`}else if(l=n===null||n===void 0?void 0:n(c))i=fr._`${i}${l}${this.opts._n}`;else throw new lP(c);a.set(c,mu.Completed)})}return i}}fP.ValueScope=uP});var be=C(function(dr){Object.defineProperty(dr,"__esModule",{value:!0});dr.or=dr.and=dr.not=dr.CodeGen=dr.operators=dr.varKinds=dr.ValueScopeName=dr.ValueScope=dr.Scope=dr.Name=dr.regexpCode=dr.stringify=dr.getProperty=dr.nil=dr.strConcat=dr.str=dr._=void 0;var Re=za(),nn=Km(),Si=za();Object.defineProperty(dr,"_",{enumerable:!0,get:function(){return Si._}});Object.defineProperty(dr,"str",{enumerable:!0,get:function(){return Si.str}});Object.defineProperty(dr,"strConcat",{enumerable:!0,get:function(){return Si.strConcat}});Object.defineProperty(dr,"nil",{enumerable:!0,get:function(){return Si.nil}});Object.defineProperty(dr,"getProperty",{enumerable:!0,get:function(){return Si.getProperty}});Object.defineProperty(dr,"stringify",{enumerable:!0,get:function(){return Si.stringify}});Object.defineProperty(dr,"regexpCode",{enumerable:!0,get:function(){return Si.regexpCode}});Object.defineProperty(dr,"Name",{enumerable:!0,get:function(){return Si.Name}});var $u=Km();Object.defineProperty(dr,"Scope",{enumerable:!0,get:function(){return $u.Scope}});Object.defineProperty(dr,"ValueScope",{enumerable:!0,get:function(){return $u.ValueScope}});Object.defineProperty(dr,"ValueScopeName",{enumerable:!0,get:function(){return $u.ValueScopeName}});Object.defineProperty(dr,"varKinds",{enumerable:!0,get:function(){return $u.varKinds}});dr.operators={GT:new Re._Code(">"),GTE:new Re._Code(">="),LT:new Re._Code("<"),LTE:new Re._Code("<="),EQ:new Re._Code("==="),NEQ:new Re._Code("!=="),NOT:new Re._Code("!"),OR:new Re._Code("||"),AND:new Re._Code("&&"),ADD:new Re._Code("+")};class Ei{optimizeNodes(){return this}optimizeNames(e,t){return this}}class pP extends Ei{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?nn.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=$o(this.rhs,e,t);return this}get names(){return this.rhs instanceof Re._CodeOrName?this.rhs.names:{}}}class Xm extends Ei{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof Re.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=$o(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Re.Name?{}:{...this.lhs.names};return xu(e,this.rhs)}}class mP extends Xm{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class hP extends Ei{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class gP extends Ei{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class yP extends Ei{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class bP extends Ei{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=$o(this.code,e,t),this}get names(){return this.code instanceof Re._CodeOrName?this.code.names:{}}}class vu extends Ei{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let i=r[n];if(i.optimizeNames(e,t))continue;y4(e,i.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ls(e,t.names),{})}}class _i extends vu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class xP extends vu{}class Ka extends _i{}Ka.kind="else";class Kn extends _i{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Ka(r):r}if(t){if(e===!1)return t instanceof Kn?t:t.nodes;if(this.nodes.length)return this;return new Kn(EP(e),t instanceof Kn?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=$o(this.condition,e,t),this}get names(){let e=super.names;if(xu(e,this.condition),this.else)ls(e,this.else.names);return e}}Kn.kind="if";class xo extends _i{}xo.kind="for";class $P extends xo{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=$o(this.iteration,e,t),this}get names(){return ls(super.names,this.iteration.names)}}class vP extends xo{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?nn.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=xu(super.names,this.from);return xu(e,this.to)}}class Gm extends xo{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=$o(this.iterable,e,t),this}get names(){return ls(super.names,this.iterable.names)}}class hu extends _i{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}hu.kind="func";class gu extends vu{render(e){return"return "+super.render(e)}}gu.kind="return";class wP extends _i{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)ls(e,this.catch.names);if(this.finally)ls(e,this.finally.names);return e}}class yu extends _i{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}yu.kind="catch";class bu extends _i{render(e){return"finally"+super.render(e)}}bu.kind="finally";class SP{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
604
- `:""},this._extScope=e,this._scope=new nn.Scope({parent:e}),this._nodes=[new xP]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let i=this._scope.toName(t);if(r!==void 0&&n)this._constants[i.str]=r;return this._leafNode(new pP(e,i,r)),i}const(e,t,r){return this._def(nn.varKinds.const,e,t,r)}let(e,t,r){return this._def(nn.varKinds.let,e,t,r)}var(e,t,r){return this._def(nn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Xm(e,t,r))}add(e,t){return this._leafNode(new mP(e,dr.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==Re.nil)this._leafNode(new bP(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),Re.addCodeArg(t,n)}return t.push("}"),new Re._Code(t)}if(e,t,r){if(this._blockNode(new Kn(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Kn(e))}else(){return this._elseNode(new Ka)}endIf(){return this._endBlockNode(Kn,Ka)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new $P(e),t)}forRange(e,t,r,n,i=this.opts.es5?nn.varKinds.var:nn.varKinds.let){let s=this._scope.toName(e);return this._for(new vP(i,s,t,r),()=>n(s))}forOf(e,t,r,n=nn.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let s=t instanceof Re.Name?t:this.var("_arr",t);return this.forRange("_i",0,Re._`${s}.length`,(o)=>{this.var(i,Re._`${s}[${o}]`),r(i)})}return this._for(new Gm("of",n,i,t),()=>r(i))}forIn(e,t,r,n=this.opts.es5?nn.varKinds.var:nn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,Re._`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new Gm("in",n,i,t),()=>r(i))}endFor(){return this._endBlockNode(xo)}label(e){return this._leafNode(new hP(e))}break(e){return this._leafNode(new gP(e))}return(e){let t=new gu;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(gu)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new wP;if(this._blockNode(n),this.code(e),t){let i=this.name("e");this._currNode=n.catch=new yu(i),t(i)}if(r)this._currNode=n.finally=new bu,this.code(r);return this._endBlockNode(yu,bu)}throw(e){return this._leafNode(new yP(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=Re.nil,r,n){if(this._blockNode(new hu(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(hu)}optimize(e=1){while(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,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Kn))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}dr.CodeGen=SP;function ls(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function xu(e,t){return t instanceof Re._CodeOrName?ls(e,t.names):e}function $o(e,t,r){if(e instanceof Re.Name)return n(e);if(!i(e))return e;return new Re._Code(e._items.reduce((s,o)=>{if(o instanceof Re.Name)o=n(o);if(o instanceof Re._Code)s.push(...o._items);else s.push(o);return s},[]));function n(s){let o=r[s.str];if(o===void 0||t[s.str]!==1)return s;return delete t[s.str],o}function i(s){return s instanceof Re._Code&&s._items.some((o)=>o instanceof Re.Name&&t[o.str]===1&&r[o.str]!==void 0)}}function y4(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function EP(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:Re._`!${Ym(e)}`}dr.not=EP;var b4=_P(dr.operators.AND);function x4(...e){return e.reduce(b4)}dr.and=x4;var $4=_P(dr.operators.OR);function v4(...e){return e.reduce($4)}dr.or=v4;function _P(e){return(t,r)=>t===Re.nil?r:r===Re.nil?t:Re._`${Ym(t)} ${e} ${Ym(r)}`}function Ym(e){return e instanceof Re.Name?e:Re._`(${e})`}});var _e=C(function(TP){Object.defineProperty(TP,"__esModule",{value:!0});TP.checkStrictMode=TP.getErrorPath=TP.Type=TP.useFunc=TP.setEvaluated=TP.evaluatedPropsToName=TP.mergeEvaluated=TP.eachItem=TP.unescapeJsonPointer=TP.escapeJsonPointer=TP.escapeFragment=TP.unescapeFragment=TP.schemaRefOrVal=TP.schemaHasRulesButRef=TP.schemaHasRules=TP.checkUnknownRules=TP.alwaysValidSchema=TP.toHash=void 0;var Ue=be(),_4=za();function P4(e){let t={};for(let r of e)t[r]=!0;return t}TP.toHash=P4;function k4(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return jP(e,t),!RP(t,e.self.RULES.all)}TP.alwaysValidSchema=k4;function jP(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let i=n.RULES.keywords;for(let s in t)if(!i[s])IP(e,`unknown keyword: "${s}"`)}TP.checkUnknownRules=jP;function RP(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}TP.schemaHasRules=RP;function A4(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}TP.schemaHasRulesButRef=A4;function j4({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return Ue._`${r}`}return Ue._`${e}${t}${Ue.getProperty(n)}`}TP.schemaRefOrVal=j4;function R4(e){return OP(decodeURIComponent(e))}TP.unescapeFragment=R4;function O4(e){return encodeURIComponent(Zm(e))}TP.escapeFragment=O4;function Zm(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}TP.escapeJsonPointer=Zm;function OP(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}TP.unescapeJsonPointer=OP;function C4(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}TP.eachItem=C4;function kP({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof Ue.Name?(s instanceof Ue.Name?e(i,s,o):t(i,s,o),o):s instanceof Ue.Name?(t(i,o,s),s):r(s,o);return a===Ue.Name&&!(c instanceof Ue.Name)?n(i,c):c}}TP.mergeEvaluated={props:kP({mergeNames:(e,t,r)=>e.if(Ue._`${r} !== true && ${t} !== undefined`,()=>{e.if(Ue._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,Ue._`${r} || {}`).code(Ue._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(Ue._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,Ue._`${r} || {}`),eh(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:CP}),items:kP({mergeNames:(e,t,r)=>e.if(Ue._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,Ue._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(Ue._`${r} !== true`,()=>e.assign(r,t===!0?!0:Ue._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function CP(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",Ue._`{}`);if(t!==void 0)eh(e,r,t);return r}TP.evaluatedPropsToName=CP;function eh(e,t,r){Object.keys(r).forEach((n)=>e.assign(Ue._`${t}${Ue.getProperty(n)}`,!0))}TP.setEvaluated=eh;var AP={};function I4(e,t){return e.scopeValue("func",{ref:t,code:AP[t.code]||(AP[t.code]=new _4._Code(t.code))})}TP.useFunc=I4;var Qm;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Qm||(TP.Type=Qm={}));function T4(e,t,r){if(e instanceof Ue.Name){let n=t===Qm.Num;return r?n?Ue._`"[" + ${e} + "]"`:Ue._`"['" + ${e} + "']"`:n?Ue._`"/" + ${e}`:Ue._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?Ue.getProperty(e).toString():"/"+Zm(e)}TP.getErrorPath=T4;function IP(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}TP.checkStrictMode=IP});var Fr=C(function(MP){Object.defineProperty(MP,"__esModule",{value:!0});var Mt=be(),Q4={data:new Mt.Name("data"),valCxt:new Mt.Name("valCxt"),instancePath:new Mt.Name("instancePath"),parentData:new Mt.Name("parentData"),parentDataProperty:new Mt.Name("parentDataProperty"),rootData:new Mt.Name("rootData"),dynamicAnchors:new Mt.Name("dynamicAnchors"),vErrors:new Mt.Name("vErrors"),errors:new Mt.Name("errors"),this:new Mt.Name("this"),self:new Mt.Name("self"),scope:new Mt.Name("scope"),json:new Mt.Name("json"),jsonPos:new Mt.Name("jsonPos"),jsonLen:new Mt.Name("jsonLen"),jsonPart:new Mt.Name("jsonPart")};MP.default=Q4});var Ga=C(function(FP){Object.defineProperty(FP,"__esModule",{value:!0});FP.extendErrors=FP.resetErrorsCount=FP.reportExtraError=FP.reportError=FP.keyword$DataError=FP.keywordError=void 0;var Oe=be(),Su=_e(),Yt=Fr();FP.keywordError={message:({keyword:e})=>Oe.str`must pass "${e}" keyword validation`};FP.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Oe.str`"${e}" keyword must be ${t} ($data)`:Oe.str`"${e}" keyword is invalid ($data)`};function eV(e,t=FP.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:o,allErrors:a}=i,c=JP(e,t,r);if(n!==null&&n!==void 0?n:o||a)LP(s,c);else DP(i,Oe._`[${c}]`)}FP.reportError=eV;function tV(e,t=FP.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:o}=n,a=JP(e,t,r);if(LP(i,a),!(s||o))DP(n,Yt.default.vErrors)}FP.reportExtraError=tV;function rV(e,t){e.assign(Yt.default.errors,t),e.if(Oe._`${Yt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Oe._`${Yt.default.vErrors}.length`,t),()=>e.assign(Yt.default.vErrors,null)))}FP.resetErrorsCount=rV;function nV({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw Error("ajv implementation error");let o=e.name("err");e.forRange("i",i,Yt.default.errors,(a)=>{if(e.const(o,Oe._`${Yt.default.vErrors}[${a}]`),e.if(Oe._`${o}.instancePath === undefined`,()=>e.assign(Oe._`${o}.instancePath`,Oe.strConcat(Yt.default.instancePath,s.errorPath))),e.assign(Oe._`${o}.schemaPath`,Oe.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(Oe._`${o}.schema`,r),e.assign(Oe._`${o}.data`,n)})}FP.extendErrors=nV;function LP(e,t){let r=e.const("err",t);e.if(Oe._`${Yt.default.vErrors} === null`,()=>e.assign(Yt.default.vErrors,Oe._`[${r}]`),Oe._`${Yt.default.vErrors}.push(${r})`),e.code(Oe._`${Yt.default.errors}++`)}function DP(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;if(i.$async)r.throw(Oe._`new ${e.ValidationError}(${t})`);else r.assign(Oe._`${n}.errors`,t),r.return(!1)}var us={keyword:new Oe.Name("keyword"),schemaPath:new Oe.Name("schemaPath"),params:new Oe.Name("params"),propertyName:new Oe.Name("propertyName"),message:new Oe.Name("message"),schema:new Oe.Name("schema"),parentSchema:new Oe.Name("parentSchema")};function JP(e,t,r){let{createErrors:n}=e.it;if(n===!1)return Oe._`{}`;return iV(e,t,r)}function iV(e,t,r={}){let{gen:n,it:i}=e,s=[sV(i,r),oV(e,r)];return aV(e,t,s),n.object(...s)}function sV({errorPath:e},{instancePath:t}){let r=t?Oe.str`${e}${Su.getErrorPath(t,Su.Type.Str)}`:e;return[Yt.default.instancePath,Oe.strConcat(Yt.default.instancePath,r)]}function oV({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:Oe.str`${t}/${e}`;if(r)i=Oe.str`${i}${Su.getErrorPath(r,Su.Type.Str)}`;return[us.schemaPath,i]}function aV(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;if(n.push([us.keyword,i],[us.params,typeof t=="function"?t(e):t||Oe._`{}`]),c.messages)n.push([us.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([us.schema,o],[us.parentSchema,Oe._`${u}${d}`],[Yt.default.data,s]);if(l)n.push([us.propertyName,l])}});var VP=C(function(HP){Object.defineProperty(HP,"__esModule",{value:!0});HP.boolOrEmptySchema=HP.topBoolOrEmptySchema=void 0;var dV=Ga(),pV=be(),mV=Fr(),hV={message:"boolean schema is false"};function gV(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)BP(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(mV.default.data);else t.assign(pV._`${n}.errors`,null),t.return(!0)}HP.topBoolOrEmptySchema=gV;function yV(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),BP(e);else r.var(t,!0)}HP.boolOrEmptySchema=yV;function BP(e,t){let{gen:r,data:n}=e;dV.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},hV,void 0,t)}});var rh=C(function(WP){Object.defineProperty(WP,"__esModule",{value:!0});WP.getRules=WP.isJSONType=void 0;var xV=["string","number","integer","boolean","null","object","array"],$V=new Set(xV);function vV(e){return typeof e=="string"&&$V.has(e)}WP.isJSONType=vV;function wV(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}WP.getRules=wV});var nh=C(function(YP){Object.defineProperty(YP,"__esModule",{value:!0});YP.shouldUseRule=YP.shouldUseGroup=YP.schemaHasRulesForType=void 0;function EV({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&KP(e,n)}YP.schemaHasRulesForType=EV;function KP(e,t){return t.rules.some((r)=>GP(e,r))}YP.shouldUseGroup=KP;function GP(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}YP.shouldUseRule=GP});var Ya=C(function(tk){Object.defineProperty(tk,"__esModule",{value:!0});tk.reportTypeError=tk.checkDataTypes=tk.checkDataType=tk.coerceAndCheckDataType=tk.getJSONTypes=tk.getSchemaTypes=tk.DataType=void 0;var kV=rh(),AV=nh(),jV=Ga(),ve=be(),QP=_e(),vo;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(vo||(tk.DataType=vo={}));function RV(e){let t=ZP(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}tk.getSchemaTypes=RV;function ZP(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(kV.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}tk.getJSONTypes=ZP;function OV(e,t){let{gen:r,data:n,opts:i}=e,s=CV(t,i.coerceTypes),o=t.length>0&&!(s.length===0&&t.length===1&&AV.schemaHasRulesForType(e,t[0]));if(o){let a=sh(t,n,i.strictNumbers,vo.Wrong);r.if(a,()=>{if(s.length)IV(e,t,s);else oh(e)})}return o}tk.coerceAndCheckDataType=OV;var ek=new Set(["string","number","integer","boolean","null"]);function CV(e,t){return t?e.filter((r)=>ek.has(r)||t==="array"&&r==="array"):[]}function IV(e,t,r){let{gen:n,data:i,opts:s}=e,o=n.let("dataType",ve._`typeof ${i}`),a=n.let("coerced",ve._`undefined`);if(s.coerceTypes==="array")n.if(ve._`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,ve._`${i}[0]`).assign(o,ve._`typeof ${i}`).if(sh(t,i,s.strictNumbers),()=>n.assign(a,i)));n.if(ve._`${a} !== undefined`);for(let l of r)if(ek.has(l)||l==="array"&&s.coerceTypes==="array")c(l);n.else(),oh(e),n.endIf(),n.if(ve._`${a} !== undefined`,()=>{n.assign(i,a),TV(e,a)});function c(l){switch(l){case"string":n.elseIf(ve._`${o} == "number" || ${o} == "boolean"`).assign(a,ve._`"" + ${i}`).elseIf(ve._`${i} === null`).assign(a,ve._`""`);return;case"number":n.elseIf(ve._`${o} == "boolean" || ${i} === null
603
+ ${S}`);let{extAttrs:de}=p,fe=de.indexOf(v),ye=de.splice(fe,1);de.length?de.length===fe?de[fe-1].tokens.separator=void 0:de[fe].tokens.name.trivia.trim()||(de[fe].tokens.name.trivia=ye[0].tokens.name.trivia):de.tokens.open=de.tokens.close=void 0}}class H extends rr{static parse(p,v,{extMembers:S=[],partial:A}={}){let O={partial:A,base:v};if(O.mixin=p.consume("mixin"),O.mixin)return rr.parse(p,new H({source:p.source,tokens:O}),{allowedMembers:[...S,[Qn.parse],[Ce],[F.parse,{noInherit:!0}],[D.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class B extends s{static parse(p){let v={},S=Z(new B({source:p.source,tokens:v}));return S.extAttrs=x.parse(p),v.required=p.consume("required"),S.idlType=te(p,"dictionary-type")||p.error("Dictionary member lacks a type"),v.name=p.consumeKind("identifier")||p.error("Dictionary member lacks a name"),S.default=k.parse(p),v.required&&S.default&&p.error("Required member must not have a default"),v.termination=p.consume(";")||p.error("Unterminated dictionary member, expected `;`"),S.this}get type(){return"field"}get name(){return N(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(p){yield*this.idlType.validate(p)}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.required),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),this.default?this.default.write(p):"",p.token(this.tokens.termination)]),{data:this,parent:v})}}class ae extends rr{static parse(p,{extMembers:v=[],partial:S}={}){let A={partial:S};if(A.base=p.consume("dictionary"),A.base)return rr.parse(p,new ae({source:p.source,tokens:A}),{inheritable:!S,allowedMembers:[...v,[B.parse]]})}get type(){return"dictionary"}}class we extends rr{static parse(p,{extMembers:v=[],partial:S}={}){let A={partial:S};if(A.base=p.consume("namespace"),A.base)return rr.parse(p,new we({source:p.source,tokens:A}),{allowedMembers:[...v,[F.parse,{noInherit:!0,readonly:!0}],[Qn.parse],[D.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(p){if(!this.partial&&this.extAttrs.every((v)=>v.name!=="Exposed"))yield i(this.tokens.name,this,"require-exposed","Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:oe(this)});yield*super.validate(p)}}class gt extends rr{static parse(p,v,{extMembers:S=[]}={}){let A={callback:v};if(A.base=p.consume("interface"),A.base)return rr.parse(p,new gt({source:p.source,tokens:A}),{allowedMembers:[...S,[Qn.parse],[D.parse,{regular:!0}]]})}get type(){return"callback interface"}}function st(p,v){let S=p.source;function A(fe){p.error(fe)}function O(...fe){return p.consume(...fe)}function V(fe){let ye=O("interface");if(ye)return H.parse(p,ye,{...fe,...v?.extensions?.mixin})||xs.parse(p,ye,{...fe,...v?.extensions?.interface})||A("Interface has no proper body")}function G(){if(v.productions)for(let fe of v.productions){let ye=fe(p);if(ye)return ye}return function(){let fe=O("callback");if(fe)return p.probe("interface")?gt.parse(p,fe,{...v?.extensions?.callbackInterface}):bs.parse(p,fe)}()||V()||function(){let fe=O("partial");if(fe)return ae.parse(p,{partial:fe,...v?.extensions?.dictionary})||V({partial:fe})||we.parse(p,{partial:fe,...v?.extensions?.namespace})||A("Partial doesn't apply to anything")}()||ae.parse(p,v?.extensions?.dictionary)||tr.parse(p)||Ii.parse(p)||Xn.parse(p)||we.parse(p,v?.extensions?.namespace)}let de=function(){if(!S.length)return[];let fe=[];for(;;){let Ae=x.parse(p),Ne=G();if(!Ne){Ae.length&&A("Stray extended attributes");break}Z(Ne).extAttrs=Ae,fe.push(Ne)}let ye=u.parse(p);return v.concrete&&fe.push(ye),fe}();return p.position<S.length&&A("Unrecognised tokens"),de}function jt(p,v={}){let S=new nt(p);return v.sourceName!==void 0&&(S.source.name=v.sourceName),st(S,v)}function me(p){return p}let ot={wrap:(p)=>p.join(""),trivia:me,name:me,reference:me,type:me,generic:me,nameless:me,inheritance:me,definition:me,extendedAttribute:me,extendedAttributeReference:me};class We{constructor(p){this.ts=Object.assign({},ot,p)}reference(p,{unescaped:v,context:S}){return v||(v=p.startsWith("_")?p.slice(1):p),this.ts.reference(p,v,S)}token(p,v=me,...S){if(!p)return"";let A=v(p.value,...S);return this.ts.wrap([this.ts.trivia(p.trivia),A])}reference_token(p,v){return this.token(p,this.reference.bind(this),{context:v})}name_token(p,v){return this.token(p,this.ts.name,v)}identifier(p,v){return this.ts.wrap([this.reference_token(p.tokens.value,v),this.token(p.tokens.separator)])}}function Ft(p,{templates:v=ot}={}){v=Object.assign({},ot,v);let S=new We(v);return v.wrap(p.map((A)=>A.write(S)))}function nf(p,v){let S=new Map,A=p.filter((O)=>O.type==="includes");for(let O of A){let V=v.get(O.includes);if(!V)continue;let G=S.get(O.target);G?G.push(V):S.set(O.target,[V])}return S}function*vc(p){let v=function(S){let A=new Map,O=new Set,V=new Map;for(let G of S)if(G.partial){let de=V.get(G.name);de?de.push(G):V.set(G.name,[G])}else G.name&&(A.has(G.name)?O.add(G):A.set(G.name,G));return{all:S,unique:A,partials:V,duplicates:O,mixinMap:nf(S,A),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(p);for(let S of v.all)S.validate&&(yield*S.validate(v));yield*function*({unique:S,duplicates:A}){for(let O of A){let{name:V}=O,G=`The name "${V}" of type "${S.get(V).type}" was already seen`;yield i(O.tokens.name,O,"no-duplicate",G)}}(v)}function fC(p){return[...vc((v=p,v.flat?v.flat():[].concat(...v)))];var v}return t})())});var j1=C(function(koe,A1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",E1=De("fs").promises,_1=De("path"),NU=S1();class P1{constructor(e,t){this.filename=t,this.shortname=_1.basename(t,".idl"),this.path=_1.join(e,t)}async text(){return await E1.readFile(this.path,"utf8")}async parse(){let e=await this.text();return NU.parse(e)}}async function k1({folder:e=__dirname}={}){let t={},r=await E1.readdir(e);for(let n of r)if(n.endsWith(".idl")){let i=new P1(e,n);t[i.shortname]=i}return t}async function MU(e){let t=await k1(e);for(let[r,n]of Object.entries(t))t[r]=await n.parse();return t}A1.exports={listAll:k1,parseAll:MU}});var R1,O1;var C1=L(()=>{R1={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},O1={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var I1;var T1=L(()=>{I1={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"}});var N1,M1,L1;var D1=L(()=>{N1={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},M1={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},L1={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var J1;var F1=L(()=>{J1={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"}});var q1,B1;var H1=L(()=>{q1={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},B1={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var U1;var V1=L(()=>{U1={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var W1,z1,K1,G1,Y1,X1,Q1,Z1,e_;var t_=L(()=>{W1={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"},z1={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},K1={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"},G1={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Y1={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},X1={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:String.raw`^\$map/(item|index)(/.*)?$`,type:"string"},Q1={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Z1={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},e_={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var uu;var r_=L(()=>{uu={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"}});var n_,i_;var s_=L(()=>{n_={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item. A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:String.raw`^\$map/item(/.+)?$`,type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},i_={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:String.raw`\$\{`,type:"string"}]}});var o_,a_,c_,l_,u_,Cm;var f_=L(()=>{o_={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},a_={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},c_={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},l_={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"},u_={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},Cm={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/ElementTagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var d_;var p_=L(()=>{d_={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var m_;var h_=L(()=>{m_={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: an opaque JS source string (first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var g_,y_;var b_=L(()=>{g_={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed), or the two WHATWG event verbs stopPropagation and preventDefault, each spelled as the member set to true.",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"},{additionalProperties:!1,properties:{stopPropagation:{const:!0,description:"Stop the handler's event at the current target (WHATWG DOM stopPropagation), so an ancestor's handler for the same event does not run. A body run without an event has nothing to stop."}},required:["stopPropagation"],title:"stopPropagation — stop the event here (WHATWG DOM)",type:"object"},{additionalProperties:!1,properties:{preventDefault:{const:!0,description:"Cancel the handler's event's default action (WHATWG DOM preventDefault): a link's navigation, a form's submission, a key's scroll."}},required:["preventDefault"],title:"preventDefault — cancel the event's default action (WHATWG DOM)",type:"object"}]},y_={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var x_;var $_=L(()=>{x_={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},filter:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single filter object, e.g. an equality shorthand.",type:"object"},{description:'Ordered filter rules, e.g. [{ field: "Slug", op: "not empty" }].',items:{type:"object"},type:"array"}],description:"Filter configuration: a reactive $ref binding, a single filter object, or an ordered array of rules."},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var v_;var w_=L(()=>{v_={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});var S_,E_,__,P_,k_,A_,j_,R_,O_,C_,I_,T_,N_,M_,L_,D_,J_;var F_=L(()=>{Mf();S_={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:String.raw`^(\$map/|\$reduce/|\$args/|event#/|#/|parent#/|window#/|document#/)`,type:"string"}},required:["$ref"],type:"object"},E_={anyOf:[{not:{pattern:String.raw`\$\{`},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},__={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},P_={enum:["!","-"]},k_={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},A_={const:"?:"},j_={const:"switch"},R_={const:"call"},O_={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]},C_={enum:["=","+=","-=","*=","/="]},I_={enum:["pop","shift"]},T_={enum:["push","unshift"]},N_={const:"splice"},M_={const:"reduce"},L_={enum:["map","filter"]},D_={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${Qy()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},J_={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var q_,B_,H_,U_;var V_=L(()=>{q_={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},B_={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},H_={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},U_={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var LU,Im,Tm,Nm,Mm,Lm,Dm,Jm,Fm,qm,W_;var z_=L(()=>{LU=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],Im={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},Tm={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},Nm={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},Mm={description:"A class method or accessor definition. Capability roles (parse, serialize, rewrite, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:LU,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},Lm={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:String.raw`^\.`,type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},Dm={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Jm={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},Fm={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},qm={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},W_={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});var K_;var G_=L(()=>{K_={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var fu;var Y_=L(()=>{fu={description:"Image optimization configuration for the project.",properties:{formats:{items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},picture:{description:"Wrap a multi-format image in a <picture> with one <source> per format (default true). With it off the <img> carries a srcset in the preferred format alone, which browsers that cannot decode that format will still select from.",type:"boolean"},quality:{properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" runs Sharp at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var DU,Bm;var X_=L(()=>{zi();DU=[301,302,303,307,308],Bm={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"Global type definitions available to all pages.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:"utf8",description:"Default charset for the page.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:Fc,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:Fc,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:Fc,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...DU],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});function JU(){return Q_??=FU(),Q_}async function FU(){let[e,t,r]=await Promise.all([eP.listAll(),tP.default.listAll(),rP.default.parseAll()]),n=new Set;for(let{elements:l}of Object.values(e))for(let u of l)if(!u.obsolete)n.add(u.name);let i=[...n].toSorted(),s=new Set;for(let l of t.properties)for(let u of l.styleDeclaration??[])s.add(u);let o=[...s].toSorted(),a=new Set;for(let l of Object.values(r))for(let u of l){if(u.type!=="interface"&&u.type!=="interface mixin")continue;if(!u.members)continue;for(let d of u.members)if(d.type==="attribute"&&d.name?.startsWith("on")&&d.idlType?.idlType==="EventHandler")a.add(d.name)}let c=[...a].toSorted();return{cssProps:o,eventHandlers:c,tagExamples:i}}function qU(e){let t={};for(let r of e)t[r]={description:`Event handler for the "${r.slice(2)}" event.`,oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]};return t}function BU(e){let t={...uu.properties};for(let r of e)t[r]={oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"}]};return t}async function HU(){let{tagExamples:e,cssProps:t,eventHandlers:r}=await JU();return{$defs:{DefsMap:H_,TypeDefEntry:U_,StateMap:B_,StateEntry:q_,TypedStateDef:d_,PureTypeDef:v_,FunctionDef:m_,ClassDef:W_,ClassParameterDef:Im,ClassFieldDef:Tm,ClassConstructorDef:Nm,ClassMethodDef:Mm,FormatDef:Lm,ProjectBlockDef:Dm,ServerBlockDef:Jm,ConnectorBlockDef:Fm,StudioHints:qm,ExternalClassDef:x_,ExpressionPointer:S_,ExpressionLiteral:E_,ExpressionOperand:__,UnaryOperator:P_,BinaryOperator:k_,ConditionalOperator:A_,SwitchOperator:j_,CallOperator:R_,PureMethod:O_,AssignmentOperator:C_,NoArgMethod:I_,OneArgMethod:T_,SpliceMethod:N_,ReduceMethod:M_,MapFilterMethod:L_,ExpressionNode:D_,ExpressionEntry:J_,Statement:g_,StatementList:y_,ElementDef:{...Cm,properties:{...Cm.properties,...qU(r)}},ChildrenValue:i_,ArrayNamespace:n_,SwitchDef:l_,SwitchNode:u_,StyleObject:{...uu,properties:BU(t)},AttributesObject:o_,PropsObject:a_,RefObject:Z1,AnyRef:Q1,InternalRef:W1,StateRef:z1,ExternalRef:K1,ExternalComponentRef:e_,GlobalRef:G1,ParentRef:Y1,MapRef:X1,ElementPropertyValue:c_,StringOrRef:N1,BoolOrRef:M1,NumberOrRef:L1,CemParameter:q1,CemEvent:B1,TagName:{...I1,examples:[...e,"my-counter","todo-app","user-card"]},TagExpression:R1,ElementTagName:O1,JsonSchemaType:U1,HeadEntry:J1,ImageConfig:fu,PathsValue:{$id:cs,anyOf:[...Fa,_m],description:"Default $paths source union: the core shapes, plus a catch-all for source shapes contributed by extensions this schema cannot see. The project's generated document.schema.json replaces this with the exact set its extensions provide."}},$id:"https://jxsuite.com/schema/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"Schema for Jx component files. A Jx document is a JSON object that declaratively describes a reactive web component: its structure (DOM tree), styling, type definitions ($defs), runtime state, and inline or external functions. Reactivity is powered by @vue/reactivity.",properties:{$defs:{$ref:"#/$defs/DefsMap",description:"Pure JSON Schema type definitions for this component. "+"All entries are reusable type schemas — no runtime artifacts are produced. "+"Referenced from state entries via $ref. Naming convention: PascalCase."},$elements:{description:"Custom element dependencies. Items are either $ref objects pointing to JX element definitions, or bare npm package name strings for web component libraries.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{description:"npm package specifier (must declare customElements in package.json)",type:"string"}]},type:"array"},$head:{description:"Page-level <head> entries. Array of head entries for meta tags, link tags, script tags, etc. Merged with layout and site-level $head entries.",items:{$ref:"#/$defs/HeadEntry"},type:"array"},$id:{description:"Component identifier string. Used by tooling and the builder.",examples:["Counter","TodoApp","UserCard"],type:"string"},$dir:{description:"Base direction for this page's <html> element, overriding `defaults.dir`. Right-to-left content renders left-to-right without it.",enum:["ltr","rtl","auto"],type:"string"},$lang:{description:"Language tag for this page's <html> element, overriding `defaults.lang` "+"(site-architecture.md §8.4).",examples:["en","fr","ar-EG"],type:"string"},$translationKey:{description:"This page's identity across languages, overriding the one its path implies "+"(site-architecture.md §13.5). Two routes are translations when their keys match; "+"the default key is the path with the locale prefix removed, which is right whenever "+"the paths are parallel and wrong for a localized slug — /fr-ca/a-propos/ shares "+"nothing with /about/ until one of them says so.",examples:["about","blog/hello-world"],type:"string"},$layout:{description:"Layout reference for pages. String path to a layout JSON file, or false to opt out of the default layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{const:!1,type:"boolean"}]},$shadow:{description:"Render this component into a shadow root instead of the light DOM (spec.md §16.6). "+"Off unless set: a shadow root isolates the component's styles from the page and replaces the <slot> emulation with real slot distribution, so it changes how the "+"component composes. Overrides `defaults.shadow` in both directions — `false` opts "+"one component out of a project that opted in.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]},$sitemap:{description:"Set false to exclude this page from sitemap.xml (site-architecture.md §8.4.1). "+"Every other page with a URL is included.",type:"boolean"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Keys use the CSS custom property -- prefix. Pure color-scheme queries (e.g. "--dark": "(prefers-color-scheme: dark)") are dual-emitted so a data-color-scheme attribute on the root element forces the scheme '+"regardless of the OS preference (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$paths:{$ref:cs,description:"Dynamic route source for a page: expands one page per entry at build time. One of the core shapes (explicit `values`, a `$ref` data file, or a bare array of parameter objects) or a source shape contributed by an enabled extension, such as the parser's `contentType`."},$schema:{description:"URI identifying the Jx dialect version. Enables schema-aware IDE tooling.",examples:["https://jxsuite.com/schema/v1"],type:"string"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases object. Maps case values to element definitions or external component refs. Used alongside $switch for dynamic component rendering.",type:"object"},children:{$ref:"#/$defs/ChildrenValue"},imports:{additionalProperties:{type:"string"},description:"Import map: $prototype names to .class.json file paths. Allows state entries to reference external classes by name without $src.",type:"object"},observedAttributes:{description:"HTML attributes the custom element watches for changes. Follows the Web Components observedAttributes convention.",items:{type:"string"},type:"array"},state:{$ref:"#/$defs/StateMap",description:"Runtime variables for this component. All entries are reactive by default. Entry shape is determined by value type: "+"scalar/array → reactive property, string with ${} → computed, "+"object with $prototype → function or data source, "+"object with type and default → typed reactive property."},style:{$ref:"#/$defs/StyleObject"},tagName:{$ref:"#/$defs/TagName"},title:{$ref:"#/$defs/StringOrRef",description:"Page title. Can be a static string or a template string with ${} expressions."}},title:"Jx Document",type:"object"}}function UU(){return{$defs:{ImageConfig:fu,StyleObject:nP},$id:"https://jxsuite.com/schema/project/v1",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:Bm.properties,title:"Jx Project",type:"object"}}function VU(){return{$defs:{ImageConfig:fu,JxFieldSchema:e1,RelationshipRef:t1,StyleObject:nP},$id:"https://jxsuite.com/schema/project/core/v2",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Core fragment of the Jx project.json schema. Open by design: extension fragments contribute their own top-level sections and the generated per-project entry document "+"(project.schema.json) closes the composition. See specs/extensions.md §5.",properties:Bm.properties,title:"Jx Project Core",type:"object"}}function WU(){return{$id:Ja,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/JxFieldSchema"},{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/RelationshipRef"}],description:"Default field-schema union for section entry schemas: the core field shape plus relationship references. Per-project entry documents override this resource with the "+"effective union. See specs/extensions.md §5.3.",title:"Jx Project Field Union"}}function zU(){return{$id:cs,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[...Fa,_m],description:"Default $paths-value union for documents: the core source shapes. Per-project entry documents override this resource with those members PLUS every extension-contributed paths shape.",title:"Jx Document Paths Union"}}function KU(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...K_}}function Hm(){return{$defs:{ClassConstructorDef:Nm,ClassFieldDef:Tm,ClassMethodDef:Mm,ClassParameterDef:Im,ConnectorBlockDef:Fm,FormatDef:Lm,ProjectBlockDef:Dm,ServerBlockDef:Jm,StudioHints:qm},$id:"https://jxsuite.com/schema/class/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Schema for Jx .class.json files. A class definition describes a schema-defined class with fields, constructor, methods, and type parameters. Optionally points to a JS module via $implementation for hybrid execution.",properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",examples:["./md.js","./lib/calculator.js"],type:"string"},$prototype:{const:"Class",description:'Must be "Class" for class definition files.',type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",examples:["MarkdownFile","DataSource","Calculator"],type:"string"}},required:["$prototype","title"],title:"Jx Class Definition",type:"object"}}async function GU(e){let{mkdirSync:t,writeFileSync:r}=await import("node:fs"),{resolve:n,dirname:i}=await import("node:path"),s=i(n(e,"..")),o=await HU(),a=UU(),c=Hm(),l=VU(),u=KU(),d=WU(),h=zU(),m=JSON.stringify(o,null,2),y=JSON.stringify(a,null,2),g=JSON.stringify(c,null,2),b=JSON.stringify(l,null,2),x=JSON.stringify(u,null,2),_=JSON.stringify(d,null,2),P=JSON.stringify(h,null,2),[E]=process.argv.slice(2);if(E)r(E,m,"utf8"),console.error(`Jx component schema written to ${E}`);else{r(n(s,"schema.json"),m,"utf8"),r(n(s,"project-schema.json"),y,"utf8"),r(n(s,"class-schema.json"),g,"utf8"),t(n(s,"schemas"),{recursive:!0}),r(n(s,"schemas","project.core.schema.json"),b,"utf8"),r(n(s,"schemas","project.fields.schema.json"),_,"utf8"),r(n(s,"schemas","document.paths.schema.json"),P,"utf8"),r(n(s,"extension-manifest.schema.json"),x,"utf8");let w=Bun.spawnSync(["bunx","oxfmt",n(s,"schemas","project.core.schema.json"),n(s,"schemas","project.fields.schema.json"),n(s,"schemas","document.paths.schema.json")],{cwd:s});if(w.exitCode!==0){let k=w.stderr.toString()||w.stdout.toString()||`exit ${w.exitCode}${w.signalCode?`, signal ${w.signalCode}`:""}`;console.error(`Warning: skipped oxfmt reformat of generated schemas (${k})`)}console.error("Generated:"),console.error(" schema.json (component)"),console.error(" project-schema.json"),console.error(" class-schema.json"),console.error(" schemas/project.core.schema.json"),console.error(" schemas/project.fields.schema.json"),console.error(" schemas/document.paths.schema.json"),console.error(" extension-manifest.schema.json")}}var eP,tP,rP,Q_=null,nP,Z_,xae;var iP=L(()=>{C1();T1();D1();F1();H1();V1();t_();r_();s_();f_();p_();h_();b_();$_();w_();F_();V_();z_();G_();au();Y_();X_();eP=Bt(x1(),1),tP=Bt(w1(),1),rP=Bt(j1(),1);nP={...uu,additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]}};[,Z_]=process.argv,xae=Z_?.endsWith("schema.ts")?GU(Z_):void 0});var za=C(function(aP){Object.defineProperty(aP,"__esModule",{value:!0});aP.regexpCode=aP.getEsmExportName=aP.getProperty=aP.safeStringify=aP.stringify=aP.strConcat=aP.addCodeArg=aP.str=aP._=aP.nil=aP._Code=aP.Name=aP.IDENTIFIER=aP._CodeOrName=void 0;class du{}aP._CodeOrName=du;aP.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class bo extends du{constructor(e){super();if(!aP.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}aP.Name=bo;class rn extends du{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((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof bo)t[r.str]=(t[r.str]||0)+1;return t},{})}}aP._Code=rn;aP.nil=new rn("");function sP(e,...t){let r=[e[0]],n=0;while(n<t.length)Vm(r,t[n]),r.push(e[++n]);return new rn(r)}aP._=sP;var Um=new rn("+");function oP(e,...t){let r=[Wa(e[0])],n=0;while(n<t.length)r.push(Um),Vm(r,t[n]),r.push(Um,Wa(e[++n]));return YU(r),new rn(r)}aP.str=oP;function Vm(e,t){if(t instanceof rn)e.push(...t._items);else if(t instanceof bo)e.push(t);else e.push(ZU(t))}aP.addCodeArg=Vm;function YU(e){let t=1;while(t<e.length-1){if(e[t]===Um){let r=XU(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function XU(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof bo||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof bo))return`"${e}${t.slice(1)}`;return}function QU(e,t){return t.emptyStr()?e:e.emptyStr()?t:oP`${e}${t}`}aP.strConcat=QU;function ZU(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Wa(Array.isArray(e)?e.join(","):e)}function e4(e){return new rn(Wa(e))}aP.stringify=e4;function Wa(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}aP.safeStringify=Wa;function t4(e){return typeof e=="string"&&aP.IDENTIFIER.test(e)?new rn(`.${e}`):sP`[${e}]`}aP.getProperty=t4;function r4(e){if(typeof e=="string"&&aP.IDENTIFIER.test(e))return new rn(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}aP.getEsmExportName=r4;function n4(e){return new rn(e.toString())}aP.regexpCode=n4});var Gm=C(function(fP){Object.defineProperty(fP,"__esModule",{value:!0});fP.ValueScope=fP.ValueScopeName=fP.Scope=fP.varKinds=fP.UsedValueState=void 0;var fr=za();class lP extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var mu;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(mu||(fP.UsedValueState=mu={}));fP.varKinds={const:new fr.Name("const"),let:new fr.Name("let"),var:new fr.Name("var")};class zm{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof fr.Name?e:this.name(e)}name(e){return new fr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}fP.Scope=zm;class Km extends fr.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=fr._`.${new fr.Name(t)}[${r}]`}}fP.ValueScopeName=Km;var g4=fr._`\n`;class uP extends zm{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?g4:fr.nil}}get(){return this._scope}name(e){return new Km(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,s=(r=t.key)!==null&&r!==void 0?r:t.ref,o=this._values[i];if(o){let l=o.get(s);if(l)return l}else o=this._values[i]=new Map;o.set(s,n);let a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return fr._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let i=fr.nil;for(let s in e){let o=e[s];if(!o)continue;let a=r[s]=r[s]||new Map;o.forEach((c)=>{if(a.has(c))return;a.set(c,mu.Started);let l=t(c);if(l){let u=this.opts.es5?fP.varKinds.var:fP.varKinds.const;i=fr._`${i}${u} ${c} = ${l};${this.opts._n}`}else if(l=n===null||n===void 0?void 0:n(c))i=fr._`${i}${l}${this.opts._n}`;else throw new lP(c);a.set(c,mu.Completed)})}return i}}fP.ValueScope=uP});var be=C(function(dr){Object.defineProperty(dr,"__esModule",{value:!0});dr.or=dr.and=dr.not=dr.CodeGen=dr.operators=dr.varKinds=dr.ValueScopeName=dr.ValueScope=dr.Scope=dr.Name=dr.regexpCode=dr.stringify=dr.getProperty=dr.nil=dr.strConcat=dr.str=dr._=void 0;var Re=za(),nn=Gm(),Si=za();Object.defineProperty(dr,"_",{enumerable:!0,get:function(){return Si._}});Object.defineProperty(dr,"str",{enumerable:!0,get:function(){return Si.str}});Object.defineProperty(dr,"strConcat",{enumerable:!0,get:function(){return Si.strConcat}});Object.defineProperty(dr,"nil",{enumerable:!0,get:function(){return Si.nil}});Object.defineProperty(dr,"getProperty",{enumerable:!0,get:function(){return Si.getProperty}});Object.defineProperty(dr,"stringify",{enumerable:!0,get:function(){return Si.stringify}});Object.defineProperty(dr,"regexpCode",{enumerable:!0,get:function(){return Si.regexpCode}});Object.defineProperty(dr,"Name",{enumerable:!0,get:function(){return Si.Name}});var $u=Gm();Object.defineProperty(dr,"Scope",{enumerable:!0,get:function(){return $u.Scope}});Object.defineProperty(dr,"ValueScope",{enumerable:!0,get:function(){return $u.ValueScope}});Object.defineProperty(dr,"ValueScopeName",{enumerable:!0,get:function(){return $u.ValueScopeName}});Object.defineProperty(dr,"varKinds",{enumerable:!0,get:function(){return $u.varKinds}});dr.operators={GT:new Re._Code(">"),GTE:new Re._Code(">="),LT:new Re._Code("<"),LTE:new Re._Code("<="),EQ:new Re._Code("==="),NEQ:new Re._Code("!=="),NOT:new Re._Code("!"),OR:new Re._Code("||"),AND:new Re._Code("&&"),ADD:new Re._Code("+")};class Ei{optimizeNodes(){return this}optimizeNames(e,t){return this}}class pP extends Ei{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?nn.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=$o(this.rhs,e,t);return this}get names(){return this.rhs instanceof Re._CodeOrName?this.rhs.names:{}}}class Qm extends Ei{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof Re.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=$o(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Re.Name?{}:{...this.lhs.names};return xu(e,this.rhs)}}class mP extends Qm{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class hP extends Ei{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class gP extends Ei{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class yP extends Ei{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class bP extends Ei{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=$o(this.code,e,t),this}get names(){return this.code instanceof Re._CodeOrName?this.code.names:{}}}class vu extends Ei{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let i=r[n];if(i.optimizeNames(e,t))continue;$4(e,i.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ls(e,t.names),{})}}class _i extends vu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class xP extends vu{}class Ka extends _i{}Ka.kind="else";class Kn extends _i{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Ka(r):r}if(t){if(e===!1)return t instanceof Kn?t:t.nodes;if(this.nodes.length)return this;return new Kn(EP(e),t instanceof Kn?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=$o(this.condition,e,t),this}get names(){let e=super.names;if(xu(e,this.condition),this.else)ls(e,this.else.names);return e}}Kn.kind="if";class xo extends _i{}xo.kind="for";class $P extends xo{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=$o(this.iteration,e,t),this}get names(){return ls(super.names,this.iteration.names)}}class vP extends xo{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?nn.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=xu(super.names,this.from);return xu(e,this.to)}}class Ym extends xo{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=$o(this.iterable,e,t),this}get names(){return ls(super.names,this.iterable.names)}}class hu extends _i{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}hu.kind="func";class gu extends vu{render(e){return"return "+super.render(e)}}gu.kind="return";class wP extends _i{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)ls(e,this.catch.names);if(this.finally)ls(e,this.finally.names);return e}}class yu extends _i{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}yu.kind="catch";class bu extends _i{render(e){return"finally"+super.render(e)}}bu.kind="finally";class SP{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
604
+ `:""},this._extScope=e,this._scope=new nn.Scope({parent:e}),this._nodes=[new xP]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let i=this._scope.toName(t);if(r!==void 0&&n)this._constants[i.str]=r;return this._leafNode(new pP(e,i,r)),i}const(e,t,r){return this._def(nn.varKinds.const,e,t,r)}let(e,t,r){return this._def(nn.varKinds.let,e,t,r)}var(e,t,r){return this._def(nn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Qm(e,t,r))}add(e,t){return this._leafNode(new mP(e,dr.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==Re.nil)this._leafNode(new bP(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),Re.addCodeArg(t,n)}return t.push("}"),new Re._Code(t)}if(e,t,r){if(this._blockNode(new Kn(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Kn(e))}else(){return this._elseNode(new Ka)}endIf(){return this._endBlockNode(Kn,Ka)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new $P(e),t)}forRange(e,t,r,n,i=this.opts.es5?nn.varKinds.var:nn.varKinds.let){let s=this._scope.toName(e);return this._for(new vP(i,s,t,r),()=>n(s))}forOf(e,t,r,n=nn.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let s=t instanceof Re.Name?t:this.var("_arr",t);return this.forRange("_i",0,Re._`${s}.length`,(o)=>{this.var(i,Re._`${s}[${o}]`),r(i)})}return this._for(new Ym("of",n,i,t),()=>r(i))}forIn(e,t,r,n=this.opts.es5?nn.varKinds.var:nn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,Re._`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new Ym("in",n,i,t),()=>r(i))}endFor(){return this._endBlockNode(xo)}label(e){return this._leafNode(new hP(e))}break(e){return this._leafNode(new gP(e))}return(e){let t=new gu;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(gu)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new wP;if(this._blockNode(n),this.code(e),t){let i=this.name("e");this._currNode=n.catch=new yu(i),t(i)}if(r)this._currNode=n.finally=new bu,this.code(r);return this._endBlockNode(yu,bu)}throw(e){return this._leafNode(new yP(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=Re.nil,r,n){if(this._blockNode(new hu(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(hu)}optimize(e=1){while(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,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Kn))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}dr.CodeGen=SP;function ls(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function xu(e,t){return t instanceof Re._CodeOrName?ls(e,t.names):e}function $o(e,t,r){if(e instanceof Re.Name)return n(e);if(!i(e))return e;return new Re._Code(e._items.reduce((s,o)=>{if(o instanceof Re.Name)o=n(o);if(o instanceof Re._Code)s.push(...o._items);else s.push(o);return s},[]));function n(s){let o=r[s.str];if(o===void 0||t[s.str]!==1)return s;return delete t[s.str],o}function i(s){return s instanceof Re._Code&&s._items.some((o)=>o instanceof Re.Name&&t[o.str]===1&&r[o.str]!==void 0)}}function $4(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function EP(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:Re._`!${Xm(e)}`}dr.not=EP;var v4=_P(dr.operators.AND);function w4(...e){return e.reduce(v4)}dr.and=w4;var S4=_P(dr.operators.OR);function E4(...e){return e.reduce(S4)}dr.or=E4;function _P(e){return(t,r)=>t===Re.nil?r:r===Re.nil?t:Re._`${Xm(t)} ${e} ${Xm(r)}`}function Xm(e){return e instanceof Re.Name?e:Re._`(${e})`}});var _e=C(function(TP){Object.defineProperty(TP,"__esModule",{value:!0});TP.checkStrictMode=TP.getErrorPath=TP.Type=TP.useFunc=TP.setEvaluated=TP.evaluatedPropsToName=TP.mergeEvaluated=TP.eachItem=TP.unescapeJsonPointer=TP.escapeJsonPointer=TP.escapeFragment=TP.unescapeFragment=TP.schemaRefOrVal=TP.schemaHasRulesButRef=TP.schemaHasRules=TP.checkUnknownRules=TP.alwaysValidSchema=TP.toHash=void 0;var Ue=be(),A4=za();function j4(e){let t={};for(let r of e)t[r]=!0;return t}TP.toHash=j4;function R4(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return jP(e,t),!RP(t,e.self.RULES.all)}TP.alwaysValidSchema=R4;function jP(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let i=n.RULES.keywords;for(let s in t)if(!i[s])IP(e,`unknown keyword: "${s}"`)}TP.checkUnknownRules=jP;function RP(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}TP.schemaHasRules=RP;function O4(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}TP.schemaHasRulesButRef=O4;function C4({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return Ue._`${r}`}return Ue._`${e}${t}${Ue.getProperty(n)}`}TP.schemaRefOrVal=C4;function I4(e){return OP(decodeURIComponent(e))}TP.unescapeFragment=I4;function T4(e){return encodeURIComponent(eh(e))}TP.escapeFragment=T4;function eh(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}TP.escapeJsonPointer=eh;function OP(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}TP.unescapeJsonPointer=OP;function N4(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}TP.eachItem=N4;function kP({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof Ue.Name?(s instanceof Ue.Name?e(i,s,o):t(i,s,o),o):s instanceof Ue.Name?(t(i,o,s),s):r(s,o);return a===Ue.Name&&!(c instanceof Ue.Name)?n(i,c):c}}TP.mergeEvaluated={props:kP({mergeNames:(e,t,r)=>e.if(Ue._`${r} !== true && ${t} !== undefined`,()=>{e.if(Ue._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,Ue._`${r} || {}`).code(Ue._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(Ue._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,Ue._`${r} || {}`),th(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:CP}),items:kP({mergeNames:(e,t,r)=>e.if(Ue._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,Ue._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(Ue._`${r} !== true`,()=>e.assign(r,t===!0?!0:Ue._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function CP(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",Ue._`{}`);if(t!==void 0)th(e,r,t);return r}TP.evaluatedPropsToName=CP;function th(e,t,r){Object.keys(r).forEach((n)=>e.assign(Ue._`${t}${Ue.getProperty(n)}`,!0))}TP.setEvaluated=th;var AP={};function M4(e,t){return e.scopeValue("func",{ref:t,code:AP[t.code]||(AP[t.code]=new A4._Code(t.code))})}TP.useFunc=M4;var Zm;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Zm||(TP.Type=Zm={}));function L4(e,t,r){if(e instanceof Ue.Name){let n=t===Zm.Num;return r?n?Ue._`"[" + ${e} + "]"`:Ue._`"['" + ${e} + "']"`:n?Ue._`"/" + ${e}`:Ue._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?Ue.getProperty(e).toString():"/"+eh(e)}TP.getErrorPath=L4;function IP(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}TP.checkStrictMode=IP});var Fr=C(function(MP){Object.defineProperty(MP,"__esModule",{value:!0});var Mt=be(),tV={data:new Mt.Name("data"),valCxt:new Mt.Name("valCxt"),instancePath:new Mt.Name("instancePath"),parentData:new Mt.Name("parentData"),parentDataProperty:new Mt.Name("parentDataProperty"),rootData:new Mt.Name("rootData"),dynamicAnchors:new Mt.Name("dynamicAnchors"),vErrors:new Mt.Name("vErrors"),errors:new Mt.Name("errors"),this:new Mt.Name("this"),self:new Mt.Name("self"),scope:new Mt.Name("scope"),json:new Mt.Name("json"),jsonPos:new Mt.Name("jsonPos"),jsonLen:new Mt.Name("jsonLen"),jsonPart:new Mt.Name("jsonPart")};MP.default=tV});var Ga=C(function(FP){Object.defineProperty(FP,"__esModule",{value:!0});FP.extendErrors=FP.resetErrorsCount=FP.reportExtraError=FP.reportError=FP.keyword$DataError=FP.keywordError=void 0;var Oe=be(),Su=_e(),Yt=Fr();FP.keywordError={message:({keyword:e})=>Oe.str`must pass "${e}" keyword validation`};FP.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Oe.str`"${e}" keyword must be ${t} ($data)`:Oe.str`"${e}" keyword is invalid ($data)`};function nV(e,t=FP.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:o,allErrors:a}=i,c=JP(e,t,r);if(n!==null&&n!==void 0?n:o||a)LP(s,c);else DP(i,Oe._`[${c}]`)}FP.reportError=nV;function iV(e,t=FP.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:o}=n,a=JP(e,t,r);if(LP(i,a),!(s||o))DP(n,Yt.default.vErrors)}FP.reportExtraError=iV;function sV(e,t){e.assign(Yt.default.errors,t),e.if(Oe._`${Yt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Oe._`${Yt.default.vErrors}.length`,t),()=>e.assign(Yt.default.vErrors,null)))}FP.resetErrorsCount=sV;function oV({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw Error("ajv implementation error");let o=e.name("err");e.forRange("i",i,Yt.default.errors,(a)=>{if(e.const(o,Oe._`${Yt.default.vErrors}[${a}]`),e.if(Oe._`${o}.instancePath === undefined`,()=>e.assign(Oe._`${o}.instancePath`,Oe.strConcat(Yt.default.instancePath,s.errorPath))),e.assign(Oe._`${o}.schemaPath`,Oe.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(Oe._`${o}.schema`,r),e.assign(Oe._`${o}.data`,n)})}FP.extendErrors=oV;function LP(e,t){let r=e.const("err",t);e.if(Oe._`${Yt.default.vErrors} === null`,()=>e.assign(Yt.default.vErrors,Oe._`[${r}]`),Oe._`${Yt.default.vErrors}.push(${r})`),e.code(Oe._`${Yt.default.errors}++`)}function DP(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;if(i.$async)r.throw(Oe._`new ${e.ValidationError}(${t})`);else r.assign(Oe._`${n}.errors`,t),r.return(!1)}var us={keyword:new Oe.Name("keyword"),schemaPath:new Oe.Name("schemaPath"),params:new Oe.Name("params"),propertyName:new Oe.Name("propertyName"),message:new Oe.Name("message"),schema:new Oe.Name("schema"),parentSchema:new Oe.Name("parentSchema")};function JP(e,t,r){let{createErrors:n}=e.it;if(n===!1)return Oe._`{}`;return aV(e,t,r)}function aV(e,t,r={}){let{gen:n,it:i}=e,s=[cV(i,r),lV(e,r)];return uV(e,t,s),n.object(...s)}function cV({errorPath:e},{instancePath:t}){let r=t?Oe.str`${e}${Su.getErrorPath(t,Su.Type.Str)}`:e;return[Yt.default.instancePath,Oe.strConcat(Yt.default.instancePath,r)]}function lV({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:Oe.str`${t}/${e}`;if(r)i=Oe.str`${i}${Su.getErrorPath(r,Su.Type.Str)}`;return[us.schemaPath,i]}function uV(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;if(n.push([us.keyword,i],[us.params,typeof t=="function"?t(e):t||Oe._`{}`]),c.messages)n.push([us.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([us.schema,o],[us.parentSchema,Oe._`${u}${d}`],[Yt.default.data,s]);if(l)n.push([us.propertyName,l])}});var VP=C(function(HP){Object.defineProperty(HP,"__esModule",{value:!0});HP.boolOrEmptySchema=HP.topBoolOrEmptySchema=void 0;var hV=Ga(),gV=be(),yV=Fr(),bV={message:"boolean schema is false"};function xV(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)BP(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(yV.default.data);else t.assign(gV._`${n}.errors`,null),t.return(!0)}HP.topBoolOrEmptySchema=xV;function $V(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),BP(e);else r.var(t,!0)}HP.boolOrEmptySchema=$V;function BP(e,t){let{gen:r,data:n}=e;hV.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},bV,void 0,t)}});var nh=C(function(WP){Object.defineProperty(WP,"__esModule",{value:!0});WP.getRules=WP.isJSONType=void 0;var wV=["string","number","integer","boolean","null","object","array"],SV=new Set(wV);function EV(e){return typeof e=="string"&&SV.has(e)}WP.isJSONType=EV;function _V(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}WP.getRules=_V});var ih=C(function(YP){Object.defineProperty(YP,"__esModule",{value:!0});YP.shouldUseRule=YP.shouldUseGroup=YP.schemaHasRulesForType=void 0;function kV({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&KP(e,n)}YP.schemaHasRulesForType=kV;function KP(e,t){return t.rules.some((r)=>GP(e,r))}YP.shouldUseGroup=KP;function GP(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}YP.shouldUseRule=GP});var Ya=C(function(tk){Object.defineProperty(tk,"__esModule",{value:!0});tk.reportTypeError=tk.checkDataTypes=tk.checkDataType=tk.coerceAndCheckDataType=tk.getJSONTypes=tk.getSchemaTypes=tk.DataType=void 0;var RV=nh(),OV=ih(),CV=Ga(),ve=be(),QP=_e(),vo;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(vo||(tk.DataType=vo={}));function IV(e){let t=ZP(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}tk.getSchemaTypes=IV;function ZP(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(RV.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}tk.getJSONTypes=ZP;function TV(e,t){let{gen:r,data:n,opts:i}=e,s=NV(t,i.coerceTypes),o=t.length>0&&!(s.length===0&&t.length===1&&OV.schemaHasRulesForType(e,t[0]));if(o){let a=oh(t,n,i.strictNumbers,vo.Wrong);r.if(a,()=>{if(s.length)MV(e,t,s);else ah(e)})}return o}tk.coerceAndCheckDataType=TV;var ek=new Set(["string","number","integer","boolean","null"]);function NV(e,t){return t?e.filter((r)=>ek.has(r)||t==="array"&&r==="array"):[]}function MV(e,t,r){let{gen:n,data:i,opts:s}=e,o=n.let("dataType",ve._`typeof ${i}`),a=n.let("coerced",ve._`undefined`);if(s.coerceTypes==="array")n.if(ve._`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,ve._`${i}[0]`).assign(o,ve._`typeof ${i}`).if(oh(t,i,s.strictNumbers),()=>n.assign(a,i)));n.if(ve._`${a} !== undefined`);for(let l of r)if(ek.has(l)||l==="array"&&s.coerceTypes==="array")c(l);n.else(),ah(e),n.endIf(),n.if(ve._`${a} !== undefined`,()=>{n.assign(i,a),LV(e,a)});function c(l){switch(l){case"string":n.elseIf(ve._`${o} == "number" || ${o} == "boolean"`).assign(a,ve._`"" + ${i}`).elseIf(ve._`${i} === null`).assign(a,ve._`""`);return;case"number":n.elseIf(ve._`${o} == "boolean" || ${i} === null
605
605
  || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,ve._`+${i}`);return;case"integer":n.elseIf(ve._`${o} === "boolean" || ${i} === null
606
606
  || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,ve._`+${i}`);return;case"boolean":n.elseIf(ve._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf(ve._`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf(ve._`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf(ve._`${o} === "string" || ${o} === "number"
607
- || ${o} === "boolean" || ${i} === null`).assign(a,ve._`[${i}]`)}}}function TV({gen:e,parentData:t,parentDataProperty:r},n){e.if(ve._`${t} !== undefined`,()=>e.assign(ve._`${t}[${r}]`,n))}function ih(e,t,r,n=vo.Correct){let i=n===vo.Correct?ve.operators.EQ:ve.operators.NEQ,s;switch(e){case"null":return ve._`${t} ${i} null`;case"array":s=ve._`Array.isArray(${t})`;break;case"object":s=ve._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=o(ve._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=o();break;default:return ve._`typeof ${t} ${i} ${e}`}return n===vo.Correct?s:ve.not(s);function o(a=ve.nil){return ve.and(ve._`typeof ${t} == "number"`,a,r?ve._`isFinite(${t})`:ve.nil)}}tk.checkDataType=ih;function sh(e,t,r,n){if(e.length===1)return ih(e[0],t,r,n);let i,s=QP.toHash(e);if(s.array&&s.object){let o=ve._`typeof ${t} != "object"`;i=s.null?o:ve._`!${t} || ${o}`,delete s.null,delete s.array,delete s.object}else i=ve.nil;if(s.number)delete s.integer;for(let o in s)i=ve.and(i,ih(o,t,r,n));return i}tk.checkDataTypes=sh;var NV={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?ve._`{type: ${e}}`:ve._`{type: ${t}}`};function oh(e){let t=MV(e);jV.reportError(t,NV)}tk.reportTypeError=oh;function MV(e){let{gen:t,data:r,schema:n}=e,i=QP.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var ok=C(function(ik){Object.defineProperty(ik,"__esModule",{value:!0});ik.assignDefaults=void 0;var wo=be(),HV=_e();function UV(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)nk(e,i,r[i].default);else if(t==="array"&&Array.isArray(n))n.forEach((i,s)=>nk(e,s,i.default))}ik.assignDefaults=UV;function nk(e,t,r){let{gen:n,compositeRule:i,data:s,opts:o}=e;if(r===void 0)return;let a=wo._`${s}${wo.getProperty(t)}`;if(i){HV.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=wo._`${a} === undefined`;if(o.useDefaults==="empty")c=wo._`${c} || ${a} === null || ${a} === ""`;n.if(c,wo._`${a} = ${wo.stringify(r)}`)}});var qr=C(function(lk){Object.defineProperty(lk,"__esModule",{value:!0});lk.validateUnion=lk.validateArray=lk.usePattern=lk.callValidateCode=lk.schemaProperties=lk.allSchemaProperties=lk.noPropertyInData=lk.propertyInData=lk.isOwnProperty=lk.hasPropFunc=lk.reportMissingProp=lk.checkMissingProp=lk.checkReportMissingProp=void 0;var Ye=be(),ah=_e(),Pi=Fr(),VV=_e();function WV(e,t){let{gen:r,data:n,it:i}=e;r.if(lh(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:Ye._`${t}`},!0),e.error()})}lk.checkReportMissingProp=WV;function zV({gen:e,data:t,it:{opts:r}},n,i){return Ye.or(...n.map((s)=>Ye.and(lh(e,t,s,r.ownProperties),Ye._`${i} = ${s}`)))}lk.checkMissingProp=zV;function KV(e,t){e.setParams({missingProperty:t},!0),e.error()}lk.reportMissingProp=KV;function ak(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Ye._`Object.prototype.hasOwnProperty`})}lk.hasPropFunc=ak;function ch(e,t,r){return Ye._`${ak(e)}.call(${t}, ${r})`}lk.isOwnProperty=ch;function GV(e,t,r,n){let i=Ye._`${t}${Ye.getProperty(r)} !== undefined`;return n?Ye._`${i} && ${ch(e,t,r)}`:i}lk.propertyInData=GV;function lh(e,t,r,n){let i=Ye._`${t}${Ye.getProperty(r)} === undefined`;return n?Ye.or(i,Ye.not(ch(e,t,r))):i}lk.noPropertyInData=lh;function ck(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}lk.allSchemaProperties=ck;function YV(e,t){return ck(t).filter((r)=>!ah.alwaysValidSchema(e,t[r]))}lk.schemaProperties=YV;function XV({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?Ye._`${e}, ${t}, ${n}${i}`:t,d=[[Pi.default.instancePath,Ye.strConcat(Pi.default.instancePath,s)],[Pi.default.parentData,o.parentData],[Pi.default.parentDataProperty,o.parentDataProperty],[Pi.default.rootData,Pi.default.rootData]];if(o.opts.dynamicRef)d.push([Pi.default.dynamicAnchors,Pi.default.dynamicAnchors]);let h=Ye._`${u}, ${r.object(...d)}`;return c!==Ye.nil?Ye._`${a}.call(${c}, ${h})`:Ye._`${a}(${h})`}lk.callValidateCode=XV;var QV=Ye._`new RegExp`;function ZV({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:Ye._`${i.code==="new RegExp"?QV:VV.useFunc(e,i)}(${r}, ${n})`})}lk.usePattern=ZV;function eW(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(s,!0),o(()=>t.break()),s;function o(a){let c=t.const("len",Ye._`${r}.length`);t.forRange("i",0,c,(l)=>{e.subschema({keyword:n,dataProp:l,dataPropType:ah.Type.Num},s),t.if(Ye.not(s),a)})}}lk.validateArray=eW;function tW(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>ah.alwaysValidSchema(i,c))&&!i.opts.unevaluated)return;let o=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let u=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);if(t.assign(o,Ye._`${o} || ${a}`),!e.mergeValidEvaluated(u,a))t.if(Ye.not(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}lk.validateUnion=tW});var hk=C(function(pk){Object.defineProperty(pk,"__esModule",{value:!0});pk.validateKeywordUsage=pk.validSchemaType=pk.funcKeywordCode=pk.macroKeywordCode=void 0;var Xt=be(),fs=Fr(),mW=qr(),hW=Ga();function gW(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=e,a=t.macro.call(o.self,i,s,o),c=dk(r,n,a);if(o.opts.validateSchema!==!1)o.self.validateSchema(a,!0);let l=r.name("valid");e.subschema({schema:a,schemaPath:Xt.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}pk.macroKeywordCode=gW;function yW(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=e;xW(c,t);let l=!a&&t.compile?t.compile.call(c.self,s,o,c):t.validate,u=dk(n,i,l),d=n.let("valid");e.block$data(d,h),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function h(){if(t.errors===!1){if(g(),t.modifying)fk(e);b(()=>e.error())}else{let x=t.async?m():y();if(t.modifying)fk(e);b(()=>bW(e,x))}}function m(){let x=n.let("ruleErrs",null);return n.try(()=>g(Xt._`await `),(_)=>n.assign(d,!1).if(Xt._`${_} instanceof ${c.ValidationError}`,()=>n.assign(x,Xt._`${_}.errors`),()=>n.throw(_))),x}function y(){let x=Xt._`${u}.errors`;return n.assign(x,null),g(Xt.nil),x}function g(x=t.async?Xt._`await `:Xt.nil){let _=c.opts.passContext?fs.default.this:fs.default.self,k=!(("compile"in t)&&!a||t.schema===!1);n.assign(d,Xt._`${x}${mW.callValidateCode(e,u,_,k)}`,t.modifying)}function b(x){var _;n.if(Xt.not((_=t.valid)!==null&&_!==void 0?_:d),x)}}pk.funcKeywordCode=yW;function fk(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,Xt._`${n.parentData}[${n.parentDataProperty}]`))}function bW(e,t){let{gen:r}=e;r.if(Xt._`Array.isArray(${t})`,()=>{r.assign(fs.default.vErrors,Xt._`${fs.default.vErrors} === null ? ${t} : ${fs.default.vErrors}.concat(${t})`).assign(fs.default.errors,Xt._`${fs.default.vErrors}.length`),hW.extendErrors(e)},()=>e.error())}function xW({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function dk(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:Xt.stringify(r)})}function $W(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}pk.validSchemaType=$W;function vW({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw Error("ajv implementation error");let o=i.dependencies;if(o===null||o===void 0?void 0:o.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}pk.validateKeywordUsage=vW});var xk=C(function(yk){Object.defineProperty(yk,"__esModule",{value:!0});yk.extendSubschemaMode=yk.extendSubschemaData=yk.getSubschema=void 0;var En=be(),gk=_e();function _W(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:En._`${e.schemaPath}${En.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:En._`${e.schemaPath}${En.getProperty(t)}${En.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${gk.escapeFragment(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')}yk.getSubschema=_W;function PW(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=t,h=a.let("data",En._`${t.data}${En.getProperty(r)}`,!0);c(h),e.errorPath=En.str`${l}${gk.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=En._`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(i!==void 0){let l=i instanceof En.Name?i:a.let("data",i,!0);if(c(l),o!==void 0)e.propertyName=o}if(s)e.dataTypes=s;function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}yk.extendSubschemaData=PW;function kW(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){if(n!==void 0)e.compositeRule=n;if(i!==void 0)e.createErrors=i;if(s!==void 0)e.allErrors=s;e.jtdDiscriminator=t,e.jtdMetadata=r}yk.extendSubschemaMode=kW});var uh=C(function(Bae,$k){$k.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}});var wk=C(function(Hae,vk){var ki=vk.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Eu(t,n,i,e,"",e)};ki.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ki.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ki.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ki.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 Eu(e,t,r,n,i,s,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in ki.arrayKeywords)for(var h=0;h<d.length;h++)Eu(e,t,r,d[h],i+"/"+u+"/"+h,s,i,u,n,h)}else if(u in ki.propsKeywords){if(d&&typeof d=="object")for(var m in d)Eu(e,t,r,d[m],i+"/"+u+"/"+RW(m),s,i,u,n,m)}else if(u in ki.keywords||e.allKeys&&!(u in ki.skipKeywords))Eu(e,t,r,d,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,c,l)}}function RW(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Xa=C(function(Pk){Object.defineProperty(Pk,"__esModule",{value:!0});Pk.getSchemaRefs=Pk.resolveUrl=Pk.normalizeId=Pk._getFullPath=Pk.getFullPath=Pk.inlineRef=void 0;var OW=_e(),CW=uh(),IW=wk(),TW=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function NW(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!fh(e);if(!t)return!1;return Sk(e)<=t}Pk.inlineRef=NW;var MW=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function fh(e){for(let t in e){if(MW.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(fh))return!0;if(typeof r=="object"&&fh(r))return!0}return!1}function Sk(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,TW.has(r))continue;if(typeof e[r]=="object")OW.eachItem(e[r],(n)=>t+=Sk(n));if(t===1/0)return 1/0}return t}function Ek(e,t="",r){if(r!==!1)t=So(t);let n=e.parse(t);return _k(e,n)}Pk.getFullPath=Ek;function _k(e,t){return e.serialize(t).split("#")[0]+"#"}Pk._getFullPath=_k;var LW=/#\/?$/;function So(e){return e?e.replace(LW,""):""}Pk.normalizeId=So;function DW(e,t,r){return r=So(r),e.resolve(t,r)}Pk.resolveUrl=DW;var JW=/^[a-z_][-a-z0-9._]*$/i;function FW(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=So(e[r]||t),s={"":i},o=Ek(n,i,!1),a={},c=new Set;return IW(e,{allKeys:!0},(d,h,m,y)=>{if(y===void 0)return;let g=o+h,b=s[y];if(typeof d[r]=="string")b=x.call(this,d[r]);_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),s[h]=b;function x(k){let E=this.opts.uriResolver.resolve;if(k=So(b?E(b,k):k),c.has(k))throw u(k);c.add(k);let w=this.refs[k];if(typeof w=="string")w=this.refs[w];if(typeof w=="object")l(d,w.schema,k);else if(k!==So(g))if(k[0]==="#")l(d,a[k],k),a[k]=d;else this.refs[k]=g;return k}function _(k){if(typeof k=="string"){if(!JW.test(k))throw Error(`invalid anchor "${k}"`);x.call(this,`#${k}`)}}}),a;function l(d,h,m){if(h!==void 0&&!CW(d,h))throw u(m)}function u(d){return Error(`reference "${d}" resolves to more than one schema`)}}Pk.getSchemaRefs=FW});var Eo=C(function(Bk){Object.defineProperty(Bk,"__esModule",{value:!0});Bk.getData=Bk.KeywordCxt=Bk.validateFunctionCode=void 0;var Ok=VP(),Ck=Ya(),dh=nh(),_u=Ya(),WW=ok(),Qa=hk(),ph=xk(),se=be(),ge=Fr(),zW=Xa(),Gn=_e(),Za=Ga();function KW(e){if(Nk(e)){if(Mk(e),Tk(e)){XW(e);return}}Ik(e,()=>Ok.topBoolOrEmptySchema(e))}Bk.validateFunctionCode=KW;function Ik({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){if(i.code.es5)e.func(t,se._`${ge.default.data}, ${ge.default.valCxt}`,n.$async,()=>{e.code(se._`"use strict"; ${Ak(r,i)}`),YW(e,i),e.code(s)});else e.func(t,se._`${ge.default.data}, ${GW(i)}`,n.$async,()=>e.code(Ak(r,i)).code(s))}function GW(e){return se._`{${ge.default.instancePath}="", ${ge.default.parentData}, ${ge.default.parentDataProperty}, ${ge.default.rootData}=${ge.default.data}${e.dynamicRef?se._`, ${ge.default.dynamicAnchors}={}`:se.nil}}={}`}function YW(e,t){e.if(ge.default.valCxt,()=>{if(e.var(ge.default.instancePath,se._`${ge.default.valCxt}.${ge.default.instancePath}`),e.var(ge.default.parentData,se._`${ge.default.valCxt}.${ge.default.parentData}`),e.var(ge.default.parentDataProperty,se._`${ge.default.valCxt}.${ge.default.parentDataProperty}`),e.var(ge.default.rootData,se._`${ge.default.valCxt}.${ge.default.rootData}`),t.dynamicRef)e.var(ge.default.dynamicAnchors,se._`${ge.default.valCxt}.${ge.default.dynamicAnchors}`)},()=>{if(e.var(ge.default.instancePath,se._`""`),e.var(ge.default.parentData,se._`undefined`),e.var(ge.default.parentDataProperty,se._`undefined`),e.var(ge.default.rootData,ge.default.data),t.dynamicRef)e.var(ge.default.dynamicAnchors,se._`{}`)})}function XW(e){let{schema:t,opts:r,gen:n}=e;Ik(e,()=>{if(r.$comment&&t.$comment)Dk(e);if(r6(e),n.let(ge.default.vErrors,null),n.let(ge.default.errors,0),r.unevaluated)QW(e);Lk(e),s6(e)});return}function QW(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",se._`${r}.evaluated`),t.if(se._`${e.evaluated}.dynamicProps`,()=>t.assign(se._`${e.evaluated}.props`,se._`undefined`)),t.if(se._`${e.evaluated}.dynamicItems`,()=>t.assign(se._`${e.evaluated}.items`,se._`undefined`))}function Ak(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?se._`/*# sourceURL=${r} */`:se.nil}function ZW(e,t){if(Nk(e)){if(Mk(e),Tk(e)){e6(e,t);return}}Ok.boolOrEmptySchema(e,t)}function Tk({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Nk(e){return typeof e.schema!="boolean"}function e6(e,t){let{schema:r,gen:n,opts:i}=e;if(i.$comment&&r.$comment)Dk(e);n6(e),i6(e);let s=n.const("_errs",ge.default.errors);Lk(e,s),n.var(t,se._`${s} === ${ge.default.errors}`)}function Mk(e){Gn.checkUnknownRules(e),t6(e)}function Lk(e,t){if(e.opts.jtd)return jk(e,[],!1,t);let r=Ck.getSchemaTypes(e.schema),n=Ck.coerceAndCheckDataType(e,r);jk(e,r,!n,t)}function t6(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Gn.schemaHasRulesButRef(t,i.RULES))i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function r6(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Gn.checkStrictMode(e,"default is ignored in the schema root")}function n6(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=zW.resolveUrl(e.opts.uriResolver,e.baseId,t)}function i6(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Dk({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code(se._`${ge.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=se.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(se._`${ge.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function s6(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;if(r.$async)t.if(se._`${ge.default.errors} === 0`,()=>t.return(ge.default.data),()=>t.throw(se._`new ${i}(${ge.default.vErrors})`));else{if(t.assign(se._`${n}.errors`,ge.default.vErrors),s.unevaluated)o6(e);t.return(se._`${ge.default.errors} === 0`)}}function o6({gen:e,evaluated:t,props:r,items:n}){if(r instanceof se.Name)e.assign(se._`${t}.props`,r);if(n instanceof se.Name)e.assign(se._`${t}.items`,n)}function jk(e,t,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=e,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!Gn.schemaHasRulesButRef(s,u))){i.block(()=>Fk(e,"$ref",u.all.$ref.definition));return}if(!c.jtd)a6(e,t);i.block(()=>{for(let h of u.rules)d(h);d(u.post)});function d(h){if(!dh.shouldUseGroup(s,h))return;if(h.type){if(i.if(_u.checkDataType(h.type,o,c.strictNumbers)),Rk(e,h),t.length===1&&t[0]===h.type&&r)i.else(),_u.reportTypeError(e);i.endIf()}else Rk(e,h);if(!a)i.if(se._`${ge.default.errors} === ${n||0}`)}}function Rk(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;if(i)WW.assignDefaults(e,t.type);r.block(()=>{for(let s of t.rules)if(dh.shouldUseRule(n,s))Fk(e,s.keyword,s.definition,t.type)})}function a6(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(c6(e,t),!e.opts.allowUnionTypes)l6(e,t);u6(e,e.dataTypes)}function c6(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Jk(e.dataTypes,r))mh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),d6(e,t)}function l6(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))mh(e,"use allowUnionTypes to allow union type keyword")}function u6(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&dh.shouldUseRule(e.schema,i)){let{type:s}=i.definition;if(s.length&&!s.some((o)=>f6(t,o)))mh(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function f6(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Jk(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function d6(e,t){let r=[];for(let n of e.dataTypes)if(Jk(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function mh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Gn.checkStrictMode(e,t,e.opts.strictTypes)}class hh{constructor(e,t,r){if(Qa.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Gn.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",qk(this.$data,e));else if(this.schemaCode=this.schemaValue,!Qa.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",ge.default.errors)}result(e,t,r){this.failResult(se.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(se.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(se._`${t} !== undefined && (${se.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Za.reportExtraError:Za.reportError)(this,this.def.error,t)}$dataError(){Za.reportError(this,this.def.$dataError||Za.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Za.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=se.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=se.nil,t=se.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:i,def:s}=this;if(r.if(se.or(se._`${n} === undefined`,t)),e!==se.nil)r.assign(e,!0);if(i.length||s.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==se.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return se.or(s(),o());function s(){if(r.length){if(!(t instanceof se.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return se._`${_u.checkDataTypes(a,t,i.opts.strictNumbers,_u.DataType.Wrong)}`}return se.nil}function o(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return se._`!${a}(${t})`}return se.nil}}subschema(e,t){let r=ph.getSubschema(this.it,e);ph.extendSubschemaData(r,this.it,e),ph.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return ZW(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Gn.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Gn.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,se.Name)),!0}}Bk.KeywordCxt=hh;function Fk(e,t,r,n){let i=new hh(e,r,t);if("code"in r)r.code(i,n);else if(i.$data&&r.validate)Qa.funcKeywordCode(i,r);else if("macro"in r)Qa.macroKeywordCode(i,r);else if(r.compile||r.validate)Qa.funcKeywordCode(i,r)}var p6=/^\/(?:[^~]|~0|~1)*$/,m6=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function qk(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return ge.default.rootData;if(e[0]==="/"){if(!p6.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,s=ge.default.rootData}else{let l=m6.exec(e);if(!l)throw Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=t)throw Error(c("property/index",u));return n[t-u]}if(u>t)throw Error(c("data",u));if(s=r[t-u],!i)return s}let o=s,a=i.split("/");for(let l of a)if(l)s=se._`${s}${se.getProperty(Gn.unescapeJsonPointer(l))}`,o=se._`${o} && ${s}`;return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}Bk.getData=qk});var ec=C(function(Vk){Object.defineProperty(Vk,"__esModule",{value:!0});class Uk extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Vk.default=Uk});var _o=C(function(zk){Object.defineProperty(zk,"__esModule",{value:!0});var gh=Xa();class Wk extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=gh.resolveUrl(e,t,r),this.missingSchema=gh.normalizeId(gh.getFullPath(e,this.missingRef))}}zk.default=Wk});var rc=C(function(Yk){Object.defineProperty(Yk,"__esModule",{value:!0});Yk.resolveSchema=Yk.getCompilingSchema=Yk.resolveRef=Yk.compileSchema=Yk.SchemaEnv=void 0;var sn=be(),x6=ec(),ds=Fr(),on=Xa(),Kk=_e(),$6=Eo();class tc{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:on.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}Yk.SchemaEnv=tc;function bh(e){let t=Gk.call(this,e);if(t)return t;let r=on.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new sn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;if(e.$async)a=o.scopeValue("Error",{ref:x6.default,code:sn._`require("ajv/dist/runtime/validation_error").default`});let c=o.scopeName("validate");e.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:ds.default.data,parentData:ds.default.parentData,parentDataProperty:ds.default.parentDataProperty,dataNames:[ds.default.data],dataPathArr:[sn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:sn.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:sn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:sn._`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),$6.validateFunctionCode(l),o.optimize(this.opts.code.optimize);let d=o.toString();if(u=`${o.scopeRefs(ds.default.scope)}return ${d}`,this.opts.code.process)u=this.opts.code.process(u,e);let m=Function(`${ds.default.self}`,`${ds.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async)m.$async=!0;if(this.opts.code.source===!0)m.source={validateName:c,validateCode:d,scopeValues:o._values};if(this.opts.unevaluated){let{props:y,items:g}=l;if(m.evaluated={props:y instanceof sn.Name?void 0:y,items:g instanceof sn.Name?void 0:g,dynamicProps:y instanceof sn.Name,dynamicItems:g instanceof sn.Name},m.source)m.source.evaluated=sn.stringify(m.evaluated)}return e.validate=m,e}catch(d){if(delete e.validate,delete e.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw d}finally{this._compilations.delete(e)}}Yk.compileSchema=bh;function v6(e,t,r){var n;r=on.resolveUrl(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=E6.call(this,e,r);if(s===void 0){let o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(o)s=new tc({schema:o,schemaId:a,root:e,baseId:t})}if(s===void 0)return;return e.refs[r]=w6.call(this,s)}Yk.resolveRef=v6;function w6(e){if(on.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:bh.call(this,e)}function Gk(e){for(let t of this._compilations)if(S6(t,e))return t}Yk.getCompilingSchema=Gk;function S6(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function E6(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||Pu.call(this,e,t)}function Pu(e,t){let r=this.opts.uriResolver.parse(t),n=on._getFullPath(this.opts.uriResolver,r),i=on.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return yh.call(this,r,e);let s=on.normalizeId(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=Pu.call(this,e,o);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return yh.call(this,r,a)}if(typeof(o===null||o===void 0?void 0:o.schema)!=="object")return;if(!o.validate)bh.call(this,o);if(s===on.normalizeId(t)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];if(l)i=on.resolveUrl(this.opts.uriResolver,i,l);return new tc({schema:a,schemaId:c,root:e,baseId:i})}return yh.call(this,r,o)}Yk.resolveSchema=Pu;var _6=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function yh(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[Kk.unescapeFragment(a)];if(c===void 0)return;r=c;let l=typeof r==="object"&&r[this.opts.schemaId];if(!_6.has(a)&&l)t=on.resolveUrl(this.opts.uriResolver,t,l)}let s;if(typeof r!="boolean"&&r.$ref&&!Kk.schemaHasRulesButRef(r,this.RULES)){let a=on.resolveUrl(this.opts.uriResolver,t,r.$ref);s=Pu.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new tc({schema:r,schemaId:o,root:n,baseId:t}),s.schema!==s.root.schema)return s;return}});var Qk=C(function(Gae,R6){R6.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 Eh=C(function(Yae,sA){var O6=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),$h=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),C6=RegExp.prototype.test.bind(/^\d*$/u),ps=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),vh=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),eA=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),wh=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),I6=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),pr=Array(256);for(let t=0;t<256;t++)pr[t]="%"+"0123456789ABCDEF"[t>>4]+"0123456789ABCDEF"[t&15];function Lt(e){if(e<2048)return pr[192|e>>6]+pr[128|e&63];if(e<65536)return pr[224|e>>12]+pr[128|e>>6&63]+pr[128|e&63];return pr[240|e>>18]+pr[128|e>>12&63]+pr[128|e>>6&63]+pr[128|e&63]}function T6(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var N6=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),M6=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),L6=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),D6=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function J6(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){if(L6(e[t]))continue;if(e[t]==="%"&&t+2<e.length&&ps(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function Zk(e){let t=-1,r=0,n=-1,i=0;for(let a=0;a<e.length;a++)if(e[a]==="0"){if(n===-1)n=a;if(i++,i>r)r=i,t=n}else n=-1,i=0;if(r<2)return e.join(":");let s=e.slice(0,t).join(":"),o=e.slice(t+r).join(":");return s+"::"+o}function F6(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),n=t===-1?[]:e.slice(t+2).split(":");if(t!==-1){if(r.length===1&&r[0]==="")r.length=0;if(n.length===1&&n[0]==="")n.length=0}let i=r.concat(n),s=0;for(let a=0;a<i.length;a++){let c=i[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==i.length-1||t!==-1&&n.length===0||!$h(c))return;s+=2;continue}if(!N6(c))return;i[a]=parseInt(c,16).toString(16),s++}if(t===-1){if(s!==8)return;return Zk(i)}if(s>=8)return;let o=i.slice(0,r.length);for(let a=s;a<8;a++)o.push("0");for(let a=r.length;a<i.length;a++)o.push(i[a]);return Zk(o)}function xh(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let n=t?e.slice(1,-1):e;if(t&&M6(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(q6(n,":")<2)return{host:e,isIPV6:!1,error:t};let i="",s=n.indexOf("%");if(s!==-1){let a=n.slice(s,s+3).toLowerCase()==="%25"?3:1;if(i=n.slice(s+a),!J6(i))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,s)}let o=F6(n);if(o===void 0)return{host:e,isIPV6:!1,error:!0};return{host:o+(i?"%"+i:""),escapedHost:o+(i?"%25"+i:""),isIPV6:!0}}function q6(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function B6(e){let t=e,r=[],n=-1,i=0;while(i=t.length){if(i===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(i===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(i===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}var H6={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},U6=/[@/?#:]/g,V6=/[@/?#]/g;function tA(e,t){let r=t?V6:U6;return r.lastIndex=0,e.replace(r,(n)=>H6[n])}function rA(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(t&&vh(o))r+=o;else r+="%"+s;n+=2;continue}}r+=e[n]}return r}function W6(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(o!=="."&&vh(o))t+=o;else t+="%"+s;r+=2;continue}}if(eA(n))t+=n;else{let i=e.charCodeAt(r);if(i<128)t+=iA(i)?n:pr[i];else if(i<55296||i>57343)t+=Lt(i);else if(i<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);if(s>=56320&&s<=57343)t+=Lt(65536+(i-55296<<10)+(s-56320)),r++;else t+=Lt(65533)}else t+=Lt(65533)}}return t}function z6(e,t=!1){let r="",n=t&&e[0]!=="/";for(let i=0;i<e.length;i++){let s=e[i];if(s==="%"&&i+2<e.length){let o=e.slice(i+1,i+3);if(ps(o)){r+="%"+o.toUpperCase(),i+=2;continue}}if(s==="/")n=!1;if(eA(s)&&(s!==":"||!n))r+=s;else{let o=e.charCodeAt(i);if(o<128)r+=pr[o];else if(o<55296||o>57343)r+=Lt(o);else if(o<=56319&&i+1<e.length){let a=e.charCodeAt(i+1);if(a>=56320&&a<=57343)r+=Lt(65536+(o-55296<<10)+(a-56320)),i++;else r+=Lt(65533)}else r+=Lt(65533)}}return r}function Sh(e,t){let r="";for(let n=0;n<e.length;n++){let i=e[n];if(i==="%"&&n+2<e.length){let s=e.slice(n+1,n+3);if(ps(s)){r+="%"+s.toUpperCase(),n+=2;continue}}if(t(i))r+=i;else{let s=e.charCodeAt(n);if(s<128)r+=pr[s];else if(s<55296||s>57343)r+=Lt(s);else if(s<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);if(o>=56320&&o<=57343)r+=Lt(65536+(s-55296<<10)+(o-56320)),n++;else r+=Lt(65533)}else r+=Lt(65533)}}return r}function nA(e){return Sh(e,I6)}function K6(e){return Sh(e,wh)}function G6(e){return Sh(e,wh)}function iA(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function Y6(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(vh(o))t+=o;else t+="%"+s;r+=2;continue}}if(wh(n))t+=n;else{let i=e.charCodeAt(r);if(i<128)t+=iA(i)?n:pr[i];else if(i<55296||i>57343)t+=Lt(i);else if(i<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);if(s>=56320&&s<=57343)t+=Lt(65536+(i-55296<<10)+(s-56320)),r++;else t+=Lt(65533)}else t+=Lt(65533)}}return t}function X6(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(ps(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function Q6(e){let t=[];if(e.userinfo!==void 0)t.push(nA(e.userinfo)),t.push("@");if(e.host!==void 0){let r=e.host;if(!$h(r)){let n=xh(r);if(n.isIPV6!==!0&&n.isIPVFuture!==!0)r=rA(r,!0),n=xh(r);if(n.isIPV6===!0||n.isIPVFuture===!0)r=`[${n.escapedHost}]`;else r=tA(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string"){let r=String(e.port);if(!C6(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}sA.exports={nonSimpleDomain:D6,recomposeAuthority:Q6,reescapeHostDelimiters:tA,normalizePercentEncoding:rA,normalizePathEncoding:W6,serializePathEncoding:z6,normalizeQueryFragmentEncoding:Y6,encodeUserinfo:nA,encodeQuery:K6,encodeFragment:G6,escapePreservingEscapes:X6,removeDotSegments:B6,isIPv4:$h,isUUID:O6,normalizeIPv6:xh,stringArrayToHexStripped:T6}});var uA=C(function(Xae,lA){var{isUUID:Z6}=Eh(),e9=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,t9=["http","https","ws","wss","urn","urn:uuid"];function r9(e){return t9.indexOf(e)!==-1}function _h(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function oA(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function aA(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function n9(e){return e.secure=_h(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function i9(e){if(e.port===(_h(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function s9(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(e9);if(r&&r[0]===e.path){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=Ph(i);if(e.path=void 0,s)e=s.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function o9(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=Ph(i);if(s)e=s.serialize(e,t);let o=e,a=e.nss;return o.path=`${n||t.nid}:${a}`,t.skipEscape=!0,o}function a9(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Z6(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function c9(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var cA={scheme:"http",domainHost:!0,parse:oA,serialize:aA},l9={scheme:"https",domainHost:cA.domainHost,parse:oA,serialize:aA},ku={scheme:"ws",domainHost:!0,parse:n9,serialize:i9},u9={scheme:"wss",domainHost:ku.domainHost,parse:ku.parse,serialize:ku.serialize},f9={scheme:"urn",parse:s9,serialize:o9,skipNormalize:!0},d9={scheme:"urn:uuid",parse:a9,serialize:c9,skipNormalize:!0},Au={http:cA,https:l9,ws:ku,wss:u9,urn:f9,"urn:uuid":d9};Object.setPrototypeOf(Au,null);function Ph(e){return e&&(Au[e]||Au[e.toLowerCase()])||void 0}lA.exports={wsIsSecure:_h,SCHEMES:Au,isValidSchemeName:r9,getSchemeHandler:Ph}});var wA=C(function(Qae,Ou){var{normalizeIPv6:hA,removeDotSegments:ic,recomposeAuthority:p9,normalizePercentEncoding:kh,normalizePathEncoding:m9,serializePathEncoding:fA,normalizeQueryFragmentEncoding:dA,encodeQuery:h9,encodeFragment:g9,reescapeHostDelimiters:y9,isIPv4:gA,nonSimpleDomain:b9}=Eh(),{SCHEMES:yA,getSchemeHandler:Ah}=uA(),bA=/^[A-Za-z][A-Za-z0-9+.-]*$/u;function pA(e){let t=unescape(String(e));if(!bA.test(t))throw TypeError("URI scheme is malformed.");return t}function x9(e,t){if(typeof e==="string")e=k9(e,t);else if(typeof e==="object")e=Ru(ms(e,t),t);return e}function $9(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:s,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:l}=ju(e,n),{parsed:u,malformedAuthorityOrPort:d,malformedPercentEncoding:h,malformedSchemeSpecific:m,malformedHost:y,malformedScheme:g}=ju(t,n);if(s||d||o||h||a||m||c||y||l||g)throw Error(i.error||u.error||"URI is malformed.");let b=xA(i,u,n,!0),x=Ah(r&&r.scheme||b.scheme),_=b.host,k=_!==void 0&&_!==""&&(gA(_)||hA(_).isIPV6);$A(b,r||{},x,k);let E=_&&_.indexOf("%")!==-1&&!/\P{ASCII}/u.test(_);if(b.error&&!E)throw Error(b.error);return n.skipEscape=!0,ms(b,n)}function xA(e,t,r,n){let i={};if(!n)e=Ru(ms(e,r),r),t=Ru(ms(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ic(t.path||""),i.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ic(t.path||""),i.query=t.query;else{if(!t.path)if(i.path=e.path,t.query!==void 0)i.query=t.query;else i.query=e.query;else{if(t.path[0]==="/")i.path=ic(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)i.path="/"+t.path;else if(!e.path)i.path=t.path;else i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;i.path=ic(i.path)}i.query=t.query}i.userinfo=e.userinfo,i.host=e.host,i.port=e.port}i.scheme=e.scheme}return i.fragment=t.fragment,i}function v9(e,t,r){let n=mA(e,r),i=mA(t,r);return n!==void 0&&i!==void 0&&n===i}function ms(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[];if(r.scheme)r.scheme=pA(r.scheme);let s=Ah(n.scheme||r.scheme);if(s&&s.serialize)s.serialize(r,n);let o=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=!n.skipEscape&&r.scheme===void 0&&!o;if(r.path!==void 0)if(!n.skipEscape)r.path=fA(r.path,a);else r.path=kh(r.path);if(n.reference!=="suffix"&&r.scheme)r.scheme=pA(r.scheme),i.push(r.scheme,":");let c=p9(r);if(c!==void 0){if(n.reference!=="suffix")i.push("//");if(i.push(c),r.path&&r.path[0]!=="/")i.push("/")}if(r.path!==void 0){let l=r.path;if(!n.absolutePath&&(!s||!s.absolutePath))l=ic(l);if(a)l=fA(l,!0);if(c===void 0&&l[0]==="/"&&l[1]==="/")l="/%2F"+l.slice(2);i.push(l)}if(r.query!==void 0)i.push("?",h9(r.query));if(r.fragment!==void 0)i.push("#",g9(r.fragment));return i.join("")}var w9=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,S9=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,E9=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function _9(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function nc(e){if(e===void 0)return!1;let t=e.indexOf("%");while(t!==-1){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function jh(e){return e[0]==="["&&e[e.length-1]==="]"}function P9(e){let t=e[4];return nc(e[3])||t!==void 0&&!jh(t)&&nc(t)||nc(e[6])||nc(e[7])||nc(e[8])}function $A(e,t,r,n){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!jh(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&b9(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(i){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+i,!0}return!1}function ju(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1,o=!1,a=!1,c=!1,l=!1,u=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let d=e.match(S9);if(d!==null&&d[1].indexOf("\\")!==-1)n.error="URI authority must not contain a literal backslash.",i=!0;let h=e.match(E9);if(h!==null){let y=h[1],g=y.replace(/[\t\n\r]/g,"");if(g.length>=2){if(g.slice(0,2)!=="//")n.error=n.error||"URI authority must not contain a literal backslash.",i=!0;else if(y.length!==g.length)n.error=n.error||"URI authority introducer must not contain whitespace.",i=!0}}let m=e.match(w9);if(m){if(n.scheme=m[1],n.userinfo=m[3],n.host=m[4],n.port=parseInt(m[5],10),n.path=m[6]||"",n.query=m[7],n.fragment=m[8],n.scheme!==void 0){let b=unescape(n.scheme);if(bA.test(b))n.scheme=b.toLowerCase();else n.error=n.error||"URI scheme is malformed.",l=!0}if(s=P9(m),s)n.error=n.error||"URI contains malformed percent-encoding.";if(isNaN(n.port))n.port=m[5];let y=_9(n,m);if(y!==void 0)n.error=n.error||y,i=!0;if(n.host)if(gA(n.host)===!1){let x=jh(n.host),_=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,k=hA(n.host);if(u=k.isIPV6||k.isIPVFuture===!0,c=_&&(!x||k.error===!0),n.host=u?k.host:k.host.toLowerCase(),c)n.error=n.error||"URI host is malformed.",i=!0}else u=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let g=Ah(r.scheme||n.scheme);if(!c)a=$A(n,r,g,u);if(e.indexOf("%")!==-1&&n.host!==void 0&&!c){let b=u?n.host:kh(n.host,!0);if(!u)b=kh(b.toLowerCase());n.host=y9(b,u)}if(!g||g&&!g.skipNormalize){if(n.path)n.path=m9(n.path);if(n.query)n.query=dA(n.query);if(n.fragment)n.fragment=dA(n.fragment)}if(g&&g.parse){if(g.parse(n,r),g===yA.urn&&n.nid===void 0)o=!0}}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:l}}function Ru(e,t){return ju(e,t).parsed}function k9(e,t){return vA(e,t).normalized}function vA(e,t){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:a}=ju(e,t);return{normalized:n||i||s||o||a?e:ms(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:a}}function mA(e,t){if(typeof e!=="string"&&typeof e!=="object")return;let r;try{r=typeof e==="string"?e:ms(e,t)}catch{return}let{normalized:n,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:c}=vA(r,t);return i||s||o||a||c?void 0:n}var Rh={SCHEMES:yA,normalize:x9,resolve:$9,resolveComponent:xA,equal:v9,serialize:ms,parse:Ru};Ou.exports=Rh;Ou.exports.default=Rh;Ou.exports.fastUri=Rh});var _A=C(function(EA){Object.defineProperty(EA,"__esModule",{value:!0});var SA=wA();SA.code='require("ajv/dist/runtime/uri").default';EA.default=SA});var Ih=C(function(Yn){Object.defineProperty(Yn,"__esModule",{value:!0});Yn.CodeGen=Yn.Name=Yn.nil=Yn.stringify=Yn.str=Yn._=Yn.KeywordCxt=void 0;var j9=Eo();Object.defineProperty(Yn,"KeywordCxt",{enumerable:!0,get:function(){return j9.KeywordCxt}});var Po=be();Object.defineProperty(Yn,"_",{enumerable:!0,get:function(){return Po._}});Object.defineProperty(Yn,"str",{enumerable:!0,get:function(){return Po.str}});Object.defineProperty(Yn,"stringify",{enumerable:!0,get:function(){return Po.stringify}});Object.defineProperty(Yn,"nil",{enumerable:!0,get:function(){return Po.nil}});Object.defineProperty(Yn,"Name",{enumerable:!0,get:function(){return Po.Name}});Object.defineProperty(Yn,"CodeGen",{enumerable:!0,get:function(){return Po.CodeGen}});var R9=ec(),RA=_o(),O9=rh(),oc=rc(),C9=be(),sc=Xa(),Cu=Ya(),Ch=_e(),PA=Qk(),I9=_A(),OA=(e,t)=>new RegExp(e,t);OA.code="new RegExp";var T9=["removeAdditional","useDefaults","coerceTypes"],N9=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),M9={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."},L9={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},kA=200;function D9(e){var t,r,n,i,s,o,a,c,l,u,d,h,m,y,g,b,x,_,k,E,w,P,R,j,D;let F=e.strict,N=(t=e.code)===null||t===void 0?void 0:t.optimize,q=N===!0||N===void 0?1:N||0,U=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:OA,ne=(i=e.uriResolver)!==null&&i!==void 0?i:I9.default;return{strictSchema:(o=(s=e.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:F)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:F)!==null&&u!==void 0?u:"log",strictTuples:(h=(d=e.strictTuples)!==null&&d!==void 0?d:F)!==null&&h!==void 0?h:"log",strictRequired:(y=(m=e.strictRequired)!==null&&m!==void 0?m:F)!==null&&y!==void 0?y:!1,code:e.code?{...e.code,optimize:q,regExp:U}:{optimize:q,regExp:U},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:kA,loopEnum:(b=e.loopEnum)!==null&&b!==void 0?b:kA,meta:(x=e.meta)!==null&&x!==void 0?x:!0,messages:(_=e.messages)!==null&&_!==void 0?_:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(E=e.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(w=e.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(P=e.validateSchema)!==null&&P!==void 0?P:!0,validateFormats:(R=e.validateFormats)!==null&&R!==void 0?R:!0,unicodeRegExp:(j=e.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(D=e.int32range)!==null&&D!==void 0?D:!0,uriResolver:ne}}class Iu{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,...D9(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new C9.ValueScope({scope:{},prefixes:N9,es5:t,lines:r}),this.logger=U9(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=O9.getRules(),AA.call(this,M9,e,"NOT SUPPORTED"),AA.call(this,L9,e,"DEPRECATED","warn"),this._metaOpts=B9.call(this),e.formats)F9.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)q9.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);J9.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=PA;if(r==="id")n={...PA},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(l,u){await i.call(this,l.$schema);let d=this._addSchema(l,u);return d.validate||s.call(this,d)}async function i(l){if(l&&!this.getSchema(l))await n.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(u){if(!(u instanceof RA.default))throw u;return o.call(this,u),await a.call(this,u.missingSchema),s.call(this,l)}}function o({missingSchema:l,missingRef:u}){if(this.refs[l])throw Error(`AnySchema ${l} is loaded but ${u} cannot be resolved`)}async function a(l){let u=await c.call(this,l);if(!this.refs[l])await i.call(this,u.$schema);if(!this.refs[l])this.addSchema(u,l,t)}async function c(l){let u=this._loading[l];if(u)return u;try{return await(this._loading[l]=r(l))}finally{delete this._loading[l]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,r,n);return this}let i;if(typeof e==="object"){let{schemaId:s}=this.opts;if(i=e[s],i!==void 0&&typeof i!="string")throw Error(`schema ${s} must be string`)}return t=sc.normalizeId(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw Error(i)}return n}getSchema(e){let t;while(typeof(t=jA.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new oc.SchemaEnv({schema:{},schemaId:r});if(t=oc.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=jA.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=sc.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(W9.call(this,r,t),!t)return Ch.eachItem(r,(i)=>Oh.call(this,i)),this;K9.call(this,t);let n={...t,type:Cu.getJSONTypes(t.type),schemaType:Cu.getJSONTypes(t.schemaType)};return Ch.eachItem(r,n.type.length===0?(i)=>Oh.call(this,i,n):(i)=>n.type.forEach((s)=>Oh.call(this,i,n,s))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((i)=>i.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,i)=>n+t+i)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let i=n.split("/").slice(1),s=e;for(let o of i)s=s[o];for(let o in r){let a=r[o];if(typeof a!="object")continue;let{$data:c}=a.definition,l=s[o];if(c&&l)s[o]=CA(l)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:o}=this.opts;if(typeof e=="object")s=e[o];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=sc.normalizeId(s||r);let c=sc.getSchemaRefs.call(this,e,r);if(a=new oc.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),i&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else oc.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{oc.compileSchema.call(this,e)}finally{this.opts=t}}}Iu.ValidationError=R9.default;Iu.MissingRefError=RA.default;Yn.default=Iu;function AA(e,t,r,n="error"){for(let i in e){let s=i;if(s in t)this.logger[n](`${r}: option ${i}. ${e[s]}`)}}function jA(e){return e=sc.normalizeId(e),this.schemas[e]||this.refs[e]}function J9(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function F9(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function q9(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function B9(){let e={...this.opts};for(let t of T9)delete e[t];return e}var H9={log(){},warn(){},error(){}};function U9(e){if(e===!1)return H9;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var V9=/^[a-z_$][a-z0-9_$:-]*$/i;function W9(e,t){let{RULES:r}=this;if(Ch.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!V9.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function Oh(e,t,r){var n;let i=t===null||t===void 0?void 0:t.post;if(r&&i)throw Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(!o)o={type:r,rules:[]},s.rules.push(o);if(s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Cu.getJSONTypes(t.type),schemaType:Cu.getJSONTypes(t.schemaType)}};if(t.before)z9.call(this,o,a,t.before);else o.rules.push(a);s.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function z9(e,t,r){let n=e.rules.findIndex((i)=>i.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function K9(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=CA(t);e.validateSchema=this.compile(t,!0)}var G9={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function CA(e){return{anyOf:[e,G9]}}});var TA=C(function(IA){Object.defineProperty(IA,"__esModule",{value:!0});var Q9={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};IA.default=Q9});var Mu=C(function(DA){Object.defineProperty(DA,"__esModule",{value:!0});DA.callRef=DA.getValidate=void 0;var ez=_o(),NA=qr(),mr=be(),ko=Fr(),MA=rc(),Tu=_e(),tz={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=MA.resolveRef.call(c,l,i,r);if(u===void 0)throw new ez.default(n.opts.uriResolver,i,r);if(u instanceof MA.SchemaEnv)return h(u);return m(u);function d(){if(s===l)return Nu(e,o,s,s.$async);let y=t.scopeValue("root",{ref:l});return Nu(e,mr._`${y}.validate`,l,l.$async)}function h(y){let g=LA(e,y);Nu(e,g,y,y.$async)}function m(y){let g=t.scopeValue("schema",a.code.source===!0?{ref:y,code:mr.stringify(y)}:{ref:y}),b=t.name("valid"),x=e.subschema({schema:y,dataTypes:[],schemaPath:mr.nil,topSchemaRef:g,errSchemaPath:r},b);e.mergeEvaluated(x),e.ok(b)}}};function LA(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):mr._`${r.scopeValue("wrapper",{ref:t})}.validate`}DA.getValidate=LA;function Nu(e,t,r,n){let{gen:i,it:s}=e,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?ko.default.this:mr.nil;if(n)u();else d();function u(){if(!a.$async)throw Error("async schema referenced by sync schema");let y=i.let("valid");i.try(()=>{if(i.code(mr._`await ${NA.callValidateCode(e,t,l)}`),m(t),!o)i.assign(y,!0)},(g)=>{if(i.if(mr._`!(${g} instanceof ${s.ValidationError})`,()=>i.throw(g)),h(g),!o)i.assign(y,!1)}),e.ok(y)}function d(){e.result(NA.callValidateCode(e,t,l),()=>m(t),()=>h(t))}function h(y){let g=mr._`${y}.errors`;i.assign(ko.default.vErrors,mr._`${ko.default.vErrors} === null ? ${g} : ${ko.default.vErrors}.concat(${g})`),i.assign(ko.default.errors,mr._`${ko.default.vErrors}.length`)}function m(y){var g;if(!s.opts.unevaluated)return;let b=(g=r===null||r===void 0?void 0:r.validate)===null||g===void 0?void 0:g.evaluated;if(s.props!==!0)if(b&&!b.dynamicProps){if(b.props!==void 0)s.props=Tu.mergeEvaluated.props(i,b.props,s.props)}else{let x=i.var("props",mr._`${y}.evaluated.props`);s.props=Tu.mergeEvaluated.props(i,x,s.props,mr.Name)}if(s.items!==!0)if(b&&!b.dynamicItems){if(b.items!==void 0)s.items=Tu.mergeEvaluated.items(i,b.items,s.items)}else{let x=i.var("items",mr._`${y}.evaluated.items`);s.items=Tu.mergeEvaluated.items(i,x,s.items,mr.Name)}}}DA.callRef=Nu;DA.default=tz});var Th=C(function(FA){Object.defineProperty(FA,"__esModule",{value:!0});var iz=TA(),sz=Mu(),oz=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",iz.default,sz.default];FA.default=oz});var BA=C(function(qA){Object.defineProperty(qA,"__esModule",{value:!0});var Du=be(),Ai=Du.operators,Lu={maximum:{okStr:"<=",ok:Ai.LTE,fail:Ai.GT},minimum:{okStr:">=",ok:Ai.GTE,fail:Ai.LT},exclusiveMaximum:{okStr:"<",ok:Ai.LT,fail:Ai.GTE},exclusiveMinimum:{okStr:">",ok:Ai.GT,fail:Ai.LTE}},cz={message:({keyword:e,schemaCode:t})=>Du.str`must be ${Lu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Du._`{comparison: ${Lu[e].okStr}, limit: ${t}}`},lz={keyword:Object.keys(Lu),type:"number",schemaType:"number",$data:!0,error:cz,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Du._`${r} ${Lu[t].fail} ${n} || isNaN(${r})`)}};qA.default=lz});var UA=C(function(HA){Object.defineProperty(HA,"__esModule",{value:!0});var ac=be(),fz={message:({schemaCode:e})=>ac.str`must be multiple of ${e}`,params:({schemaCode:e})=>ac._`{multipleOf: ${e}}`},dz={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:fz,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,o=t.let("res"),a=s?ac._`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:ac._`${o} !== parseInt(${o})`;e.fail$data(ac._`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};HA.default=dz});var zA=C(function(WA){Object.defineProperty(WA,"__esModule",{value:!0});function VA(e){let t=e.length,r=0,n=0,i;while(n<t)if(r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t){if(i=e.charCodeAt(n),(i&64512)===56320)n++}return r}WA.default=VA;VA.code='require("ajv/dist/runtime/ucs2length").default'});var GA=C(function(KA){Object.defineProperty(KA,"__esModule",{value:!0});var hs=be(),hz=_e(),gz=zA(),yz={message({keyword:e,schemaCode:t}){return hs.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>hs._`{limit: ${e}}`},bz={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:yz,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?hs.operators.GT:hs.operators.LT,o=i.opts.unicode===!1?hs._`${r}.length`:hs._`${hz.useFunc(e.gen,gz.default)}(${r})`;e.fail$data(hs._`${o} ${s} ${n}`)}};KA.default=bz});var XA=C(function(YA){Object.defineProperty(YA,"__esModule",{value:!0});var $z=qr(),vz=_e(),Ao=be(),wz={message:({schemaCode:e})=>Ao.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ao._`{pattern: ${e}}`},Sz={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:wz,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,l=c.code==="new RegExp"?Ao._`new RegExp`:vz.useFunc(t,c),u=t.let("valid");t.try(()=>t.assign(u,Ao._`${l}(${s}, ${a}).test(${r})`),()=>t.assign(u,!1)),e.fail$data(Ao._`!${u}`)}else{let c=$z.usePattern(e,i);e.fail$data(Ao._`!${c}.test(${r})`)}}};YA.default=Sz});var ZA=C(function(QA){Object.defineProperty(QA,"__esModule",{value:!0});var cc=be(),_z={message({keyword:e,schemaCode:t}){return cc.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>cc._`{limit: ${e}}`},Pz={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:_z,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?cc.operators.GT:cc.operators.LT;e.fail$data(cc._`Object.keys(${r}).length ${i} ${n}`)}};QA.default=Pz});var tj=C(function(ej){Object.defineProperty(ej,"__esModule",{value:!0});var uc=qr(),lc=be(),Az=_e(),jz={message:({params:{missingProperty:e}})=>lc.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>lc._`{missingProperty: ${e}}`},Rz={keyword:"required",type:"object",schemaType:"array",$data:!0,error:jz,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:o}=e,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors)l();else u();if(a.strictRequired){let m=e.parentSchema.properties,{definedProperties:y}=e.it;for(let g of r)if((m===null||m===void 0?void 0:m[g])===void 0&&!y.has(g)){let b=o.schemaEnv.baseId+o.errSchemaPath,x=`required property "${g}" is not defined at "${b}" (strictRequired)`;Az.checkStrictMode(o,x,o.opts.strictRequired)}}function l(){if(c||s)e.block$data(lc.nil,d);else for(let m of r)uc.checkReportMissingProp(e,m)}function u(){let m=t.let("missing");if(c||s){let y=t.let("valid",!0);e.block$data(y,()=>h(m,y)),e.ok(y)}else t.if(uc.checkMissingProp(e,r,m)),uc.reportMissingProp(e,m),t.else()}function d(){t.forOf("prop",n,(m)=>{e.setParams({missingProperty:m}),t.if(uc.noPropertyInData(t,i,m,a.ownProperties),()=>e.error())})}function h(m,y){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(y,uc.propertyInData(t,i,m,a.ownProperties)),t.if(lc.not(y),()=>{e.error(),t.break()})},lc.nil)}}};ej.default=Rz});var nj=C(function(rj){Object.defineProperty(rj,"__esModule",{value:!0});var fc=be(),Cz={message({keyword:e,schemaCode:t}){return fc.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>fc._`{limit: ${e}}`},Iz={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Cz,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?fc.operators.GT:fc.operators.LT;e.fail$data(fc._`${r}.length ${i} ${n}`)}};rj.default=Iz});var Ju=C(function(sj){Object.defineProperty(sj,"__esModule",{value:!0});var ij=uh();ij.code='require("ajv/dist/runtime/equal").default';sj.default=ij});var aj=C(function(oj){Object.defineProperty(oj,"__esModule",{value:!0});var Nh=Ya(),At=be(),Mz=_e(),Lz=Ju(),Dz={message:({params:{i:e,j:t}})=>At.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>At._`{i: ${e}, j: ${t}}`},Jz={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Dz,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=e;if(!n&&!i)return;let c=t.let("valid"),l=s.items?Nh.getSchemaTypes(s.items):[];e.block$data(c,u,At._`${o} === false`),e.ok(c);function u(){let y=t.let("i",At._`${r}.length`),g=t.let("j");e.setParams({i:y,j:g}),t.assign(c,!0),t.if(At._`${y} > 1`,()=>(d()?h:m)(y,g))}function d(){return l.length>0&&!l.some((y)=>y==="object"||y==="array")}function h(y,g){let b=t.name("item"),x=Nh.checkDataTypes(l,b,a.opts.strictNumbers,Nh.DataType.Wrong),_=t.const("indices",At._`{}`);t.for(At._`;${y}--;`,()=>{if(t.let(b,At._`${r}[${y}]`),t.if(x,At._`continue`),l.length>1)t.if(At._`typeof ${b} == "string"`,At._`${b} += "_"`);t.if(At._`typeof ${_}[${b}] == "number"`,()=>{t.assign(g,At._`${_}[${b}]`),e.error(),t.assign(c,!1).break()}).code(At._`${_}[${b}] = ${y}`)})}function m(y,g){let b=Mz.useFunc(t,Lz.default),x=t.name("outer");t.label(x).for(At._`;${y}--;`,()=>t.for(At._`${g} = ${y}; ${g}--;`,()=>t.if(At._`${b}(${r}[${y}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(x)})))}}};oj.default=Jz});var lj=C(function(cj){Object.defineProperty(cj,"__esModule",{value:!0});var Mh=be(),qz=_e(),Bz=Ju(),Hz={message:"must be equal to constant",params:({schemaCode:e})=>Mh._`{allowedValue: ${e}}`},Uz={keyword:"const",$data:!0,error:Hz,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;if(n||s&&typeof s=="object")e.fail$data(Mh._`!${qz.useFunc(t,Bz.default)}(${r}, ${i})`);else e.fail(Mh._`${s} !== ${r}`)}};cj.default=Uz});var fj=C(function(uj){Object.defineProperty(uj,"__esModule",{value:!0});var dc=be(),Wz=_e(),zz=Ju(),Kz={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>dc._`{allowedValues: ${e}}`},Gz={keyword:"enum",schemaType:"array",$data:!0,error:Kz,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e;if(!n&&i.length===0)throw Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c!==null&&c!==void 0?c:c=Wz.useFunc(t,zz.default),u;if(a||n)u=t.let("valid"),e.block$data(u,d);else{if(!Array.isArray(i))throw Error("ajv implementation error");let m=t.const("vSchema",s);u=dc.or(...i.map((y,g)=>h(m,g)))}e.pass(u);function d(){t.assign(u,!1),t.forOf("v",s,(m)=>t.if(dc._`${l()}(${r}, ${m})`,()=>t.assign(u,!0).break()))}function h(m,y){let g=i[y];return typeof g==="object"&&g!==null?dc._`${l()}(${r}, ${m}[${y}])`:dc._`${r} === ${g}`}}};uj.default=Gz});var Lh=C(function(dj){Object.defineProperty(dj,"__esModule",{value:!0});var Xz=BA(),Qz=UA(),Zz=GA(),e8=XA(),t8=ZA(),r8=tj(),n8=nj(),i8=aj(),s8=lj(),o8=fj(),a8=[Xz.default,Qz.default,Zz.default,e8.default,t8.default,r8.default,n8.default,i8.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s8.default,o8.default];dj.default=a8});var Jh=C(function(mj){Object.defineProperty(mj,"__esModule",{value:!0});mj.validateAdditionalItems=void 0;var gs=be(),Dh=_e(),l8={message:({params:{len:e}})=>gs.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>gs._`{limit: ${e}}`},u8={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:l8,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){Dh.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}pj(e,n)}};function pj(e,t){let{gen:r,schema:n,data:i,keyword:s,it:o}=e;o.items=!0;let a=r.const("len",gs._`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(gs._`${a} <= ${t.length}`);else if(typeof n=="object"&&!Dh.alwaysValidSchema(o,n)){let l=r.var("valid",gs._`${a} <= ${t.length}`);r.if(gs.not(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,a,(u)=>{if(e.subschema({keyword:s,dataProp:u,dataPropType:Dh.Type.Num},l),!o.allErrors)r.if(gs.not(l),()=>r.break())})}}mj.validateAdditionalItems=pj;mj.default=u8});var Fh=C(function(bj){Object.defineProperty(bj,"__esModule",{value:!0});bj.validateTuple=void 0;var gj=be(),Fu=_e(),d8=qr(),p8={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return yj(e,"additionalItems",t);if(r.items=!0,Fu.alwaysValidSchema(r,t))return;e.ok(d8.validateArray(e))}};function yj(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=e;if(u(i),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=Fu.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),l=n.const("len",gj._`${s}.length`);r.forEach((d,h)=>{if(Fu.alwaysValidSchema(a,d))return;n.if(gj._`${l} > ${h}`,()=>e.subschema({keyword:o,schemaProp:h,dataProp:h},c)),e.ok(c)});function u(d){let{opts:h,errSchemaPath:m}=a,y=r.length,g=y===d.minItems&&(y===d.maxItems||d[t]===!1);if(h.strictTuples&&!g){let b=`"${o}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;Fu.checkStrictMode(a,b,h.strictTuples)}}}bj.validateTuple=yj;bj.default=p8});var vj=C(function($j){Object.defineProperty($j,"__esModule",{value:!0});var h8=Fh(),g8={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>h8.validateTuple(e,"items")};$j.default=g8});var Ej=C(function(Sj){Object.defineProperty(Sj,"__esModule",{value:!0});var wj=be(),b8=_e(),x8=qr(),$8=Jh(),v8={message:({params:{len:e}})=>wj.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>wj._`{limit: ${e}}`},w8={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:v8,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;if(n.items=!0,b8.alwaysValidSchema(n,t))return;if(i)$8.validateAdditionalItems(e,i);else e.ok(x8.validateArray(e))}};Sj.default=w8});var Pj=C(function(_j){Object.defineProperty(_j,"__esModule",{value:!0});var Br=be(),qu=_e(),E8={message:({params:{min:e,max:t}})=>t===void 0?Br.str`must contain at least ${e} valid item(s)`:Br.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Br._`{minContains: ${e}}`:Br._`{minContains: ${e}, maxContains: ${t}}`},_8={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:E8,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,o,a,{minContains:c,maxContains:l}=n;if(s.opts.next)o=c===void 0?1:c,a=l;else o=1;let u=t.const("len",Br._`${i}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){qu.checkStrictMode(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){qu.checkStrictMode(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(qu.alwaysValidSchema(s,r)){let g=Br._`${u} >= ${o}`;if(a!==void 0)g=Br._`${g} && ${u} <= ${a}`;e.pass(g);return}s.items=!0;let d=t.name("valid");if(a===void 0&&o===1)m(d,()=>t.if(d,()=>t.break()));else if(o===0){if(t.let(d,!0),a!==void 0)t.if(Br._`${i}.length > 0`,h)}else t.let(d,!1),h();e.result(d,()=>e.reset());function h(){let g=t.name("_valid"),b=t.let("count",0);m(g,()=>t.if(g,()=>y(b)))}function m(g,b){t.forRange("i",0,u,(x)=>{e.subschema({keyword:"contains",dataProp:x,dataPropType:qu.Type.Num,compositeRule:!0},g),b()})}function y(g){if(t.code(Br._`${g}++`),a===void 0)t.if(Br._`${g} >= ${o}`,()=>t.assign(d,!0).break());else if(t.if(Br._`${g} > ${a}`,()=>t.assign(d,!1).break()),o===1)t.assign(d,!0);else t.if(Br._`${g} >= ${o}`,()=>t.assign(d,!0))}}};_j.default=_8});var Bu=C(function(jj){Object.defineProperty(jj,"__esModule",{value:!0});jj.validateSchemaDeps=jj.validatePropertyDeps=jj.error=void 0;var qh=be(),k8=_e(),pc=qr();jj.error={message:({params:{property:e,depsCount:t,deps:r}})=>qh.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>qh._`{property: ${e},
607
+ || ${o} === "boolean" || ${i} === null`).assign(a,ve._`[${i}]`)}}}function LV({gen:e,parentData:t,parentDataProperty:r},n){e.if(ve._`${t} !== undefined`,()=>e.assign(ve._`${t}[${r}]`,n))}function sh(e,t,r,n=vo.Correct){let i=n===vo.Correct?ve.operators.EQ:ve.operators.NEQ,s;switch(e){case"null":return ve._`${t} ${i} null`;case"array":s=ve._`Array.isArray(${t})`;break;case"object":s=ve._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=o(ve._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=o();break;default:return ve._`typeof ${t} ${i} ${e}`}return n===vo.Correct?s:ve.not(s);function o(a=ve.nil){return ve.and(ve._`typeof ${t} == "number"`,a,r?ve._`isFinite(${t})`:ve.nil)}}tk.checkDataType=sh;function oh(e,t,r,n){if(e.length===1)return sh(e[0],t,r,n);let i,s=QP.toHash(e);if(s.array&&s.object){let o=ve._`typeof ${t} != "object"`;i=s.null?o:ve._`!${t} || ${o}`,delete s.null,delete s.array,delete s.object}else i=ve.nil;if(s.number)delete s.integer;for(let o in s)i=ve.and(i,sh(o,t,r,n));return i}tk.checkDataTypes=oh;var DV={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?ve._`{type: ${e}}`:ve._`{type: ${t}}`};function ah(e){let t=JV(e);CV.reportError(t,DV)}tk.reportTypeError=ah;function JV(e){let{gen:t,data:r,schema:n}=e,i=QP.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var ok=C(function(ik){Object.defineProperty(ik,"__esModule",{value:!0});ik.assignDefaults=void 0;var wo=be(),WV=_e();function zV(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)nk(e,i,r[i].default);else if(t==="array"&&Array.isArray(n))n.forEach((i,s)=>nk(e,s,i.default))}ik.assignDefaults=zV;function nk(e,t,r){let{gen:n,compositeRule:i,data:s,opts:o}=e;if(r===void 0)return;let a=wo._`${s}${wo.getProperty(t)}`;if(i){WV.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=wo._`${a} === undefined`;if(o.useDefaults==="empty")c=wo._`${c} || ${a} === null || ${a} === ""`;n.if(c,wo._`${a} = ${wo.stringify(r)}`)}});var qr=C(function(lk){Object.defineProperty(lk,"__esModule",{value:!0});lk.validateUnion=lk.validateArray=lk.usePattern=lk.callValidateCode=lk.schemaProperties=lk.allSchemaProperties=lk.noPropertyInData=lk.propertyInData=lk.isOwnProperty=lk.hasPropFunc=lk.reportMissingProp=lk.checkMissingProp=lk.checkReportMissingProp=void 0;var Ye=be(),ch=_e(),Pi=Fr(),KV=_e();function GV(e,t){let{gen:r,data:n,it:i}=e;r.if(uh(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:Ye._`${t}`},!0),e.error()})}lk.checkReportMissingProp=GV;function YV({gen:e,data:t,it:{opts:r}},n,i){return Ye.or(...n.map((s)=>Ye.and(uh(e,t,s,r.ownProperties),Ye._`${i} = ${s}`)))}lk.checkMissingProp=YV;function XV(e,t){e.setParams({missingProperty:t},!0),e.error()}lk.reportMissingProp=XV;function ak(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Ye._`Object.prototype.hasOwnProperty`})}lk.hasPropFunc=ak;function lh(e,t,r){return Ye._`${ak(e)}.call(${t}, ${r})`}lk.isOwnProperty=lh;function QV(e,t,r,n){let i=Ye._`${t}${Ye.getProperty(r)} !== undefined`;return n?Ye._`${i} && ${lh(e,t,r)}`:i}lk.propertyInData=QV;function uh(e,t,r,n){let i=Ye._`${t}${Ye.getProperty(r)} === undefined`;return n?Ye.or(i,Ye.not(lh(e,t,r))):i}lk.noPropertyInData=uh;function ck(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}lk.allSchemaProperties=ck;function ZV(e,t){return ck(t).filter((r)=>!ch.alwaysValidSchema(e,t[r]))}lk.schemaProperties=ZV;function eW({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?Ye._`${e}, ${t}, ${n}${i}`:t,d=[[Pi.default.instancePath,Ye.strConcat(Pi.default.instancePath,s)],[Pi.default.parentData,o.parentData],[Pi.default.parentDataProperty,o.parentDataProperty],[Pi.default.rootData,Pi.default.rootData]];if(o.opts.dynamicRef)d.push([Pi.default.dynamicAnchors,Pi.default.dynamicAnchors]);let h=Ye._`${u}, ${r.object(...d)}`;return c!==Ye.nil?Ye._`${a}.call(${c}, ${h})`:Ye._`${a}(${h})`}lk.callValidateCode=eW;var tW=Ye._`new RegExp`;function rW({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:Ye._`${i.code==="new RegExp"?tW:KV.useFunc(e,i)}(${r}, ${n})`})}lk.usePattern=rW;function nW(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(s,!0),o(()=>t.break()),s;function o(a){let c=t.const("len",Ye._`${r}.length`);t.forRange("i",0,c,(l)=>{e.subschema({keyword:n,dataProp:l,dataPropType:ch.Type.Num},s),t.if(Ye.not(s),a)})}}lk.validateArray=nW;function iW(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>ch.alwaysValidSchema(i,c))&&!i.opts.unevaluated)return;let o=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let u=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);if(t.assign(o,Ye._`${o} || ${a}`),!e.mergeValidEvaluated(u,a))t.if(Ye.not(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}lk.validateUnion=iW});var hk=C(function(pk){Object.defineProperty(pk,"__esModule",{value:!0});pk.validateKeywordUsage=pk.validSchemaType=pk.funcKeywordCode=pk.macroKeywordCode=void 0;var Xt=be(),fs=Fr(),yW=qr(),bW=Ga();function xW(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=e,a=t.macro.call(o.self,i,s,o),c=dk(r,n,a);if(o.opts.validateSchema!==!1)o.self.validateSchema(a,!0);let l=r.name("valid");e.subschema({schema:a,schemaPath:Xt.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}pk.macroKeywordCode=xW;function $W(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=e;wW(c,t);let l=!a&&t.compile?t.compile.call(c.self,s,o,c):t.validate,u=dk(n,i,l),d=n.let("valid");e.block$data(d,h),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function h(){if(t.errors===!1){if(g(),t.modifying)fk(e);b(()=>e.error())}else{let x=t.async?m():y();if(t.modifying)fk(e);b(()=>vW(e,x))}}function m(){let x=n.let("ruleErrs",null);return n.try(()=>g(Xt._`await `),(_)=>n.assign(d,!1).if(Xt._`${_} instanceof ${c.ValidationError}`,()=>n.assign(x,Xt._`${_}.errors`),()=>n.throw(_))),x}function y(){let x=Xt._`${u}.errors`;return n.assign(x,null),g(Xt.nil),x}function g(x=t.async?Xt._`await `:Xt.nil){let _=c.opts.passContext?fs.default.this:fs.default.self,P=!(("compile"in t)&&!a||t.schema===!1);n.assign(d,Xt._`${x}${yW.callValidateCode(e,u,_,P)}`,t.modifying)}function b(x){var _;n.if(Xt.not((_=t.valid)!==null&&_!==void 0?_:d),x)}}pk.funcKeywordCode=$W;function fk(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,Xt._`${n.parentData}[${n.parentDataProperty}]`))}function vW(e,t){let{gen:r}=e;r.if(Xt._`Array.isArray(${t})`,()=>{r.assign(fs.default.vErrors,Xt._`${fs.default.vErrors} === null ? ${t} : ${fs.default.vErrors}.concat(${t})`).assign(fs.default.errors,Xt._`${fs.default.vErrors}.length`),bW.extendErrors(e)},()=>e.error())}function wW({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function dk(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:Xt.stringify(r)})}function SW(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}pk.validSchemaType=SW;function EW({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw Error("ajv implementation error");let o=i.dependencies;if(o===null||o===void 0?void 0:o.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}pk.validateKeywordUsage=EW});var xk=C(function(yk){Object.defineProperty(yk,"__esModule",{value:!0});yk.extendSubschemaMode=yk.extendSubschemaData=yk.getSubschema=void 0;var En=be(),gk=_e();function AW(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:En._`${e.schemaPath}${En.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:En._`${e.schemaPath}${En.getProperty(t)}${En.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${gk.escapeFragment(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')}yk.getSubschema=AW;function jW(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=t,h=a.let("data",En._`${t.data}${En.getProperty(r)}`,!0);c(h),e.errorPath=En.str`${l}${gk.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=En._`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(i!==void 0){let l=i instanceof En.Name?i:a.let("data",i,!0);if(c(l),o!==void 0)e.propertyName=o}if(s)e.dataTypes=s;function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}yk.extendSubschemaData=jW;function RW(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){if(n!==void 0)e.compositeRule=n;if(i!==void 0)e.createErrors=i;if(s!==void 0)e.allErrors=s;e.jtdDiscriminator=t,e.jtdMetadata=r}yk.extendSubschemaMode=RW});var fh=C(function(zae,$k){$k.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}});var wk=C(function(Kae,vk){var ki=vk.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Eu(t,n,i,e,"",e)};ki.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ki.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ki.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ki.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 Eu(e,t,r,n,i,s,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in ki.arrayKeywords)for(var h=0;h<d.length;h++)Eu(e,t,r,d[h],i+"/"+u+"/"+h,s,i,u,n,h)}else if(u in ki.propsKeywords){if(d&&typeof d=="object")for(var m in d)Eu(e,t,r,d[m],i+"/"+u+"/"+IW(m),s,i,u,n,m)}else if(u in ki.keywords||e.allKeys&&!(u in ki.skipKeywords))Eu(e,t,r,d,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,c,l)}}function IW(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Xa=C(function(Pk){Object.defineProperty(Pk,"__esModule",{value:!0});Pk.getSchemaRefs=Pk.resolveUrl=Pk.normalizeId=Pk._getFullPath=Pk.getFullPath=Pk.inlineRef=void 0;var TW=_e(),NW=fh(),MW=wk(),LW=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function DW(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!dh(e);if(!t)return!1;return Sk(e)<=t}Pk.inlineRef=DW;var JW=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function dh(e){for(let t in e){if(JW.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(dh))return!0;if(typeof r=="object"&&dh(r))return!0}return!1}function Sk(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,LW.has(r))continue;if(typeof e[r]=="object")TW.eachItem(e[r],(n)=>t+=Sk(n));if(t===1/0)return 1/0}return t}function Ek(e,t="",r){if(r!==!1)t=So(t);let n=e.parse(t);return _k(e,n)}Pk.getFullPath=Ek;function _k(e,t){return e.serialize(t).split("#")[0]+"#"}Pk._getFullPath=_k;var FW=/#\/?$/;function So(e){return e?e.replace(FW,""):""}Pk.normalizeId=So;function qW(e,t,r){return r=So(r),e.resolve(t,r)}Pk.resolveUrl=qW;var BW=/^[a-z_][-a-z0-9._]*$/i;function HW(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=So(e[r]||t),s={"":i},o=Ek(n,i,!1),a={},c=new Set;return MW(e,{allKeys:!0},(d,h,m,y)=>{if(y===void 0)return;let g=o+h,b=s[y];if(typeof d[r]=="string")b=x.call(this,d[r]);_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),s[h]=b;function x(P){let E=this.opts.uriResolver.resolve;if(P=So(b?E(b,P):P),c.has(P))throw u(P);c.add(P);let w=this.refs[P];if(typeof w=="string")w=this.refs[w];if(typeof w=="object")l(d,w.schema,P);else if(P!==So(g))if(P[0]==="#")l(d,a[P],P),a[P]=d;else this.refs[P]=g;return P}function _(P){if(typeof P=="string"){if(!BW.test(P))throw Error(`invalid anchor "${P}"`);x.call(this,`#${P}`)}}}),a;function l(d,h,m){if(h!==void 0&&!NW(d,h))throw u(m)}function u(d){return Error(`reference "${d}" resolves to more than one schema`)}}Pk.getSchemaRefs=HW});var Eo=C(function(Bk){Object.defineProperty(Bk,"__esModule",{value:!0});Bk.getData=Bk.KeywordCxt=Bk.validateFunctionCode=void 0;var Ok=VP(),Ck=Ya(),ph=ih(),_u=Ya(),GW=ok(),Qa=hk(),mh=xk(),se=be(),ge=Fr(),YW=Xa(),Gn=_e(),Za=Ga();function XW(e){if(Nk(e)){if(Mk(e),Tk(e)){e6(e);return}}Ik(e,()=>Ok.topBoolOrEmptySchema(e))}Bk.validateFunctionCode=XW;function Ik({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){if(i.code.es5)e.func(t,se._`${ge.default.data}, ${ge.default.valCxt}`,n.$async,()=>{e.code(se._`"use strict"; ${Ak(r,i)}`),ZW(e,i),e.code(s)});else e.func(t,se._`${ge.default.data}, ${QW(i)}`,n.$async,()=>e.code(Ak(r,i)).code(s))}function QW(e){return se._`{${ge.default.instancePath}="", ${ge.default.parentData}, ${ge.default.parentDataProperty}, ${ge.default.rootData}=${ge.default.data}${e.dynamicRef?se._`, ${ge.default.dynamicAnchors}={}`:se.nil}}={}`}function ZW(e,t){e.if(ge.default.valCxt,()=>{if(e.var(ge.default.instancePath,se._`${ge.default.valCxt}.${ge.default.instancePath}`),e.var(ge.default.parentData,se._`${ge.default.valCxt}.${ge.default.parentData}`),e.var(ge.default.parentDataProperty,se._`${ge.default.valCxt}.${ge.default.parentDataProperty}`),e.var(ge.default.rootData,se._`${ge.default.valCxt}.${ge.default.rootData}`),t.dynamicRef)e.var(ge.default.dynamicAnchors,se._`${ge.default.valCxt}.${ge.default.dynamicAnchors}`)},()=>{if(e.var(ge.default.instancePath,se._`""`),e.var(ge.default.parentData,se._`undefined`),e.var(ge.default.parentDataProperty,se._`undefined`),e.var(ge.default.rootData,ge.default.data),t.dynamicRef)e.var(ge.default.dynamicAnchors,se._`{}`)})}function e6(e){let{schema:t,opts:r,gen:n}=e;Ik(e,()=>{if(r.$comment&&t.$comment)Dk(e);if(s6(e),n.let(ge.default.vErrors,null),n.let(ge.default.errors,0),r.unevaluated)t6(e);Lk(e),c6(e)});return}function t6(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",se._`${r}.evaluated`),t.if(se._`${e.evaluated}.dynamicProps`,()=>t.assign(se._`${e.evaluated}.props`,se._`undefined`)),t.if(se._`${e.evaluated}.dynamicItems`,()=>t.assign(se._`${e.evaluated}.items`,se._`undefined`))}function Ak(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?se._`/*# sourceURL=${r} */`:se.nil}function r6(e,t){if(Nk(e)){if(Mk(e),Tk(e)){n6(e,t);return}}Ok.boolOrEmptySchema(e,t)}function Tk({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Nk(e){return typeof e.schema!="boolean"}function n6(e,t){let{schema:r,gen:n,opts:i}=e;if(i.$comment&&r.$comment)Dk(e);o6(e),a6(e);let s=n.const("_errs",ge.default.errors);Lk(e,s),n.var(t,se._`${s} === ${ge.default.errors}`)}function Mk(e){Gn.checkUnknownRules(e),i6(e)}function Lk(e,t){if(e.opts.jtd)return jk(e,[],!1,t);let r=Ck.getSchemaTypes(e.schema),n=Ck.coerceAndCheckDataType(e,r);jk(e,r,!n,t)}function i6(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Gn.schemaHasRulesButRef(t,i.RULES))i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function s6(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Gn.checkStrictMode(e,"default is ignored in the schema root")}function o6(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=YW.resolveUrl(e.opts.uriResolver,e.baseId,t)}function a6(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Dk({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code(se._`${ge.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=se.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(se._`${ge.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function c6(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;if(r.$async)t.if(se._`${ge.default.errors} === 0`,()=>t.return(ge.default.data),()=>t.throw(se._`new ${i}(${ge.default.vErrors})`));else{if(t.assign(se._`${n}.errors`,ge.default.vErrors),s.unevaluated)l6(e);t.return(se._`${ge.default.errors} === 0`)}}function l6({gen:e,evaluated:t,props:r,items:n}){if(r instanceof se.Name)e.assign(se._`${t}.props`,r);if(n instanceof se.Name)e.assign(se._`${t}.items`,n)}function jk(e,t,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=e,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!Gn.schemaHasRulesButRef(s,u))){i.block(()=>Fk(e,"$ref",u.all.$ref.definition));return}if(!c.jtd)u6(e,t);i.block(()=>{for(let h of u.rules)d(h);d(u.post)});function d(h){if(!ph.shouldUseGroup(s,h))return;if(h.type){if(i.if(_u.checkDataType(h.type,o,c.strictNumbers)),Rk(e,h),t.length===1&&t[0]===h.type&&r)i.else(),_u.reportTypeError(e);i.endIf()}else Rk(e,h);if(!a)i.if(se._`${ge.default.errors} === ${n||0}`)}}function Rk(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;if(i)GW.assignDefaults(e,t.type);r.block(()=>{for(let s of t.rules)if(ph.shouldUseRule(n,s))Fk(e,s.keyword,s.definition,t.type)})}function u6(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(f6(e,t),!e.opts.allowUnionTypes)d6(e,t);p6(e,e.dataTypes)}function f6(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Jk(e.dataTypes,r))hh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),h6(e,t)}function d6(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))hh(e,"use allowUnionTypes to allow union type keyword")}function p6(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&ph.shouldUseRule(e.schema,i)){let{type:s}=i.definition;if(s.length&&!s.some((o)=>m6(t,o)))hh(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function m6(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Jk(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function h6(e,t){let r=[];for(let n of e.dataTypes)if(Jk(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function hh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Gn.checkStrictMode(e,t,e.opts.strictTypes)}class gh{constructor(e,t,r){if(Qa.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Gn.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",qk(this.$data,e));else if(this.schemaCode=this.schemaValue,!Qa.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",ge.default.errors)}result(e,t,r){this.failResult(se.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(se.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(se._`${t} !== undefined && (${se.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Za.reportExtraError:Za.reportError)(this,this.def.error,t)}$dataError(){Za.reportError(this,this.def.$dataError||Za.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Za.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=se.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=se.nil,t=se.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:i,def:s}=this;if(r.if(se.or(se._`${n} === undefined`,t)),e!==se.nil)r.assign(e,!0);if(i.length||s.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==se.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return se.or(s(),o());function s(){if(r.length){if(!(t instanceof se.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return se._`${_u.checkDataTypes(a,t,i.opts.strictNumbers,_u.DataType.Wrong)}`}return se.nil}function o(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return se._`!${a}(${t})`}return se.nil}}subschema(e,t){let r=mh.getSubschema(this.it,e);mh.extendSubschemaData(r,this.it,e),mh.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return r6(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Gn.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Gn.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,se.Name)),!0}}Bk.KeywordCxt=gh;function Fk(e,t,r,n){let i=new gh(e,r,t);if("code"in r)r.code(i,n);else if(i.$data&&r.validate)Qa.funcKeywordCode(i,r);else if("macro"in r)Qa.macroKeywordCode(i,r);else if(r.compile||r.validate)Qa.funcKeywordCode(i,r)}var g6=/^\/(?:[^~]|~0|~1)*$/,y6=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function qk(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return ge.default.rootData;if(e[0]==="/"){if(!g6.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,s=ge.default.rootData}else{let l=y6.exec(e);if(!l)throw Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=t)throw Error(c("property/index",u));return n[t-u]}if(u>t)throw Error(c("data",u));if(s=r[t-u],!i)return s}let o=s,a=i.split("/");for(let l of a)if(l)s=se._`${s}${se.getProperty(Gn.unescapeJsonPointer(l))}`,o=se._`${o} && ${s}`;return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}Bk.getData=qk});var ec=C(function(Vk){Object.defineProperty(Vk,"__esModule",{value:!0});class Uk extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Vk.default=Uk});var _o=C(function(zk){Object.defineProperty(zk,"__esModule",{value:!0});var yh=Xa();class Wk extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=yh.resolveUrl(e,t,r),this.missingSchema=yh.normalizeId(yh.getFullPath(e,this.missingRef))}}zk.default=Wk});var rc=C(function(Yk){Object.defineProperty(Yk,"__esModule",{value:!0});Yk.resolveSchema=Yk.getCompilingSchema=Yk.resolveRef=Yk.compileSchema=Yk.SchemaEnv=void 0;var sn=be(),w6=ec(),ds=Fr(),on=Xa(),Kk=_e(),S6=Eo();class tc{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:on.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}Yk.SchemaEnv=tc;function xh(e){let t=Gk.call(this,e);if(t)return t;let r=on.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new sn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;if(e.$async)a=o.scopeValue("Error",{ref:w6.default,code:sn._`require("ajv/dist/runtime/validation_error").default`});let c=o.scopeName("validate");e.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:ds.default.data,parentData:ds.default.parentData,parentDataProperty:ds.default.parentDataProperty,dataNames:[ds.default.data],dataPathArr:[sn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:sn.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:sn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:sn._`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),S6.validateFunctionCode(l),o.optimize(this.opts.code.optimize);let d=o.toString();if(u=`${o.scopeRefs(ds.default.scope)}return ${d}`,this.opts.code.process)u=this.opts.code.process(u,e);let m=Function(`${ds.default.self}`,`${ds.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async)m.$async=!0;if(this.opts.code.source===!0)m.source={validateName:c,validateCode:d,scopeValues:o._values};if(this.opts.unevaluated){let{props:y,items:g}=l;if(m.evaluated={props:y instanceof sn.Name?void 0:y,items:g instanceof sn.Name?void 0:g,dynamicProps:y instanceof sn.Name,dynamicItems:g instanceof sn.Name},m.source)m.source.evaluated=sn.stringify(m.evaluated)}return e.validate=m,e}catch(d){if(delete e.validate,delete e.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw d}finally{this._compilations.delete(e)}}Yk.compileSchema=xh;function E6(e,t,r){var n;r=on.resolveUrl(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=k6.call(this,e,r);if(s===void 0){let o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(o)s=new tc({schema:o,schemaId:a,root:e,baseId:t})}if(s===void 0)return;return e.refs[r]=_6.call(this,s)}Yk.resolveRef=E6;function _6(e){if(on.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:xh.call(this,e)}function Gk(e){for(let t of this._compilations)if(P6(t,e))return t}Yk.getCompilingSchema=Gk;function P6(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function k6(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||Pu.call(this,e,t)}function Pu(e,t){let r=this.opts.uriResolver.parse(t),n=on._getFullPath(this.opts.uriResolver,r),i=on.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return bh.call(this,r,e);let s=on.normalizeId(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=Pu.call(this,e,o);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return bh.call(this,r,a)}if(typeof(o===null||o===void 0?void 0:o.schema)!=="object")return;if(!o.validate)xh.call(this,o);if(s===on.normalizeId(t)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];if(l)i=on.resolveUrl(this.opts.uriResolver,i,l);return new tc({schema:a,schemaId:c,root:e,baseId:i})}return bh.call(this,r,o)}Yk.resolveSchema=Pu;var A6=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function bh(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[Kk.unescapeFragment(a)];if(c===void 0)return;r=c;let l=typeof r==="object"&&r[this.opts.schemaId];if(!A6.has(a)&&l)t=on.resolveUrl(this.opts.uriResolver,t,l)}let s;if(typeof r!="boolean"&&r.$ref&&!Kk.schemaHasRulesButRef(r,this.RULES)){let a=on.resolveUrl(this.opts.uriResolver,t,r.$ref);s=Pu.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new tc({schema:r,schemaId:o,root:n,baseId:t}),s.schema!==s.root.schema)return s;return}});var Qk=C(function(ece,I6){I6.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 _h=C(function(tce,oA){var T6=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),vh=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),N6=RegExp.prototype.test.bind(/^\d*$/u),ps=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),wh=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),eA=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Sh=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),M6=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),pr=Array(256);for(let t=0;t<256;t++)pr[t]="%"+"0123456789ABCDEF"[t>>4]+"0123456789ABCDEF"[t&15];function Lt(e){if(e<2048)return pr[192|e>>6]+pr[128|e&63];if(e<65536)return pr[224|e>>12]+pr[128|e>>6&63]+pr[128|e&63];return pr[240|e>>18]+pr[128|e>>12&63]+pr[128|e>>6&63]+pr[128|e&63]}function L6(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var D6=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),J6=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),F6=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),q6=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function B6(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){if(F6(e[t]))continue;if(e[t]==="%"&&t+2<e.length&&ps(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function Zk(e){let t=-1,r=0,n=-1,i=0;for(let a=0;a<e.length;a++)if(e[a]==="0"){if(n===-1)n=a;if(i++,i>r)r=i,t=n}else n=-1,i=0;if(r<2)return e.join(":");let s=e.slice(0,t).join(":"),o=e.slice(t+r).join(":");return s+"::"+o}function H6(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),n=t===-1?[]:e.slice(t+2).split(":");if(t!==-1){if(r.length===1&&r[0]==="")r.length=0;if(n.length===1&&n[0]==="")n.length=0}let i=r.concat(n),s=0;for(let a=0;a<i.length;a++){let c=i[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==i.length-1||t!==-1&&n.length===0||!vh(c))return;s+=2;continue}if(!D6(c))return;i[a]=parseInt(c,16).toString(16),s++}if(t===-1){if(s!==8)return;return Zk(i)}if(s>=8)return;let o=i.slice(0,r.length);for(let a=s;a<8;a++)o.push("0");for(let a=r.length;a<i.length;a++)o.push(i[a]);return Zk(o)}function $h(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let n=t?e.slice(1,-1):e;if(t&&J6(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(U6(n,":")<2)return{host:e,isIPV6:!1,error:t};let i="",s=n.indexOf("%");if(s!==-1){let a=n.slice(s,s+3).toLowerCase()==="%25"?3:1;if(i=n.slice(s+a),!B6(i))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,s)}let o=H6(n);if(o===void 0)return{host:e,isIPV6:!1,error:!0};return{host:o+(i?"%"+i:""),escapedHost:o+(i?"%25"+i:""),isIPV6:!0}}function U6(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function tA(e){let t=e,r=[],n=-1,i=0;while(i=t.length){if(i===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(i===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(i===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function V6(e){if(e===""||e[0]==="/")return tA(e);let t=e.split("/"),r=t.length-1,n=[],i=!1;for(let s=0;s<=r;s++){let o=t[s];if(o==="."||o===".."){if(o==="..")if(n.length!==0&&n[n.length-1]!=="..")n.pop();else n.push("..");i=s===r}else n.push(o)}if(i&&n[n.length-1]!=="..")n.push("");if(n.length===0||n[0]===""||n[0].includes(":"))n.unshift(".");return n.join("/")}var W6={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},z6=/[@/?#:]/g,K6=/[@/?#]/g;function rA(e,t){let r=t?K6:z6;return r.lastIndex=0,e.replace(r,(n)=>W6[n])}function nA(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(t&&wh(o))r+=o;else r+="%"+s;n+=2;continue}}r+=e[n]}return r}function G6(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(o!=="."&&wh(o))t+=o;else t+="%"+s;r+=2;continue}}if(eA(n))t+=n;else{let i=e.charCodeAt(r);if(i<128)t+=sA(i)?n:pr[i];else if(i<55296||i>57343)t+=Lt(i);else if(i<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);if(s>=56320&&s<=57343)t+=Lt(65536+(i-55296<<10)+(s-56320)),r++;else t+=Lt(65533)}else t+=Lt(65533)}}return t}function Y6(e,t=!1){let r="",n=t&&e[0]!=="/";for(let i=0;i<e.length;i++){let s=e[i];if(s==="%"&&i+2<e.length){let o=e.slice(i+1,i+3);if(ps(o)){r+="%"+o.toUpperCase(),i+=2;continue}}if(s==="/")n=!1;if(eA(s)&&(s!==":"||!n))r+=s;else{let o=e.charCodeAt(i);if(o<128)r+=pr[o];else if(o<55296||o>57343)r+=Lt(o);else if(o<=56319&&i+1<e.length){let a=e.charCodeAt(i+1);if(a>=56320&&a<=57343)r+=Lt(65536+(o-55296<<10)+(a-56320)),i++;else r+=Lt(65533)}else r+=Lt(65533)}}return r}function Eh(e,t){let r="";for(let n=0;n<e.length;n++){let i=e[n];if(i==="%"&&n+2<e.length){let s=e.slice(n+1,n+3);if(ps(s)){r+="%"+s.toUpperCase(),n+=2;continue}}if(t(i))r+=i;else{let s=e.charCodeAt(n);if(s<128)r+=pr[s];else if(s<55296||s>57343)r+=Lt(s);else if(s<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);if(o>=56320&&o<=57343)r+=Lt(65536+(s-55296<<10)+(o-56320)),n++;else r+=Lt(65533)}else r+=Lt(65533)}}return r}function iA(e){return Eh(e,M6)}function X6(e){return Eh(e,Sh)}function Q6(e){return Eh(e,Sh)}function sA(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function Z6(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(wh(o))t+=o;else t+="%"+s;r+=2;continue}}if(Sh(n))t+=n;else{let i=e.charCodeAt(r);if(i<128)t+=sA(i)?n:pr[i];else if(i<55296||i>57343)t+=Lt(i);else if(i<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);if(s>=56320&&s<=57343)t+=Lt(65536+(i-55296<<10)+(s-56320)),r++;else t+=Lt(65533)}else t+=Lt(65533)}}return t}function e9(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(ps(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function t9(e){let t=[];if(e.userinfo!==void 0)t.push(iA(e.userinfo)),t.push("@");if(e.host!==void 0){let r=e.host;if(!vh(r)){let n=$h(r);if(n.isIPV6!==!0&&n.isIPVFuture!==!0)r=nA(r,!0),n=$h(r);if(n.isIPV6===!0||n.isIPVFuture===!0)r=`[${n.escapedHost}]`;else r=rA(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string"){let r=String(e.port);if(!N6(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}oA.exports={nonSimpleDomain:q6,recomposeAuthority:t9,reescapeHostDelimiters:rA,normalizePercentEncoding:nA,normalizePathEncoding:G6,serializePathEncoding:Y6,normalizeQueryFragmentEncoding:Z6,encodeUserinfo:iA,encodeQuery:X6,encodeFragment:Q6,escapePreservingEscapes:e9,removeDotSegments:tA,removeDotSegmentsRelative:V6,isIPv4:vh,isUUID:T6,normalizeIPv6:$h,stringArrayToHexStripped:L6}});var fA=C(function(rce,uA){var{isUUID:r9}=_h(),n9=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,i9=["http","https","ws","wss","urn","urn:uuid"];function s9(e){return i9.indexOf(e)!==-1}function Ph(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function aA(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function cA(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function o9(e){return e.secure=Ph(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function a9(e){if(e.port===(Ph(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function c9(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(n9);if(r&&r[0]===e.path){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=kh(i);if(e.path=void 0,s)e=s.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function l9(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=kh(i);if(s)e=s.serialize(e,t);let o=e,a=e.nss;return o.path=`${n||t.nid}:${a}`,t.skipEscape=!0,o}function u9(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!r9(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function f9(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var lA={scheme:"http",domainHost:!0,parse:aA,serialize:cA},d9={scheme:"https",domainHost:lA.domainHost,parse:aA,serialize:cA},ku={scheme:"ws",domainHost:!0,parse:o9,serialize:a9},p9={scheme:"wss",domainHost:ku.domainHost,parse:ku.parse,serialize:ku.serialize},m9={scheme:"urn",parse:c9,serialize:l9,skipNormalize:!0},h9={scheme:"urn:uuid",parse:u9,serialize:f9,skipNormalize:!0},Au={http:lA,https:d9,ws:ku,wss:p9,urn:m9,"urn:uuid":h9};Object.setPrototypeOf(Au,null);function kh(e){return e&&(Au[e]||Au[e.toLowerCase()])||void 0}uA.exports={wsIsSecure:Ph,SCHEMES:Au,isValidSchemeName:s9,getSchemeHandler:kh}});var _A=C(function(nce,Cu){var{normalizeIPv6:gA,removeDotSegments:ic,removeDotSegmentsRelative:yA,recomposeAuthority:g9,normalizePercentEncoding:Ah,normalizePathEncoding:y9,serializePathEncoding:dA,normalizeQueryFragmentEncoding:pA,encodeQuery:b9,encodeFragment:x9,reescapeHostDelimiters:$9,isIPv4:bA,nonSimpleDomain:v9}=_h(),{SCHEMES:xA,getSchemeHandler:jh}=fA(),$A=/^[A-Za-z][A-Za-z0-9+.-]*$/u,w9=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function mA(e){let t=String(e);if(!$A.test(t))throw TypeError("URI scheme is malformed.");return t}function S9(e,t){if(typeof e==="string")e=C9(e,t);else if(typeof e==="object")e=Ru(ms(e,t),t);return e}function E9(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:s,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:l}=ju(e,n),{parsed:u,malformedAuthorityOrPort:d,malformedPercentEncoding:h,malformedSchemeSpecific:m,malformedHost:y,malformedScheme:g}=ju(t,n);if(s||d||o||h||a||m||c||y||l||g)throw Error(i.error||u.error||"URI is malformed.");let b=vA(i,u,n,!0),x=jh(r&&r.scheme||b.scheme),_=b.host,P=_!==void 0&&_!==""&&(bA(_)||gA(_).isIPV6);if(SA(b,r||{},x,P))throw Error("URI host is malformed.");wA(b,r||{},x,P);let E=_&&_.indexOf("%")!==-1&&!/\P{ASCII}/u.test(_);if(b.error&&!E)throw Error(b.error);return n.skipEscape=!0,ms(b,n)}function vA(e,t,r,n){let i={};if(!n)e=Ru(ms(e,r),r),t=Ru(ms(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ic(t.path||""),i.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ic(t.path||""),i.query=t.query;else{if(!t.path)if(i.path=e.path,t.query!==void 0)i.query=t.query;else i.query=e.query;else{if(t.path[0]==="/")i.path=ic(t.path);else{let s=e.userinfo!==void 0||e.host!==void 0||e.port!==void 0;if(s&&!e.path)i.path="/"+t.path;else if(!e.path)i.path=t.path;else i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;i.path=e.scheme===void 0&&!s&&i.path[0]!=="/"?yA(i.path):ic(i.path)}i.query=t.query}i.userinfo=e.userinfo,i.host=e.host,i.port=e.port}i.scheme=e.scheme}return i.fragment=t.fragment,i}function _9(e,t,r){let n=hA(e,r),i=hA(t,r);return n!==void 0&&i!==void 0&&n===i}function ms(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[];if(r.scheme)r.scheme=mA(r.scheme);let s=jh(n.scheme||r.scheme);if(s&&s.serialize)s.serialize(r,n);let o=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=(r.scheme===void 0||n.reference==="suffix")&&!o,c=!n.skipEscape&&a;if(r.path!==void 0)if(!n.skipEscape)r.path=dA(r.path,c);else r.path=Ah(r.path);if(n.reference!=="suffix"&&r.scheme)r.scheme=mA(r.scheme),i.push(r.scheme,":");let l=g9(r);if(l!==void 0){if(n.reference!=="suffix")i.push("//");if(i.push(l),r.path&&r.path[0]!=="/")i.push("/")}if(r.path!==void 0){let u=r.path;if(!n.absolutePath&&(!s||!s.absolutePath))u=a&&u[0]!=="/"?yA(u):ic(u);if(a)u=dA(u,!0);if(l===void 0&&u[0]==="/"&&u[1]==="/")u="/%2F"+u.slice(2);i.push(u)}if(r.query!==void 0)i.push("?",b9(r.query));if(r.fragment!==void 0)i.push("#",x9(r.fragment));return i.join("")}var P9=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,k9=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,A9=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function j9(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function nc(e){if(e===void 0)return!1;let t=e.indexOf("%");while(t!==-1){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Ou(e){return e[0]==="["&&e[e.length-1]==="]"}function R9(e){let t=e[4];return nc(e[3])||t!==void 0&&!Ou(t)&&nc(t)||nc(e[6])||nc(e[7])||nc(e[8])}function wA(e,t,r,n){if(SA(e,t,r,n))return e.error=e.error||"URI host is malformed.",!0;if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Ou(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&v9(e.host)){let i;try{i=new URL("http://"+e.host)}catch(s){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+s,!0}if(!O9(i))return e.error=e.error||"URI host is malformed.",!0;e.host=i.hostname}return!1}function SA(e,t,r,n){return Boolean(e.host&&n===!1&&!Ou(e.host)&&(t.domainHost||r&&r.domainHost)&&w9.test(e.host))}function O9(e){return e.username===""&&e.password===""&&e.port===""&&e.pathname==="/"&&e.search===""&&e.hash===""&&e.hostname!==""}function ju(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1,o=!1,a=!1,c=!1,l=!1,u=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let d=e.match(k9);if(d!==null&&d[1].indexOf("\\")!==-1)n.error="URI authority must not contain a literal backslash.",i=!0;let h=e.match(A9);if(h!==null){let y=h[1],g=y.replace(/[\t\n\r]/g,"");if(g.length>=2){if(g.slice(0,2)!=="//")n.error=n.error||"URI authority must not contain a literal backslash.",i=!0;else if(y.length!==g.length)n.error=n.error||"URI authority introducer must not contain whitespace.",i=!0}}let m=e.match(P9);if(m){if(n.scheme=m[1],n.userinfo=m[3],n.host=m[4],n.port=parseInt(m[5],10),n.path=m[6]||"",n.query=m[7],n.fragment=m[8],n.scheme!==void 0)if($A.test(n.scheme))n.scheme=n.scheme.toLowerCase();else n.error=n.error||"URI scheme is malformed.",l=!0;if(s=R9(m),s)n.error=n.error||"URI contains malformed percent-encoding.";if(isNaN(n.port))n.port=m[5];let y=j9(n,m);if(y!==void 0)n.error=n.error||y,i=!0;if(n.host)if(bA(n.host)===!1){let x=Ou(n.host),_=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,P=gA(n.host);if(u=P.isIPV6||P.isIPVFuture===!0,c=_&&(!x||P.error===!0),n.host=u?P.host:P.host.toLowerCase(),c)n.error=n.error||"URI host is malformed.",i=!0}else u=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let g=jh(r.scheme||n.scheme);if(!c)a=wA(n,r,g,u);if(e.indexOf("%")!==-1&&n.host!==void 0&&!c){let b=u?n.host:Ah(n.host,!0);if(!u)b=Ah(b.toLowerCase());n.host=u||r.scheme!=="null"?$9(b,u):b}if(!g||g&&!g.skipNormalize){if(n.path)n.path=y9(n.path);if(n.query)n.query=pA(n.query);if(n.fragment)n.fragment=pA(n.fragment)}if(g&&g.parse){if(g.parse(n,r),g===xA.urn&&n.nid===void 0)o=!0}}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:l}}function Ru(e,t){return ju(e,t).parsed}function C9(e,t){return EA(e,t).normalized}function EA(e,t){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:a}=ju(e,t);return{normalized:n||i||s||o||a?e:ms(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:a}}function hA(e,t){if(typeof e!=="string"&&typeof e!=="object")return;let r;try{r=typeof e==="string"?e:ms(e,t)}catch{return}let{normalized:n,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:c}=EA(r,t);return i||s||o||a||c?void 0:n}var Rh={SCHEMES:xA,normalize:S9,resolve:E9,resolveComponent:vA,equal:_9,serialize:ms,parse:Ru};Cu.exports=Rh;Cu.exports.default=Rh;Cu.exports.fastUri=Rh});var AA=C(function(kA){Object.defineProperty(kA,"__esModule",{value:!0});var PA=_A();PA.code='require("ajv/dist/runtime/uri").default';kA.default=PA});var Ih=C(function(Yn){Object.defineProperty(Yn,"__esModule",{value:!0});Yn.CodeGen=Yn.Name=Yn.nil=Yn.stringify=Yn.str=Yn._=Yn.KeywordCxt=void 0;var T9=Eo();Object.defineProperty(Yn,"KeywordCxt",{enumerable:!0,get:function(){return T9.KeywordCxt}});var Po=be();Object.defineProperty(Yn,"_",{enumerable:!0,get:function(){return Po._}});Object.defineProperty(Yn,"str",{enumerable:!0,get:function(){return Po.str}});Object.defineProperty(Yn,"stringify",{enumerable:!0,get:function(){return Po.stringify}});Object.defineProperty(Yn,"nil",{enumerable:!0,get:function(){return Po.nil}});Object.defineProperty(Yn,"Name",{enumerable:!0,get:function(){return Po.Name}});Object.defineProperty(Yn,"CodeGen",{enumerable:!0,get:function(){return Po.CodeGen}});var N9=ec(),IA=_o(),M9=nh(),oc=rc(),L9=be(),sc=Xa(),Iu=Ya(),Ch=_e(),jA=Qk(),D9=AA(),TA=(e,t)=>new RegExp(e,t);TA.code="new RegExp";var J9=["removeAdditional","useDefaults","coerceTypes"],F9=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),q9={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."},B9={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},RA=200;function H9(e){var t,r,n,i,s,o,a,c,l,u,d,h,m,y,g,b,x,_,P,E,w,k,R,j,D;let F=e.strict,N=(t=e.code)===null||t===void 0?void 0:t.optimize,q=N===!0||N===void 0?1:N||0,U=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:TA,ne=(i=e.uriResolver)!==null&&i!==void 0?i:D9.default;return{strictSchema:(o=(s=e.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:F)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:F)!==null&&u!==void 0?u:"log",strictTuples:(h=(d=e.strictTuples)!==null&&d!==void 0?d:F)!==null&&h!==void 0?h:"log",strictRequired:(y=(m=e.strictRequired)!==null&&m!==void 0?m:F)!==null&&y!==void 0?y:!1,code:e.code?{...e.code,optimize:q,regExp:U}:{optimize:q,regExp:U},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:RA,loopEnum:(b=e.loopEnum)!==null&&b!==void 0?b:RA,meta:(x=e.meta)!==null&&x!==void 0?x:!0,messages:(_=e.messages)!==null&&_!==void 0?_:!0,inlineRefs:(P=e.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(E=e.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(w=e.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(k=e.validateSchema)!==null&&k!==void 0?k:!0,validateFormats:(R=e.validateFormats)!==null&&R!==void 0?R:!0,unicodeRegExp:(j=e.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(D=e.int32range)!==null&&D!==void 0?D:!0,uriResolver:ne}}class Tu{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,...H9(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new L9.ValueScope({scope:{},prefixes:F9,es5:t,lines:r}),this.logger=G9(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=M9.getRules(),OA.call(this,q9,e,"NOT SUPPORTED"),OA.call(this,B9,e,"DEPRECATED","warn"),this._metaOpts=z9.call(this),e.formats)V9.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)W9.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);U9.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=jA;if(r==="id")n={...jA},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(l,u){await i.call(this,l.$schema);let d=this._addSchema(l,u);return d.validate||s.call(this,d)}async function i(l){if(l&&!this.getSchema(l))await n.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(u){if(!(u instanceof IA.default))throw u;return o.call(this,u),await a.call(this,u.missingSchema),s.call(this,l)}}function o({missingSchema:l,missingRef:u}){if(this.refs[l])throw Error(`AnySchema ${l} is loaded but ${u} cannot be resolved`)}async function a(l){let u=await c.call(this,l);if(!this.refs[l])await i.call(this,u.$schema);if(!this.refs[l])this.addSchema(u,l,t)}async function c(l){let u=this._loading[l];if(u)return u;try{return await(this._loading[l]=r(l))}finally{delete this._loading[l]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,r,n);return this}let i;if(typeof e==="object"){let{schemaId:s}=this.opts;if(i=e[s],i!==void 0&&typeof i!="string")throw Error(`schema ${s} must be string`)}return t=sc.normalizeId(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw Error(i)}return n}getSchema(e){let t;while(typeof(t=CA.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new oc.SchemaEnv({schema:{},schemaId:r});if(t=oc.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=CA.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=sc.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(X9.call(this,r,t),!t)return Ch.eachItem(r,(i)=>Oh.call(this,i)),this;Z9.call(this,t);let n={...t,type:Iu.getJSONTypes(t.type),schemaType:Iu.getJSONTypes(t.schemaType)};return Ch.eachItem(r,n.type.length===0?(i)=>Oh.call(this,i,n):(i)=>n.type.forEach((s)=>Oh.call(this,i,n,s))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((i)=>i.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,i)=>n+t+i)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let i=n.split("/").slice(1),s=e;for(let o of i)s=s[o];for(let o in r){let a=r[o];if(typeof a!="object")continue;let{$data:c}=a.definition,l=s[o];if(c&&l)s[o]=NA(l)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:o}=this.opts;if(typeof e=="object")s=e[o];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=sc.normalizeId(s||r);let c=sc.getSchemaRefs.call(this,e,r);if(a=new oc.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),i&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else oc.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{oc.compileSchema.call(this,e)}finally{this.opts=t}}}Tu.ValidationError=N9.default;Tu.MissingRefError=IA.default;Yn.default=Tu;function OA(e,t,r,n="error"){for(let i in e){let s=i;if(s in t)this.logger[n](`${r}: option ${i}. ${e[s]}`)}}function CA(e){return e=sc.normalizeId(e),this.schemas[e]||this.refs[e]}function U9(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function V9(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function W9(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function z9(){let e={...this.opts};for(let t of J9)delete e[t];return e}var K9={log(){},warn(){},error(){}};function G9(e){if(e===!1)return K9;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Y9=/^[a-z_$][a-z0-9_$:-]*$/i;function X9(e,t){let{RULES:r}=this;if(Ch.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Y9.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function Oh(e,t,r){var n;let i=t===null||t===void 0?void 0:t.post;if(r&&i)throw Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(!o)o={type:r,rules:[]},s.rules.push(o);if(s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Iu.getJSONTypes(t.type),schemaType:Iu.getJSONTypes(t.schemaType)}};if(t.before)Q9.call(this,o,a,t.before);else o.rules.push(a);s.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Q9(e,t,r){let n=e.rules.findIndex((i)=>i.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function Z9(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=NA(t);e.validateSchema=this.compile(t,!0)}var ez={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function NA(e){return{anyOf:[e,ez]}}});var LA=C(function(MA){Object.defineProperty(MA,"__esModule",{value:!0});var nz={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};MA.default=nz});var Lu=C(function(qA){Object.defineProperty(qA,"__esModule",{value:!0});qA.callRef=qA.getValidate=void 0;var sz=_o(),DA=qr(),mr=be(),ko=Fr(),JA=rc(),Nu=_e(),oz={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=JA.resolveRef.call(c,l,i,r);if(u===void 0)throw new sz.default(n.opts.uriResolver,i,r);if(u instanceof JA.SchemaEnv)return h(u);return m(u);function d(){if(s===l)return Mu(e,o,s,s.$async);let y=t.scopeValue("root",{ref:l});return Mu(e,mr._`${y}.validate`,l,l.$async)}function h(y){let g=FA(e,y);Mu(e,g,y,y.$async)}function m(y){let g=t.scopeValue("schema",a.code.source===!0?{ref:y,code:mr.stringify(y)}:{ref:y}),b=t.name("valid"),x=e.subschema({schema:y,dataTypes:[],schemaPath:mr.nil,topSchemaRef:g,errSchemaPath:r},b);e.mergeEvaluated(x),e.ok(b)}}};function FA(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):mr._`${r.scopeValue("wrapper",{ref:t})}.validate`}qA.getValidate=FA;function Mu(e,t,r,n){let{gen:i,it:s}=e,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?ko.default.this:mr.nil;if(n)u();else d();function u(){if(!a.$async)throw Error("async schema referenced by sync schema");let y=i.let("valid");i.try(()=>{if(i.code(mr._`await ${DA.callValidateCode(e,t,l)}`),m(t),!o)i.assign(y,!0)},(g)=>{if(i.if(mr._`!(${g} instanceof ${s.ValidationError})`,()=>i.throw(g)),h(g),!o)i.assign(y,!1)}),e.ok(y)}function d(){e.result(DA.callValidateCode(e,t,l),()=>m(t),()=>h(t))}function h(y){let g=mr._`${y}.errors`;i.assign(ko.default.vErrors,mr._`${ko.default.vErrors} === null ? ${g} : ${ko.default.vErrors}.concat(${g})`),i.assign(ko.default.errors,mr._`${ko.default.vErrors}.length`)}function m(y){var g;if(!s.opts.unevaluated)return;let b=(g=r===null||r===void 0?void 0:r.validate)===null||g===void 0?void 0:g.evaluated;if(s.props!==!0)if(b&&!b.dynamicProps){if(b.props!==void 0)s.props=Nu.mergeEvaluated.props(i,b.props,s.props)}else{let x=i.var("props",mr._`${y}.evaluated.props`);s.props=Nu.mergeEvaluated.props(i,x,s.props,mr.Name)}if(s.items!==!0)if(b&&!b.dynamicItems){if(b.items!==void 0)s.items=Nu.mergeEvaluated.items(i,b.items,s.items)}else{let x=i.var("items",mr._`${y}.evaluated.items`);s.items=Nu.mergeEvaluated.items(i,x,s.items,mr.Name)}}}qA.callRef=Mu;qA.default=oz});var Th=C(function(HA){Object.defineProperty(HA,"__esModule",{value:!0});var lz=LA(),uz=Lu(),fz=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",lz.default,uz.default];HA.default=fz});var VA=C(function(UA){Object.defineProperty(UA,"__esModule",{value:!0});var Ju=be(),Ai=Ju.operators,Du={maximum:{okStr:"<=",ok:Ai.LTE,fail:Ai.GT},minimum:{okStr:">=",ok:Ai.GTE,fail:Ai.LT},exclusiveMaximum:{okStr:"<",ok:Ai.LT,fail:Ai.GTE},exclusiveMinimum:{okStr:">",ok:Ai.GT,fail:Ai.LTE}},pz={message:({keyword:e,schemaCode:t})=>Ju.str`must be ${Du[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ju._`{comparison: ${Du[e].okStr}, limit: ${t}}`},mz={keyword:Object.keys(Du),type:"number",schemaType:"number",$data:!0,error:pz,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Ju._`${r} ${Du[t].fail} ${n} || isNaN(${r})`)}};UA.default=mz});var zA=C(function(WA){Object.defineProperty(WA,"__esModule",{value:!0});var ac=be(),gz={message:({schemaCode:e})=>ac.str`must be multiple of ${e}`,params:({schemaCode:e})=>ac._`{multipleOf: ${e}}`},yz={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gz,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,o=t.let("res"),a=s?ac._`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:ac._`${o} !== parseInt(${o})`;e.fail$data(ac._`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};WA.default=yz});var YA=C(function(GA){Object.defineProperty(GA,"__esModule",{value:!0});function KA(e){let t=e.length,r=0,n=0,i;while(n<t)if(r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t){if(i=e.charCodeAt(n),(i&64512)===56320)n++}return r}GA.default=KA;KA.code='require("ajv/dist/runtime/ucs2length").default'});var QA=C(function(XA){Object.defineProperty(XA,"__esModule",{value:!0});var hs=be(),$z=_e(),vz=YA(),wz={message({keyword:e,schemaCode:t}){return hs.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>hs._`{limit: ${e}}`},Sz={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wz,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?hs.operators.GT:hs.operators.LT,o=i.opts.unicode===!1?hs._`${r}.length`:hs._`${$z.useFunc(e.gen,vz.default)}(${r})`;e.fail$data(hs._`${o} ${s} ${n}`)}};XA.default=Sz});var ej=C(function(ZA){Object.defineProperty(ZA,"__esModule",{value:!0});var _z=qr(),Pz=_e(),Ao=be(),kz={message:({schemaCode:e})=>Ao.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ao._`{pattern: ${e}}`},Az={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:kz,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,l=c.code==="new RegExp"?Ao._`new RegExp`:Pz.useFunc(t,c),u=t.let("valid");t.try(()=>t.assign(u,Ao._`${l}(${s}, ${a}).test(${r})`),()=>t.assign(u,!1)),e.fail$data(Ao._`!${u}`)}else{let c=_z.usePattern(e,i);e.fail$data(Ao._`!${c}.test(${r})`)}}};ZA.default=Az});var rj=C(function(tj){Object.defineProperty(tj,"__esModule",{value:!0});var cc=be(),Rz={message({keyword:e,schemaCode:t}){return cc.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>cc._`{limit: ${e}}`},Oz={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Rz,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?cc.operators.GT:cc.operators.LT;e.fail$data(cc._`Object.keys(${r}).length ${i} ${n}`)}};tj.default=Oz});var ij=C(function(nj){Object.defineProperty(nj,"__esModule",{value:!0});var uc=qr(),lc=be(),Iz=_e(),Tz={message:({params:{missingProperty:e}})=>lc.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>lc._`{missingProperty: ${e}}`},Nz={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Tz,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:o}=e,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors)l();else u();if(a.strictRequired){let m=e.parentSchema.properties,{definedProperties:y}=e.it;for(let g of r)if((m===null||m===void 0?void 0:m[g])===void 0&&!y.has(g)){let b=o.schemaEnv.baseId+o.errSchemaPath,x=`required property "${g}" is not defined at "${b}" (strictRequired)`;Iz.checkStrictMode(o,x,o.opts.strictRequired)}}function l(){if(c||s)e.block$data(lc.nil,d);else for(let m of r)uc.checkReportMissingProp(e,m)}function u(){let m=t.let("missing");if(c||s){let y=t.let("valid",!0);e.block$data(y,()=>h(m,y)),e.ok(y)}else t.if(uc.checkMissingProp(e,r,m)),uc.reportMissingProp(e,m),t.else()}function d(){t.forOf("prop",n,(m)=>{e.setParams({missingProperty:m}),t.if(uc.noPropertyInData(t,i,m,a.ownProperties),()=>e.error())})}function h(m,y){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(y,uc.propertyInData(t,i,m,a.ownProperties)),t.if(lc.not(y),()=>{e.error(),t.break()})},lc.nil)}}};nj.default=Nz});var oj=C(function(sj){Object.defineProperty(sj,"__esModule",{value:!0});var fc=be(),Lz={message({keyword:e,schemaCode:t}){return fc.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>fc._`{limit: ${e}}`},Dz={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Lz,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?fc.operators.GT:fc.operators.LT;e.fail$data(fc._`${r}.length ${i} ${n}`)}};sj.default=Dz});var Fu=C(function(cj){Object.defineProperty(cj,"__esModule",{value:!0});var aj=fh();aj.code='require("ajv/dist/runtime/equal").default';cj.default=aj});var uj=C(function(lj){Object.defineProperty(lj,"__esModule",{value:!0});var Nh=Ya(),At=be(),qz=_e(),Bz=Fu(),Hz={message:({params:{i:e,j:t}})=>At.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>At._`{i: ${e}, j: ${t}}`},Uz={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Hz,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=e;if(!n&&!i)return;let c=t.let("valid"),l=s.items?Nh.getSchemaTypes(s.items):[];e.block$data(c,u,At._`${o} === false`),e.ok(c);function u(){let y=t.let("i",At._`${r}.length`),g=t.let("j");e.setParams({i:y,j:g}),t.assign(c,!0),t.if(At._`${y} > 1`,()=>(d()?h:m)(y,g))}function d(){return l.length>0&&!l.some((y)=>y==="object"||y==="array")}function h(y,g){let b=t.name("item"),x=Nh.checkDataTypes(l,b,a.opts.strictNumbers,Nh.DataType.Wrong),_=t.const("indices",At._`{}`);t.for(At._`;${y}--;`,()=>{if(t.let(b,At._`${r}[${y}]`),t.if(x,At._`continue`),l.length>1)t.if(At._`typeof ${b} == "string"`,At._`${b} += "_"`);t.if(At._`typeof ${_}[${b}] == "number"`,()=>{t.assign(g,At._`${_}[${b}]`),e.error(),t.assign(c,!1).break()}).code(At._`${_}[${b}] = ${y}`)})}function m(y,g){let b=qz.useFunc(t,Bz.default),x=t.name("outer");t.label(x).for(At._`;${y}--;`,()=>t.for(At._`${g} = ${y}; ${g}--;`,()=>t.if(At._`${b}(${r}[${y}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(x)})))}}};lj.default=Uz});var dj=C(function(fj){Object.defineProperty(fj,"__esModule",{value:!0});var Mh=be(),Wz=_e(),zz=Fu(),Kz={message:"must be equal to constant",params:({schemaCode:e})=>Mh._`{allowedValue: ${e}}`},Gz={keyword:"const",$data:!0,error:Kz,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;if(n||s&&typeof s=="object")e.fail$data(Mh._`!${Wz.useFunc(t,zz.default)}(${r}, ${i})`);else e.fail(Mh._`${s} !== ${r}`)}};fj.default=Gz});var mj=C(function(pj){Object.defineProperty(pj,"__esModule",{value:!0});var dc=be(),Xz=_e(),Qz=Fu(),Zz={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>dc._`{allowedValues: ${e}}`},e8={keyword:"enum",schemaType:"array",$data:!0,error:Zz,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e;if(!n&&i.length===0)throw Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c!==null&&c!==void 0?c:c=Xz.useFunc(t,Qz.default),u;if(a||n)u=t.let("valid"),e.block$data(u,d);else{if(!Array.isArray(i))throw Error("ajv implementation error");let m=t.const("vSchema",s);u=dc.or(...i.map((y,g)=>h(m,g)))}e.pass(u);function d(){t.assign(u,!1),t.forOf("v",s,(m)=>t.if(dc._`${l()}(${r}, ${m})`,()=>t.assign(u,!0).break()))}function h(m,y){let g=i[y];return typeof g==="object"&&g!==null?dc._`${l()}(${r}, ${m}[${y}])`:dc._`${r} === ${g}`}}};pj.default=e8});var Lh=C(function(hj){Object.defineProperty(hj,"__esModule",{value:!0});var r8=VA(),n8=zA(),i8=QA(),s8=ej(),o8=rj(),a8=ij(),c8=oj(),l8=uj(),u8=dj(),f8=mj(),d8=[r8.default,n8.default,i8.default,s8.default,o8.default,a8.default,c8.default,l8.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u8.default,f8.default];hj.default=d8});var Jh=C(function(yj){Object.defineProperty(yj,"__esModule",{value:!0});yj.validateAdditionalItems=void 0;var gs=be(),Dh=_e(),m8={message:({params:{len:e}})=>gs.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>gs._`{limit: ${e}}`},h8={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:m8,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){Dh.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}gj(e,n)}};function gj(e,t){let{gen:r,schema:n,data:i,keyword:s,it:o}=e;o.items=!0;let a=r.const("len",gs._`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(gs._`${a} <= ${t.length}`);else if(typeof n=="object"&&!Dh.alwaysValidSchema(o,n)){let l=r.var("valid",gs._`${a} <= ${t.length}`);r.if(gs.not(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,a,(u)=>{if(e.subschema({keyword:s,dataProp:u,dataPropType:Dh.Type.Num},l),!o.allErrors)r.if(gs.not(l),()=>r.break())})}}yj.validateAdditionalItems=gj;yj.default=h8});var Fh=C(function(vj){Object.defineProperty(vj,"__esModule",{value:!0});vj.validateTuple=void 0;var xj=be(),qu=_e(),y8=qr(),b8={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return $j(e,"additionalItems",t);if(r.items=!0,qu.alwaysValidSchema(r,t))return;e.ok(y8.validateArray(e))}};function $j(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=e;if(u(i),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=qu.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),l=n.const("len",xj._`${s}.length`);r.forEach((d,h)=>{if(qu.alwaysValidSchema(a,d))return;n.if(xj._`${l} > ${h}`,()=>e.subschema({keyword:o,schemaProp:h,dataProp:h},c)),e.ok(c)});function u(d){let{opts:h,errSchemaPath:m}=a,y=r.length,g=y===d.minItems&&(y===d.maxItems||d[t]===!1);if(h.strictTuples&&!g){let b=`"${o}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;qu.checkStrictMode(a,b,h.strictTuples)}}}vj.validateTuple=$j;vj.default=b8});var Ej=C(function(Sj){Object.defineProperty(Sj,"__esModule",{value:!0});var $8=Fh(),v8={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>$8.validateTuple(e,"items")};Sj.default=v8});var kj=C(function(Pj){Object.defineProperty(Pj,"__esModule",{value:!0});var _j=be(),S8=_e(),E8=qr(),_8=Jh(),P8={message:({params:{len:e}})=>_j.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>_j._`{limit: ${e}}`},k8={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:P8,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;if(n.items=!0,S8.alwaysValidSchema(n,t))return;if(i)_8.validateAdditionalItems(e,i);else e.ok(E8.validateArray(e))}};Pj.default=k8});var jj=C(function(Aj){Object.defineProperty(Aj,"__esModule",{value:!0});var Br=be(),Bu=_e(),j8={message:({params:{min:e,max:t}})=>t===void 0?Br.str`must contain at least ${e} valid item(s)`:Br.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Br._`{minContains: ${e}}`:Br._`{minContains: ${e}, maxContains: ${t}}`},R8={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:j8,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,o,a,{minContains:c,maxContains:l}=n;if(s.opts.next)o=c===void 0?1:c,a=l;else o=1;let u=t.const("len",Br._`${i}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){Bu.checkStrictMode(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){Bu.checkStrictMode(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Bu.alwaysValidSchema(s,r)){let g=Br._`${u} >= ${o}`;if(a!==void 0)g=Br._`${g} && ${u} <= ${a}`;e.pass(g);return}s.items=!0;let d=t.name("valid");if(a===void 0&&o===1)m(d,()=>t.if(d,()=>t.break()));else if(o===0){if(t.let(d,!0),a!==void 0)t.if(Br._`${i}.length > 0`,h)}else t.let(d,!1),h();e.result(d,()=>e.reset());function h(){let g=t.name("_valid"),b=t.let("count",0);m(g,()=>t.if(g,()=>y(b)))}function m(g,b){t.forRange("i",0,u,(x)=>{e.subschema({keyword:"contains",dataProp:x,dataPropType:Bu.Type.Num,compositeRule:!0},g),b()})}function y(g){if(t.code(Br._`${g}++`),a===void 0)t.if(Br._`${g} >= ${o}`,()=>t.assign(d,!0).break());else if(t.if(Br._`${g} > ${a}`,()=>t.assign(d,!1).break()),o===1)t.assign(d,!0);else t.if(Br._`${g} >= ${o}`,()=>t.assign(d,!0))}}};Aj.default=R8});var Hu=C(function(Cj){Object.defineProperty(Cj,"__esModule",{value:!0});Cj.validateSchemaDeps=Cj.validatePropertyDeps=Cj.error=void 0;var qh=be(),C8=_e(),pc=qr();Cj.error={message:({params:{property:e,depsCount:t,deps:r}})=>qh.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>qh._`{property: ${e},
608
608
  missingProperty: ${n},
609
609
  depsCount: ${t},
610
- deps: ${r}}`};var A8={keyword:"dependencies",type:"object",schemaType:"object",error:jj.error,code(e){let[t,r]=j8(e);kj(e,t),Aj(e,r)}};function j8({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function kj(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let o in t){let a=t[o];if(a.length===0)continue;let c=pc.propertyInData(r,n,o,i.opts.ownProperties);if(e.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors)r.if(c,()=>{for(let l of a)pc.checkReportMissingProp(e,l)});else r.if(qh._`${c} && (${pc.checkMissingProp(e,a,s)})`),pc.reportMissingProp(e,s),r.else()}}jj.validatePropertyDeps=kj;function Aj(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,o=r.name("valid");for(let a in t){if(k8.alwaysValidSchema(s,t[a]))continue;r.if(pc.propertyInData(r,n,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:i,schemaProp:a},o);e.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),e.ok(o)}}jj.validateSchemaDeps=Aj;jj.default=A8});var Tj=C(function(Ij){Object.defineProperty(Ij,"__esModule",{value:!0});var Cj=be(),C8=_e(),I8={message:"property name must be valid",params:({params:e})=>Cj._`{propertyName: ${e.propertyName}}`},T8={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:I8,code(e){let{gen:t,schema:r,data:n,it:i}=e;if(C8.alwaysValidSchema(i,r))return;let s=t.name("valid");t.forIn("key",n,(o)=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),t.if(Cj.not(s),()=>{if(e.error(!0),!i.allErrors)t.break()})}),e.ok(s)}};Ij.default=T8});var Bh=C(function(Nj){Object.defineProperty(Nj,"__esModule",{value:!0});var Hu=qr(),an=be(),M8=Fr(),Uu=_e(),L8={message:"must NOT have additional properties",params:({params:e})=>an._`{additionalProperty: ${e.additionalProperty}}`},D8={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:L8,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&Uu.alwaysValidSchema(o,r))return;let l=Hu.allSchemaProperties(n.properties),u=Hu.allSchemaProperties(n.patternProperties);d(),e.ok(an._`${s} === ${M8.default.errors}`);function d(){t.forIn("key",i,(b)=>{if(!l.length&&!u.length)y(b);else t.if(h(b),()=>y(b))})}function h(b){let x;if(l.length>8){let _=Uu.schemaRefOrVal(o,n.properties,"properties");x=Hu.isOwnProperty(t,_,b)}else if(l.length)x=an.or(...l.map((_)=>an._`${b} === ${_}`));else x=an.nil;if(u.length)x=an.or(x,...u.map((_)=>an._`${Hu.usePattern(e,_)}.test(${b})`));return an.not(x)}function m(b){t.code(an._`delete ${i}[${b}]`)}function y(b){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(b);return}if(r===!1){if(e.setParams({additionalProperty:b}),e.error(),!a)t.break();return}if(typeof r=="object"&&!Uu.alwaysValidSchema(o,r)){let x=t.name("valid");if(c.removeAdditional==="failing")g(b,x,!1),t.if(an.not(x),()=>{e.reset(),m(b)});else if(g(b,x),!a)t.if(an.not(x),()=>t.break())}}function g(b,x,_){let k={keyword:"additionalProperties",dataProp:b,dataPropType:Uu.Type.Str};if(_===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,x)}}};Nj.default=D8});var Jj=C(function(Dj){Object.defineProperty(Dj,"__esModule",{value:!0});var F8=Eo(),Lj=qr(),Hh=_e(),Mj=Bh(),q8={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;if(s.opts.removeAdditional==="all"&&n.additionalProperties===void 0)Mj.default.code(new F8.KeywordCxt(s,Mj.default,"additionalProperties"));let o=Lj.allSchemaProperties(r);for(let d of o)s.definedProperties.add(d);if(s.opts.unevaluated&&o.length&&s.props!==!0)s.props=Hh.mergeEvaluated.props(t,Hh.toHash(o),s.props);let a=o.filter((d)=>!Hh.alwaysValidSchema(s,r[d]));if(a.length===0)return;let c=t.name("valid");for(let d of a){if(l(d))u(d);else{if(t.if(Lj.propertyInData(t,i,d,s.opts.ownProperties)),u(d),!s.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function l(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function u(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Dj.default=q8});var Uj=C(function(Hj){Object.defineProperty(Hj,"__esModule",{value:!0});var Fj=qr(),Vu=be(),qj=_e(),Bj=_e(),H8={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:o}=s,a=Fj.allSchemaProperties(r),c=a.filter((g)=>qj.alwaysValidSchema(s,r[g]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=t.name("valid");if(s.props!==!0&&!(s.props instanceof Vu.Name))s.props=Bj.evaluatedPropsToName(t,s.props);let{props:d}=s;h();function h(){for(let g of a){if(l)m(g);if(s.allErrors)y(g);else t.var(u,!0),y(g),t.if(u)}}function m(g){for(let b in l)if(new RegExp(g).test(b))qj.checkStrictMode(s,`property ${b} matches pattern ${g} (use allowMatchingProperties)`)}function y(g){t.forIn("key",n,(b)=>{t.if(Vu._`${Fj.usePattern(e,g)}.test(${b})`,()=>{let x=c.includes(g);if(!x)e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:b,dataPropType:Bj.Type.Str},u);if(s.opts.unevaluated&&d!==!0)t.assign(Vu._`${d}[${b}]`,!0);else if(!x&&!s.allErrors)t.if(Vu.not(u),()=>t.break())})})}}};Hj.default=H8});var Wj=C(function(Vj){Object.defineProperty(Vj,"__esModule",{value:!0});var V8=_e(),W8={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(V8.alwaysValidSchema(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Vj.default=W8});var Kj=C(function(zj){Object.defineProperty(zj,"__esModule",{value:!0});var K8=qr(),G8={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:K8.validateUnion,error:{message:"must match a schema in anyOf"}};zj.default=G8});var Yj=C(function(Gj){Object.defineProperty(Gj,"__esModule",{value:!0});var Wu=be(),X8=_e(),Q8={message:"must match exactly one schema in oneOf",params:({params:e})=>Wu._`{passingSchemas: ${e.passing}}`},Z8={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Q8,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((u,d)=>{let h;if(X8.alwaysValidSchema(i,u))t.var(c,!0);else h=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(Wu._`${c} && ${o}`).assign(o,!1).assign(a,Wu._`[${a}, ${d}]`).else();t.if(c,()=>{if(t.assign(o,!0),t.assign(a,d),h)e.mergeEvaluated(h,Wu.Name)})})}}};Gj.default=Z8});var Qj=C(function(Xj){Object.defineProperty(Xj,"__esModule",{value:!0});var tK=_e(),rK={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let i=t.name("valid");r.forEach((s,o)=>{if(tK.alwaysValidSchema(n,s))return;let a=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(a)})}};Xj.default=rK});var rR=C(function(tR){Object.defineProperty(tR,"__esModule",{value:!0});var zu=be(),eR=_e(),iK={message:({params:e})=>zu.str`must match "${e.ifClause}" schema`,params:({params:e})=>zu._`{failingKeyword: ${e.ifClause}}`},sK={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:iK,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)eR.checkStrictMode(n,'"if" without "then" and "else" is ignored');let i=Zj(n,"then"),s=Zj(n,"else");if(!i&&!s)return;let o=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),i&&s){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,l("then",u),l("else",u))}else if(i)t.if(a,l("then"));else t.if(zu.not(a),l("else"));e.pass(o,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function l(u,d){return()=>{let h=e.subschema({keyword:u},a);if(t.assign(o,a),e.mergeValidEvaluated(h,o),d)t.assign(d,zu._`${u}`);else e.setParams({ifClause:u})}}}};function Zj(e,t){let r=e.schema[t];return r!==void 0&&!eR.alwaysValidSchema(e,r)}tR.default=sK});var iR=C(function(nR){Object.defineProperty(nR,"__esModule",{value:!0});var aK=_e(),cK={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)aK.checkStrictMode(r,`"${e}" without "if" is ignored`)}};nR.default=cK});var Uh=C(function(sR){Object.defineProperty(sR,"__esModule",{value:!0});var uK=Jh(),fK=vj(),dK=Fh(),pK=Ej(),mK=Pj(),hK=Bu(),gK=Tj(),yK=Bh(),bK=Jj(),xK=Uj(),$K=Wj(),vK=Kj(),wK=Yj(),SK=Qj(),EK=rR(),_K=iR();function PK(e=!1){let t=[$K.default,vK.default,wK.default,SK.default,EK.default,_K.default,gK.default,yK.default,hK.default,bK.default,xK.default];if(e)t.push(fK.default,pK.default);else t.push(uK.default,dK.default);return t.push(mK.default),t}sR.default=PK});var Wh=C(function(cR){Object.defineProperty(cR,"__esModule",{value:!0});cR.dynamicAnchor=void 0;var Vh=be(),AK=Fr(),oR=rc(),jK=Mu(),RK={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>aR(e,e.schema)};function aR(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let i=Vh._`${AK.default.dynamicAnchors}${Vh.getProperty(t)}`,s=n.errSchemaPath==="#"?n.validateName:OK(e);r.if(Vh._`!${i}`,()=>r.assign(i,s))}cR.dynamicAnchor=aR;function OK(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:i,baseId:s,localRefs:o,meta:a}=t.root,{schemaId:c}=n.opts,l=new oR.SchemaEnv({schema:r,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return oR.compileSchema.call(n,l),jK.getValidate(e,l)}cR.default=RK});var zh=C(function(pR){Object.defineProperty(pR,"__esModule",{value:!0});pR.dynamicRef=void 0;var fR=be(),IK=Fr(),uR=Mu(),TK={keyword:"$dynamicRef",schemaType:"string",code:(e)=>dR(e,e.schema)};function dR(e,t){let{gen:r,keyword:n,it:i}=e;if(t[0]!=="#")throw Error(`"${n}" only supports hash fragment reference`);let s=t.slice(1);if(i.allErrors)o();else{let c=r.let("valid",!1);o(c),e.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",fR._`${IK.default.dynamicAnchors}${fR.getProperty(s)}`);r.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>r.block(()=>{uR.callRef(e,c),r.let(l,!0)}):()=>uR.callRef(e,c)}}pR.dynamicRef=dR;pR.default=TK});var gR=C(function(hR){Object.defineProperty(hR,"__esModule",{value:!0});var MK=Wh(),LK=_e(),DK={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)MK.dynamicAnchor(e,"");else LK.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};hR.default=DK});var bR=C(function(yR){Object.defineProperty(yR,"__esModule",{value:!0});var FK=zh(),qK={keyword:"$recursiveRef",schemaType:"string",code:(e)=>FK.dynamicRef(e,e.schema)};yR.default=qK});var $R=C(function(xR){Object.defineProperty(xR,"__esModule",{value:!0});var HK=Wh(),UK=zh(),VK=gR(),WK=bR(),zK=[HK.default,UK.default,VK.default,WK.default];xR.default=zK});var SR=C(function(wR){Object.defineProperty(wR,"__esModule",{value:!0});var vR=Bu(),GK={keyword:"dependentRequired",type:"object",schemaType:"object",error:vR.error,code:(e)=>vR.validatePropertyDeps(e)};wR.default=GK});var _R=C(function(ER){Object.defineProperty(ER,"__esModule",{value:!0});var XK=Bu(),QK={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>XK.validateSchemaDeps(e)};ER.default=QK});var kR=C(function(PR){Object.defineProperty(PR,"__esModule",{value:!0});var eG=_e(),tG={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)eG.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};PR.default=tG});var jR=C(function(AR){Object.defineProperty(AR,"__esModule",{value:!0});var nG=SR(),iG=_R(),sG=kR(),oG=[nG.default,iG.default,sG.default];AR.default=oG});var CR=C(function(OR){Object.defineProperty(OR,"__esModule",{value:!0});var ji=be(),RR=_e(),cG=Fr(),lG={message:"must NOT have unevaluated properties",params:({params:e})=>ji._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},uG={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:lG,code(e){let{gen:t,schema:r,data:n,errsCount:i,it:s}=e;if(!i)throw Error("ajv implementation error");let{allErrors:o,props:a}=s;if(a instanceof ji.Name)t.if(ji._`${a} !== true`,()=>t.forIn("key",n,(d)=>t.if(l(a,d),()=>c(d))));else if(a!==!0)t.forIn("key",n,(d)=>a===void 0?c(d):t.if(u(a,d),()=>c(d)));s.props=!0,e.ok(ji._`${i} === ${cG.default.errors}`);function c(d){if(r===!1){if(e.setParams({unevaluatedProperty:d}),e.error(),!o)t.break();return}if(!RR.alwaysValidSchema(s,r)){let h=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:RR.Type.Str},h),!o)t.if(ji.not(h),()=>t.break())}}function l(d,h){return ji._`!${d} || !${d}[${h}]`}function u(d,h){let m=[];for(let y in d)if(d[y]===!0)m.push(ji._`${h} !== ${y}`);return ji.and(...m)}}};OR.default=uG});var NR=C(function(TR){Object.defineProperty(TR,"__esModule",{value:!0});var ys=be(),IR=_e(),dG={message:({params:{len:e}})=>ys.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ys._`{limit: ${e}}`},pG={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:dG,code(e){let{gen:t,schema:r,data:n,it:i}=e,s=i.items||0;if(s===!0)return;let o=t.const("len",ys._`${n}.length`);if(r===!1)e.setParams({len:s}),e.fail(ys._`${o} > ${s}`);else if(typeof r=="object"&&!IR.alwaysValidSchema(i,r)){let c=t.var("valid",ys._`${o} <= ${s}`);t.if(ys.not(c),()=>a(c,s)),e.ok(c)}i.items=!0;function a(c,l){t.forRange("i",l,o,(u)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:IR.Type.Num},c),!i.allErrors)t.if(ys.not(c),()=>t.break())})}}};TR.default=pG});var LR=C(function(MR){Object.defineProperty(MR,"__esModule",{value:!0});var hG=CR(),gG=NR(),yG=[hG.default,gG.default];MR.default=yG});var JR=C(function(DR){Object.defineProperty(DR,"__esModule",{value:!0});var mt=be(),xG={message:({schemaCode:e})=>mt.str`must match format "${e}"`,params:({schemaCode:e})=>mt._`{format: ${e}}`},$G={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:xG,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;if(i)h();else m();function h(){let y=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=r.const("fDef",mt._`${y}[${o}]`),b=r.let("fType"),x=r.let("format");r.if(mt._`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(b,mt._`${g}.type || "string"`).assign(x,mt._`${g}.validate`),()=>r.assign(b,mt._`"string"`).assign(x,g)),e.fail$data(mt.or(_(),k()));function _(){if(c.strictSchema===!1)return mt.nil;return mt._`${o} && !${x}`}function k(){let E=u.$async?mt._`(${g}.async ? await ${x}(${n}) : ${x}(${n}))`:mt._`${x}(${n})`,w=mt._`(typeof ${x} == "function" ? ${E} : ${x}.test(${n}))`;return mt._`${x} && ${x} !== true && ${b} === ${t} && !${w}`}}function m(){let y=d.formats[s];if(!y){_();return}if(y===!0)return;let[g,b,x]=k(y);if(g===t)e.pass(E());function _(){if(c.strictSchema===!1){d.logger.warn(w());return}throw Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function k(w){let P=w instanceof RegExp?mt.regexpCode(w):c.code.formats?mt._`${c.code.formats}${mt.getProperty(s)}`:void 0,R=r.scopeValue("formats",{key:s,ref:w,code:P});if(typeof w=="object"&&!(w instanceof RegExp))return[w.type||"string",w.validate,mt._`${R}.validate`];return["string",w,R]}function E(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw Error("async format in sync schema");return mt._`await ${x}(${n})`}return typeof b=="function"?mt._`${x}(${n})`:mt._`${x}.test(${n})`}}}};DR.default=$G});var Kh=C(function(FR){Object.defineProperty(FR,"__esModule",{value:!0});var wG=JR(),SG=[wG.default];FR.default=SG});var Gh=C(function(qR){Object.defineProperty(qR,"__esModule",{value:!0});qR.contentVocabulary=qR.metadataVocabulary=void 0;qR.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];qR.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var VR=C(function(UR){Object.defineProperty(UR,"__esModule",{value:!0});var PG=Th(),kG=Lh(),AG=Uh(),jG=$R(),RG=jR(),OG=LR(),CG=Kh(),HR=Gh(),IG=[jG.default,PG.default,kG.default,(0,AG.default)(!0),CG.default,HR.metadataVocabulary,HR.contentVocabulary,RG.default,OG.default];UR.default=IG});var GR=C(function(zR){Object.defineProperty(zR,"__esModule",{value:!0});zR.DiscrError=void 0;var WR;(function(e){e.Tag="tag",e.Mapping="mapping"})(WR||(zR.DiscrError=WR={}))});var Xh=C(function(XR){Object.defineProperty(XR,"__esModule",{value:!0});var jo=be(),Yh=GR(),YR=rc(),NG=_o(),MG=_e(),LG={message:({params:{discrError:e,tagName:t}})=>e===Yh.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>jo._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},DG={keyword:"discriminator",type:"object",schemaType:"object",error:LG,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:o}=i;if(!s.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!o)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",jo._`${r}${jo.getProperty(a)}`);t.if(jo._`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:Yh.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function u(){let m=h();t.if(!1);for(let y in m)t.elseIf(jo._`${l} === ${y}`),t.assign(c,d(m[y]));t.else(),e.error(!1,{discrError:Yh.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function d(m){let y=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:m},y);return e.mergeEvaluated(g,jo.Name),y}function h(){var m;let y={},g=x(i),b=!0;for(let E=0;E<o.length;E++){let w=o[E];if((w===null||w===void 0?void 0:w.$ref)&&!MG.schemaHasRulesButRef(w,s.self.RULES)){let R=w.$ref;if(w=YR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,R),w instanceof YR.SchemaEnv)w=w.schema;if(w===void 0)throw new NG.default(s.opts.uriResolver,s.baseId,R)}let P=(m=w===null||w===void 0?void 0:w.properties)===null||m===void 0?void 0:m[a];if(typeof P!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);b=b&&(g||x(w)),_(P,E)}if(!b)throw Error(`discriminator: "${a}" must be required`);return y;function x({required:E}){return Array.isArray(E)&&E.includes(a)}function _(E,w){if(E.const)k(E.const,w);else if(E.enum)for(let P of E.enum)k(P,w);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(E,w){if(typeof E!="string"||E in y)throw Error(`discriminator: "${a}" values must be unique strings`);y[E]=w}}}};XR.default=DG});var QR=C(function(ile,FG){FG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var ZR=C(function(sle,qG){qG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var eO=C(function(ole,BG){BG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var tO=C(function(ale,HG){HG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var rO=C(function(cle,UG){UG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var nO=C(function(lle,VG){VG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var iO=C(function(ule,WG){WG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var sO=C(function(fle,zG){zG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var aO=C(function(oO){Object.defineProperty(oO,"__esModule",{value:!0});var KG=QR(),GG=ZR(),YG=eO(),XG=tO(),QG=rO(),ZG=nO(),e7=iO(),t7=sO(),r7=["/properties"];function n7(e){return[KG,GG,YG,XG,QG,t(this,ZG),e7,t(this,t7)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,r7):n}}oO.default=n7});var eg=C(function(hr,Zh){Object.defineProperty(hr,"__esModule",{value:!0});hr.MissingRefError=hr.ValidationError=hr.CodeGen=hr.Name=hr.nil=hr.stringify=hr.str=hr._=hr.KeywordCxt=hr.Ajv2020=void 0;var s7=Ih(),o7=VR(),a7=Xh(),c7=aO(),Qh="https://json-schema.org/draft/2020-12/schema";class mc extends s7.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),o7.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(a7.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;c7.default.call(this,e),this.refs["http://json-schema.org/schema"]=Qh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Qh)?Qh:void 0)}}hr.Ajv2020=mc;Zh.exports=hr=mc;Zh.exports.Ajv2020=mc;Object.defineProperty(hr,"__esModule",{value:!0});hr.default=mc;var l7=Eo();Object.defineProperty(hr,"KeywordCxt",{enumerable:!0,get:function(){return l7.KeywordCxt}});var Ro=be();Object.defineProperty(hr,"_",{enumerable:!0,get:function(){return Ro._}});Object.defineProperty(hr,"str",{enumerable:!0,get:function(){return Ro.str}});Object.defineProperty(hr,"stringify",{enumerable:!0,get:function(){return Ro.stringify}});Object.defineProperty(hr,"nil",{enumerable:!0,get:function(){return Ro.nil}});Object.defineProperty(hr,"Name",{enumerable:!0,get:function(){return Ro.Name}});Object.defineProperty(hr,"CodeGen",{enumerable:!0,get:function(){return Ro.CodeGen}});var u7=ec();Object.defineProperty(hr,"ValidationError",{enumerable:!0,get:function(){return u7.default}});var f7=_o();Object.defineProperty(hr,"MissingRefError",{enumerable:!0,get:function(){return f7.default}})});import{existsSync as Gu,readFileSync as m7}from"node:fs";import{createRequire as cO}from"node:module";import{isAbsolute as h7,relative as g7,resolve as Ku}from"node:path";import{fileURLToPath as lO,pathToFileURL as y7}from"node:url";function hc(e){return JSON.parse(m7(e,"utf8"))}async function uO(e){let t=Ku(e),r=Ku(t,"project.json"),n=Ku(t,"project.schema.json");if(!Gu(r))throw Error(`project.json not found in ${t}`);if(!Gu(n))throw Error(`project.schema.json not found in ${t} — run \`jx schema\` to generate it from `+"project.json#/extensions");let i=hc(r),s=hc(n);s.$id=y7(n).href;let o;try{({default:o}=await Promise.resolve().then(() => Bt(eg(),1)))}catch(u){throw Error("Project validation requires ajv: bun add ajv",{cause:u})}let c=await new o({allErrors:!0,loadSchema:(u)=>b7(u,t),strict:!1}).compileAsync(s),l=c(i);return{errors:c.errors??null,valid:l}}async function b7(e,t){if(!e.startsWith("file:"))throw Error(`Cannot resolve schema ref "${e}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let r=lO(e),n=g7(t,r);if(n.startsWith("..")||h7(n))throw Error(`Schema ref "${e}" escapes the project root ${t}`);if(Gu(r))return hc(r);let i=n.split("\\").join("/"),s="node_modules/",o=i.lastIndexOf(s);if(o===-1)throw Error(`Schema ref "${e}" does not exist`);let a=i.slice(o+s.length),c;try{c=cO(Ku(t,"package.json")).resolve(a)}catch{try{c=cO(import.meta.url).resolve(a)}catch(l){if(a.startsWith("@jxsuite/schema/")){let d=lO(new URL(`../${a.slice(16)}`,import.meta.url));if(Gu(d))return hc(d)}throw Error(`Schema ref "${e}" does not exist and "${a}" is not resolvable from the project or the host`,{cause:l})}}return hc(c)}var fO=()=>{};function Pn(e){return ee(e.attributes)?e.attributes:{}}function Dt(e,t){let r=Pn(e)[t];return T(r)?r:null}function ht(e){return T(e.tagName)?e.tagName.toLowerCase():""}function Zt(e,t="the popover"){let r=T(e.id)?e.id:Dt(e,"id");if(r)return`#${r}`;let n=ht(e);return n===""?t:`the <${n}>`}function v7(e){let t=Pn(e).popover;return T(t)?t:null}function pO(e){let t=new Set,r=new Set;for(let n of e){let i=n!==null&&T(n.tagName)?n.tagName:"";if(n===null||!i.includes("-"))continue;if(tg(n))t.add(i);let s=n.observedAttributes;if(Array.isArray(s)&&w7.every((o)=>s.includes(o)))r.add(i)}return{invokerTags:r,popoverTags:t}}function tg(e){return"popover"in Pn(e)||"popover"in e}function gc(e,t){return tg(e)||(t?.popoverTags?.has(ht(e))??!1)}function Ri(e){if(T(e.id)&&e.id!=="")return e.id;let t=Dt(e,"id");return t===""?null:t}function*_n(e,t=[],r=null,n){yield{enclosing:r,node:e,path:t};let i=gc(e,n)?e:r,{children:s}=e;if(Array.isArray(s)){for(let[c,l]of s.entries())if(J(l))yield*_n(l,[...t,"children",c],i,n)}else if(ee(s)&&ir(s.map))yield*_n(s.map,[...t,"children","map"],i,n);let o=ir(e.map)?e.map:null;if(o)yield*_n(o,[...t,"map"],i,n);let a=ee(e.cases)?e.cases:{};for(let[c,l]of Object.entries(a))if(J(l))yield*_n(l,[...t,"cases",c],i,n)}function rg(e,t){let r=[];for(let{node:n}of _n(e,[],null,t)){if(!gc(n,t))continue;let i=Ri(n);if(i!==null&&!r.includes(i))r.push(i)}return r}function Yu(e){return e.startsWith("@")}function mO(e){return e.startsWith(":")||e.startsWith("&")||e.startsWith(".")||e.startsWith("[")}function Qt(e,t){let r=e?.[t];if(r===void 0||Li(r)||Array.isArray(r))return null;return String(r)}function hO(e){for(let[t,r]of Object.entries(e??{})){if(!Li(r))continue;if(mO(t)&&t.includes(":popover-open")&&Qt(r,"display")!==null)return!0;if(Yu(t)&&hO(r))return!0}return!1}function gO(e){for(let[t,r]of Object.entries(e??{})){if(!Li(r))continue;if(mO(t)&&t.includes(":popover-open"))return!0;if(Yu(t)&&gO(r))return!0}return!1}function E7(e){return S7.some((t)=>Qt(e,t)!==null)}function _7(e){if(!e)return[];let t=[];for(let[r,n]of Object.entries(e))if(Yu(r)&&Li(n)&&Qt(n,"display")!==null)t.push(r);return t}function yO(e){if(!e)return[];let t=[],r=Qt(e,"transition");if(r!==null)t.push(r);for(let[n,i]of Object.entries(e))if(Yu(n)&&Li(i))t.push(...yO(i));return t}function P7(e){if(!e)return!1;if(Qt(e,"positionAnchor")!==null||Qt(e,"position-anchor")!==null)return!0;return["top","left","right","bottom","inset","insetBlockStart","insetInlineStart"].some((t)=>(Qt(e,t)??"").includes("anchor("))}function k7(e){if(!e)return!1;if(Qt(e,"positionArea")!==null||Qt(e,"position-area")!==null||Qt(e,"positionTryFallbacks")!==null||Qt(e,"position-try-fallbacks")!==null)return!0;return Object.keys(e).some((t)=>t.startsWith("@supports"))}function bO(e,t){let r=[..._n(e,[],null,t)],n=rg(e,t),i=r.some(({node:a})=>gc(a,t)),s=new Set;for(let{node:a}of r)if(dO.has(ht(a))){let c=Dt(a,"popovertarget");if(c!==null)s.add(c)}let o=[];for(let{enclosing:a,node:c,path:l}of r)if(o.push(...A7(c,l,a,n,i,t)),tg(c))o.push(...j7(c,l,s));return o}function A7(e,t,r,n,i,s){let o=[],a=ht(e),c=Dt(e,"popovertarget"),l=dO.has(a)||(s?.invokerTags?.has(a)??!1);if(c!==null&&!l)return o.push({detail:"`popovertarget` and `popovertargetaction` come from the `PopoverTargetAttributes` IDL mixin, which HTML includes into `HTMLButtonElement` and `HTMLInputElement` and into nothing else. Elsewhere they parse and do nothing. A link inside an open popover "+"dismisses it by navigating away, which is why this looks like it works — but it does "+`not for a new tab or a same-page fragment. Remove both attributes. ${Xe}`,fix:"invoker",message:`<${a||"element"}> carries popovertarget, which only <button> and <input> support.`,path:t,rule:"invoker-not-button",severity:"error"}),o;if(c!==null){if(i&&!n.includes(c)){let u=n.length>0?`The popovers here are: ${n.map((d)=>`"${d}"`).join(", ")}. `:"";o.push({detail:`No element in this document declares \`popover\` with the id "${c}". ${u}A target that names nothing does nothing, silently. ${Xe}`,message:`popovertarget="${c}" names no popover in this document.`,path:t,rule:"target-missing",severity:"error"})}else if(r!==null&&Ri(r)!==null&&Ri(r)!==c)o.push({detail:`This control is inside ${Zt(r)} but targets "${c}". Dismissing a different popover leaves the one the reader is looking at open. This is usually a copy-paste between two panels in the same file. ${Xe}`,message:`A control inside ${Zt(r)} targets "${c}" instead.`,path:t,rule:"target-mismatch",severity:"warn"})}if(a==="a"&&r!==null&&c===null){let u=Dt(e,"href")??(T(e.href)?e.href:null),d=Dt(e,"target")==="_blank",h=u!==null&&u.includes("#");if(d||h){let m=d?"it opens a new tab, so the panel stays open on the page behind it. ":"it is a same-document fragment, so the page scrolls behind the open panel. ";o.push({detail:`A link inside a panel normally dismisses it by navigating away. This one does not: ${m}`+"There is no declarative fix — a link cannot carry `popovertarget`. Move it out of the "+`panel, make it a <button>, or accept it deliberately. ${Xe}`,message:`A link inside ${Zt(r)} does not dismiss it.`,path:t,rule:"link-does-not-dismiss",severity:"warn"})}}return o}function j7(e,t,r){let n=[],{style:i}=e,s=Zt(e),o=v7(e);if(o!==null&&o!==""&&!$7.some((l)=>l===o))n.push({detail:"`popover` is an enumerated attribute taking `auto`, `manual` or `hint`. Anything else falls back to the invalid-value default `manual`, which gives up light dismiss and gives "+`up Escape — so the panel opens and there is no way to close it. Write "auto". ${Xe}`,fix:"mode",message:`${s} declares popover="${o}", which is not one of auto, manual or hint.`,path:t,rule:"invalid-mode",severity:"error"});else if(Rt(Pn(e).popover))n.push({detail:`\`popover\` carries its value in its text, so a boolean is not the right shape. Written as \`true\` it reaches two of the compiler's emitters as \`popover="true"\`, which is not one of the three keywords, so HTML falls back to \`manual\`: no light dismiss, no Escape, and the trigger stops toggling. Write "auto". ${Xe}`,fix:"mode",message:`${s} writes popover as a boolean.`,path:t,rule:"invalid-mode",severity:"error"});let a=Qt(i,"display");if(a!==null&&a!=="revert"&&a!=="revert-layer")n.push({detail:"A closed popover is hidden by the browser's own `[popover]:not(:popover-open) { display: none }`. That rule is UA-origin, so any author `display` beats it at any specificity, and "+"the panel is laid out on every page whether it is open or not — usually parked off the "+`side of the viewport by the transform meant to animate it, so nothing looks wrong until you scroll sideways. \`display\` belongs in \`:popover-open\` and nowhere else. ${Xe}`,fix:"display",message:`${s} sets display in its base rule.`,path:t,rule:"base-display",severity:"error"});for(let l of _7(i))n.push({detail:`The same defect as a base \`display\`, arriving through \`${l}\` and therefore only at `+"one width — which is what makes it hard to see. Gate the TRIGGER on a breakpoint, never "+`the panel: the popover mechanism is what hides the panel. ${Xe}`,fix:"display",message:`${s} sets display inside ${l}.`,path:t,rule:"breakpoint-display",severity:"error"});if(Qt(i,"visibility")!==null)n.push({detail:`A second hiding mechanism the browser already provides. Once \`display\` leaves the base rule this one only adds a frame of flicker on open, and it hides the element from assistive technology in a way \`display: none\` already did. ${Xe}`,fix:"display",message:`${s} also hides itself with visibility.`,path:t,rule:"base-visibility",severity:"warn"});if(!gO(i))n.push({detail:"Nothing changes when it opens, so no transition on it can run and — if `display` is not "+"in the base rule — the panel has no `display` at all while open. This is usually a panel "+`that was styled before it was made a popover. ${Xe}`,message:`${s} has no :popover-open rule.`,path:t,rule:"no-open-rule",severity:"warn"});else if(!hO(i)&&a===null&&E7(i))n.push({detail:`${s} declares flex or grid properties, but neither its base rule nor its `+"`:popover-open` rule sets a `display` for them to apply to — and the base rule must not "+`(that is what keeps the closed panel hidden). So it opens with the UA's \`display: block\` and the layout silently does nothing. Put \`display: flex\` in \`:popover-open\`. ${Xe}`,fix:"open-display",message:`${s} is laid out with flex or grid but never sets display.`,path:t,rule:"no-open-display",severity:"error"});for(let l of yO(i))if(l.includes("display")&&!l.includes("overlay")){n.push({detail:"`display …allow-discrete` keeps the box alive while it animates out; `overlay "+"…allow-discrete` is what keeps it in the TOP LAYER for those same milliseconds. "+`Without it the panel drops behind the page content and the backdrop disappears a frame early, so the exit reads as a flicker rather than an animation. ${Xe}`,message:`${s} transitions display but not overlay.`,path:t,rule:"cut-exit",severity:"warn"});break}if(P7(i)&&!k7(i))n.push({detail:"When `anchor()` does not resolve, every inset it feeds computes to `auto` — and a "+`\`position: fixed\` box with four \`auto\` insets falls back to its STATIC position, which for a panel declared inside a header is in the middle of the header. Use \`position-area\` with \`position-try-fallbacks\`, or add a \`@supports\` block that positions it without anchors. ${Xe}`,message:`${s} is anchor-positioned with no fallback.`,path:t,rule:"unsafe-anchor",severity:"warn"});let c=Ri(e);if(c!==null&&!r.has(c))n.push({detail:`No \`<button>\` or \`<input>\` in this document names it with \`popovertarget\`. If it is opened from another file or from a function that calls \`showPopover()\`, this is fine; otherwise there is no way for a reader to open it. ${Xe}`,message:`${s} has no invoker in this document.`,path:t,rule:"no-invoker",severity:"warn"});return n}var $7,dO,w7,S7,Xe="See docs/framework/concepts/overlays.";var Xu=L(()=>{Ee();$7=["auto","manual","hint"],dO=new Set(["button","input"]);w7=["popovertarget","popovertargetaction","command","commandfor"];S7=["flexDirection","flex-direction","alignItems","align-items","justifyContent","justify-content","flexWrap","flex-wrap","gridTemplateColumns","grid-template-columns","gridTemplateRows","grid-template-rows","gap"]});function To(e,t){let r=Pn(e),n=t in r?r[t]:e[t];if(n===void 0||n===null)return{kind:"absent"};if(Je(n)||ee(n))return{kind:"bound"};if(T(n))return n.includes("${")?{kind:"bound"}:{kind:"text",text:n};return{isTrue:n===!0,kind:"other"}}function Co(e,t){let r=To(e,t);return r.kind==="text"&&r.text.trim()!==""?r.text:null}function Jt(e,t){return To(e,t).kind!=="absent"}function Oi(e){let t=To(e,"role");if(t.kind==="bound")return Io;return t.kind==="text"?t.text.trim().toLowerCase().split(/\s+/)[0]:null}function Qu(e){let t=To(e,"id");if(t.kind==="bound")return Io;return t.kind==="text"&&t.text!==""?t.text:null}function Hr(e,t){let r=To(e,t);return r.kind==="bound"||r.kind==="text"&&r.text.trim()!==""}function Zu(e){let t=e.textContent;if(T(t)){if(t.trim()!=="")return!0}else if(t!==void 0&&t!==null)return!0;if(Hr(e,"aria-label")||Jt(e,"aria-labelledby"))return!0;if(ht(e)==="img"&&(Hr(e,"alt")||Hr(e,"title")))return!0;if(ht(e)==="slot")return!0;let{children:r}=e;if(Array.isArray(r)){for(let i of r)if(T(i)){if(i.trim()!=="")return!0}else if(J(i)&&Zu(i))return!0}else if(r!=null)return!0;if(ee(e.map))return!0;return(ee(e.cases)?Object.values(e.cases):[]).some((i)=>ir(i)&&Zu(i))}function*Oo(e,t=[],r=[],n=[]){yield{node:e,path:t,roles:r,tags:n};let i=[...r,Oi(e)],s=[...n,ht(e)],{children:o}=e;if(Array.isArray(o)){for(let[a,c]of o.entries())if(J(c))yield*Oo(c,[...t,"children",a],i,s)}else if(ee(o)&&ir(o.map))yield*Oo(o.map,[...t,"children","map"],i,s);if(ir(e.map))yield*Oo(e.map,[...t,"map"],i,s);if(ee(e.cases)){for(let[a,c]of Object.entries(e.cases))if(J(c))yield*Oo(c,[...t,"cases",a],i,s)}}function N7(e){return e.some((t)=>t.includes("-"))}function kn(e,t,r,n,i,s="error"){return{criterion:i,detail:`${n} ${R7}`,message:r,path:t,rule:e,severity:s}}function xO(e,t,r){if(r.includes("label"))return!0;if(e===Io||t.bound)return!0;return e!==null&&t.ids.has(e)}function M7(e,t){let{node:r,path:n,tags:i}=e,s=ht(r),o=Oi(r);if(o==="bound")return null;if(Hr(r,"aria-label")||Jt(r,"aria-labelledby")||Hr(r,"title"))return null;let c=Zt(r,"the control"),l=(d)=>kn("interactive-unnamed",n,`${c} has no accessible name.`,`A control with no name is announced as its role alone, so a reader hears "button" and nothing else. ${d}`,"4.1.2"),u=L7(r,s,t,i);if(u==="named"||u==="exempt")return null;if(o!==null&&O7.has(o))return Zu(r)?null:l("Give it text content, or an aria-label.");if(o!==null&&C7.has(o))return l("Give it an aria-label, or aria-labelledby naming its visible label.");if(o!==null)return null;if(s==="button"||s==="summary"||s==="a"&&Jt(r,"href"))return Zu(r)?null:l("Give it text content, or an aria-label.");if(u==="unnamed")return l("Give it a <label for> naming its id, or an aria-label.");if(u==="unnamed-value")return l("Give it a value, or an aria-label.");if(u==="unnamed-alt")return l("Give it an alt, or an aria-label.");return null}function L7(e,t,r,n){if(t==="area"){if(!Jt(e,"href"))return"none";return Hr(e,"alt")?"named":"unnamed-alt"}if(t==="select"||t==="textarea")return xO(Qu(e),r,n)||Hr(e,"placeholder")?"named":"unnamed";if(t!=="input")return"none";let i=(Co(e,"type")??"text").toLowerCase();if(i==="hidden"||Jt(e,"type")&&Co(e,"type")===null)return"exempt";if(I7.has(i))return Hr(e,"value")?"named":"unnamed-value";if(i==="image")return Hr(e,"alt")?"named":"unnamed-alt";return xO(Qu(e),r,n)||Hr(e,"placeholder")?"named":"unnamed"}function J7(e){let{node:t,path:r,tags:n}=e,i=ht(t);if(!i.includes("-")||!n.some((s)=>D7.has(s)))return null;return kn("custom-element-in-select",r,`<${i}> is a custom element inside a <select>.`,'A <select> builds its own rows: an element it does not know is not in select.options, so it cannot be picked, cannot be reached with the arrow keys, and fires no change event — while role="option" on it still makes the accessibility tree read as though it could. Every row of a <select> is a native <option>; a listbox whose rows are jx-option elements is a jx-listbox.',"4.1.2")}function F7(e){let{node:t,path:r}=e;if(ht(t)!=="img")return null;let n=Oi(t);if(n==="bound"||n==="presentation"||n==="none")return null;if(Jt(t,"alt")||Hr(t,"aria-label")||Jt(t,"aria-labelledby"))return null;return kn("img-alt-missing",r,`${Zt(t,"the image")} has no alt text.`,'An image with no alt is announced by its file name. Describe it in alt, or write alt="" for a decorative one.',"1.1.1")}function B7(e,t){let{node:r,path:n}=e,i=[];for(let s of q7){let o=Co(r,s);if(o===null)continue;for(let a of o.split(/\s+/))if(a!==""&&!t.has(a))i.push(kn("aria-target-missing",n,`${Zt(r,"the element")} points ${s} at #${a}, which nothing in this document has as its id.`,"A reference to an id that is not in the document is silently dropped, so the relationship it declares does not exist. Name an element that is here, or give that element the id.","1.3.1"))}return i}function H7(e,t,r){for(let n of $O.get(t)??[]){let i=r.get(n);if(i===void 0)continue;if(i.bound)return!0;if(e===Io&&i.ids.size>0)return!0;if(e!==null&&e!==Io&&i.ids.has(e))return!0}return!1}function U7(e,t){let{node:r,path:n,roles:i,tags:s}=e,o=Oi(r);if(o===null||o==="bound"||n.length===0||N7(s))return null;if(i.includes("bound")||H7(Qu(r),o,t))return null;let a=Zt(r,"the element");if(o==="tab"&&!i.includes("tablist"))return kn("tab-outside-tablist",n,`${a} is a tab outside any tablist.`,'A tab is announced with its position in a tablist, so one with no tablist ancestor has no place to be counted in. Put the tabs in a container with role="tablist".',"1.3.1");if((o==="menuitem"||o==="menuitemcheckbox"||o==="menuitemradio")&&!i.includes("menu")&&!i.includes("menubar"))return kn("menuitem-outside-menu",n,`${a} is a ${o} outside any menu.`,'A menu item is owned by a menu, and is announced as one of its items. Put it in a container with role="menu" or role="menubar".',"1.3.1");if(o==="option"&&!i.includes("listbox")&&!s.includes("select")&&!s.includes("datalist"))return kn("option-outside-listbox",n,`${a} is an option outside any listbox.`,'An option is owned by a listbox, and is announced as one of its choices. Put it in a container with role="listbox", or in a <select>.',"1.3.1");return null}function V7(e){let t=[];for(let{node:r}of Oo(e)){if(Oi(r)!=="tab")continue;let n=To(r,"aria-selected");if(n.kind==="bound")return null;t.push(n.kind==="other"&&n.isTrue||n.kind==="text"&&n.text==="true")}return t}function W7(e){let{node:t,path:r}=e;if(Oi(t)!=="tablist")return null;let n=V7(t);if(n===null||n.length===0||n.includes(!0))return null;return kn("tablist-none-selected",r,`${Zt(t,"the tablist")} has ${n.length} tab(s) and none is selected.`,'A tablist always has a current tab, and aria-selected="true" is how it is announced. Mark the tab whose panel is showing.',"4.1.2","warn")}function z7(e){let{node:t,path:r}=e,n=Oi(t);if(!(ht(t)==="dialog"||n==="dialog"||n==="alertdialog")||n==="bound")return null;if(Hr(t,"aria-label")||Jt(t,"aria-labelledby"))return null;return kn("dialog-unnamed",r,`${Zt(t,"the dialog")} has no accessible name.`,"A dialog is announced by its name when it opens, and its content does not name it. Give it aria-labelledby naming its heading, or an aria-label.","4.1.2")}function G7(e){let{node:t,path:r}=e;if(!Jt(t,"aria-activedescendant"))return null;let n=ht(t);if(K7.has(n)||n==="a"&&Jt(t,"href")||Jt(t,"tabIndex")||Jt(t,"tabindex")||Jt(t,"contenteditable"))return null;return kn("activedescendant-not-focusable",r,`${Zt(t,"the element")} manages focus with aria-activedescendant but cannot itself take focus.`,"aria-activedescendant names the active child of a FOCUSED container; on one that cannot be focused, the keyboard never reaches it. Give the container a tabindex.","2.1.1")}function vO(e){let t=[...Oo(e)],r=new Set,n={bound:!1,ids:new Set},i=new Map,s=!1;for(let{node:a}of t){let c=Oi(a);if(c!==null&&T7.has(c)){let u=i.get(c)??{bound:!1,ids:new Set},d=Co(a,"aria-owns");if(d===null)u.bound||=Jt(a,"aria-owns");else for(let h of d.split(/\s+/))if(h!=="")u.ids.add(h);i.set(c,u)}let l=Qu(a);if(l===Io)s=!0;else if(l!==null)r.add(l);if(ht(a)==="label"){let u=Co(a,"for")??Co(a,"htmlFor");if(u===null)n.bound||=Jt(a,"for")||Jt(a,"htmlFor");else n.ids.add(u)}}let o=[];for(let a of t){let c=[M7(a,n),F7(a),U7(a,i),J7(a),W7(a),z7(a),G7(a)];for(let l of c)if(l)o.push(l);if(!s)o.push(...B7(a,r))}return o}var R7="See docs/framework/concepts/accessibility.",Io="bound",O7,C7,I7,$O,T7,D7,q7,K7;var wO=L(()=>{Ee();Xu();O7=new Set(["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab","treeitem"]),C7=new Set(["combobox","listbox","searchbox","slider","spinbutton","textbox"]),I7=new Set(["button","reset","submit"]),$O=new Map([["menuitem",["menu","menubar"]],["menuitemcheckbox",["menu","menubar"]],["menuitemradio",["menu","menubar"]],["option",["listbox"]],["tab",["tablist"]]]),T7=new Set([...$O.values()].flat());D7=new Set(["select","jx-select"]);q7=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"];K7=new Set(["button","input","select","textarea"])});function ng(e){return ht(e)==="dialog"}function SO(e){return e.startsWith("--")}function rY(e){let t=[];for(let{node:r}of _n(e)){let n=Ri(r);if(ng(r)&&n!==null&&!t.includes(n))t.push(n)}return t}function nY(e){let t=e.oncommand;return t!==void 0&&t!==null}function iY(e,t){for(let{node:r}of _n(e)){if(r===e)continue;let n=ht(r);if(n==="button"){let i=Dt(r,"command"),s=Dt(r,"commandfor");if(i!==null&&(i==="close"||i==="request-close")&&(s===null||s===t))return!0}if(n==="form"&&Dt(r,"method")?.toLowerCase()==="dialog")return!0}return!1}function _O(e,t){let r=[..._n(e,[],null,t)],n=rY(e),i=rg(e,t),s=n.length>0||i.length>0,o=new Map,a=new Map;for(let{node:l}of r){let u=Ri(l);if(u!==null&&!o.has(u))o.set(u,l);if(ht(l)==="button"){let d=Dt(l,"commandfor"),h=Dt(l,"command");if(d!==null){let m=a.get(d)??new Set;m.add(h??""),a.set(d,m)}}}let c=[];for(let{node:l,path:u}of r)if(c.push(...sY(l,u,o,n,i,s,t)),ng(l))c.push(...oY(l,u,a));return c}function sY(e,t,r,n,i,s,o){let a=[],c=ht(e),l=o?.invokerTags?.has(c)??!1,u=Dt(e,"command"),d=Dt(e,"commandfor");if(!(u!==null||d!==null||("command"in Pn(e))||("commandfor"in Pn(e))))return a;let m=Zt(e,"the element");if(!tY.has(c)&&!l)return a.push({detail:"`command` and `commandfor` are attributes of `HTMLButtonElement` and of no other "+"interface — not even `<input>`, which `popovertarget` does allow. Elsewhere they parse "+`and do nothing. Make it a <button>, or remove both attributes. ${Xe}`,fix:"invoker",message:`<${c||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),a;if(u!==null&&!Z7.has(u)&&!SO(u))return a.push({detail:`\`command\` is an enumerated attribute taking ${EO.map((y)=>`\`${y}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${Xe}`,message:`${m} declares command="${u}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),a;if(d!==null){let y=r.get(d),g=n.includes(d),b=i.includes(d);if(!y&&s){let x=[...n,...i].map((_)=>`"${_}"`).join(", ");return a.push({detail:`No element in this document has the id "${d}". The dialogs and popovers here are: ${x}. A commandfor that names nothing does nothing, silently. ${Xe}`,message:`commandfor="${d}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),a}if(u!==null&&y){if(Y7.has(u)&&!ng(y))a.push({detail:`\`${u}\` acts on a <dialog>, and "${d}" is ${b?"a popover":`a <${ht(y)||"element"}>`}. The click is ignored. ${b?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${Xe}`,message:`${m} sends ${u} to "${d}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(X7.has(u)&&!gc(y,o))a.push({detail:`\`${u}\` acts on a popover, and "${d}" is ${g?"a dialog":`a <${ht(y)||"element"}>`} that declares no \`popover\`. The click is ignored. ${g?"Use `show-modal`, `close` or `request-close` for a dialog.":"Give the target a `popover` attribute, or point the button elsewhere."} ${Xe}`,message:`${m} sends ${u} to "${d}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(SO(u)&&!nY(y))a.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${d}" has no `+"`oncommand` handler to answer it — so the click does nothing. Add one that switches on "+`\`event#/command\`, or use a built-in command. ${Xe}`,message:`${m} sends ${u} to "${d}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return a}function oY(e,t,r){let n=[],i=Zt(e,"the dialog"),s=Ri(e),{style:o}=e,a=Dt(e,"closedby");if(a!==null&&!eY.has(a))n.push({detail:`\`closedby\` is an enumerated attribute taking \`any\` (light dismiss and Escape), \`closerequest\` (Escape only, the default for a modal) or \`none\`. Anything else is the invalid-value default, \`auto\`, which is the same as leaving it out. ${Xe}`,message:`${i} declares closedby="${a}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if(Qt(o,"display")!==null)n.push({detail:`A closed dialog is hidden by the browser's own \`dialog:not([open]) { display: none }\`. That rule is UA-origin, so any author \`display\` beats it, and the dialog is laid out on every page whether or not anyone opened it. \`display\` belongs in the \`&[open]\` rule and nowhere else. ${Xe}`,fix:"display",message:`${i} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let c=s===null?void 0:r.get(s),l=Dt(e,"open")!==null||Pn(e).open===!0||e.open===!0;if(s!==null&&!c?.has("show-modal")&&!l)n.push({detail:`No <button> in this document opens it with \`command="show-modal"\`. If it is opened from another file or from a function that calls \`showModal()\`, this is fine; otherwise there is no way for a reader to open it. ${Xe}`,message:`${i} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(c?.has("show-modal")&&a==="none"&&!iY(e,s))n.push({detail:`A modal dialog makes everything outside it inert, so the only ways out are the ones it offers: \`closedby="none"\` turns off Escape and light dismiss, and nothing inside it closes it. A reader who opens it cannot leave. Add a <button command="close"> inside, or drop \`closedby="none"\`. ${Xe}`,message:`${i} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return n}var EO,Y7,X7,Q7,Z7,eY,tY;var PO=L(()=>{Ee();Xu();EO=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],Y7=new Set(["show-modal","close","request-close"]),X7=new Set(["toggle-popover","show-popover","hide-popover"]),Q7=["any","closerequest","none"],Z7=new Set(EO),eY=new Set(Q7),tY=new Set(["button"])});var MO=C(function(TO){Object.defineProperty(TO,"__esModule",{value:!0});TO.formatNames=TO.fastFormats=TO.fullFormats=void 0;function An(e,t){return{validate:e,compare:t}}TO.fullFormats={date:An(RO,ag),time:An(sg(!0),cg),"date-time":An(kO(!0),CO),"iso-time":An(sg(),OO),"iso-date-time":An(kO(),IO),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:dY,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:xY,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:pY,int32:{type:"number",validate:gY},int64:{type:"number",validate:yY},float:{type:"number",validate:jO},double:{type:"number",validate:jO},password:!0,binary:!0};TO.fastFormats={...TO.fullFormats,date:An(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ag),time:An(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,cg),"date-time":An(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,CO),"iso-time":An(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,OO),"iso-date-time":An(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,IO),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};TO.formatNames=Object.keys(TO.fullFormats);function aY(e){return e%4===0&&(e%100!==0||e%400===0)}var cY=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,lY=[0,31,28,31,30,31,30,31,31,30,31,30,31];function RO(e){let t=cY.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&aY(r)?29:lY[n])}function ag(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var ig=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function sg(e){return function(r){let n=ig.exec(r);if(!n)return!1;let i=+n[1],s=+n[2],o=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!a)return!1;if(i<=23&&s<=59&&o<60)return!0;let d=s-u*c,h=i-l*c-(d<0?1:0);return(h===23||h===-1)&&(d===59||d===-1)&&o<61}}function cg(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function OO(e,t){if(!(e&&t))return;let r=ig.exec(e),n=ig.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var og=/t|\s/i;function kO(e){let t=sg(e);return function(n){let i=n.split(og);return i.length===2&&RO(i[0])&&t(i[1])}}function CO(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function IO(e,t){if(!(e&&t))return;let[r,n]=e.split(og),[i,s]=t.split(og),o=ag(r,i);if(o===void 0)return;return o||cg(n,s)}var uY=/\/|:/,fY=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function dY(e){return uY.test(e)&&fY.test(e)}var AO=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function pY(e){return AO.lastIndex=0,AO.test(e)}var mY=-2147483648,hY=2147483647;function gY(e){return Number.isInteger(e)&&e<=hY&&e>=mY}function yY(e){return Number.isInteger(e)}function jO(){return!0}var bY=/[^\\]\\Z/;function xY(e){if(bY.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var JO=C(function(DO){Object.defineProperty(DO,"__esModule",{value:!0});var vY=Th(),wY=Lh(),SY=Uh(),EY=Kh(),LO=Gh(),_Y=[vY.default,wY.default,(0,SY.default)(),EY.default,LO.metadataVocabulary,LO.contentVocabulary];DO.default=_Y});var FO=C(function(Mle,kY){kY.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 BO=C(function(gr,ug){Object.defineProperty(gr,"__esModule",{value:!0});gr.MissingRefError=gr.ValidationError=gr.CodeGen=gr.Name=gr.nil=gr.stringify=gr.str=gr._=gr.KeywordCxt=gr.Ajv=void 0;var AY=Ih(),jY=JO(),RY=Xh(),qO=FO(),OY=["/properties"],ef="http://json-schema.org/draft-07/schema";class yc extends AY.default{_addVocabularies(){if(super._addVocabularies(),jY.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(RY.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(qO,OY):qO;this.addMetaSchema(e,ef,!1),this.refs["http://json-schema.org/schema"]=ef}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ef)?ef:void 0)}}gr.Ajv=yc;ug.exports=gr=yc;ug.exports.Ajv=yc;Object.defineProperty(gr,"__esModule",{value:!0});gr.default=yc;var CY=Eo();Object.defineProperty(gr,"KeywordCxt",{enumerable:!0,get:function(){return CY.KeywordCxt}});var No=be();Object.defineProperty(gr,"_",{enumerable:!0,get:function(){return No._}});Object.defineProperty(gr,"str",{enumerable:!0,get:function(){return No.str}});Object.defineProperty(gr,"stringify",{enumerable:!0,get:function(){return No.stringify}});Object.defineProperty(gr,"nil",{enumerable:!0,get:function(){return No.nil}});Object.defineProperty(gr,"Name",{enumerable:!0,get:function(){return No.Name}});Object.defineProperty(gr,"CodeGen",{enumerable:!0,get:function(){return No.CodeGen}});var IY=ec();Object.defineProperty(gr,"ValidationError",{enumerable:!0,get:function(){return IY.default}});var TY=_o();Object.defineProperty(gr,"MissingRefError",{enumerable:!0,get:function(){return TY.default}})});var UO=C(function(HO){Object.defineProperty(HO,"__esModule",{value:!0});HO.formatLimitDefinition=void 0;var LY=BO(),cn=be(),Ci=cn.operators,tf={formatMaximum:{okStr:"<=",ok:Ci.LTE,fail:Ci.GT},formatMinimum:{okStr:">=",ok:Ci.GTE,fail:Ci.LT},formatExclusiveMaximum:{okStr:"<",ok:Ci.LT,fail:Ci.GTE},formatExclusiveMinimum:{okStr:">",ok:Ci.GT,fail:Ci.LTE}},DY={message:({keyword:e,schemaCode:t})=>cn.str`should be ${tf[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>cn._`{comparison: ${tf[e].okStr}, limit: ${t}}`};HO.formatLimitDefinition={keyword:Object.keys(tf),type:"string",schemaType:"string",$data:!0,error:DY,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:o,self:a}=s;if(!o.validateFormats)return;let c=new LY.KeywordCxt(s,a.RULES.all.format.definition,"format");if(c.$data)l();else u();function l(){let h=t.scopeValue("formats",{ref:a.formats,code:o.code.formats}),m=t.const("fmt",cn._`${h}[${c.schemaCode}]`);e.fail$data(cn.or(cn._`typeof ${m} != "object"`,cn._`${m} instanceof RegExp`,cn._`typeof ${m}.compare != "function"`,d(m)))}function u(){let h=c.schema,m=a.formats[h];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw Error(`"${i}": format "${h}" does not define "compare" function`);let y=t.scopeValue("formats",{key:h,ref:m,code:o.code.formats?cn._`${o.code.formats}${cn.getProperty(h)}`:void 0});e.fail$data(d(y))}function d(h){return cn._`${h}.compare(${r}, ${n}) ${tf[i].fail} 0`}},dependencies:["format"]};var JY=(e)=>(e.addKeyword(HO.formatLimitDefinition),e);HO.default=JY});var KO=C(function(bc,zO){Object.defineProperty(bc,"__esModule",{value:!0});var Mo=MO(),qY=UO(),dg=be(),VO=new dg.Name("fullFormats"),BY=new dg.Name("fastFormats"),pg=(e,t={keywords:!0})=>{if(Array.isArray(t))return WO(e,t,Mo.fullFormats,VO),e;let[r,n]=t.mode==="fast"?[Mo.fastFormats,BY]:[Mo.fullFormats,VO],i=t.formats||Mo.formatNames;if(WO(e,i,r,n),t.keywords)(0,qY.default)(e);return e};pg.get=(e,t="full")=>{let n=(t==="fast"?Mo.fastFormats:Mo.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function WO(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=dg._`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}zO.exports=bc=pg;Object.defineProperty(bc,"__esModule",{value:!0});bc.default=pg});import{existsSync as YO,readFileSync as XO,readdirSync as QO,statSync as ZO}from"node:fs";import{createRequire as HY}from"node:module";import{join as eC,relative as mg,resolve as hg}from"node:path";async function zY(){try{let{default:e}=await Promise.resolve().then(() => Bt(eg(),1)),{default:t}=await Promise.resolve().then(() => Bt(KO(),1));return{addFormats:t,Ajv:e}}catch(e){throw Error("Project validation requires ajv and ajv-formats: bun add ajv ajv-formats",{cause:e})}}async function tC(e,t={}){let r=hg(e),n=[],i=[],s=0;for(let k of["project.schema.json","document.schema.json"]){let E=hg(r,k);if(!YO(E))continue;s+=1;let w=xc(E),P=GY(w);if(P.length>0)n.push({errors:P.map(({reason:R,ref:j})=>({message:`$ref "${j}" ${R} — committed entry documents must be self-contained `+"single-resource schemas; regenerate with `jx schema`"})),file:k})}if(n.length>0)return{checked:s,issues:n,lint:i,valid:!1};let o=await uO(r);if(s+=1,!o.valid)n.push({errors:o.errors??[],file:"project.json"});let{addFormats:a,Ajv:c}=await zY(),{document:l}=await p1(r,{write:!1}),u=new c({allErrors:!0,ownProperties:!0,strict:!1});a(u);let d=u.compile(l),h=pO(GO(r).flatMap((k)=>{try{return[JSON.parse(XO(k,"utf8"))]}catch{return[]}}));for(let k of UY)for(let E of iC(hg(r,k))){if(E.endsWith(".class.json"))continue;s+=1;let w=xc(E);if(d(w))i.push(...KY(w,mg(r,E),h));else n.push({errors:d.errors??[],file:mg(r,E)})}let m=new c({allErrors:!0,ownProperties:!0,strict:!1});a(m);let y=m.compile(Bm());for(let k of GO(r)){s+=1;let E=xc(k);if(!y(E))n.push({errors:y.errors??[],file:mg(r,k)})}let{config:g}=ni(r),b=await ri(r,g),x=HY(import.meta.url);for(let k of b.extensions)for(let E of["project","document","fields"]){let w=k.schemas[E];if(!w)continue;s+=1;let P=new c({allErrors:!0,ownProperties:!0,strict:!1});a(P);for(let R of WY){let j=x.resolve(R);P.addSchema(xc(j))}try{P.compile(xc(w))}catch(R){n.push({errors:[{message:R instanceof Error?R.message:String(R)}],file:`${k.specifier} (${E} fragment)`})}}let _=t.strict===!0&&i.some((k)=>k.severity==="error");return{checked:s,issues:n,lint:i,valid:n.length===0&&!_}}function xc(e){return JSON.parse(XO(e,"utf8"))}function KY(e,t,r){let n=[];for(let i of bO(e,r))n.push({...gg(i),file:t,source:"popover"});for(let i of _O(e,r))n.push({...gg(i),file:t,source:"dialog"});for(let i of vO(e))n.push({...gg(i),criterion:i.criterion,file:t,source:"accessibility"});return n}function gg(e){return{detail:e.detail,message:e.message,path:e.path,rule:e.rule,severity:e.severity}}function rC(e){return e.lint.map((t)=>{let r=t.criterion===void 0?`${t.source}/${t.rule}`:`${t.source}/${t.rule}, WCAG ${t.criterion}`;return`${t.file}: ${t.severity}: ${t.message} [${r}]`})}function GY(e){let t=[],r=new Set,n=(s)=>{let o=e;for(let a of s.slice(1).split("/")){if(a==="")continue;let c=a.replaceAll("~1","/").replaceAll("~0","~");if(!J(o))return!1;if(o=o[c],o===void 0)return!1}return!0},i=(s)=>{if(!ee(s)||r.has(s))return;r.add(s);let o=s.$ref;if(T(o)){if(/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(o))t.push({reason:"is an absolute URI editors resolve over the network",ref:o});else if(!o.startsWith("#"))t.push({reason:"is a relative path only Node module resolution can follow",ref:o});else if(o.length>1&&!o.startsWith("#/"))t.push({reason:"is an $anchor reference, which has no root-pointer form",ref:o});else if(o.length>1&&!n(o.slice(1)))t.push({reason:"points at no node in this document",ref:o})}for(let[a,c]of Object.entries(s)){if(!YY.has(a))continue;if(Array.isArray(c))for(let l of c)i(l);else if(ee(c)){if(i(c),nC.has(a))for(let l of Object.values(c))i(l)}}};return i(e),t}function iC(e){if(!YO(e))return[];let t=[];for(let r of QO(e)){let n=eC(e,r);if(ZO(n).isDirectory())t.push(...iC(n));else if(r.endsWith(".json"))t.push(n)}return t.toSorted()}function GO(e){let t=[],r=(n)=>{for(let i of QO(n)){if(VY.has(i))continue;let s=eC(n,i);if(ZO(s).isDirectory())r(s);else if(i.endsWith(".class.json"))t.push(s)}};return r(e),t.toSorted()}function sC(e){let t=[];for(let r of e.issues){t.push(`${r.file}:`);for(let n of r.errors){let i=ee(n)?n:{},{instancePath:s,message:o}=i;t.push(` - ${s||"/"}: ${o??JSON.stringify(n)}`)}}return t}var UY,VY,WY,nC,YY;var oC=L(()=>{iP();fO();wO();PO();Xu();Ee();On();Ho();jm();UY=["components","pages","layouts"],VY=new Set(["node_modules","dist",".git"]),WY=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"];nC=new Set(["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"]),YY=new Set([...nC,"additionalItems","additionalProperties","allOf","anyOf","contains","contentSchema","else","if","items","not","oneOf","prefixItems","propertyNames","then","unevaluatedItems","unevaluatedProperties"])});vr();import{relative as yg,resolve as aC}from"node:path";async function XY(){let e=process.argv.slice(2),[t]=e;if(!t||t==="--help"||t==="-h")console.log(`Usage: jx <command> [options]
610
+ deps: ${r}}`};var I8={keyword:"dependencies",type:"object",schemaType:"object",error:Cj.error,code(e){let[t,r]=T8(e);Rj(e,t),Oj(e,r)}};function T8({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function Rj(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let o in t){let a=t[o];if(a.length===0)continue;let c=pc.propertyInData(r,n,o,i.opts.ownProperties);if(e.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors)r.if(c,()=>{for(let l of a)pc.checkReportMissingProp(e,l)});else r.if(qh._`${c} && (${pc.checkMissingProp(e,a,s)})`),pc.reportMissingProp(e,s),r.else()}}Cj.validatePropertyDeps=Rj;function Oj(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,o=r.name("valid");for(let a in t){if(C8.alwaysValidSchema(s,t[a]))continue;r.if(pc.propertyInData(r,n,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:i,schemaProp:a},o);e.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),e.ok(o)}}Cj.validateSchemaDeps=Oj;Cj.default=I8});var Lj=C(function(Mj){Object.defineProperty(Mj,"__esModule",{value:!0});var Nj=be(),L8=_e(),D8={message:"property name must be valid",params:({params:e})=>Nj._`{propertyName: ${e.propertyName}}`},J8={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:D8,code(e){let{gen:t,schema:r,data:n,it:i}=e;if(L8.alwaysValidSchema(i,r))return;let s=t.name("valid");t.forIn("key",n,(o)=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),t.if(Nj.not(s),()=>{if(e.error(!0),!i.allErrors)t.break()})}),e.ok(s)}};Mj.default=J8});var Bh=C(function(Dj){Object.defineProperty(Dj,"__esModule",{value:!0});var Uu=qr(),an=be(),q8=Fr(),Vu=_e(),B8={message:"must NOT have additional properties",params:({params:e})=>an._`{additionalProperty: ${e.additionalProperty}}`},H8={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:B8,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&Vu.alwaysValidSchema(o,r))return;let l=Uu.allSchemaProperties(n.properties),u=Uu.allSchemaProperties(n.patternProperties);d(),e.ok(an._`${s} === ${q8.default.errors}`);function d(){t.forIn("key",i,(b)=>{if(!l.length&&!u.length)y(b);else t.if(h(b),()=>y(b))})}function h(b){let x;if(l.length>8){let _=Vu.schemaRefOrVal(o,n.properties,"properties");x=Uu.isOwnProperty(t,_,b)}else if(l.length)x=an.or(...l.map((_)=>an._`${b} === ${_}`));else x=an.nil;if(u.length)x=an.or(x,...u.map((_)=>an._`${Uu.usePattern(e,_)}.test(${b})`));return an.not(x)}function m(b){t.code(an._`delete ${i}[${b}]`)}function y(b){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(b);return}if(r===!1){if(e.setParams({additionalProperty:b}),e.error(),!a)t.break();return}if(typeof r=="object"&&!Vu.alwaysValidSchema(o,r)){let x=t.name("valid");if(c.removeAdditional==="failing")g(b,x,!1),t.if(an.not(x),()=>{e.reset(),m(b)});else if(g(b,x),!a)t.if(an.not(x),()=>t.break())}}function g(b,x,_){let P={keyword:"additionalProperties",dataProp:b,dataPropType:Vu.Type.Str};if(_===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(P,x)}}};Dj.default=H8});var Bj=C(function(qj){Object.defineProperty(qj,"__esModule",{value:!0});var V8=Eo(),Fj=qr(),Hh=_e(),Jj=Bh(),W8={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;if(s.opts.removeAdditional==="all"&&n.additionalProperties===void 0)Jj.default.code(new V8.KeywordCxt(s,Jj.default,"additionalProperties"));let o=Fj.allSchemaProperties(r);for(let d of o)s.definedProperties.add(d);if(s.opts.unevaluated&&o.length&&s.props!==!0)s.props=Hh.mergeEvaluated.props(t,Hh.toHash(o),s.props);let a=o.filter((d)=>!Hh.alwaysValidSchema(s,r[d]));if(a.length===0)return;let c=t.name("valid");for(let d of a){if(l(d))u(d);else{if(t.if(Fj.propertyInData(t,i,d,s.opts.ownProperties)),u(d),!s.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function l(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function u(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};qj.default=W8});var zj=C(function(Wj){Object.defineProperty(Wj,"__esModule",{value:!0});var Hj=qr(),Wu=be(),Uj=_e(),Vj=_e(),K8={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:o}=s,a=Hj.allSchemaProperties(r),c=a.filter((g)=>Uj.alwaysValidSchema(s,r[g]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=t.name("valid");if(s.props!==!0&&!(s.props instanceof Wu.Name))s.props=Vj.evaluatedPropsToName(t,s.props);let{props:d}=s;h();function h(){for(let g of a){if(l)m(g);if(s.allErrors)y(g);else t.var(u,!0),y(g),t.if(u)}}function m(g){for(let b in l)if(new RegExp(g).test(b))Uj.checkStrictMode(s,`property ${b} matches pattern ${g} (use allowMatchingProperties)`)}function y(g){t.forIn("key",n,(b)=>{t.if(Wu._`${Hj.usePattern(e,g)}.test(${b})`,()=>{let x=c.includes(g);if(!x)e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:b,dataPropType:Vj.Type.Str},u);if(s.opts.unevaluated&&d!==!0)t.assign(Wu._`${d}[${b}]`,!0);else if(!x&&!s.allErrors)t.if(Wu.not(u),()=>t.break())})})}}};Wj.default=K8});var Gj=C(function(Kj){Object.defineProperty(Kj,"__esModule",{value:!0});var Y8=_e(),X8={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(Y8.alwaysValidSchema(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Kj.default=X8});var Xj=C(function(Yj){Object.defineProperty(Yj,"__esModule",{value:!0});var Z8=qr(),eK={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Z8.validateUnion,error:{message:"must match a schema in anyOf"}};Yj.default=eK});var Zj=C(function(Qj){Object.defineProperty(Qj,"__esModule",{value:!0});var zu=be(),rK=_e(),nK={message:"must match exactly one schema in oneOf",params:({params:e})=>zu._`{passingSchemas: ${e.passing}}`},iK={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:nK,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((u,d)=>{let h;if(rK.alwaysValidSchema(i,u))t.var(c,!0);else h=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(zu._`${c} && ${o}`).assign(o,!1).assign(a,zu._`[${a}, ${d}]`).else();t.if(c,()=>{if(t.assign(o,!0),t.assign(a,d),h)e.mergeEvaluated(h,zu.Name)})})}}};Qj.default=iK});var tR=C(function(eR){Object.defineProperty(eR,"__esModule",{value:!0});var oK=_e(),aK={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let i=t.name("valid");r.forEach((s,o)=>{if(oK.alwaysValidSchema(n,s))return;let a=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(a)})}};eR.default=aK});var sR=C(function(iR){Object.defineProperty(iR,"__esModule",{value:!0});var Ku=be(),nR=_e(),lK={message:({params:e})=>Ku.str`must match "${e.ifClause}" schema`,params:({params:e})=>Ku._`{failingKeyword: ${e.ifClause}}`},uK={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:lK,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)nR.checkStrictMode(n,'"if" without "then" and "else" is ignored');let i=rR(n,"then"),s=rR(n,"else");if(!i&&!s)return;let o=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),i&&s){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,l("then",u),l("else",u))}else if(i)t.if(a,l("then"));else t.if(Ku.not(a),l("else"));e.pass(o,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function l(u,d){return()=>{let h=e.subschema({keyword:u},a);if(t.assign(o,a),e.mergeValidEvaluated(h,o),d)t.assign(d,Ku._`${u}`);else e.setParams({ifClause:u})}}}};function rR(e,t){let r=e.schema[t];return r!==void 0&&!nR.alwaysValidSchema(e,r)}iR.default=uK});var aR=C(function(oR){Object.defineProperty(oR,"__esModule",{value:!0});var dK=_e(),pK={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)dK.checkStrictMode(r,`"${e}" without "if" is ignored`)}};oR.default=pK});var Uh=C(function(cR){Object.defineProperty(cR,"__esModule",{value:!0});var hK=Jh(),gK=Ej(),yK=Fh(),bK=kj(),xK=jj(),$K=Hu(),vK=Lj(),wK=Bh(),SK=Bj(),EK=zj(),_K=Gj(),PK=Xj(),kK=Zj(),AK=tR(),jK=sR(),RK=aR();function OK(e=!1){let t=[_K.default,PK.default,kK.default,AK.default,jK.default,RK.default,vK.default,wK.default,$K.default,SK.default,EK.default];if(e)t.push(gK.default,bK.default);else t.push(hK.default,yK.default);return t.push(xK.default),t}cR.default=OK});var Wh=C(function(fR){Object.defineProperty(fR,"__esModule",{value:!0});fR.dynamicAnchor=void 0;var Vh=be(),IK=Fr(),lR=rc(),TK=Lu(),NK={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>uR(e,e.schema)};function uR(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let i=Vh._`${IK.default.dynamicAnchors}${Vh.getProperty(t)}`,s=n.errSchemaPath==="#"?n.validateName:MK(e);r.if(Vh._`!${i}`,()=>r.assign(i,s))}fR.dynamicAnchor=uR;function MK(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:i,baseId:s,localRefs:o,meta:a}=t.root,{schemaId:c}=n.opts,l=new lR.SchemaEnv({schema:r,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return lR.compileSchema.call(n,l),TK.getValidate(e,l)}fR.default=NK});var zh=C(function(gR){Object.defineProperty(gR,"__esModule",{value:!0});gR.dynamicRef=void 0;var mR=be(),DK=Fr(),pR=Lu(),JK={keyword:"$dynamicRef",schemaType:"string",code:(e)=>hR(e,e.schema)};function hR(e,t){let{gen:r,keyword:n,it:i}=e;if(t[0]!=="#")throw Error(`"${n}" only supports hash fragment reference`);let s=t.slice(1);if(i.allErrors)o();else{let c=r.let("valid",!1);o(c),e.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",mR._`${DK.default.dynamicAnchors}${mR.getProperty(s)}`);r.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>r.block(()=>{pR.callRef(e,c),r.let(l,!0)}):()=>pR.callRef(e,c)}}gR.dynamicRef=hR;gR.default=JK});var xR=C(function(bR){Object.defineProperty(bR,"__esModule",{value:!0});var qK=Wh(),BK=_e(),HK={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)qK.dynamicAnchor(e,"");else BK.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};bR.default=HK});var vR=C(function($R){Object.defineProperty($R,"__esModule",{value:!0});var VK=zh(),WK={keyword:"$recursiveRef",schemaType:"string",code:(e)=>VK.dynamicRef(e,e.schema)};$R.default=WK});var SR=C(function(wR){Object.defineProperty(wR,"__esModule",{value:!0});var KK=Wh(),GK=zh(),YK=xR(),XK=vR(),QK=[KK.default,GK.default,YK.default,XK.default];wR.default=QK});var PR=C(function(_R){Object.defineProperty(_R,"__esModule",{value:!0});var ER=Hu(),eG={keyword:"dependentRequired",type:"object",schemaType:"object",error:ER.error,code:(e)=>ER.validatePropertyDeps(e)};_R.default=eG});var AR=C(function(kR){Object.defineProperty(kR,"__esModule",{value:!0});var rG=Hu(),nG={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>rG.validateSchemaDeps(e)};kR.default=nG});var RR=C(function(jR){Object.defineProperty(jR,"__esModule",{value:!0});var sG=_e(),oG={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)sG.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};jR.default=oG});var CR=C(function(OR){Object.defineProperty(OR,"__esModule",{value:!0});var cG=PR(),lG=AR(),uG=RR(),fG=[cG.default,lG.default,uG.default];OR.default=fG});var NR=C(function(TR){Object.defineProperty(TR,"__esModule",{value:!0});var ji=be(),IR=_e(),pG=Fr(),mG={message:"must NOT have unevaluated properties",params:({params:e})=>ji._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},hG={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:mG,code(e){let{gen:t,schema:r,data:n,errsCount:i,it:s}=e;if(!i)throw Error("ajv implementation error");let{allErrors:o,props:a}=s;if(a instanceof ji.Name)t.if(ji._`${a} !== true`,()=>t.forIn("key",n,(d)=>t.if(l(a,d),()=>c(d))));else if(a!==!0)t.forIn("key",n,(d)=>a===void 0?c(d):t.if(u(a,d),()=>c(d)));s.props=!0,e.ok(ji._`${i} === ${pG.default.errors}`);function c(d){if(r===!1){if(e.setParams({unevaluatedProperty:d}),e.error(),!o)t.break();return}if(!IR.alwaysValidSchema(s,r)){let h=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:IR.Type.Str},h),!o)t.if(ji.not(h),()=>t.break())}}function l(d,h){return ji._`!${d} || !${d}[${h}]`}function u(d,h){let m=[];for(let y in d)if(d[y]===!0)m.push(ji._`${h} !== ${y}`);return ji.and(...m)}}};TR.default=hG});var DR=C(function(LR){Object.defineProperty(LR,"__esModule",{value:!0});var ys=be(),MR=_e(),yG={message:({params:{len:e}})=>ys.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ys._`{limit: ${e}}`},bG={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:yG,code(e){let{gen:t,schema:r,data:n,it:i}=e,s=i.items||0;if(s===!0)return;let o=t.const("len",ys._`${n}.length`);if(r===!1)e.setParams({len:s}),e.fail(ys._`${o} > ${s}`);else if(typeof r=="object"&&!MR.alwaysValidSchema(i,r)){let c=t.var("valid",ys._`${o} <= ${s}`);t.if(ys.not(c),()=>a(c,s)),e.ok(c)}i.items=!0;function a(c,l){t.forRange("i",l,o,(u)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:MR.Type.Num},c),!i.allErrors)t.if(ys.not(c),()=>t.break())})}}};LR.default=bG});var FR=C(function(JR){Object.defineProperty(JR,"__esModule",{value:!0});var $G=NR(),vG=DR(),wG=[$G.default,vG.default];JR.default=wG});var BR=C(function(qR){Object.defineProperty(qR,"__esModule",{value:!0});var mt=be(),EG={message:({schemaCode:e})=>mt.str`must match format "${e}"`,params:({schemaCode:e})=>mt._`{format: ${e}}`},_G={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:EG,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;if(i)h();else m();function h(){let y=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=r.const("fDef",mt._`${y}[${o}]`),b=r.let("fType"),x=r.let("format");r.if(mt._`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(b,mt._`${g}.type || "string"`).assign(x,mt._`${g}.validate`),()=>r.assign(b,mt._`"string"`).assign(x,g)),e.fail$data(mt.or(_(),P()));function _(){if(c.strictSchema===!1)return mt.nil;return mt._`${o} && !${x}`}function P(){let E=u.$async?mt._`(${g}.async ? await ${x}(${n}) : ${x}(${n}))`:mt._`${x}(${n})`,w=mt._`(typeof ${x} == "function" ? ${E} : ${x}.test(${n}))`;return mt._`${x} && ${x} !== true && ${b} === ${t} && !${w}`}}function m(){let y=d.formats[s];if(!y){_();return}if(y===!0)return;let[g,b,x]=P(y);if(g===t)e.pass(E());function _(){if(c.strictSchema===!1){d.logger.warn(w());return}throw Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function P(w){let k=w instanceof RegExp?mt.regexpCode(w):c.code.formats?mt._`${c.code.formats}${mt.getProperty(s)}`:void 0,R=r.scopeValue("formats",{key:s,ref:w,code:k});if(typeof w=="object"&&!(w instanceof RegExp))return[w.type||"string",w.validate,mt._`${R}.validate`];return["string",w,R]}function E(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw Error("async format in sync schema");return mt._`await ${x}(${n})`}return typeof b=="function"?mt._`${x}(${n})`:mt._`${x}.test(${n})`}}}};qR.default=_G});var Kh=C(function(HR){Object.defineProperty(HR,"__esModule",{value:!0});var kG=BR(),AG=[kG.default];HR.default=AG});var Gh=C(function(UR){Object.defineProperty(UR,"__esModule",{value:!0});UR.contentVocabulary=UR.metadataVocabulary=void 0;UR.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];UR.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var KR=C(function(zR){Object.defineProperty(zR,"__esModule",{value:!0});var OG=Th(),CG=Lh(),IG=Uh(),TG=SR(),NG=CR(),MG=FR(),LG=Kh(),WR=Gh(),DG=[TG.default,OG.default,CG.default,(0,IG.default)(!0),LG.default,WR.metadataVocabulary,WR.contentVocabulary,NG.default,MG.default];zR.default=DG});var QR=C(function(YR){Object.defineProperty(YR,"__esModule",{value:!0});YR.DiscrError=void 0;var GR;(function(e){e.Tag="tag",e.Mapping="mapping"})(GR||(YR.DiscrError=GR={}))});var Xh=C(function(eO){Object.defineProperty(eO,"__esModule",{value:!0});var jo=be(),Yh=QR(),ZR=rc(),FG=_o(),qG=_e(),BG={message:({params:{discrError:e,tagName:t}})=>e===Yh.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>jo._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},HG={keyword:"discriminator",type:"object",schemaType:"object",error:BG,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:o}=i;if(!s.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!o)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",jo._`${r}${jo.getProperty(a)}`);t.if(jo._`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:Yh.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function u(){let m=h();t.if(!1);for(let y in m)t.elseIf(jo._`${l} === ${y}`),t.assign(c,d(m[y]));t.else(),e.error(!1,{discrError:Yh.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function d(m){let y=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:m},y);return e.mergeEvaluated(g,jo.Name),y}function h(){var m;let y={},g=x(i),b=!0;for(let E=0;E<o.length;E++){let w=o[E];if((w===null||w===void 0?void 0:w.$ref)&&!qG.schemaHasRulesButRef(w,s.self.RULES)){let R=w.$ref;if(w=ZR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,R),w instanceof ZR.SchemaEnv)w=w.schema;if(w===void 0)throw new FG.default(s.opts.uriResolver,s.baseId,R)}let k=(m=w===null||w===void 0?void 0:w.properties)===null||m===void 0?void 0:m[a];if(typeof k!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);b=b&&(g||x(w)),_(k,E)}if(!b)throw Error(`discriminator: "${a}" must be required`);return y;function x({required:E}){return Array.isArray(E)&&E.includes(a)}function _(E,w){if(E.const)P(E.const,w);else if(E.enum)for(let k of E.enum)P(k,w);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function P(E,w){if(typeof E!="string"||E in y)throw Error(`discriminator: "${a}" values must be unique strings`);y[E]=w}}}};eO.default=HG});var tO=C(function(lle,VG){VG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var rO=C(function(ule,WG){WG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var nO=C(function(fle,zG){zG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var iO=C(function(dle,KG){KG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var sO=C(function(ple,GG){GG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var oO=C(function(mle,YG){YG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var aO=C(function(hle,XG){XG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var cO=C(function(gle,QG){QG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var uO=C(function(lO){Object.defineProperty(lO,"__esModule",{value:!0});var ZG=tO(),e7=rO(),t7=nO(),r7=iO(),n7=sO(),i7=oO(),s7=aO(),o7=cO(),a7=["/properties"];function c7(e){return[ZG,e7,t7,r7,n7,t(this,i7),s7,t(this,o7)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,a7):n}}lO.default=c7});var eg=C(function(hr,Zh){Object.defineProperty(hr,"__esModule",{value:!0});hr.MissingRefError=hr.ValidationError=hr.CodeGen=hr.Name=hr.nil=hr.stringify=hr.str=hr._=hr.KeywordCxt=hr.Ajv2020=void 0;var u7=Ih(),f7=KR(),d7=Xh(),p7=uO(),Qh="https://json-schema.org/draft/2020-12/schema";class mc extends u7.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),f7.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(d7.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;p7.default.call(this,e),this.refs["http://json-schema.org/schema"]=Qh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Qh)?Qh:void 0)}}hr.Ajv2020=mc;Zh.exports=hr=mc;Zh.exports.Ajv2020=mc;Object.defineProperty(hr,"__esModule",{value:!0});hr.default=mc;var m7=Eo();Object.defineProperty(hr,"KeywordCxt",{enumerable:!0,get:function(){return m7.KeywordCxt}});var Ro=be();Object.defineProperty(hr,"_",{enumerable:!0,get:function(){return Ro._}});Object.defineProperty(hr,"str",{enumerable:!0,get:function(){return Ro.str}});Object.defineProperty(hr,"stringify",{enumerable:!0,get:function(){return Ro.stringify}});Object.defineProperty(hr,"nil",{enumerable:!0,get:function(){return Ro.nil}});Object.defineProperty(hr,"Name",{enumerable:!0,get:function(){return Ro.Name}});Object.defineProperty(hr,"CodeGen",{enumerable:!0,get:function(){return Ro.CodeGen}});var h7=ec();Object.defineProperty(hr,"ValidationError",{enumerable:!0,get:function(){return h7.default}});var g7=_o();Object.defineProperty(hr,"MissingRefError",{enumerable:!0,get:function(){return g7.default}})});import{existsSync as Yu,readFileSync as x7}from"node:fs";import{createRequire as fO}from"node:module";import{isAbsolute as $7,relative as v7,resolve as Gu}from"node:path";import{fileURLToPath as dO,pathToFileURL as w7}from"node:url";function hc(e){return JSON.parse(x7(e,"utf8"))}async function pO(e){let t=Gu(e),r=Gu(t,"project.json"),n=Gu(t,"project.schema.json");if(!Yu(r))throw Error(`project.json not found in ${t}`);if(!Yu(n))throw Error(`project.schema.json not found in ${t} — run \`jx schema\` to generate it from `+"project.json#/extensions");let i=hc(r),s=hc(n);s.$id=w7(n).href;let o;try{({default:o}=await Promise.resolve().then(() => Bt(eg(),1)))}catch(u){throw Error("Project validation requires ajv: bun add ajv",{cause:u})}let c=await new o({allErrors:!0,loadSchema:(u)=>S7(u,t),strict:!1}).compileAsync(s),l=c(i);return{errors:c.errors??null,valid:l}}async function S7(e,t){if(!e.startsWith("file:"))throw Error(`Cannot resolve schema ref "${e}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let r=dO(e),n=v7(t,r);if(n.startsWith("..")||$7(n))throw Error(`Schema ref "${e}" escapes the project root ${t}`);if(Yu(r))return hc(r);let i=n.split("\\").join("/"),s="node_modules/",o=i.lastIndexOf(s);if(o===-1)throw Error(`Schema ref "${e}" does not exist`);let a=i.slice(o+s.length),c;try{c=fO(Gu(t,"package.json")).resolve(a)}catch{try{c=fO(import.meta.url).resolve(a)}catch(l){if(a.startsWith("@jxsuite/schema/")){let d=dO(new URL(`../${a.slice(16)}`,import.meta.url));if(Yu(d))return hc(d)}throw Error(`Schema ref "${e}" does not exist and "${a}" is not resolvable from the project or the host`,{cause:l})}}return hc(c)}var mO=()=>{};function Pn(e){return ee(e.attributes)?e.attributes:{}}function Dt(e,t){let r=Pn(e)[t];return T(r)?r:null}function ht(e){return T(e.tagName)?e.tagName.toLowerCase():""}function Zt(e,t="the popover"){let r=T(e.id)?e.id:Dt(e,"id");if(r)return`#${r}`;let n=ht(e);return n===""?t:`the <${n}>`}function P7(e){let t=Pn(e).popover;return T(t)?t:null}function gO(e){let t=new Set,r=new Set;for(let n of e){let i=n!==null&&T(n.tagName)?n.tagName:"";if(n===null||!i.includes("-"))continue;if(tg(n))t.add(i);let s=n.observedAttributes;if(Array.isArray(s)&&k7.every((o)=>s.includes(o)))r.add(i)}return{invokerTags:r,popoverTags:t}}function tg(e){return"popover"in Pn(e)||"popover"in e}function gc(e,t){return tg(e)||(t?.popoverTags?.has(ht(e))??!1)}function Ri(e){if(T(e.id)&&e.id!=="")return e.id;let t=Dt(e,"id");return t===""?null:t}function*_n(e,t=[],r=null,n){yield{enclosing:r,node:e,path:t};let i=gc(e,n)?e:r,{children:s}=e;if(Array.isArray(s)){for(let[c,l]of s.entries())if(J(l))yield*_n(l,[...t,"children",c],i,n)}else if(ee(s)&&ir(s.map))yield*_n(s.map,[...t,"children","map"],i,n);let o=ir(e.map)?e.map:null;if(o)yield*_n(o,[...t,"map"],i,n);let a=ee(e.cases)?e.cases:{};for(let[c,l]of Object.entries(a))if(J(l))yield*_n(l,[...t,"cases",c],i,n)}function rg(e,t){let r=[];for(let{node:n}of _n(e,[],null,t)){if(!gc(n,t))continue;let i=Ri(n);if(i!==null&&!r.includes(i))r.push(i)}return r}function Xu(e){return e.startsWith("@")}function yO(e){return e.startsWith(":")||e.startsWith("&")||e.startsWith(".")||e.startsWith("[")}function Qt(e,t){let r=e?.[t];if(r===void 0||Li(r)||Array.isArray(r))return null;return String(r)}function bO(e){for(let[t,r]of Object.entries(e??{})){if(!Li(r))continue;if(yO(t)&&t.includes(":popover-open")&&Qt(r,"display")!==null)return!0;if(Xu(t)&&bO(r))return!0}return!1}function xO(e){for(let[t,r]of Object.entries(e??{})){if(!Li(r))continue;if(yO(t)&&t.includes(":popover-open"))return!0;if(Xu(t)&&xO(r))return!0}return!1}function j7(e){return A7.some((t)=>Qt(e,t)!==null)}function R7(e){if(!e)return[];let t=[];for(let[r,n]of Object.entries(e))if(Xu(r)&&Li(n)&&Qt(n,"display")!==null)t.push(r);return t}function $O(e){if(!e)return[];let t=[],r=Qt(e,"transition");if(r!==null)t.push(r);for(let[n,i]of Object.entries(e))if(Xu(n)&&Li(i))t.push(...$O(i));return t}function O7(e){if(!e)return!1;if(Qt(e,"positionAnchor")!==null||Qt(e,"position-anchor")!==null)return!0;return["top","left","right","bottom","inset","insetBlockStart","insetInlineStart"].some((t)=>(Qt(e,t)??"").includes("anchor("))}function C7(e){if(!e)return!1;if(Qt(e,"positionArea")!==null||Qt(e,"position-area")!==null||Qt(e,"positionTryFallbacks")!==null||Qt(e,"position-try-fallbacks")!==null)return!0;return Object.keys(e).some((t)=>t.startsWith("@supports"))}function vO(e,t){let r=[..._n(e,[],null,t)],n=rg(e,t),i=r.some(({node:a})=>gc(a,t)),s=new Set;for(let{node:a}of r)if(hO.has(ht(a))){let c=Dt(a,"popovertarget");if(c!==null)s.add(c)}let o=[];for(let{enclosing:a,node:c,path:l}of r)if(o.push(...I7(c,l,a,n,i,t)),tg(c))o.push(...T7(c,l,s));return o}function I7(e,t,r,n,i,s){let o=[],a=ht(e),c=Dt(e,"popovertarget"),l=hO.has(a)||(s?.invokerTags?.has(a)??!1);if(c!==null&&!l)return o.push({detail:"`popovertarget` and `popovertargetaction` come from the `PopoverTargetAttributes` IDL mixin, which HTML includes into `HTMLButtonElement` and `HTMLInputElement` and into nothing else. Elsewhere they parse and do nothing. A link inside an open popover "+"dismisses it by navigating away, which is why this looks like it works — but it does "+`not for a new tab or a same-page fragment. Remove both attributes. ${Xe}`,fix:"invoker",message:`<${a||"element"}> carries popovertarget, which only <button> and <input> support.`,path:t,rule:"invoker-not-button",severity:"error"}),o;if(c!==null){if(i&&!n.includes(c)){let u=n.length>0?`The popovers here are: ${n.map((d)=>`"${d}"`).join(", ")}. `:"";o.push({detail:`No element in this document declares \`popover\` with the id "${c}". ${u}A target that names nothing does nothing, silently. ${Xe}`,message:`popovertarget="${c}" names no popover in this document.`,path:t,rule:"target-missing",severity:"error"})}else if(r!==null&&Ri(r)!==null&&Ri(r)!==c)o.push({detail:`This control is inside ${Zt(r)} but targets "${c}". Dismissing a different popover leaves the one the reader is looking at open. This is usually a copy-paste between two panels in the same file. ${Xe}`,message:`A control inside ${Zt(r)} targets "${c}" instead.`,path:t,rule:"target-mismatch",severity:"warn"})}if(a==="a"&&r!==null&&c===null){let u=Dt(e,"href")??(T(e.href)?e.href:null),d=Dt(e,"target")==="_blank",h=u!==null&&u.includes("#");if(d||h){let m=d?"it opens a new tab, so the panel stays open on the page behind it. ":"it is a same-document fragment, so the page scrolls behind the open panel. ";o.push({detail:`A link inside a panel normally dismisses it by navigating away. This one does not: ${m}`+"There is no declarative fix — a link cannot carry `popovertarget`. Move it out of the "+`panel, make it a <button>, or accept it deliberately. ${Xe}`,message:`A link inside ${Zt(r)} does not dismiss it.`,path:t,rule:"link-does-not-dismiss",severity:"warn"})}}return o}function T7(e,t,r){let n=[],{style:i}=e,s=Zt(e),o=P7(e);if(o!==null&&o!==""&&!_7.some((l)=>l===o))n.push({detail:"`popover` is an enumerated attribute taking `auto`, `manual` or `hint`. Anything else falls back to the invalid-value default `manual`, which gives up light dismiss and gives "+`up Escape — so the panel opens and there is no way to close it. Write "auto". ${Xe}`,fix:"mode",message:`${s} declares popover="${o}", which is not one of auto, manual or hint.`,path:t,rule:"invalid-mode",severity:"error"});else if(Rt(Pn(e).popover))n.push({detail:`\`popover\` carries its value in its text, so a boolean is not the right shape. Written as \`true\` it reaches two of the compiler's emitters as \`popover="true"\`, which is not one of the three keywords, so HTML falls back to \`manual\`: no light dismiss, no Escape, and the trigger stops toggling. Write "auto". ${Xe}`,fix:"mode",message:`${s} writes popover as a boolean.`,path:t,rule:"invalid-mode",severity:"error"});let a=Qt(i,"display");if(a!==null&&a!=="revert"&&a!=="revert-layer")n.push({detail:"A closed popover is hidden by the browser's own `[popover]:not(:popover-open) { display: none }`. That rule is UA-origin, so any author `display` beats it at any specificity, and "+"the panel is laid out on every page whether it is open or not — usually parked off the "+`side of the viewport by the transform meant to animate it, so nothing looks wrong until you scroll sideways. \`display\` belongs in \`:popover-open\` and nowhere else. ${Xe}`,fix:"display",message:`${s} sets display in its base rule.`,path:t,rule:"base-display",severity:"error"});for(let l of R7(i))n.push({detail:`The same defect as a base \`display\`, arriving through \`${l}\` and therefore only at `+"one width — which is what makes it hard to see. Gate the TRIGGER on a breakpoint, never "+`the panel: the popover mechanism is what hides the panel. ${Xe}`,fix:"display",message:`${s} sets display inside ${l}.`,path:t,rule:"breakpoint-display",severity:"error"});if(Qt(i,"visibility")!==null)n.push({detail:`A second hiding mechanism the browser already provides. Once \`display\` leaves the base rule this one only adds a frame of flicker on open, and it hides the element from assistive technology in a way \`display: none\` already did. ${Xe}`,fix:"display",message:`${s} also hides itself with visibility.`,path:t,rule:"base-visibility",severity:"warn"});if(!xO(i))n.push({detail:"Nothing changes when it opens, so no transition on it can run and — if `display` is not "+"in the base rule — the panel has no `display` at all while open. This is usually a panel "+`that was styled before it was made a popover. ${Xe}`,message:`${s} has no :popover-open rule.`,path:t,rule:"no-open-rule",severity:"warn"});else if(!bO(i)&&a===null&&j7(i))n.push({detail:`${s} declares flex or grid properties, but neither its base rule nor its `+"`:popover-open` rule sets a `display` for them to apply to — and the base rule must not "+`(that is what keeps the closed panel hidden). So it opens with the UA's \`display: block\` and the layout silently does nothing. Put \`display: flex\` in \`:popover-open\`. ${Xe}`,fix:"open-display",message:`${s} is laid out with flex or grid but never sets display.`,path:t,rule:"no-open-display",severity:"error"});for(let l of $O(i))if(l.includes("display")&&!l.includes("overlay")){n.push({detail:"`display …allow-discrete` keeps the box alive while it animates out; `overlay "+"…allow-discrete` is what keeps it in the TOP LAYER for those same milliseconds. "+`Without it the panel drops behind the page content and the backdrop disappears a frame early, so the exit reads as a flicker rather than an animation. ${Xe}`,message:`${s} transitions display but not overlay.`,path:t,rule:"cut-exit",severity:"warn"});break}if(O7(i)&&!C7(i))n.push({detail:"When `anchor()` does not resolve, every inset it feeds computes to `auto` — and a "+`\`position: fixed\` box with four \`auto\` insets falls back to its STATIC position, which for a panel declared inside a header is in the middle of the header. Use \`position-area\` with \`position-try-fallbacks\`, or add a \`@supports\` block that positions it without anchors. ${Xe}`,message:`${s} is anchor-positioned with no fallback.`,path:t,rule:"unsafe-anchor",severity:"warn"});let c=Ri(e);if(c!==null&&!r.has(c))n.push({detail:`No \`<button>\` or \`<input>\` in this document names it with \`popovertarget\`. If it is opened from another file or from a function that calls \`showPopover()\`, this is fine; otherwise there is no way for a reader to open it. ${Xe}`,message:`${s} has no invoker in this document.`,path:t,rule:"no-invoker",severity:"warn"});return n}var _7,hO,k7,A7,Xe="See docs/framework/concepts/overlays.";var Qu=L(()=>{Ee();_7=["auto","manual","hint"],hO=new Set(["button","input"]);k7=["popovertarget","popovertargetaction","command","commandfor"];A7=["flexDirection","flex-direction","alignItems","align-items","justifyContent","justify-content","flexWrap","flex-wrap","gridTemplateColumns","grid-template-columns","gridTemplateRows","grid-template-rows","gap"]});function To(e,t){let r=Pn(e),n=t in r?r[t]:e[t];if(n===void 0||n===null)return{kind:"absent"};if(Je(n)||ee(n))return{kind:"bound"};if(T(n))return n.includes("${")?{kind:"bound"}:{kind:"text",text:n};return{isTrue:n===!0,kind:"other"}}function Co(e,t){let r=To(e,t);return r.kind==="text"&&r.text.trim()!==""?r.text:null}function Jt(e,t){return To(e,t).kind!=="absent"}function Oi(e){let t=To(e,"role");if(t.kind==="bound")return Io;return t.kind==="text"?t.text.trim().toLowerCase().split(/\s+/)[0]:null}function Zu(e){let t=To(e,"id");if(t.kind==="bound")return Io;return t.kind==="text"&&t.text!==""?t.text:null}function Hr(e,t){let r=To(e,t);return r.kind==="bound"||r.kind==="text"&&r.text.trim()!==""}function ef(e){let t=e.textContent;if(T(t)){if(t.trim()!=="")return!0}else if(t!==void 0&&t!==null)return!0;if(Hr(e,"aria-label")||Jt(e,"aria-labelledby"))return!0;if(ht(e)==="img"&&(Hr(e,"alt")||Hr(e,"title")))return!0;if(ht(e)==="slot")return!0;let{children:r}=e;if(Array.isArray(r)){for(let i of r)if(T(i)){if(i.trim()!=="")return!0}else if(J(i)&&ef(i))return!0}else if(r!=null)return!0;if(ee(e.map))return!0;return(ee(e.cases)?Object.values(e.cases):[]).some((i)=>ir(i)&&ef(i))}function*Oo(e,t=[],r=[],n=[]){yield{node:e,path:t,roles:r,tags:n};let i=[...r,Oi(e)],s=[...n,ht(e)],{children:o}=e;if(Array.isArray(o)){for(let[a,c]of o.entries())if(J(c))yield*Oo(c,[...t,"children",a],i,s)}else if(ee(o)&&ir(o.map))yield*Oo(o.map,[...t,"children","map"],i,s);if(ir(e.map))yield*Oo(e.map,[...t,"map"],i,s);if(ee(e.cases)){for(let[a,c]of Object.entries(e.cases))if(J(c))yield*Oo(c,[...t,"cases",a],i,s)}}function F7(e){return e.some((t)=>t.includes("-"))}function kn(e,t,r,n,i,s="error"){return{criterion:i,detail:`${n} ${N7}`,message:r,path:t,rule:e,severity:s}}function wO(e,t,r){if(r.includes("label"))return!0;if(e===Io||t.bound)return!0;return e!==null&&t.ids.has(e)}function q7(e,t){let{node:r,path:n,tags:i}=e,s=ht(r),o=Oi(r);if(o==="bound")return null;if(Hr(r,"aria-label")||Jt(r,"aria-labelledby")||Hr(r,"title"))return null;let c=Zt(r,"the control"),l=(d)=>kn("interactive-unnamed",n,`${c} has no accessible name.`,`A control with no name is announced as its role alone, so a reader hears "button" and nothing else. ${d}`,"4.1.2"),u=B7(r,s,t,i);if(u==="named"||u==="exempt")return null;if(o!==null&&M7.has(o))return ef(r)?null:l("Give it text content, or an aria-label.");if(o!==null&&L7.has(o))return l("Give it an aria-label, or aria-labelledby naming its visible label.");if(o!==null)return null;if(s==="button"||s==="summary"||s==="a"&&Jt(r,"href"))return ef(r)?null:l("Give it text content, or an aria-label.");if(u==="unnamed")return l("Give it a <label for> naming its id, or an aria-label.");if(u==="unnamed-value")return l("Give it a value, or an aria-label.");if(u==="unnamed-alt")return l("Give it an alt, or an aria-label.");return null}function B7(e,t,r,n){if(t==="area"){if(!Jt(e,"href"))return"none";return Hr(e,"alt")?"named":"unnamed-alt"}if(t==="select"||t==="textarea")return wO(Zu(e),r,n)||Hr(e,"placeholder")?"named":"unnamed";if(t!=="input")return"none";let i=(Co(e,"type")??"text").toLowerCase();if(i==="hidden"||Jt(e,"type")&&Co(e,"type")===null)return"exempt";if(D7.has(i))return Hr(e,"value")?"named":"unnamed-value";if(i==="image")return Hr(e,"alt")?"named":"unnamed-alt";return wO(Zu(e),r,n)||Hr(e,"placeholder")?"named":"unnamed"}function U7(e){let{node:t,path:r,tags:n}=e,i=ht(t);if(!i.includes("-")||!n.some((s)=>H7.has(s)))return null;return kn("custom-element-in-select",r,`<${i}> is a custom element inside a <select>.`,'A <select> builds its own rows: an element it does not know is not in select.options, so it cannot be picked, cannot be reached with the arrow keys, and fires no change event — while role="option" on it still makes the accessibility tree read as though it could. Every row of a <select> is a native <option>; a listbox whose rows are jx-option elements is a jx-listbox.',"4.1.2")}function V7(e){let{node:t,path:r}=e;if(ht(t)!=="img")return null;let n=Oi(t);if(n==="bound"||n==="presentation"||n==="none")return null;if(Jt(t,"alt")||Hr(t,"aria-label")||Jt(t,"aria-labelledby"))return null;return kn("img-alt-missing",r,`${Zt(t,"the image")} has no alt text.`,'An image with no alt is announced by its file name. Describe it in alt, or write alt="" for a decorative one.',"1.1.1")}function z7(e,t){let{node:r,path:n}=e,i=[];for(let s of W7){let o=Co(r,s);if(o===null)continue;for(let a of o.split(/\s+/))if(a!==""&&!t.has(a))i.push(kn("aria-target-missing",n,`${Zt(r,"the element")} points ${s} at #${a}, which nothing in this document has as its id.`,"A reference to an id that is not in the document is silently dropped, so the relationship it declares does not exist. Name an element that is here, or give that element the id.","1.3.1"))}return i}function K7(e,t,r){for(let n of SO.get(t)??[]){let i=r.get(n);if(i===void 0)continue;if(i.bound)return!0;if(e===Io&&i.ids.size>0)return!0;if(e!==null&&e!==Io&&i.ids.has(e))return!0}return!1}function G7(e,t){let{node:r,path:n,roles:i,tags:s}=e,o=Oi(r);if(o===null||o==="bound"||n.length===0||F7(s))return null;if(i.includes("bound")||K7(Zu(r),o,t))return null;let a=Zt(r,"the element");if(o==="tab"&&!i.includes("tablist"))return kn("tab-outside-tablist",n,`${a} is a tab outside any tablist.`,'A tab is announced with its position in a tablist, so one with no tablist ancestor has no place to be counted in. Put the tabs in a container with role="tablist".',"1.3.1");if((o==="menuitem"||o==="menuitemcheckbox"||o==="menuitemradio")&&!i.includes("menu")&&!i.includes("menubar"))return kn("menuitem-outside-menu",n,`${a} is a ${o} outside any menu.`,'A menu item is owned by a menu, and is announced as one of its items. Put it in a container with role="menu" or role="menubar".',"1.3.1");if(o==="option"&&!i.includes("listbox")&&!s.includes("select")&&!s.includes("datalist"))return kn("option-outside-listbox",n,`${a} is an option outside any listbox.`,'An option is owned by a listbox, and is announced as one of its choices. Put it in a container with role="listbox", or in a <select>.',"1.3.1");return null}function Y7(e){let t=[];for(let{node:r}of Oo(e)){if(Oi(r)!=="tab")continue;let n=To(r,"aria-selected");if(n.kind==="bound")return null;t.push(n.kind==="other"&&n.isTrue||n.kind==="text"&&n.text==="true")}return t}function X7(e){let{node:t,path:r}=e;if(Oi(t)!=="tablist")return null;let n=Y7(t);if(n===null||n.length===0||n.includes(!0))return null;return kn("tablist-none-selected",r,`${Zt(t,"the tablist")} has ${n.length} tab(s) and none is selected.`,'A tablist always has a current tab, and aria-selected="true" is how it is announced. Mark the tab whose panel is showing.',"4.1.2","warn")}function Q7(e){let{node:t,path:r}=e,n=Oi(t);if(!(ht(t)==="dialog"||n==="dialog"||n==="alertdialog")||n==="bound")return null;if(Hr(t,"aria-label")||Jt(t,"aria-labelledby"))return null;return kn("dialog-unnamed",r,`${Zt(t,"the dialog")} has no accessible name.`,"A dialog is announced by its name when it opens, and its content does not name it. Give it aria-labelledby naming its heading, or an aria-label.","4.1.2")}function eY(e){let{node:t,path:r}=e;if(!Jt(t,"aria-activedescendant"))return null;let n=ht(t);if(Z7.has(n)||n==="a"&&Jt(t,"href")||Jt(t,"tabIndex")||Jt(t,"tabindex")||Jt(t,"contenteditable"))return null;return kn("activedescendant-not-focusable",r,`${Zt(t,"the element")} manages focus with aria-activedescendant but cannot itself take focus.`,"aria-activedescendant names the active child of a FOCUSED container; on one that cannot be focused, the keyboard never reaches it. Give the container a tabindex.","2.1.1")}function EO(e){let t=[...Oo(e)],r=new Set,n={bound:!1,ids:new Set},i=new Map,s=!1;for(let{node:a}of t){let c=Oi(a);if(c!==null&&J7.has(c)){let u=i.get(c)??{bound:!1,ids:new Set},d=Co(a,"aria-owns");if(d===null)u.bound||=Jt(a,"aria-owns");else for(let h of d.split(/\s+/))if(h!=="")u.ids.add(h);i.set(c,u)}let l=Zu(a);if(l===Io)s=!0;else if(l!==null)r.add(l);if(ht(a)==="label"){let u=Co(a,"for")??Co(a,"htmlFor");if(u===null)n.bound||=Jt(a,"for")||Jt(a,"htmlFor");else n.ids.add(u)}}let o=[];for(let a of t){let c=[q7(a,n),V7(a),G7(a,i),U7(a),X7(a),Q7(a),eY(a)];for(let l of c)if(l)o.push(l);if(!s)o.push(...z7(a,r))}return o}var N7="See docs/framework/concepts/accessibility.",Io="bound",M7,L7,D7,SO,J7,H7,W7,Z7;var _O=L(()=>{Ee();Qu();M7=new Set(["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab","treeitem"]),L7=new Set(["combobox","listbox","searchbox","slider","spinbutton","textbox"]),D7=new Set(["button","reset","submit"]),SO=new Map([["menuitem",["menu","menubar"]],["menuitemcheckbox",["menu","menubar"]],["menuitemradio",["menu","menubar"]],["option",["listbox"]],["tab",["tablist"]]]),J7=new Set([...SO.values()].flat());H7=new Set(["select","jx-select"]);W7=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"];Z7=new Set(["button","input","select","textarea"])});function ng(e){return ht(e)==="dialog"}function PO(e){return e.startsWith("--")}function aY(e){let t=[];for(let{node:r}of _n(e)){let n=Ri(r);if(ng(r)&&n!==null&&!t.includes(n))t.push(n)}return t}function cY(e){let t=e.oncommand;return t!==void 0&&t!==null}function lY(e,t){for(let{node:r}of _n(e)){if(r===e)continue;let n=ht(r);if(n==="button"){let i=Dt(r,"command"),s=Dt(r,"commandfor");if(i!==null&&(i==="close"||i==="request-close")&&(s===null||s===t))return!0}if(n==="form"&&Dt(r,"method")?.toLowerCase()==="dialog")return!0}return!1}function AO(e,t){let r=[..._n(e,[],null,t)],n=aY(e),i=rg(e,t),s=n.length>0||i.length>0,o=new Map,a=new Map;for(let{node:l}of r){let u=Ri(l);if(u!==null&&!o.has(u))o.set(u,l);if(ht(l)==="button"){let d=Dt(l,"commandfor"),h=Dt(l,"command");if(d!==null){let m=a.get(d)??new Set;m.add(h??""),a.set(d,m)}}}let c=[];for(let{node:l,path:u}of r)if(c.push(...uY(l,u,o,n,i,s,t)),ng(l))c.push(...fY(l,u,a));return c}function uY(e,t,r,n,i,s,o){let a=[],c=ht(e),l=o?.invokerTags?.has(c)??!1,u=Dt(e,"command"),d=Dt(e,"commandfor");if(!(u!==null||d!==null||("command"in Pn(e))||("commandfor"in Pn(e))))return a;let m=Zt(e,"the element");if(!oY.has(c)&&!l)return a.push({detail:"`command` and `commandfor` are attributes of `HTMLButtonElement` and of no other "+"interface — not even `<input>`, which `popovertarget` does allow. Elsewhere they parse "+`and do nothing. Make it a <button>, or remove both attributes. ${Xe}`,fix:"invoker",message:`<${c||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),a;if(u!==null&&!iY.has(u)&&!PO(u))return a.push({detail:`\`command\` is an enumerated attribute taking ${kO.map((y)=>`\`${y}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${Xe}`,message:`${m} declares command="${u}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),a;if(d!==null){let y=r.get(d),g=n.includes(d),b=i.includes(d);if(!y&&s){let x=[...n,...i].map((_)=>`"${_}"`).join(", ");return a.push({detail:`No element in this document has the id "${d}". The dialogs and popovers here are: ${x}. A commandfor that names nothing does nothing, silently. ${Xe}`,message:`commandfor="${d}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),a}if(u!==null&&y){if(tY.has(u)&&!ng(y))a.push({detail:`\`${u}\` acts on a <dialog>, and "${d}" is ${b?"a popover":`a <${ht(y)||"element"}>`}. The click is ignored. ${b?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${Xe}`,message:`${m} sends ${u} to "${d}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(rY.has(u)&&!gc(y,o))a.push({detail:`\`${u}\` acts on a popover, and "${d}" is ${g?"a dialog":`a <${ht(y)||"element"}>`} that declares no \`popover\`. The click is ignored. ${g?"Use `show-modal`, `close` or `request-close` for a dialog.":"Give the target a `popover` attribute, or point the button elsewhere."} ${Xe}`,message:`${m} sends ${u} to "${d}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(PO(u)&&!cY(y))a.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${d}" has no `+"`oncommand` handler to answer it — so the click does nothing. Add one that switches on "+`\`event#/command\`, or use a built-in command. ${Xe}`,message:`${m} sends ${u} to "${d}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return a}function fY(e,t,r){let n=[],i=Zt(e,"the dialog"),s=Ri(e),{style:o}=e,a=Dt(e,"closedby");if(a!==null&&!sY.has(a))n.push({detail:`\`closedby\` is an enumerated attribute taking \`any\` (light dismiss and Escape), \`closerequest\` (Escape only, the default for a modal) or \`none\`. Anything else is the invalid-value default, \`auto\`, which is the same as leaving it out. ${Xe}`,message:`${i} declares closedby="${a}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if(Qt(o,"display")!==null)n.push({detail:`A closed dialog is hidden by the browser's own \`dialog:not([open]) { display: none }\`. That rule is UA-origin, so any author \`display\` beats it, and the dialog is laid out on every page whether or not anyone opened it. \`display\` belongs in the \`&[open]\` rule and nowhere else. ${Xe}`,fix:"display",message:`${i} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let c=s===null?void 0:r.get(s),l=Dt(e,"open")!==null||Pn(e).open===!0||e.open===!0;if(s!==null&&!c?.has("show-modal")&&!l)n.push({detail:`No <button> in this document opens it with \`command="show-modal"\`. If it is opened from another file or from a function that calls \`showModal()\`, this is fine; otherwise there is no way for a reader to open it. ${Xe}`,message:`${i} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(c?.has("show-modal")&&a==="none"&&!lY(e,s))n.push({detail:`A modal dialog makes everything outside it inert, so the only ways out are the ones it offers: \`closedby="none"\` turns off Escape and light dismiss, and nothing inside it closes it. A reader who opens it cannot leave. Add a <button command="close"> inside, or drop \`closedby="none"\`. ${Xe}`,message:`${i} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return n}var kO,tY,rY,nY,iY,sY,oY;var jO=L(()=>{Ee();Qu();kO=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],tY=new Set(["show-modal","close","request-close"]),rY=new Set(["toggle-popover","show-popover","hide-popover"]),nY=["any","closerequest","none"],iY=new Set(kO),sY=new Set(nY),oY=new Set(["button"])});var JO=C(function(LO){Object.defineProperty(LO,"__esModule",{value:!0});LO.formatNames=LO.fastFormats=LO.fullFormats=void 0;function An(e,t){return{validate:e,compare:t}}LO.fullFormats={date:An(IO,ag),time:An(sg(!0),cg),"date-time":An(RO(!0),NO),"iso-time":An(sg(),TO),"iso-date-time":An(RO(),MO),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:yY,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:EY,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:bY,int32:{type:"number",validate:vY},int64:{type:"number",validate:wY},float:{type:"number",validate:CO},double:{type:"number",validate:CO},password:!0,binary:!0};LO.fastFormats={...LO.fullFormats,date:An(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ag),time:An(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,cg),"date-time":An(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,NO),"iso-time":An(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,TO),"iso-date-time":An(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,MO),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};LO.formatNames=Object.keys(LO.fullFormats);function dY(e){return e%4===0&&(e%100!==0||e%400===0)}var pY=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,mY=[0,31,28,31,30,31,30,31,31,30,31,30,31];function IO(e){let t=pY.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&dY(r)?29:mY[n])}function ag(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var ig=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function sg(e){return function(r){let n=ig.exec(r);if(!n)return!1;let i=+n[1],s=+n[2],o=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!a)return!1;if(i<=23&&s<=59&&o<60)return!0;let d=s-u*c,h=i-l*c-(d<0?1:0);return(h===23||h===-1)&&(d===59||d===-1)&&o<61}}function cg(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function TO(e,t){if(!(e&&t))return;let r=ig.exec(e),n=ig.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var og=/t|\s/i;function RO(e){let t=sg(e);return function(n){let i=n.split(og);return i.length===2&&IO(i[0])&&t(i[1])}}function NO(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function MO(e,t){if(!(e&&t))return;let[r,n]=e.split(og),[i,s]=t.split(og),o=ag(r,i);if(o===void 0)return;return o||cg(n,s)}var hY=/\/|:/,gY=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function yY(e){return hY.test(e)&&gY.test(e)}var OO=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function bY(e){return OO.lastIndex=0,OO.test(e)}var xY=-2147483648,$Y=2147483647;function vY(e){return Number.isInteger(e)&&e<=$Y&&e>=xY}function wY(e){return Number.isInteger(e)}function CO(){return!0}var SY=/[^\\]\\Z/;function EY(e){if(SY.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var BO=C(function(qO){Object.defineProperty(qO,"__esModule",{value:!0});var PY=Th(),kY=Lh(),AY=Uh(),jY=Kh(),FO=Gh(),RY=[PY.default,kY.default,(0,AY.default)(),jY.default,FO.metadataVocabulary,FO.contentVocabulary];qO.default=RY});var HO=C(function(qle,CY){CY.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 VO=C(function(gr,ug){Object.defineProperty(gr,"__esModule",{value:!0});gr.MissingRefError=gr.ValidationError=gr.CodeGen=gr.Name=gr.nil=gr.stringify=gr.str=gr._=gr.KeywordCxt=gr.Ajv=void 0;var IY=Ih(),TY=BO(),NY=Xh(),UO=HO(),MY=["/properties"],tf="http://json-schema.org/draft-07/schema";class yc extends IY.default{_addVocabularies(){if(super._addVocabularies(),TY.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(NY.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(UO,MY):UO;this.addMetaSchema(e,tf,!1),this.refs["http://json-schema.org/schema"]=tf}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(tf)?tf:void 0)}}gr.Ajv=yc;ug.exports=gr=yc;ug.exports.Ajv=yc;Object.defineProperty(gr,"__esModule",{value:!0});gr.default=yc;var LY=Eo();Object.defineProperty(gr,"KeywordCxt",{enumerable:!0,get:function(){return LY.KeywordCxt}});var No=be();Object.defineProperty(gr,"_",{enumerable:!0,get:function(){return No._}});Object.defineProperty(gr,"str",{enumerable:!0,get:function(){return No.str}});Object.defineProperty(gr,"stringify",{enumerable:!0,get:function(){return No.stringify}});Object.defineProperty(gr,"nil",{enumerable:!0,get:function(){return No.nil}});Object.defineProperty(gr,"Name",{enumerable:!0,get:function(){return No.Name}});Object.defineProperty(gr,"CodeGen",{enumerable:!0,get:function(){return No.CodeGen}});var DY=ec();Object.defineProperty(gr,"ValidationError",{enumerable:!0,get:function(){return DY.default}});var JY=_o();Object.defineProperty(gr,"MissingRefError",{enumerable:!0,get:function(){return JY.default}})});var zO=C(function(WO){Object.defineProperty(WO,"__esModule",{value:!0});WO.formatLimitDefinition=void 0;var BY=VO(),cn=be(),Ci=cn.operators,rf={formatMaximum:{okStr:"<=",ok:Ci.LTE,fail:Ci.GT},formatMinimum:{okStr:">=",ok:Ci.GTE,fail:Ci.LT},formatExclusiveMaximum:{okStr:"<",ok:Ci.LT,fail:Ci.GTE},formatExclusiveMinimum:{okStr:">",ok:Ci.GT,fail:Ci.LTE}},HY={message:({keyword:e,schemaCode:t})=>cn.str`should be ${rf[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>cn._`{comparison: ${rf[e].okStr}, limit: ${t}}`};WO.formatLimitDefinition={keyword:Object.keys(rf),type:"string",schemaType:"string",$data:!0,error:HY,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:o,self:a}=s;if(!o.validateFormats)return;let c=new BY.KeywordCxt(s,a.RULES.all.format.definition,"format");if(c.$data)l();else u();function l(){let h=t.scopeValue("formats",{ref:a.formats,code:o.code.formats}),m=t.const("fmt",cn._`${h}[${c.schemaCode}]`);e.fail$data(cn.or(cn._`typeof ${m} != "object"`,cn._`${m} instanceof RegExp`,cn._`typeof ${m}.compare != "function"`,d(m)))}function u(){let h=c.schema,m=a.formats[h];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw Error(`"${i}": format "${h}" does not define "compare" function`);let y=t.scopeValue("formats",{key:h,ref:m,code:o.code.formats?cn._`${o.code.formats}${cn.getProperty(h)}`:void 0});e.fail$data(d(y))}function d(h){return cn._`${h}.compare(${r}, ${n}) ${rf[i].fail} 0`}},dependencies:["format"]};var UY=(e)=>(e.addKeyword(WO.formatLimitDefinition),e);WO.default=UY});var XO=C(function(bc,YO){Object.defineProperty(bc,"__esModule",{value:!0});var Mo=JO(),WY=zO(),dg=be(),KO=new dg.Name("fullFormats"),zY=new dg.Name("fastFormats"),pg=(e,t={keywords:!0})=>{if(Array.isArray(t))return GO(e,t,Mo.fullFormats,KO),e;let[r,n]=t.mode==="fast"?[Mo.fastFormats,zY]:[Mo.fullFormats,KO],i=t.formats||Mo.formatNames;if(GO(e,i,r,n),t.keywords)(0,WY.default)(e);return e};pg.get=(e,t="full")=>{let n=(t==="fast"?Mo.fastFormats:Mo.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function GO(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=dg._`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}YO.exports=bc=pg;Object.defineProperty(bc,"__esModule",{value:!0});bc.default=pg});import{existsSync as ZO,readFileSync as eC,readdirSync as tC,statSync as rC}from"node:fs";import{createRequire as KY}from"node:module";import{join as nC,relative as mg,resolve as hg}from"node:path";async function QY(){try{let{default:e}=await Promise.resolve().then(() => Bt(eg(),1)),{default:t}=await Promise.resolve().then(() => Bt(XO(),1));return{addFormats:t,Ajv:e}}catch(e){throw Error("Project validation requires ajv and ajv-formats: bun add ajv ajv-formats",{cause:e})}}async function iC(e,t={}){let r=hg(e),n=[],i=[],s=0;for(let P of["project.schema.json","document.schema.json"]){let E=hg(r,P);if(!ZO(E))continue;s+=1;let w=xc(E),k=eX(w);if(k.length>0)n.push({errors:k.map(({reason:R,ref:j})=>({message:`$ref "${j}" ${R} — committed entry documents must be self-contained `+"single-resource schemas; regenerate with `jx schema`"})),file:P})}if(n.length>0)return{checked:s,issues:n,lint:i,valid:!1};let o=await pO(r);if(s+=1,!o.valid)n.push({errors:o.errors??[],file:"project.json"});let{addFormats:a,Ajv:c}=await QY(),{document:l}=await p1(r,{write:!1}),u=new c({allErrors:!0,ownProperties:!0,strict:!1});a(u);let d=u.compile(l),h=gO(QO(r).flatMap((P)=>{try{return[JSON.parse(eC(P,"utf8"))]}catch{return[]}}));for(let P of GY)for(let E of aC(hg(r,P))){if(E.endsWith(".class.json"))continue;s+=1;let w=xc(E);if(d(w))i.push(...ZY(w,mg(r,E),h));else n.push({errors:d.errors??[],file:mg(r,E)})}let m=new c({allErrors:!0,ownProperties:!0,strict:!1});a(m);let y=m.compile(Hm());for(let P of QO(r)){s+=1;let E=xc(P);if(!y(E))n.push({errors:y.errors??[],file:mg(r,P)})}let{config:g}=ni(r),b=await ri(r,g),x=KY(import.meta.url);for(let P of b.extensions)for(let E of["project","document","fields"]){let w=P.schemas[E];if(!w)continue;s+=1;let k=new c({allErrors:!0,ownProperties:!0,strict:!1});a(k);for(let R of XY){let j=x.resolve(R);k.addSchema(xc(j))}try{k.compile(xc(w))}catch(R){n.push({errors:[{message:R instanceof Error?R.message:String(R)}],file:`${P.specifier} (${E} fragment)`})}}let _=t.strict===!0&&i.some((P)=>P.severity==="error");return{checked:s,issues:n,lint:i,valid:n.length===0&&!_}}function xc(e){return JSON.parse(eC(e,"utf8"))}function ZY(e,t,r){let n=[];for(let i of vO(e,r))n.push({...gg(i),file:t,source:"popover"});for(let i of AO(e,r))n.push({...gg(i),file:t,source:"dialog"});for(let i of EO(e))n.push({...gg(i),criterion:i.criterion,file:t,source:"accessibility"});return n}function gg(e){return{detail:e.detail,message:e.message,path:e.path,rule:e.rule,severity:e.severity}}function sC(e){return e.lint.map((t)=>{let r=t.criterion===void 0?`${t.source}/${t.rule}`:`${t.source}/${t.rule}, WCAG ${t.criterion}`;return`${t.file}: ${t.severity}: ${t.message} [${r}]`})}function eX(e){let t=[],r=new Set,n=(s)=>{let o=e;for(let a of s.slice(1).split("/")){if(a==="")continue;let c=a.replaceAll("~1","/").replaceAll("~0","~");if(!J(o))return!1;if(o=o[c],o===void 0)return!1}return!0},i=(s)=>{if(!ee(s)||r.has(s))return;r.add(s);let o=s.$ref;if(T(o)){if(/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(o))t.push({reason:"is an absolute URI editors resolve over the network",ref:o});else if(!o.startsWith("#"))t.push({reason:"is a relative path only Node module resolution can follow",ref:o});else if(o.length>1&&!o.startsWith("#/"))t.push({reason:"is an $anchor reference, which has no root-pointer form",ref:o});else if(o.length>1&&!n(o.slice(1)))t.push({reason:"points at no node in this document",ref:o})}for(let[a,c]of Object.entries(s)){if(!tX.has(a))continue;if(Array.isArray(c))for(let l of c)i(l);else if(ee(c)){if(i(c),oC.has(a))for(let l of Object.values(c))i(l)}}};return i(e),t}function aC(e){if(!ZO(e))return[];let t=[];for(let r of tC(e)){let n=nC(e,r);if(rC(n).isDirectory())t.push(...aC(n));else if(r.endsWith(".json"))t.push(n)}return t.toSorted()}function QO(e){let t=[],r=(n)=>{for(let i of tC(n)){if(YY.has(i))continue;let s=nC(n,i);if(rC(s).isDirectory())r(s);else if(i.endsWith(".class.json"))t.push(s)}};return r(e),t.toSorted()}function cC(e){let t=[];for(let r of e.issues){t.push(`${r.file}:`);for(let n of r.errors){let i=ee(n)?n:{},{instancePath:s,message:o}=i;t.push(` - ${s||"/"}: ${o??JSON.stringify(n)}`)}}return t}var GY,YY,XY,oC,tX;var lC=L(()=>{iP();mO();_O();jO();Qu();Ee();On();Ho();Rm();GY=["components","pages","layouts"],YY=new Set(["node_modules","dist",".git"]),XY=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"];oC=new Set(["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"]),tX=new Set([...oC,"additionalItems","additionalProperties","allOf","anyOf","contains","contentSchema","else","if","items","not","oneOf","prefixItems","propertyNames","then","unevaluatedItems","unevaluatedProperties"])});vr();import{relative as yg,resolve as uC}from"node:path";async function rX(){let e=process.argv.slice(2),[t]=e;if(!t||t==="--help"||t==="-h")console.log(`Usage: jx <command> [options]
611
611
 
612
612
  Commands:
613
613
  build [root] Build a Jx site to dist/
@@ -623,8 +623,8 @@ Options:
623
623
  --port <n> dev/preview: port to listen on (default 3000 / 4173)
624
624
  --dry-run db push: print the statements without executing them
625
625
  --connection db push: restrict to one connection name
626
- --strict validate: fail on an overlay or accessibility lint error, not only a schema error`),process.exit(0);let r=t==="db",n=r?e[1]:null,i=e.slice(r?2:1),s=new Set,o=[],a,c;for(let d=0;d<i.length;d+=1){let h=i[d];if(h==="--connection")d+=1,a=i[d];else if(h==="--port"){d+=1;let m=Math.trunc(Number(i[d]??""));if(Number.isFinite(m)&&m>=0)c=m}else if(h.startsWith("--"))s.add(h);else o.push(h)}let[l]=o,u=aC(l??".");if(r){if(n!=="push")console.error(`Unknown db subcommand: ${n??"(none)"}
627
- Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let d=s.has("--dry-run");try{await Promise.resolve().then(() => ry());let m={dryRun:d};if(a!==void 0)m.connection=a;let{results:y,bindingsPatched:g,wranglerPath:b}=await ty(u,m);for(let x of y){let _=x.applied?"applied":"dry-run";console.log(`${x.connection} (${x.provider}) — ${x.tables.length} table(s), ${x.statements.length} statement(s) [${_}]`);for(let k of x.statements)console.log(` ${k}`);for(let k of x.warnings)console.warn(` warning: ${k}`)}if(g&&b)console.log(`Updated bindings in ${yg(u,b)}`)}catch(h){console.error(`db push failed: ${Pe(h)}`),process.exit(1)}return}if(t==="build"){let d=s.has("--verbose"),h=!s.has("--no-clean");console.log(`Building site from ${u}...`);try{await Promise.resolve().then(() => zE());let y=await qE(u,{clean:h,verbose:d});if(y.errors.length>0){console.error(`
626
+ --strict validate: fail on an overlay or accessibility lint error, not only a schema error`),process.exit(0);let r=t==="db",n=r?e[1]:null,i=e.slice(r?2:1),s=new Set,o=[],a,c;for(let d=0;d<i.length;d+=1){let h=i[d];if(h==="--connection")d+=1,a=i[d];else if(h==="--port"){d+=1;let m=Math.trunc(Number(i[d]??""));if(Number.isFinite(m)&&m>=0)c=m}else if(h.startsWith("--"))s.add(h);else o.push(h)}let[l]=o,u=uC(l??".");if(r){if(n!=="push")console.error(`Unknown db subcommand: ${n??"(none)"}
627
+ Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let d=s.has("--dry-run");try{await Promise.resolve().then(() => ry());let m={dryRun:d};if(a!==void 0)m.connection=a;let{results:y,bindingsPatched:g,wranglerPath:b}=await ty(u,m);for(let x of y){let _=x.applied?"applied":"dry-run";console.log(`${x.connection} (${x.provider}) — ${x.tables.length} table(s), ${x.statements.length} statement(s) [${_}]`);for(let P of x.statements)console.log(` ${P}`);for(let P of x.warnings)console.warn(` warning: ${P}`)}if(g&&b)console.log(`Updated bindings in ${yg(u,b)}`)}catch(h){console.error(`db push failed: ${Pe(h)}`),process.exit(1)}return}if(t==="build"){let d=s.has("--verbose"),h=!s.has("--no-clean");console.log(`Building site from ${u}...`);try{await Promise.resolve().then(() => zE());let y=await qE(u,{clean:h,verbose:d});if(y.errors.length>0){console.error(`
628
628
  Build completed with ${y.errors.length} error(s):`);for(let g of y.errors)console.error(` - ${g}`);process.exit(1)}console.log(`
629
- Done: ${y.routes} routes → ${y.files} files`)}catch(m){console.error(`Build failed: ${Pe(m)}`),process.exit(1)}}else if(t==="dev")try{await Promise.resolve().then(() => GE());KE(u,c)}catch(d){console.error(Pe(d)),process.exit(1)}else if(t==="preview"){let{existsSync:d}=await import("node:fs"),h=aC(u,"dist");if(!d(h))console.error(`No build output at ${h} — run \`jx build\` first.`),process.exit(1);await Promise.resolve().then(() => ZE());let y=c??4173;QE(h,y),console.log(`Previewing ${h} at http://localhost:${y}`)}else if(t==="schema")try{await Promise.resolve().then(() => jm());let{projectSchemaPath:h,documentSchemaPath:m}=await d1(u);console.log(`Wrote ${yg(u,h)}`),console.log(`Wrote ${yg(u,m)}`)}catch(d){console.error(`Schema generation failed: ${Pe(d)}`),process.exit(1)}else if(t==="validate")try{await Promise.resolve().then(() => oC());let y=await tC(u,{strict:s.has("--strict")}),g=rC(y);if(y.valid){console.log(`Project is valid (${y.checked} files checked in ${u})`);for(let b of g)console.log(b)}else{console.error(`Project is INVALID (${u}):`);for(let b of[...sC(y),...g])console.error(b);process.exit(1)}}catch(d){console.error(`Validation failed: ${Pe(d)}`),process.exit(1)}else console.error(`Unknown command: ${t}
630
- Run "jx --help" for usage.`),process.exit(1)}var aue=XY();export{aue as ready};
629
+ Done: ${y.routes} routes → ${y.files} files`)}catch(m){console.error(`Build failed: ${Pe(m)}`),process.exit(1)}}else if(t==="dev")try{await Promise.resolve().then(() => GE());KE(u,c)}catch(d){console.error(Pe(d)),process.exit(1)}else if(t==="preview"){let{existsSync:d}=await import("node:fs"),h=uC(u,"dist");if(!d(h))console.error(`No build output at ${h} — run \`jx build\` first.`),process.exit(1);await Promise.resolve().then(() => ZE());let y=c??4173;QE(h,y),console.log(`Previewing ${h} at http://localhost:${y}`)}else if(t==="schema")try{await Promise.resolve().then(() => Rm());let{projectSchemaPath:h,documentSchemaPath:m}=await d1(u);console.log(`Wrote ${yg(u,h)}`),console.log(`Wrote ${yg(u,m)}`)}catch(d){console.error(`Schema generation failed: ${Pe(d)}`),process.exit(1)}else if(t==="validate")try{await Promise.resolve().then(() => lC());let y=await iC(u,{strict:s.has("--strict")}),g=sC(y);if(y.valid){console.log(`Project is valid (${y.checked} files checked in ${u})`);for(let b of g)console.log(b)}else{console.error(`Project is INVALID (${u}):`);for(let b of[...cC(y),...g])console.error(b);process.exit(1)}}catch(d){console.error(`Validation failed: ${Pe(d)}`),process.exit(1)}else console.error(`Unknown command: ${t}
630
+ Run "jx --help" for usage.`),process.exit(1)}var due=rX();export{due as ready};