@jxsuite/compiler 6.0.2 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,23 +1,23 @@
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 Qj}from"node:module";var zj=Object.create;var{getPrototypeOf:Gj,defineProperty:Up,getOwnPropertyNames:Kj}=Object;var zp=Object.prototype.hasOwnProperty;function Yj(e){return this[e]}var Xj,Zj,kt=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?Xj??=new WeakMap:Zj??=new WeakMap,i=s.get(e);if(i)return i}r=e!=null?zj(Gj(e)):{};let o=t||!e||!e.__esModule||!zp.call(e,"default")?Up(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Kj(e))if(!zp.call(o,a))Up(o,a,{get:Yj.bind(e,a),enumerable:!0})}if(n)s.set(e,o);return o};var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var q=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Te=Qj(import.meta.url);function N(e){return typeof e==="string"}function lr(e){return typeof e==="number"}function $t(e){return typeof e==="boolean"}function vt(e){return typeof e==="function"}function F(e){return typeof e==="object"&&e!==null}function ee(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ce(e){return ee(e)&&typeof e.$ref==="string"}function er(e){return ee(e)&&e.$prototype==="Function"}function tr(e){return ee(e)&&ee(e.$expression)}function rs(e){return tr(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function En(e){return er(e)&&Array.isArray(e.body)}function Cr(e){return ee(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function rn(e){return ee(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Gp(e){return ee(e)&&!e.$prototype&&!e.$expression&&"default"in e}function _n(e){if(!ee(e))return!1;for(let t of Object.keys(e))if(!Kp.has(t))return!1;return!0}function Qe(e){return ee(e)&&e.$prototype==="Array"}function jc(e){return(Array.isArray(e)?e:[e]).some((r)=>Qe(r))}function Yp(e){return ee(e)&&e.$prototype==="Class"}function Ft(e){return ee(e)}function pe(e){return typeof e==="string"&&e.includes("${")}function ns(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function ss(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function nn(e){if(!e)return[];return e.map((t)=>N(t)?t:t.name)}function ek(e){return typeof e==="string"}function Tr(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)=>N(r))&&typeof t.default==="string";return!1}function Ms(e){if(ek(e))return[e];if(!Tr(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 Kp;var ve=q(()=>{Kp=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function Zp(e){let t=[],r=[],n=null,s=0,i=()=>r.at(-1)?.path??"",o=()=>n===null?i():nk(i(),n),a=()=>{s+=1;let l="";while(s<e.length){let c=e[s];if(c==="\\"){let d=e[s+1]??"";if(d==="u")l+=String.fromCodePoint(Number.parseInt(e.slice(s+2,s+6),16)),s+=6;else l+=tk.get(d)??d,s+=2;continue}if(c==='"')return s+=1,l;l+=c,s+=1}return l};while(s<e.length){let l=e[s];if(Xp.has(l)||l===","||l===":"){s+=1;continue}if(l==="{"||l==="["){r.push(l==="{"?{keys:new Set,kind:"object",path:o()}:{kind:"array",path:o()}),n=null,s+=1;continue}if(l==="}"||l==="]"){r.pop(),n=null,s+=1;continue}if(l==='"'){let d=a(),p=r.at(-1);if(p?.kind==="object"&&rk(e,s)===":"){if(p.keys.has(d))t.push({detail:d,kind:"duplicate-key",path:p.path});p.keys.add(d),n=d}else n=null;continue}if(l==="-"||l>="0"&&l<="9"){let d=s;while(s<e.length&&/[\d+.eE-]/.test(e[s]))s+=1;let p=e.slice(d,s);if(!sk(p))t.push({detail:p,kind:"unsafe-number",path:o()});n=null;continue}let c=s;while(s<e.length&&/[A-Za-z]/.test(e[s]))s+=1;if(s===c)s+=1;n=null}return t}function rk(e,t){let r=t;while(r<e.length&&Xp.has(e[r]))r+=1;return e[r]??""}function nk(e,t){return e===""?t:`${e}.${t}`}function sk(e){if(/[.eE]/.test(e))return!0;let t=Number(e);if(!Number.isFinite(t))return!1;return String(t)===e.replace(/^\+/,"")}function Qp(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 Xp,tk;var em=q(()=>{Xp=new Set([" ","\t",`
3
+ `,"\r"]);tk=new Map([["b","\b"],["f","\f"],["n",`
4
+ `],["r","\r"],["t","\t"]])});function Ee(e){return e instanceof Error?e.message:String(e)}function rm(e){if(N(e))return tm.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((t)=>rm(t));if(ee(e))return nm(e);return e}function nm(e){let t={};for(let[r,n]of Object.entries(e))t[tm.test(r)?r.normalize("NFC"):r]=rm(n);return t}function kc(e,t,r){let n;try{n=JSON.parse(e)}catch(i){throw Error(`Failed to parse ${r} at ${t}: ${Ee(i)}`,{cause:i})}if(!ee(n))throw Error(`Invalid ${r} at ${t}: expected a JSON object`);let s=Zp(e);if(s.length>0){let i=s.map((o)=>Qp(o)).join("; ");throw Error(`Invalid ${r} at ${t}: ${i}`)}return nm(n)}function Pn(e,t){return kc(e,t,"Jx document")}function sm(e,t){return kc(e,t,"project config")}function im(e,t){return kc(e,t,"class definition")}var tm;var rr=q(()=>{ve();em();tm=/[^\p{ASCII}]/u});function ik(e){return JSON.parse(e)}function Js(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ok(e){return Js(e)&&typeof e.binding==="string"}function ak(e){try{let t=ik(e);return Js(t)?t:void 0}catch{return}}function om(e,t){if(t.length===0)return{content:e??"",patched:!1};let r={};if(e){let n=ak(e);if(n===void 0)return{content:e,patched:!1};r=n}for(let n of t)am(r,n);return{content:`${JSON.stringify(r,null,"\t")}
5
+ `,patched:!0}}function am(e,t){for(let[r,n]of Object.entries(t)){let s=r in e?e[r]:void 0;if(Array.isArray(n)){e[r]=lk(Array.isArray(s)?s:[],n);continue}if(Js(n)){if(Js(s))am(s,n);else if(s===void 0)e[r]=structuredClone(n);continue}if(s===void 0)e[r]=n}}function lk(e,t){let r=[...e];for(let n of t){if(!ok(n)){if(!r.some((a)=>JSON.stringify(a)===JSON.stringify(n)))r.push(structuredClone(n));continue}let s=r.findIndex((o)=>Js(o)&&o.binding===n.binding),i=r[s];if(Js(i))r[s]={...i,...n};else r.push(structuredClone(n))}return r}var lm=()=>{};function fm(e){if(!N(e))return null;let[t,...r]=e.split(";"),n=(t??"").indexOf("/");if(n===-1)return null;let s=(t??"").slice(0,n).trim().toLowerCase(),i=(t??"").slice(n+1).trim().toLowerCase();if(!cm.test(s)||!cm.test(i))return null;let o=i.lastIndexOf("+"),a=o===-1?null:i.slice(o+1),l=o===-1?i:i.slice(0,o);if(a==="")return null;let c=l.indexOf("."),d=c===-1?null:l.slice(0,c),p=d!==null&&ck.has(d)?d:null,h=p===null?l:l.slice(p.length+1);if(h==="")return null;let m={};for(let b of r){let g=b.indexOf("=");if(g===-1)return null;let y=b.slice(0,g).trim().toLowerCase(),v=b.slice(g+1).trim();if(y==="")return null;if(v.startsWith('"')&&v.endsWith('"')&&v.length>=2)v=v.slice(1,-1);m[y]=v}return{parameters:m,subtype:h,suffix:a,tree:p,type:s}}function pm(e){if(!N(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(fm(e)===null)return`"${e}" is not a well-formed media type (RFC 6838 §4.2)`;return null}function mm(e){let t=fm(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 cm,ck,um="text/markdown; variant=GFM",dm="application/yaml",hm;var Rc=q(()=>{ve();cm=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,ck=new Set(["vnd","prs","x"]);hm={".markdown":`${um}; charset=utf-8`,".md":`${um}; charset=utf-8`,".yaml":`${dm}; charset=utf-8`,".yml":`${dm}; charset=utf-8`}});function xm(e){if(e===null)throw TypeError("A class descriptor cannot be null");return ee(e)?e:{}}class ua{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:s}=r;this.extensions=(s?.extensions??[]).map((i)=>i.toLowerCase()),this.mediaType=s?.mediaType??null,this.mediaTypeEssence=mm(this.mediaType),this.documentKinds=s?.documentKinds??[],this.exportTarget=s?.exportTarget===!0,this.remote=s?.remote===!0,this.studio=r.$studio??null,this.project=r.project??null,this.server=r.server??null,this.connector=r.connector??null,this.capabilities=dk(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()),s=n?.[r.identifier];if(!vt(s)){let o=this.classDef.title??this.name;throw TypeError(`Format class "${this.name}": implementation export "${o}" has no static "${r.identifier}" method`)}return await s.call(n,...t)}async parseDocument(e,t){return await this.call("parse",e,t)}}class da{#t;constructor(e){this.#t=e;for(let t of e){if(t.mediaType===null)continue;let r=pm(t.mediaType);if(r!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${r}`)}for(let t of ym){let r=new Map;for(let n of e){if(!n.capabilities[t])continue;for(let s of n.extensions){let i=r.get(s);if(i)throw Error(`Format conflict: "${i.name}" and "${n.name}" both claim "${s}" with the "${t}" capability`);r.set(s,n)}}}}get entries(){return this.#t}byExtension(e,t){let r=gm(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=gm(e);return this.#t.some((r)=>r.extensions.includes(t))}}function dk(e){let t={},r=e.$defs?.methods??{};for(let[n,s]of Object.entries(r)){let{role:i}=s;if(!pk(i))continue;let o={identifier:s.identifier??n,timing:s.timing??uk};if(N(s.discriminator))o.discriminator=s.discriminator;t[i]=o}return t}function pk(e){return e!==void 0&&fk.has(e)}function gm(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var ym,bm,uk,fk;var Ac=q(()=>{ve();Rc();ym=["parse","serialize","rewrite","discover","load"],bm=[...ym,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];uk=["compiler","server"];fk=new Set(bm)});class $m{#t;#e;#r;constructor(e){this.#t=e,this.#e=e.flatMap((s)=>s.classes);let t=new Map;for(let s of e)for(let i of s.classes){let o=t.get(i.name);if(o&&o!==s.specifier)throw Error(`Extension conflict: "${o}" and "${s.specifier}" both provide a class named "${i.name}"`);t.set(i.name,s.specifier)}let r=new Map;for(let s of this.#e){if(!s.project)continue;let i=r.get(s.project.key);if(i)throw Error(`Extension conflict: "${i.name}" and "${s.name}" both claim the project section "${s.project.key}"`);r.set(s.project.key,s)}let n=new Map;for(let s of this.#e){if(!s.server)continue;let{basePath:i}=s.server;if(!i.startsWith("/_jx/"))throw Error(`Extension "${s.name}": server basePath "${i}" must be under /_jx/`);let o=n.get(i);if(o)throw Error(`Extension conflict: "${o.name}" and "${s.name}" both mount "${i}"`);n.set(i,s)}this.#r=new da(this.#e.filter((s)=>s.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 vm(e,t,r){let n=[];for(let s of e??[])n.push(await mk(s,t,r));return new $m(n)}async function mk(e,t,r){let n;if(e.startsWith("./")||e.startsWith("../")){let l=t.resolvePath(r,e);n=t.resolvePath(`${l}/package.json`,`./${Fi}`)}else try{n=t.resolvePath(r,`${e}/${Fi}`)}catch(l){throw Error(`Extension "${e}" is not resolvable: it must export ${Fi} (is the package installed, and does its exports map include it?): ${Oc(l)}`,{cause:l})}let s;try{s=await t.loadJson(n)}catch(l){throw Error(`Extension "${e}": cannot read manifest ${n}: ${Oc(l)}`,{cause:l})}if(!ee(s)||!N(s.name))throw Error(`Extension "${e}": ${Fi} must declare a "name"`);let i=s;if(!e.startsWith(".")&&i.name!==e)throw Error(`Extension "${e}": manifest name "${i.name}" does not match the specifier`);let o=[];for(let[l,c]of Object.entries(i.classes??{})){let d=t.resolvePath(n,c),p;try{p=await t.loadJson(d)}catch(h){throw Error(`Extension "${e}": cannot read class "${l}" at ${d}: ${Oc(h)}`,{cause:h})}o.push(new ua(l,d,xm(p),t))}let a={};if(i.schemas?.project)a.project=t.resolvePath(n,i.schemas.project);if(i.schemas?.document)a.document=t.resolvePath(n,i.schemas.document);if(i.schemas?.fields)a.fields=t.resolvePath(n,i.schemas.fields);return{specifier:e,manifestPath:n,manifest:i,classes:o,schemas:a}}function Oc(e){return e instanceof Error?e.message:String(e)}var Fi="jx-extension.json";var wm=q(()=>{Ac();ve();Ac()});import{readFileSync as hk}from"node:fs";import{dirname as gk,isAbsolute as yk,resolve as Cc,sep as fa}from"node:path";import{pathToFileURL as bk}from"node:url";import{createRequire as Sm}from"node:module";async function Tc(e){let t=[e],r=`${fa}src${fa}`,n=`${fa}dist${fa}`;if(e.includes(r)){let i=e.replace(r,n);if(t.push(i),i.endsWith(".ts"))t.push(`${i.slice(0,-3)}.js`)}if(e.endsWith(".js"))t.push(`${e.slice(0,-3)}.ts`);let s;for(let i of t)try{return await import(bk(i).href)}catch(o){s=o}throw s instanceof Error?s:Error(String(s))}function Nc(e){return{importModule:(t)=>Tc(t),loadJson:async(t)=>JSON.parse(hk(t,"utf8")),resolvePath:(t,r)=>{if(r.startsWith("./")||r.startsWith("../"))return Cc(gk(t),r);if(yk(r))return r;let n=Sm(Cc(e,"package.json"));try{return n.resolve(r)}catch{return Sm(import.meta.url).resolve(r)}}}}async function jn(e,t){return vm(t?.extensions,Nc(e),Cc(e,"project.json"))}function pa(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 sn=q(()=>{wm();ve()});import{existsSync as xk,readFileSync as $k}from"node:fs";import{resolve as Em}from"node:path";function kn(e){let t=Em(e,"project.json");if(!xk(t))throw Error(`project.json not found in ${e}`);let r;try{r=sm($k(t,"utf8"),t)}catch(o){throw Error(`Invalid project.json: ${Ee(o)}`,{cause:o})}let n={...qi,...r,build:{...qi.build,...r.build},defaults:{...qi.defaults,...r.defaults},images:{...qi.images,...r.images},url:r.url??qi.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 s=["cloudflare-workers","cloudflare-pages","node","bun"];if(n.build.adapter==="static")delete n.build.adapter;if(n.build.adapter&&!s.includes(n.build.adapter))throw Error(`Unknown build adapter "${n.build.adapter}" in project.json. Valid adapters: ${s.join(", ")}`);let i=["build","cloudflare"];if(!i.includes(n.images.service))throw Error(`Unknown images.service "${n.images.service}" in project.json. Valid services: ${i.join(", ")}`);return{config:n,configPath:t,projectRoot:Em(e)}}var qi;var Hi=q(()=>{rr();qi={$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 Ic,readFileSync as _m,writeFileSync as vk}from"node:fs";import{resolve as Pm}from"node:path";async function jm(e,t={}){let{dryRun:r=!1,connection:n}=t,{config:s}=kn(e),i=await jn(e,s),o=ee(s.connections)?s.connections:{},a=ee(s.data)?s.data:{},l=Object.keys(o).filter((b)=>!n||b===n);if(n&&l.length===0)throw Error(`Unknown connection "${n}" (no such connections entry in project.json)`);if(l.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 c={...process.env,...Sk(e),JX_PROJECT_ROOT:e},d=[],p=[];for(let b of l){let g=o[b],y=ee(g)?{...g,$name:b}:{$name:b},v=String(y.provider??""),j=wk(i.connectors(),v);if(!j)throw Error(`Connection "${b}" names provider "${v}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let S={};for(let[E,O]of Object.entries(a))if(ee(O)&&O.connection===b)S[E]=O;let P=await j.call("deploySchema",S,y,{dryRun:r,env:c});if(d.push({applied:P.applied??!r,connection:b,provider:v,statements:P.statements??[],tables:Object.keys(S),warnings:P.warnings??[]}),j.capabilities.bindings){let E=await j.call("bindings",y);if(ee(E)&&Object.keys(E).length>0)p.push(E)}}let h=Pm(e,"wrangler.jsonc"),m=!1;if(!r&&p.length>0&&Ic(h)){let b=_m(h,"utf8"),{content:g,patched:y}=om(b,p);if(y&&g!==b)vk(h,g,"utf8"),m=!0}return{bindingsPatched:m,results:d,wranglerPath:Ic(h)?h:null}}function wk(e,t){return e.find((r)=>r.connector?.provider===t)}function Sk(e){let t=Pm(e,".dev.vars");if(!Ic(t))return{};let r=new Map;for(let n of _m(t,"utf8").split(`
6
+ `)){let s=n.trim();if(s===""||s.startsWith("#"))continue;let i=s.indexOf("=");if(i===-1)continue;let o=s.slice(0,i).trim(),a=s.slice(i+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 km=q(()=>{lm();sn();Hi();ve()});function is(e){return e.startsWith(ma)}function Rm(e){let t=e;if(is(t))t=t.slice(ma.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${Mc}${t}.js`}function Am(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",r=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${Mc}${r}`:`${Mc}${r}.${t}`}function Om(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function ha(e){let t=Om(e);return t.startsWith("/")?t:`/${t}`}function Ek(e,t){return[...e].toSorted((r,n)=>n[t].length-r[t].length)}function ga(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 s of Ek(e,"urlPrefix")){let i=ha(s.urlPrefix);if(!n.startsWith(`${i}/`))continue;let a=n.slice(i.length+1).split("/");if(a.some((c)=>c===""||c==="."||c===".."))return null;let{filter:l}=s;if(l&&!l(a.join("/")))return null;return`${Om(s.dir)}/${a.join("/")}`}return null}function Cm(e,t){let r=new Set;for(let n of t){let s=ha(n.urlPrefix),i=new RegExp(`${s.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${_k}]+`,"g");for(let o of e.matchAll(i)){let a=o[0].split("#")[0].split("?")[0];if(!a.endsWith("/"))r.add(a)}}return[...r].filter(Boolean)}function Jc(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 s=e.slice(n,r);if(s.endsWith(",")){t.push({descriptor:"",url:s.replace(/,+$/,"")});continue}while(r<e.length&&/\s/.test(e[r]))r+=1;let i=r;while(r<e.length&&e[r]!==",")r+=1;let o=e.slice(i,r).trim();if(r+=1,s=s.replace(/,+$/,""),s!=="")t.push({descriptor:o,url:s})}return t}function Dc(e){return e.map(({url:t,descriptor:r})=>r?`${t} ${r}`:t).join(", ")}function os(e){if(!N(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 Ie(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function Rn(e,t){let r=new URL(t);if(!r.pathname.endsWith("/"))r.pathname+="/";return new URL(e.replace(/^\/+/,""),r).href}var ma="npm:",Mc="/assets/",_k;var nr=q(()=>{ve();_k=String.raw`"'\s<>()\\`});function Tm(e,t){return e.replaceAll(Ak,(r,n,s)=>{let i=s.trim(),o=Ik.exec(i),a=o?o[2]:i,l=Ie(t,a);if(l===a)return r;return`url(${n}${o?`${o[1]}${l}${o[1]}`:l}${n})`})}function Mk(e,t,r,n,s){let i=r.toLowerCase();if(Pk.has(i))return Ie(s,n);if(jk.has(i)){let o=Jc(n);return o.length===0?n:Dc(o.map((a)=>({descriptor:a.descriptor,url:Ie(s,a.url)})))}if(i==="style")return Tm(n,s);if(i==="content"&&e==="meta"&&Nk.test(t))return Ie(s,n);return n}function Nm(e,t){if(t==="")return e;let r=e.replaceAll(Ck,(n,s,i,o)=>{let a=i.replaceAll(Ok,(l,c)=>`"${Ie(t,c)}"`);return s+a+o});return r=r.replaceAll(Tk,(n,s,i,o)=>s+Tm(i,t)+o),r.replaceAll(kk,(n,s,i)=>{if(i==="")return n;let o=s.toLowerCase(),a=i.replaceAll(Rk,(l,c,d,p,h)=>{let m=p===void 0?"'":'"',b=p??h??"",g=Mk(o,i,c,b,t);return g===b?l:`${c}=${m}${g}${m}`});return a===i?n:`<${s}${a}>`})}var Pk,jk,kk,Rk,Ak,Ok,Ck,Tk,Nk,Ik;var Im=q(()=>{nr();Pk=new Set(["href","src","poster","action","formaction","data"]),jk=new Set(["srcset","imagesrcset"]),kk=/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,Rk=/([a-zA-Z_:][\w:.-]*)\s*=\s*("([^"]*)"|'([^']*)')/g,Ak=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g,Ok=/"(\/[^"/][^"]*)"/g,Ck=/(<script\b[^>]*\btype\s*=\s*["']importmap["'][^>]*>)([\s\S]*?)(<\/script>)/gi,Tk=/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/gi,Nk=/\b(?:property|name)\s*=\s*["'](?:og:|twitter:)[\w:.-]*(?:image|url|video|audio|player)[\w:.-]*["']/i,Ik=/^(&quot;|&#34;|&apos;|&#39;)([\s\S]*)\1$/});var Gi=C(function(lz,oh){var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",{defineProperty:Vc,getOwnPropertyDescriptor:Jk,getOwnPropertyNames:Dk}=Object,Lk=Object.prototype.hasOwnProperty,Fk=(e,t)=>{for(var r in t)Vc(e,r,{get:t[r],enumerable:!0})},qk=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let s of Dk(t))if(!Lk.call(e,s)&&s!==r)Vc(e,s,{get:()=>t[s],enumerable:!(n=Jk(t,s))||n.enumerable})}return e},Hk=(e)=>qk(Vc({},"__esModule",{value:!0}),e),Ui={};Fk(Ui,{analyzeMetafile:()=>xR,analyzeMetafileSync:()=>SR,build:()=>hR,buildSync:()=>$R,context:()=>gR,default:()=>jR,formatMessages:()=>bR,formatMessagesSync:()=>wR,initialize:()=>_R,stop:()=>ER,transform:()=>yR,transformSync:()=>vR,version:()=>mR});oh.exports=Hk(Ui);function Mm(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($r(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 s of n)t(s)}else{let s=Object.keys(n);r.write8(6),r.write32(s.length);for(let i of s)r.write($r(i)),t(n[i])}},r=new Um;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Fc(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Vk(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ds(r.read());case 4:return r.read();case 5:{let o=r.read32(),a=[];for(let l=0;l<o;l++)a.push(t());return a}case 6:{let o=r.read32(),a={};for(let l=0;l<o;l++)a[ds(r.read())]=t();return a}default:throw Error("Invalid packet")}},r=new Um(e),n=r.read32(),s=(n&1)===0;n>>>=1;let i=t();if(r.ptr!==e.length)throw Error("Invalid packet");return{id:n,isRequest:s,value:i}}var Um=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);Fc(this.buf,e,t)}write(e){let t=this._write(4+e.length);Fc(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 zm(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}},$r,ds,Lc;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;$r=(r)=>e.encode(r),ds=(r)=>t.decode(r),Lc='new TextEncoder().encode("")'}else if(typeof Buffer<"u")$r=(e)=>Buffer.from(e),ds=(e)=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},Lc='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!($r("")instanceof Uint8Array))throw Error(`Invariant violation: "${Lc} 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(`
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
- `),"")}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+`
11
+ `);function zm(e,t){return(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0}function Fc(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var on=String.fromCharCode;function cr(e,t,r){let n=e[t],s=1,i=0;for(let o=0;o<t;o++)if(e[o]===10)s++,i=0;else i++;throw SyntaxError(r?r:t===e.length?"Unexpected end of input while parsing JSON":n>=32&&n<=126?`Unexpected character ${on(n)} in JSON at position ${t} (line ${s}, column ${i})`:`Unexpected byte 0x${n.toString(16)} in JSON at position ${t} (line ${s}, column ${i})`)}function Wk(e){if(!(e instanceof Uint8Array))throw Error("JSON input must be a Uint8Array");let t=[],r=[],n=[],s=e.length,i=null,o=0,a,l=0;while(l<s){let c=e[l++];if(c<=32)continue;let d;if(o===2&&i===null&&c!==34&&c!==125)cr(e,--l);switch(c){case 116:{if(e[l++]!==114||e[l++]!==117||e[l++]!==101)cr(e,--l);d=!0;break}case 102:{if(e[l++]!==97||e[l++]!==108||e[l++]!==115||e[l++]!==101)cr(e,--l);d=!1;break}case 110:{if(e[l++]!==117||e[l++]!==108||e[l++]!==108)cr(e,--l);d=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 p=l;d=on(c),c=e[l];while(!0){switch(c){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:{d+=on(c),c=e[++l];continue}}break}if(d=+d,isNaN(d))cr(e,--p,"Invalid number");break}case 34:{d="";while(!0){if(l>=s)cr(e,s);if(c=e[l++],c===34)break;else if(c===92)switch(e[l++]){case 34:d+='"';break;case 47:d+="/";break;case 92:d+="\\";break;case 98:d+="\b";break;case 102:d+="\f";break;case 110:d+=`
12
+ `;break;case 114:d+="\r";break;case 116:d+="\t";break;case 117:{let p=0;for(let h=0;h<4;h++)if(c=e[l++],p<<=4,c>=48&&c<=57)p|=c-48;else if(c>=97&&c<=102)p|=c+-87;else if(c>=65&&c<=70)p|=c+-55;else cr(e,--l);d+=on(p);break}default:cr(e,--l);break}else if(c<=127)d+=on(c);else if((c&224)===192)d+=on((c&31)<<6|e[l++]&63);else if((c&240)===224)d+=on((c&15)<<12|(e[l++]&63)<<6|e[l++]&63);else if((c&248)==240){let p=(c&7)<<18|(e[l++]&63)<<12|(e[l++]&63)<<6|e[l++]&63;if(p>65535)p-=65536,d+=on(p>>10&1023|55296),p=56320|p&1023;d+=on(p)}}d[0];break}case 91:{d=[],t.push(i),r.push(a),n.push(o),i=null,a=d,o=1;continue}case 123:{d={},t.push(i),r.push(a),n.push(o),i=null,a=d,o=2;continue}case 93:{if(o!==1)cr(e,--l);d=a,i=t.pop(),a=r.pop(),o=n.pop();break}case 125:{if(o!==2)cr(e,--l);d=a,i=t.pop(),a=r.pop(),o=n.pop();break}default:cr(e,--l)}c=e[l];while(c<=32)c=e[++l];switch(o){case 0:{if(l===s)return d;break}case 1:{if(a.push(d),c===44){l++;continue}if(c===93)continue;break}case 2:{if(i===null){if(i=d,c===58){l++;continue}}else{if(a[i]=d,i=null,c===44){l++;continue}if(c===125)continue}break}}break}cr(e,l)}var it=JSON.stringify,Jm="warning",Dm="silent";function Ls(e,t){let r=[];for(let n of e){if(qt(n,t),n.indexOf(",")>=0)throw Error(`Invalid ${t}: ${n}`);r.push(n)}return r.join(",")}var xa=()=>null,Ge=(e)=>typeof e==="boolean"?null:"a boolean",re=(e)=>typeof e==="string"?null:"a string",$a=(e)=>e instanceof RegExp?null:"a RegExp object",ls=(e)=>typeof e==="number"&&e===(e|0)?null:"an integer",Bk=(e)=>typeof e==="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",Gm=(e)=>typeof e==="function"?null:"a function",an=(e)=>Array.isArray(e)?null:"an array",Ht=(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",Uk=(e)=>typeof e==="object"&&e!==null?null:"an array or an object",zk=(e)=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Lm=(e)=>typeof e==="object"&&!Array.isArray(e)?null:"an object or null",Km=(e)=>typeof e==="string"||typeof e==="boolean"?null:"a string or a boolean",Gk=(e)=>typeof e==="string"||typeof e==="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ym=(e)=>typeof e==="string"||Array.isArray(e)&&e.every((t)=>typeof t==="string")?null:"a string or an array of strings",Xm=(e)=>typeof e==="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",Kk=(e)=>typeof e==="string"||e instanceof URL?null:"a string or a URL";function T(e,t,r,n){let s=e[r];if(t[r+""]=!0,s===void 0)return;let i=n(s);if(i!==null)throw Error(`${it(r)} must be ${i}`);return s}function tt(e,t,r){for(let n in e)if(!(n in t))throw Error(`Invalid option ${r}: ${it(n)}`)}function Yk(e){let t=Object.create(null),r=T(e,t,"wasmURL",Kk),n=T(e,t,"wasmModule",zk),s=T(e,t,"worker",Ge);return tt(e,t,"in initialize() call"),{wasmURL:r,wasmModule:n,worker:s}}function Zm(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 ${it(r)} in mangle cache to map to either a string or false`)}}return t}function _a(e,t,r,n,s){let i=T(t,r,"color",Ge),o=T(t,r,"logLevel",re),a=T(t,r,"logLimit",ls),l=T(t,r,"logStyle",re);if(i!==void 0)e.push(`--color=${i}`);else if(n)e.push("--color=true");if(e.push(`--log-level=${o||s}`),e.push(`--log-limit=${a||0}`),l)e.push(`--log-style=${l}`)}function qt(e,t,r){if(typeof e!=="string")throw Error(`Expected value for ${t}${r!==void 0?" "+it(r):""} to be a string, got ${typeof e} instead`);return e}function Qm(e,t,r){let n=T(t,r,"legalComments",re),s=T(t,r,"sourceRoot",re),i=T(t,r,"sourcesContent",Ge),o=T(t,r,"target",Ym),a=T(t,r,"format",re),l=T(t,r,"globalName",re),c=T(t,r,"mangleProps",$a),d=T(t,r,"reserveProps",$a),p=T(t,r,"mangleQuoted",Ge),h=T(t,r,"minify",Ge),m=T(t,r,"minifySyntax",Ge),b=T(t,r,"minifyWhitespace",Ge),g=T(t,r,"minifyIdentifiers",Ge),y=T(t,r,"lineLimit",ls),v=T(t,r,"drop",Ht),j=T(t,r,"dropLabels",Ht),S=T(t,r,"charset",re),P=T(t,r,"treeShaking",Ge),E=T(t,r,"ignoreAnnotations",Ge),O=T(t,r,"jsx",re),R=T(t,r,"jsxFactory",re),k=T(t,r,"jsxFragment",re),I=T(t,r,"jsxImportSource",re),D=T(t,r,"jsxDev",Ge),M=T(t,r,"jsxSideEffects",Ge),L=T(t,r,"define",sr),B=T(t,r,"logOverride",sr),se=T(t,r,"supported",sr),ue=T(t,r,"pure",Ht),oe=T(t,r,"keepNames",Ge),Q=T(t,r,"platform",re),ae=T(t,r,"tsconfigRaw",Gk),ke=T(t,r,"absPaths",Ht);if(n)e.push(`--legal-comments=${n}`);if(s!==void 0)e.push(`--source-root=${s}`);if(i!==void 0)e.push(`--sources-content=${i}`);if(o)e.push(`--target=${Ls(Array.isArray(o)?o:[o],"target")}`);if(a)e.push(`--format=${a}`);if(l)e.push(`--global-name=${l}`);if(Q)e.push(`--platform=${Q}`);if(ae)e.push(`--tsconfig-raw=${typeof ae==="string"?ae:JSON.stringify(ae)}`);if(h)e.push("--minify");if(m)e.push("--minify-syntax");if(b)e.push("--minify-whitespace");if(g)e.push("--minify-identifiers");if(y)e.push(`--line-limit=${y}`);if(S)e.push(`--charset=${S}`);if(P!==void 0)e.push(`--tree-shaking=${P}`);if(E)e.push("--ignore-annotations");if(v)for(let U of v)e.push(`--drop:${qt(U,"drop")}`);if(j)e.push(`--drop-labels=${Ls(j,"drop label")}`);if(ke)e.push(`--abs-paths=${Ls(ke,"abs paths")}`);if(c)e.push(`--mangle-props=${va(c)}`);if(d)e.push(`--reserve-props=${va(d)}`);if(p!==void 0)e.push(`--mangle-quoted=${p}`);if(O)e.push(`--jsx=${O}`);if(R)e.push(`--jsx-factory=${R}`);if(k)e.push(`--jsx-fragment=${k}`);if(I)e.push(`--jsx-import-source=${I}`);if(D)e.push("--jsx-dev");if(M)e.push("--jsx-side-effects");if(L)for(let U in L){if(U.indexOf("=")>=0)throw Error(`Invalid define: ${U}`);e.push(`--define:${U}=${qt(L[U],"define",U)}`)}if(B)for(let U in B){if(U.indexOf("=")>=0)throw Error(`Invalid log override: ${U}`);e.push(`--log-override:${U}=${qt(B[U],"log override",U)}`)}if(se)for(let U in se){if(U.indexOf("=")>=0)throw Error(`Invalid supported: ${U}`);let le=se[U];if(typeof le!=="boolean")throw Error(`Expected value for supported ${it(U)} to be a boolean, got ${typeof le} instead`);e.push(`--supported:${U}=${le}`)}if(ue)for(let U of ue)e.push(`--pure:${qt(U,"pure")}`);if(oe)e.push("--keep-names")}function Xk(e,t,r,n,s){var i;let o=[],a=[],l=Object.create(null),c=null,d=null;_a(o,t,l,r,n),Qm(o,t,l);let p=T(t,l,"sourcemap",Km),h=T(t,l,"bundle",Ge),m=T(t,l,"splitting",Ge),b=T(t,l,"preserveSymlinks",Ge),g=T(t,l,"metafile",Ge),y=T(t,l,"outfile",re),v=T(t,l,"outdir",re),j=T(t,l,"outbase",re),S=T(t,l,"tsconfig",re),P=T(t,l,"resolveExtensions",Ht),E=T(t,l,"nodePaths",Ht),O=T(t,l,"mainFields",Ht),R=T(t,l,"conditions",Ht),k=T(t,l,"external",Ht),I=T(t,l,"packages",re),D=T(t,l,"alias",sr),M=T(t,l,"loader",sr),L=T(t,l,"outExtension",sr),B=T(t,l,"publicPath",re),se=T(t,l,"entryNames",re),ue=T(t,l,"chunkNames",re),oe=T(t,l,"assetNames",re),Q=T(t,l,"inject",Ht),ae=T(t,l,"banner",sr),ke=T(t,l,"footer",sr),U=T(t,l,"entryPoints",Uk),le=T(t,l,"absWorkingDir",re),z=T(t,l,"stdin",sr),te=(i=T(t,l,"write",Ge))!=null?i:s,Le=T(t,l,"allowOverwrite",Ge),fe=T(t,l,"mangleCache",sr);if(l.plugins=!0,tt(t,l,`in ${e}() call`),p)o.push(`--sourcemap${p===!0?"":`=${p}`}`);if(h)o.push("--bundle");if(Le)o.push("--allow-overwrite");if(m)o.push("--splitting");if(b)o.push("--preserve-symlinks");if(g)o.push("--metafile");if(y)o.push(`--outfile=${y}`);if(v)o.push(`--outdir=${v}`);if(j)o.push(`--outbase=${j}`);if(S)o.push(`--tsconfig=${S}`);if(I)o.push(`--packages=${I}`);if(P)o.push(`--resolve-extensions=${Ls(P,"resolve extension")}`);if(B)o.push(`--public-path=${B}`);if(se)o.push(`--entry-names=${se}`);if(ue)o.push(`--chunk-names=${ue}`);if(oe)o.push(`--asset-names=${oe}`);if(O)o.push(`--main-fields=${Ls(O,"main field")}`);if(R)o.push(`--conditions=${Ls(R,"condition")}`);if(k)for(let G of k)o.push(`--external:${qt(G,"external")}`);if(D)for(let G in D){if(G.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${G}`);o.push(`--alias:${G}=${qt(D[G],"alias",G)}`)}if(ae)for(let G in ae){if(G.indexOf("=")>=0)throw Error(`Invalid banner file type: ${G}`);o.push(`--banner:${G}=${qt(ae[G],"banner",G)}`)}if(ke)for(let G in ke){if(G.indexOf("=")>=0)throw Error(`Invalid footer file type: ${G}`);o.push(`--footer:${G}=${qt(ke[G],"footer",G)}`)}if(Q)for(let G of Q)o.push(`--inject:${qt(G,"inject")}`);if(M)for(let G in M){if(G.indexOf("=")>=0)throw Error(`Invalid loader extension: ${G}`);o.push(`--loader:${G}=${qt(M[G],"loader",G)}`)}if(L)for(let G in L){if(G.indexOf("=")>=0)throw Error(`Invalid out extension: ${G}`);o.push(`--out-extension:${G}=${qt(L[G],"out extension",G)}`)}if(U)if(Array.isArray(U))for(let G=0,Be=U.length;G<Be;G++){let Xe=U[G];if(typeof Xe==="object"&&Xe!==null){let pt=Object.create(null),ut=T(Xe,pt,"in",re),Ue=T(Xe,pt,"out",re);if(tt(Xe,pt,"in entry point at index "+G),ut===void 0)throw Error('Missing property "in" for entry point at index '+G);if(Ue===void 0)throw Error('Missing property "out" for entry point at index '+G);a.push([Ue,ut])}else a.push(["",qt(Xe,"entry point at index "+G)])}else for(let G in U)a.push([G,qt(U[G],"entry point",G)]);if(z){let G=Object.create(null),Be=T(z,G,"contents",Xm),Xe=T(z,G,"resolveDir",re),pt=T(z,G,"sourcefile",re),ut=T(z,G,"loader",re);if(tt(z,G,'in "stdin" object'),pt)o.push(`--sourcefile=${pt}`);if(ut)o.push(`--loader=${ut}`);if(Xe)d=Xe;if(typeof Be==="string")c=$r(Be);else if(Be instanceof Uint8Array)c=Be}let We=[];if(E)for(let G of E)G+="",We.push(G);return{entries:a,flags:o,write:te,stdinContents:c,stdinResolveDir:d,absWorkingDir:le,nodePaths:We,mangleCache:Zm(fe)}}function Zk(e,t,r,n){let s=[],i=Object.create(null);_a(s,t,i,r,n),Qm(s,t,i);let o=T(t,i,"sourcemap",Km),a=T(t,i,"sourcefile",re),l=T(t,i,"loader",re),c=T(t,i,"banner",re),d=T(t,i,"footer",re),p=T(t,i,"mangleCache",sr);if(tt(t,i,`in ${e}() call`),o)s.push(`--sourcemap=${o===!0?"external":o}`);if(a)s.push(`--sourcefile=${a}`);if(l)s.push(`--loader=${l}`);if(c)s.push(`--banner=${c}`);if(d)s.push(`--footer=${d}`);return{flags:s,mangleCache:Zm(p)}}function eh(e){let t={},r={didClose:!1,reason:""},n={},s=0,i=0,o=new Uint8Array(16384),a=0,l=(S)=>{let P=a+S.length;if(P>o.length){let O=new Uint8Array(P*2);O.set(o),o=O}o.set(S,a),a+=S.length;let E=0;while(E+4<=a){let O=zm(o,E);if(E+4+O>a)break;E+=4,b(o.subarray(E,E+O)),E+=O}if(E>0)o.copyWithin(0,E,a),a-=E},c=(S)=>{if(r.didClose=!0,S)r.reason=": "+(S.message||S);let P="The service was stopped"+r.reason;for(let E in n)n[E](P,null);n={}},d=(S,P,E)=>{if(r.didClose)return E("The service is no longer running"+r.reason,null);let O=s++;if(n[O]=(R,k)=>{try{E(R,k)}finally{if(S)S.unref()}},S)S.ref();e.writeToStdin(Mm({id:O,isRequest:!0,value:P}))},p=(S,P)=>{if(r.didClose)throw Error("The service is no longer running"+r.reason);e.writeToStdin(Mm({id:S,isRequest:!1,value:P}))},h=async(S,P)=>{try{if(P.command==="ping"){p(S,{});return}if(typeof P.key==="number"){let E=t[P.key];if(!E)return;let O=E[P.command];if(O){await O(S,P);return}}throw Error("Invalid command: "+P.command)}catch(E){let O=[as(E,e,null,void 0,"")];try{p(S,{errors:O})}catch{}}},m=!0,b=(S)=>{if(m){m=!1;let E=String.fromCharCode(...S);if(E!=="0.28.2")throw Error(`Cannot start service: Host version "0.28.2" does not match binary version ${it(E)}`);return}let P=Vk(S);if(P.isRequest)h(P.id,P.value);else{let E=n[P.id];if(delete n[P.id],P.value.error)E(P.value.error,{});else E(null,P.value)}};return{readFromStdout:l,afterClose:c,service:{buildOrContext:({callName:S,refs:P,options:E,isTTY:O,defaultWD:R,callback:k})=>{let I=0,D=i++,M={},L={ref(){if(++I===1){if(P)P.ref()}},unref(){if(--I===0){if(delete t[D],P)P.unref()}}};t[D]=M,L.ref(),Qk(S,D,d,p,L,e,M,E,O,R,(B,se)=>{try{k(B,se)}finally{L.unref()}})},transform:({callName:S,refs:P,input:E,options:O,isTTY:R,fs:k,callback:I})=>{let D=th(),M=(L)=>{try{if(typeof E!=="string"&&!(E instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:B,mangleCache:se}=Zk(S,O,R,Dm),ue={command:"transform",flags:B,inputFS:L!==null,input:L!==null?$r(L):typeof E==="string"?$r(E):E};if(se)ue.mangleCache=se;d(P,ue,(oe,Q)=>{if(oe)return I(Error(oe),null);let ae=Fs(Q.errors,D),ke=Fs(Q.warnings,D),U=1,le=()=>{if(--U===0){let z={warnings:ke,code:Q.code,map:Q.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in Q)z.legalComments=Q==null?void 0:Q.legalComments;if(Q.mangleCache)z.mangleCache=Q==null?void 0:Q.mangleCache;I(null,z)}};if(ae.length>0)return I(Wi("Transform failed",ae,ke),null);if(Q.codeFS)U++,k.readFile(Q.code,(z,te)=>{if(z!==null)I(z,null);else Q.code=te,le()});if(Q.mapFS)U++,k.readFile(Q.map,(z,te)=>{if(z!==null)I(z,null);else Q.map=te,le()});le()})}catch(B){let se=[];try{_a(se,O,{},R,Dm)}catch{}let ue=as(B,e,D,void 0,"");d(P,{command:"error",flags:se,error:ue},()=>{ue.detail=D.load(ue.detail),I(Wi("Transform failed",[ue],[]),null)})}};if((typeof E==="string"||E instanceof Uint8Array)&&E.length>1048576){let L=M;M=()=>k.writeFile(E,L)}M(null)},formatMessages:({callName:S,refs:P,messages:E,options:O,callback:R})=>{if(!O)throw Error(`Missing second argument in ${S}() call`);let k={},I=T(O,k,"kind",re),D=T(O,k,"color",Ge),M=T(O,k,"terminalWidth",ls),L=T(O,k,"logStyle",re);if(tt(O,k,`in ${S}() call`),I===void 0)throw Error(`Missing "kind" in ${S}() call`);if(I!=="error"&&I!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${S}() call`);let B={command:"format-msgs",messages:ln(E,"messages",null,"",M),isWarning:I==="warning"};if(D!==void 0)B.color=D;if(M!==void 0)B.terminalWidth=M;if(L!==void 0)B.logStyle=L;d(P,B,(se,ue)=>{if(se)return R(Error(se),null);R(null,ue.messages)})},analyzeMetafile:({callName:S,refs:P,metafile:E,options:O,callback:R})=>{if(O===void 0)O={};let k={},I=T(O,k,"color",Ge),D=T(O,k,"verbose",Ge);tt(O,k,`in ${S}() call`);let M={command:"analyze-metafile",metafile:E};if(I!==void 0)M.color=I;if(D!==void 0)M.verbose=D;d(P,M,(L,B)=>{if(L)return R(Error(L),null);R(null,B.result)})}}}}function Qk(e,t,r,n,s,i,o,a,l,c,d){let p=th(),h=e==="context",m=(y,v)=>{let j=[];try{_a(j,a,{},l,Jm)}catch{}let S=as(y,i,p,void 0,v);r(s,{command:"error",flags:j,error:S},()=>{S.detail=p.load(S.detail),d(Wi(h?"Context failed":"Build failed",[S],[]),null)})},b;if(typeof a==="object"){let y=a.plugins;if(y!==void 0){if(!Array.isArray(y))return m(Error('"plugins" must be an array'),"");b=y}}if(b&&b.length>0){if(i.isSync)return m(Error("Cannot use plugins in synchronous API calls"),"");eR(t,r,n,s,i,o,a,b,p).then((y)=>{if(!y.ok)return m(y.error,y.pluginName);try{g(y.requestPlugins,y.runOnEndCallbacks,y.scheduleOnDisposeCallbacks)}catch(v){m(v,"")}},(y)=>m(y,""));return}try{g(null,(y,v)=>v([],[]),()=>{})}catch(y){m(y,"")}function g(y,v,j){let S=i.hasFS,{entries:P,flags:E,write:O,stdinContents:R,stdinResolveDir:k,absWorkingDir:I,nodePaths:D,mangleCache:M}=Xk(e,a,l,Jm,S);if(O&&!i.hasFS)throw Error('The "write" option is unavailable in this environment');let L={command:"build",key:t,entries:P,flags:E,write:O,stdinContents:R,stdinResolveDir:k,absWorkingDir:I||c,nodePaths:D,context:h};if(y)L.plugins=y;if(M)L.mangleCache=M;let B=(oe,Q)=>{let ae={errors:Fs(oe.errors,p),warnings:Fs(oe.warnings,p),outputFiles:void 0,metafile:void 0,mangleCache:void 0},ke=ae.errors.slice(),U=ae.warnings.slice();if(oe.outputFiles)ae.outputFiles=oe.outputFiles.map(rR);if(oe.metafile&&oe.metafile.length)ae.metafile=nR(oe.metafile);if(oe.mangleCache)ae.mangleCache=oe.mangleCache;if(oe.writeToStdout!==void 0)console.log(ds(oe.writeToStdout).replace(/\n$/,""));v(ae,(le,z)=>{if(ke.length>0||le.length>0){let te=Wi("Build failed",ke.concat(le),U.concat(z));return Q(te,null,le,z)}Q(null,ae,le,z)})},se,ue;if(h)o["on-end"]=(oe,Q)=>new Promise((ae)=>{B(Q,(ke,U,le,z)=>{let te={errors:le,warnings:z};if(ue)ue(ke,U);se=void 0,ue=void 0,n(oe,te),ae()})});r(s,L,(oe,Q)=>{if(oe)return d(Error(oe),null);if(!h)return B(Q,(U,le)=>(j(),d(U,le)));if(Q.errors.length>0)return d(Wi("Context failed",Q.errors,Q.warnings),null);let ae=!1,ke={rebuild:()=>{if(!se)se=new Promise((U,le)=>{let z;ue=(Le,fe)=>{if(!z)z=()=>Le?le(Le):U(fe)};let te=()=>{r(s,{command:"rebuild",key:t},(fe,We)=>{if(fe)le(Error(fe));else if(z)z();else te()})};te()});return se},watch:(U={})=>new Promise((le,z)=>{if(!i.hasFS)throw Error('Cannot use the "watch" API in this environment');let te={},Le=T(U,te,"delay",ls);tt(U,te,"in watch() call");let fe={command:"watch",key:t};if(Le)fe.delay=Le;r(s,fe,(We)=>{if(We)z(Error(We));else le(void 0)})}),serve:(U={})=>new Promise((le,z)=>{if(!i.hasFS)throw Error('Cannot use the "serve" API in this environment');let te={},Le=T(U,te,"port",Bk),fe=T(U,te,"host",re),We=T(U,te,"servedir",re),G=T(U,te,"keyfile",re),Be=T(U,te,"certfile",re),Xe=T(U,te,"fallback",re),pt=T(U,te,"cors",sr),ut=T(U,te,"onRequest",Gm);tt(U,te,"in serve() call");let Ue={command:"serve",key:t,onRequest:!!ut};if(Le!==void 0)Ue.port=Le;if(fe!==void 0)Ue.host=fe;if(We!==void 0)Ue.servedir=We;if(G!==void 0)Ue.keyfile=G;if(Be!==void 0)Ue.certfile=Be;if(Xe!==void 0)Ue.fallback=Xe;if(pt){let bt={},Jt=T(pt,bt,"origin",Ym);if(tt(pt,bt,'on "cors" object'),Array.isArray(Jt))Ue.corsOrigin=Jt;else if(Jt!==void 0)Ue.corsOrigin=[Jt]}r(s,Ue,(bt,Jt)=>{if(bt)return z(Error(bt));if(ut)o["serve-request"]=(Zr,Sn)=>{ut(Sn.args),n(Zr,{})};le(Jt)})}),cancel:()=>new Promise((U)=>{if(ae)return U();r(s,{command:"cancel",key:t},()=>{U()})}),dispose:()=>new Promise((U)=>{if(ae)return U();ae=!0,r(s,{command:"dispose",key:t},()=>{U(),j(),s.unref()})})};s.ref(),d(null,ke)})}}var eR=async(e,t,r,n,s,i,o,a,l)=>{let c=[],d=[],p={},h={},m=[],b=0,g=0,y=[],v=!1;a=[...a];for(let P of a){let E={};if(typeof P!=="object")throw Error(`Plugin at index ${g} must be an object`);let O=T(P,E,"name",re);if(typeof O!=="string"||O==="")throw Error(`Plugin at index ${g} is missing a name`);try{let R=T(P,E,"setup",Gm);if(typeof R!=="function")throw Error("Plugin is missing a setup function");tt(P,E,`on plugin ${it(O)}`);let k={name:O,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};g++;let D=R({initialOptions:o,resolve:(M,L={})=>{if(!v)throw Error('Cannot call "resolve" before plugin setup has completed');if(typeof M!=="string")throw Error("The path to resolve must be a string");let B=Object.create(null),se=T(L,B,"pluginName",re),ue=T(L,B,"importer",re),oe=T(L,B,"namespace",re),Q=T(L,B,"resolveDir",re),ae=T(L,B,"kind",re),ke=T(L,B,"pluginData",xa),U=T(L,B,"with",sr);return tt(L,B,"in resolve() call"),new Promise((le,z)=>{let te={command:"resolve",path:M,key:e,pluginName:O};if(se!=null)te.pluginName=se;if(ue!=null)te.importer=ue;if(oe!=null)te.namespace=oe;if(Q!=null)te.resolveDir=Q;if(ae!=null)te.kind=ae;else throw Error('Must specify "kind" when calling "resolve"');if(ke!=null)te.pluginData=l.store(ke);if(U!=null)te.with=tR(U,"with");t(n,te,(Le,fe)=>{if(Le!==null)z(Error(Le));else le({errors:Fs(fe.errors,l),warnings:Fs(fe.warnings,l),path:fe.path,external:fe.external,sideEffects:fe.sideEffects,namespace:fe.namespace,suffix:fe.suffix,pluginData:l.load(fe.pluginData)})})})},onStart(M){let B=ya(Error('This error came from the "onStart" callback registered here:'),s,"onStart");c.push({name:O,callback:M,note:B}),k.onStart=!0},onEnd(M){let B=ya(Error('This error came from the "onEnd" callback registered here:'),s,"onEnd");d.push({name:O,callback:M,note:B}),k.onEnd=!0},onResolve(M,L){let se=ya(Error('This error came from the "onResolve" callback registered here:'),s,"onResolve"),ue={},oe=T(M,ue,"filter",$a),Q=T(M,ue,"namespace",re);if(tt(M,ue,`in onResolve() call for plugin ${it(O)}`),oe==null)throw Error("onResolve() call is missing a filter");let ae=b++;p[ae]={name:O,callback:L,note:se},k.onResolve.push({id:ae,filter:va(oe),namespace:Q||""})},onLoad(M,L){let se=ya(Error('This error came from the "onLoad" callback registered here:'),s,"onLoad"),ue={},oe=T(M,ue,"filter",$a),Q=T(M,ue,"namespace",re);if(tt(M,ue,`in onLoad() call for plugin ${it(O)}`),oe==null)throw Error("onLoad() call is missing a filter");let ae=b++;h[ae]={name:O,callback:L,note:se},k.onLoad.push({id:ae,filter:va(oe),namespace:Q||""})},onDispose(M){m.push(M)},esbuild:s.esbuild});if(D)await D;y.push(k)}catch(R){return{ok:!1,error:R,pluginName:O}}}i["on-start"]=async(P,E)=>{l.clear();let O={errors:[],warnings:[]};await Promise.all(c.map(async({name:R,callback:k,note:I})=>{try{let D=await k();if(D!=null){if(typeof D!=="object")throw Error(`Expected onStart() callback in plugin ${it(R)} to return an object`);let M={},L=T(D,M,"errors",an),B=T(D,M,"warnings",an);if(tt(D,M,`from onStart() callback in plugin ${it(R)}`),L!=null)O.errors.push(...ln(L,"errors",l,R,void 0));if(B!=null)O.warnings.push(...ln(B,"warnings",l,R,void 0))}}catch(D){O.errors.push(as(D,s,l,I&&I(),R))}})),r(P,O)},i["on-resolve"]=async(P,E)=>{let O={},R="",k,I;for(let D of E.ids)try{({name:R,callback:k,note:I}=p[D]);let M=await k({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:l.load(E.pluginData),with:E.with});if(M!=null){if(typeof M!=="object")throw Error(`Expected onResolve() callback in plugin ${it(R)} to return an object`);let L={},B=T(M,L,"pluginName",re),se=T(M,L,"path",re),ue=T(M,L,"namespace",re),oe=T(M,L,"suffix",re),Q=T(M,L,"external",Ge),ae=T(M,L,"sideEffects",Ge),ke=T(M,L,"pluginData",xa),U=T(M,L,"errors",an),le=T(M,L,"warnings",an),z=T(M,L,"watchFiles",Ht),te=T(M,L,"watchDirs",Ht);if(tt(M,L,`from onResolve() callback in plugin ${it(R)}`),O.id=D,B!=null)O.pluginName=B;if(se!=null)O.path=se;if(ue!=null)O.namespace=ue;if(oe!=null)O.suffix=oe;if(Q!=null)O.external=Q;if(ae!=null)O.sideEffects=ae;if(ke!=null)O.pluginData=l.store(ke);if(U!=null)O.errors=ln(U,"errors",l,R,void 0);if(le!=null)O.warnings=ln(le,"warnings",l,R,void 0);if(z!=null)O.watchFiles=ba(z,"watchFiles");if(te!=null)O.watchDirs=ba(te,"watchDirs");break}}catch(M){O={id:D,errors:[as(M,s,l,I&&I(),R)]};break}r(P,O)},i["on-load"]=async(P,E)=>{let O={},R="",k,I;for(let D of E.ids)try{({name:R,callback:k,note:I}=h[D]);let M=await k({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:l.load(E.pluginData),with:E.with});if(M!=null){if(typeof M!=="object")throw Error(`Expected onLoad() callback in plugin ${it(R)} to return an object`);let L={},B=T(M,L,"pluginName",re),se=T(M,L,"contents",Xm),ue=T(M,L,"resolveDir",re),oe=T(M,L,"pluginData",xa),Q=T(M,L,"loader",re),ae=T(M,L,"errors",an),ke=T(M,L,"warnings",an),U=T(M,L,"watchFiles",Ht),le=T(M,L,"watchDirs",Ht);if(tt(M,L,`from onLoad() callback in plugin ${it(R)}`),O.id=D,B!=null)O.pluginName=B;if(se instanceof Uint8Array)O.contents=se;else if(se!=null)O.contents=$r(se);if(ue!=null)O.resolveDir=ue;if(oe!=null)O.pluginData=l.store(oe);if(Q!=null)O.loader=Q;if(ae!=null)O.errors=ln(ae,"errors",l,R,void 0);if(ke!=null)O.warnings=ln(ke,"warnings",l,R,void 0);if(U!=null)O.watchFiles=ba(U,"watchFiles");if(le!=null)O.watchDirs=ba(le,"watchDirs");break}}catch(M){O={id:D,errors:[as(M,s,l,I&&I(),R)]};break}r(P,O)};let j=(P,E)=>E([],[]);if(d.length>0)j=(P,E)=>{(async()=>{let O=[],R=[];for(let{name:k,callback:I,note:D}of d){let M,L;try{let B=await I(P);if(B!=null){if(typeof B!=="object")throw Error(`Expected onEnd() callback in plugin ${it(k)} to return an object`);let se={},ue=T(B,se,"errors",an),oe=T(B,se,"warnings",an);if(tt(B,se,`from onEnd() callback in plugin ${it(k)}`),ue!=null)M=ln(ue,"errors",l,k,void 0);if(oe!=null)L=ln(oe,"warnings",l,k,void 0)}}catch(B){M=[as(B,s,l,D&&D(),k)]}if(M){O.push(...M);try{P.errors.push(...M)}catch{}}if(L){R.push(...L);try{P.warnings.push(...L)}catch{}}}E(O,R)})()};let S=()=>{for(let P of m)setTimeout(()=>P(),0)};return v=!0,{ok:!0,requestPlugins:y,runOnEndCallbacks:j,scheduleOnDisposeCallbacks:S}};function th(){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 ya(e,t,r){let n,s=!1;return()=>{if(s)return n;s=!0;try{let i=(e.stack+"").split(`
13
+ `);i.splice(1,1);let o=rh(t,i,r);if(o)return n={text:e.message,location:o},n}catch{}}}function as(e,t,r,n,s){let i="Internal error",o=null;try{i=(e&&e.message||e)+""}catch{}try{o=rh(t,(e.stack+"").split(`
14
+ `),"")}catch{}return{id:"",pluginName:s,text:i,location:o,notes:n?[n]:[],detail:r?r.store(e):-1}}function rh(e,t,r){let n=" at ";if(e.readFileSync&&!t[0].startsWith(n)&&t[1].startsWith(n))for(let s=1;s<t.length;s++){let i=t[s];if(!i.startsWith(n))continue;i=i.slice(n.length);while(!0){let o=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(o){i=o[1];continue}if(o=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),o){i=o[1];continue}if(o=/^(\S+):(\d+):(\d+)$/.exec(i),o){let a;try{a=e.readFileSync(o[1],"utf8")}catch{break}let l=a.split(/\r\n|\r|\n|\u2028|\u2029/)[+o[2]-1]||"",c=+o[3]-1,d=l.slice(c,c+r.length)===r?r.length:0;return{file:o[1],namespace:"file",line:+o[2],column:$r(l.slice(0,c)).length,length:$r(l.slice(c,c+d)).length,lineText:l+`
15
15
  `+t.slice(1).join(`
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
- ...`;if(!s.location)return`
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=`
20
- Specifically the "${s}" package is present but this platform
16
+ `),suggestion:""}}break}}return null}function Wi(e,t,r){let n=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,n+1).map((i,o)=>{if(o===n)return`
17
+ ...`;if(!i.location)return`
18
+ error: ${i.text}`;let{file:a,line:l,column:c}=i.location,d=i.pluginName?`[plugin: ${i.pluginName}] `:"";return`
19
+ ${a}:${l}:${c}: ERROR: ${d}${i.text}`}).join("");let s=Error(e);for(let[i,o]of[["errors",t],["warnings",r]])Object.defineProperty(s,i,{configurable:!0,enumerable:!0,get:()=>o,set:(a)=>Object.defineProperty(s,i,{configurable:!0,enumerable:!0,value:a})});return s}function Fs(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Fm(e,t,r){if(e==null)return null;let n={},s=T(e,n,"file",re),i=T(e,n,"namespace",re),o=T(e,n,"line",ls),a=T(e,n,"column",ls),l=T(e,n,"length",ls),c=T(e,n,"lineText",re),d=T(e,n,"suggestion",re);if(tt(e,n,t),c){let p=c.slice(0,(a&&a>0?a:0)+(l&&l>0?l:0)+(r&&r>0?r:80));if(!/[\x7F-\uFFFF]/.test(p)&&!/\n/.test(c))c=p}return{file:s||"",namespace:i||"",line:o||0,column:a||0,length:l||0,lineText:c||"",suggestion:d||""}}function ln(e,t,r,n,s){let i=[],o=0;for(let a of e){let l={},c=T(a,l,"id",re),d=T(a,l,"pluginName",re),p=T(a,l,"text",re),h=T(a,l,"location",Lm),m=T(a,l,"notes",an),b=T(a,l,"detail",xa),g=`in element ${o} of "${t}"`;tt(a,l,g);let y=[];if(m)for(let v of m){let j={},S=T(v,j,"text",re),P=T(v,j,"location",Lm);tt(v,j,g),y.push({text:S||"",location:Fm(P,g,s)})}i.push({id:c||"",pluginName:d||n,text:p||"",location:Fm(h,g,s),notes:y,detail:r?r.store(b):-1}),o++}return i}function ba(e,t){let r=[];for(let n of e){if(typeof n!=="string")throw Error(`${it(t)} must be an array of strings`);r.push(n)}return r}function tR(e,t){let r=Object.create(null);for(let n in e){let s=e[n];if(typeof s!=="string")throw Error(`key ${it(n)} in object ${it(t)} must be a string`);r[n]=s}return r}function rR({path:e,contents:t,hash:r}){let n=null;return{path:e,contents:t,hash:r,get text(){let s=this.contents;if(n===null||s!==t)t=s,n=ds(s);return n}}}function va(e){let t=e.source;if(e.flags)t=`(?${e.flags})${t}`;return t}function nR(e){let t;try{t=ds(e)}catch{return Wk(e)}return JSON.parse(t)}var An=Te("fs"),qm=Te("os"),ur=Te("path"),Ds=process.env.ESBUILD_BINARY_PATH||Ds,sR=(e)=>!!e&&e!=="/usr/bin/esbuild",Hm="@esbuild/darwin-arm64",Vm="@esbuild/darwin-x64",wa={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Sa={"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"},Wm={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function iR(){let e,t,r=!1,n=`${process.platform} ${qm.arch()} ${qm.endianness()}`;if(n in wa)e=wa[n],t="esbuild.exe";else if(n in Sa)e=Sa[n],t="bin/esbuild";else if(n in Wm)e=Wm[n],t="bin/esbuild",r=!0;else throw Error(`Unsupported platform: ${n}`);return{pkg:e,subpath:t,isWASM:r}}function oR(){let e=Te.resolve("esbuild"),t=ur.dirname(ur.dirname(ur.dirname(e)));if(ur.basename(t)==="node_modules"){for(let r in Sa)try{let n=Sa[r];if(An.existsSync(ur.join(t,n)))return n}catch{}for(let r in wa)try{let n=wa[r];if(An.existsSync(ur.join(t,n)))return n}catch{}}return null}function aR(e,t){let r=ur.dirname(Te.resolve("esbuild"));return ur.join(r,`downloaded-${e.replace("/","-")}-${ur.basename(t)}`)}function lR(){if(sR(Ds))if(!An.existsSync(Ds))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${Ds}`);else return{binPath:Ds,isWASM:!1};let{pkg:e,subpath:t,isWASM:r}=iR(),n;try{n=Te.resolve(`${e}/${t}`)}catch(s){if(n=aR(e,t),!An.existsSync(n)){try{Te.resolve(e)}catch{let i=oR();if(i){let o=`
20
+ Specifically the "${i}" 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"
23
23
  into a Docker image that runs Linux, or by copying "node_modules" between
@@ -33,8 +33,8 @@ If you are installing with yarn, you can try listing both this platform and the
33
33
  other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
34
34
  feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
35
35
  Keep in mind that this means multiple copies of esbuild will be present.
36
- `;if(e===yy&&s===gy||e===gy&&s===yy)o=`
37
- Specifically the "${s}" package is present but this platform
36
+ `;if(e===Vm&&i===Hm||e===Hm&&i===Vm)o=`
37
+ Specifically the "${i}" package is present but this platform
38
38
  needs the "${e}" package instead. People often get into this
39
39
  situation by installing esbuild with npm running inside of Rosetta 2 and then
40
40
  trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
@@ -65,70 +65,153 @@ 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 s}}if(/\.zip\//.test(n)){let s;try{s=(()=>{throw new Error("Cannot require module "+"pnpapi");})()}catch(i){}if(s){let i=s.getPackageInformation(s.topLevel).packageLocation,o=ur.join(i,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.28.2-${ur.basename(t)}`);if(!An.existsSync(o))An.mkdirSync(ur.dirname(o),{recursive:!0}),An.copyFileSync(n,o),An.chmodSync(o,493);return{binPath:o,isWASM:r}}}return{binPath:n,isWASM:r}}var nh=Te("child_process"),cR=Te("crypto"),qc=Te("path"),cs=Te("fs"),uR=Te("os"),dR=Te("tty"),Rt;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{Rt=Te("worker_threads")}catch{}let[e,t]=process.versions.node.split(".");if(+e<12||+e===12&&+t<17||+e===13&&+t<13)Rt=void 0}var Bm,zi=((Bm=Rt==null?void 0:Rt.workerData)==null?void 0:Bm.esbuildVersion)==="0.28.2",sh=()=>{if((!Ds||!1)&&(qc.basename(__filename)!=="main.js"||qc.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}=lR();if(t)return["node",[e]];else return[e,[]]}},Bi=()=>dR.isatty(2),fR={readFile(e,t){try{let r=cs.readFileSync(e,"utf8");try{cs.unlinkSync(e)}catch{}t(null,r)}catch(r){t(r,null)}},writeFile(e,t){try{let r=ih();cs.writeFileSync(r,e),t(r)}catch{t(null)}}},pR={readFile(e,t){try{cs.readFile(e,"utf8",(r,n)=>{try{cs.unlink(e,()=>t(r,n))}catch{t(r,n)}})}catch(r){t(r,null)}},writeFile(e,t){try{let r=ih();cs.writeFile(r,e,(n)=>n!==null?t(null):t(r))}catch{t(null)}}},mR="0.28.2",hR=(e)=>fs().build(e),gR=(e)=>fs().context(e),yR=(e,t)=>fs().transform(e,t),bR=(e,t)=>fs().formatMessages(e,t),xR=(e,t)=>fs().analyzeMetafile(e,t),$R=(e)=>{if(Rt&&!zi){if(!At)At=ja(Rt);return At.buildSync(e)}let t;return Pa((r)=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Bi(),defaultWD:us,callback:(n,s)=>{if(n)throw n;t=s}})),t},vR=(e,t)=>{if(Rt&&!zi){if(!At)At=ja(Rt);return At.transformSync(e,t)}let r;return Pa((n)=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Bi(),fs:fR,callback:(s,i)=>{if(s)throw s;r=i}})),r},wR=(e,t)=>{if(Rt&&!zi){if(!At)At=ja(Rt);return At.formatMessagesSync(e,t)}let r;return Pa((n)=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(s,i)=>{if(s)throw s;r=i}})),r},SR=(e,t)=>{if(Rt&&!zi){if(!At)At=ja(Rt);return At.analyzeMetafileSync(e,t)}let r;return Pa((n)=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e==="string"?e:JSON.stringify(e),options:t,callback:(s,i)=>{if(s)throw s;r=i}})),r},ER=()=>{if(Ea)Ea();if(At)At.stop();return Promise.resolve()},Hc=!1,_R=(e)=>{if(e=Yk(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(Hc)throw Error('Cannot call "initialize" more than once');return fs(),Hc=!0,Promise.resolve()},us=process.cwd(),Vi,Ea,fs=()=>{if(Vi)return Vi;let[e,t]=sh(),r=nh.spawn(e,t.concat("--service=0.28.2","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:us}),{readFromStdout:n,afterClose:s,service:i}=eh({writeToStdin(d){r.stdin.write(d,(p)=>{if(p)s(p)})},readFileSync:cs.readFileSync,isSync:!1,hasFS:!0,esbuild:Ui});r.stdin.on("error",s),r.on("error",s);let{stdin:o,stdout:a}=r;a.on("data",n),a.on("end",s),Ea=()=>{o.destroy(),a.destroy(),r.kill(),Hc=!1,Vi=void 0,Ea=void 0};let l=0;if(r.unref(),o.unref)o.unref();if(a.unref)a.unref();let c={ref(){if(++l===1)r.ref()},unref(){if(--l===0)r.unref()}};return Vi={build:(d)=>new Promise((p,h)=>{i.buildOrContext({callName:"build",refs:c,options:d,isTTY:Bi(),defaultWD:us,callback:(m,b)=>m?h(m):p(b)})}),context:(d)=>new Promise((p,h)=>i.buildOrContext({callName:"context",refs:c,options:d,isTTY:Bi(),defaultWD:us,callback:(m,b)=>m?h(m):p(b)})),transform:(d,p)=>new Promise((h,m)=>i.transform({callName:"transform",refs:c,input:d,options:p||{},isTTY:Bi(),fs:pR,callback:(b,g)=>b?m(b):h(g)})),formatMessages:(d,p)=>new Promise((h,m)=>i.formatMessages({callName:"formatMessages",refs:c,messages:d,options:p,callback:(b,g)=>b?m(b):h(g)})),analyzeMetafile:(d,p)=>new Promise((h,m)=>i.analyzeMetafile({callName:"analyzeMetafile",refs:c,metafile:typeof d==="string"?d:JSON.stringify(d),options:p,callback:(b,g)=>b?m(b):h(g)}))},Vi},Pa=(e)=>{let[t,r]=sh(),n=new Uint8Array,{readFromStdout:s,afterClose:i,service:o}=eh({writeToStdin(l){if(n.length!==0)throw Error("Must run at most one command");n=l},isSync:!0,hasFS:!0,esbuild:Ui});e(o);let a=nh.execFileSync(t,r.concat("--service=0.28.2"),{cwd:us,windowsHide:!0,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});s(a),i(null)},ih=()=>qc.join(uR.tmpdir(),`esbuild-${cR.randomBytes(32).toString("hex")}`),At=null,ja=(e)=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:us,esbuildVersion:"0.28.2"},transferList:[r],execArgv:[]}),s=0,i=(c)=>{let d=Error(`Build failed with 1 error:
71
+ error: ${c}`),p=[{id:"",pluginName:"",text:c,location:null,notes:[],detail:void 0}];return d.errors=p,d.warnings=[],d},o=(c)=>{if(!c)return;let d=c.plugins;if(d&&d.length>0)throw i("Cannot use plugins in synchronous API calls")},a=(c,d)=>{for(let p in d)c[p]=d[p]},l=(c,d)=>{let p=s++,h=new SharedArrayBuffer(8),m=new Int32Array(h),b={sharedBuffer:h,id:p,command:c,args:d};n.postMessage(b);let g=Atomics.wait(m,0,0);if(g!=="ok"&&g!=="not-equal")throw Error("Internal error: Atomics.wait() failed: "+g);let{message:{id:y,resolve:v,reject:j,properties:S}}=e.receiveMessageOnPort(t);if(p!==y)throw Error(`Internal error: Expected id ${p} but got id ${y}`);if(j)throw a(j,S),j;return v};return n.unref(),{buildSync(c){return o(c),l("build",[c])},transformSync(c,d){return l("transform",[c,d])},formatMessagesSync(c,d){return l("formatMessages",[c,d])},analyzeMetafileSync(c,d){return l("analyzeMetafile",[c,d])},stop(){n.terminate(),At=null}}},PR=()=>{let e=Rt.workerData.workerPort,t=Rt.parentPort,r=(n)=>{let s={};if(n&&typeof n==="object")for(let i in n)s[i]=n[i];return s};try{let n=fs();us=Rt.workerData.defaultWD,t.on("message",(s)=>{(async()=>{let{sharedBuffer:i,id:o,command:a,args:l}=s,c=new Int32Array(i);try{switch(a){case"build":e.postMessage({id:o,resolve:await n.build(l[0])});break;case"transform":e.postMessage({id:o,resolve:await n.transform(l[0],l[1])});break;case"formatMessages":e.postMessage({id:o,resolve:await n.formatMessages(l[0],l[1])});break;case"analyzeMetafile":e.postMessage({id:o,resolve:await n.analyzeMetafile(l[0],l[1])});break;default:throw Error(`Invalid command: ${a}`)}}catch(d){e.postMessage({id:o,reject:d,properties:r(d)})}Atomics.add(c,0,1),Atomics.notify(c,0,1/0)})()})}catch(n){t.on("message",(s)=>{let{sharedBuffer:i,id:o}=s,a=new Int32Array(i);e.postMessage({id:o,reject:n,properties:r(n)}),Atomics.add(a,0,1),Atomics.notify(a,0,1/0)})}};if(zi)PR();var jR=Ui});import{rmSync as ah,writeFileSync as lh}from"node:fs";import{createRequire as kR}from"node:module";import{tmpdir as RR}from"node:os";import{basename as AR,join as Uc,resolve as OR}from"node:path";function uh(e){return is(e)||e.startsWith("./")||e.startsWith("../")}function Ki(){return typeof Bun>"u"||process.env.JX_BUNDLER==="esbuild"}function zc(e,t,r){if(is(e)){let n=e.slice(ma.length);if(Ki())return kR(Uc(r,"package.json")).resolve(n);return Bun.resolveSync(n,r)}return OR(t,e)}function CR(e){let{onFileLoaded:t,resolver:r}=e;if(r===void 0&&t===void 0)return[];return[{name:"jx-bundle-hooks",setup:(s)=>{if(r!==void 0)s.onResolve({filter:r.filter},(i)=>r.resolve(i));if(t!==void 0)s.onLoad({filter:/.*/},(i)=>{t(i.path)})}}]}function TR(e){if(e==="cloudflare-workers"||e==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:e==="bun"?"bun":"node"}}function Wc(e){return e.minify??e.target==="browser"}function Bc(e){let t={};if(e.conditions)t.conditions=e.conditions;if(e.target==="browser")t.define={...NR};return t}function dh(e){return e==="node"||e==="bun"?"node":"browser"}function IR(e){if(e==="workerd")return"browser";return e}async function Gc(e,t){let r=t.external??[],n=CR(t);if(Ki()){let i=await Promise.resolve().then(() => kt(Gi(),1));await i.build({bundle:!0,...Bc(t),entryPoints:[e.entryPath],external:r,format:"esm",logLevel:"silent",minify:Wc(t),outfile:e.outfile,platform:dh(t.target),plugins:n});return}let s=await Bun.build({...Bc(t),entrypoints:[e.entryPath],external:r,format:"esm",minify:Wc(t),plugins:n,target:IR(t.target),throw:!1});if(!s.success||s.outputs.length===0){let i=s.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())});
79
- function ${Ds}(n, v) {
73
+ ${i}`)}lh(e.outfile,await s.outputs[0].text(),"utf8")}function Kc(e){return e==="<stdin>"||AR(e).startsWith(fh)}async function ph(e,t,r){let n=[],s=Uc(RR(),`jx-resolve-${process.pid}.js`);try{await ps(`export * from ${JSON.stringify(e)};
74
+ `,{outfile:s,resolveDir:t},{...r,minify:!1,onFileLoaded:(i)=>n.push(i)})}catch{return}finally{ah(s,{force:!0})}return n.find((i)=>!Kc(i))}async function ps(e,{resolveDir:t,outfile:r},n){if(Ki()){let i=await Promise.resolve().then(() => kt(Gi(),1));await i.build({bundle:!0,...Bc(n),external:n.external??[],format:"esm",logLevel:"silent",minify:Wc(n),outfile:r,platform:dh(n.target),stdin:{contents:e,loader:"js",resolveDir:t,sourcefile:"jx-entry.js"}});return}let s=Uc(t,`${fh}${process.pid}.mjs`);lh(s,e,"utf8");try{await Gc({entryPath:s,outfile:r},n)}finally{ah(s,{force:!0})}}async function mh(e,{projectRoot:t,outfile:r,adapter:n}){await ps(e,{outfile:r,resolveDir:t},TR(n))}var ch,NR,fh=".jx-entry-";var Yc=q(()=>{nr();ch=["@vue/reactivity","lit-html"];NR={"process.env.NODE_ENV":'"production"'}});function JR(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function hh(e){let t=JR(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 s=[],i=!1,o=!1,a=t.replaceAll(MR,(l,c,d)=>{if(i=!0,c)return o=!0,s.push(c),"*";return s.push(d),`:${d}`});return{isCatchAll:o,isDynamic:i,params:s,urlPattern:a}}function gh(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 MR;var yh=q(()=>{MR=/\[\.\.\.(\w+)\]|\[(\w+)\]/g});function dr(e){if(!N(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function Yi(e){let t=dr(e);if(t===null)return"ltr";let r=new Intl.Locale(t),n=r.script??r.maximize().script;return n!==void 0&&DR.has(n)?"rtl":"ltr"}function bh(e){let t=dr(e);if(t===null)return N(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Xc(e){let t=e.i18n,r=[];if(!F(t))return{errors:r,i18n:null};let n=Array.isArray(t.locales)?t.locales:[],s=[];for(let a of n){let l=dr(a);if(l===null){r.push(`i18n.locales: "${String(a)}" is not a well-formed BCP 47 language tag.`);continue}if(!s.includes(l))s.push(l)}let i=dr(t.defaultLocale)??s[0]??null;if(t.defaultLocale!==void 0&&dr(t.defaultLocale)===null)r.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(i===null)return r.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:r,i18n:null};if(!s.includes(i))s.unshift(i);let o=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:LR;return{errors:r,i18n:{defaultLocale:i,locales:s,routing:o}}}function Nr(e,t){if(t===null)return null;let r=e.split("/").find(Boolean);if(r===void 0)return t.defaultLocale;let n=dr(r);return n!==null&&t.locales.includes(n)?n:t.defaultLocale}var DR,ka="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",LR="prefix-except-default";var ms=q(()=>{ve();DR=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 Vt(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}function xh(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let r=e.slice(2,-1).trim();return FR.has(r.toLowerCase())?r:e.slice(1)}return null}function Xi(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function Qi(e){return e.startsWith("@keyframes")}function $h(e,t){let r=[];for(let n of Zi(e))for(let s of Zi(t))r.push(qR(n,s));return r.join(", ")}function qR(e,t){let r=Aa(t,e);if(r!==null)return r;if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Zc(e){let t=[],r=null,n=0;for(let s=0;s<e.length;s+=1){let i=e[s];if(r){if(i==="\\")s+=1;else if(i===r)r=null;continue}if(i==="\\")s+=1;else if(i==='"'||i==="'")r=i;else if(i==="[")n+=1;else if(i==="]")n=Math.max(0,n-1);else if(i==="&"&&n===0)t.push(s)}return t}function Aa(e,t){return Zc(e).length>0?HR(e,t):null}function HR(e,t){let r="",n=0;for(let s of Zc(e))r+=e.slice(n,s)+t,n=s+1;return r+e.slice(n)}function Zi(e){let t=[],r=0,n=null,s=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(s,o)),s=o+1}t.push(e.slice(s));let i=t.flatMap((o)=>{let a=o.trim();return a===""?[]:[a]});return i.length>0?i:[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 Qc(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 On(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function eu(e){return e.startsWith("--")?e:Vt(e)}function Ra(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 vh(e,t,r){let n=r.map(([i,o])=>`${i}: ${o}`).join("; "),s=t===null?n:`${t} { ${n} }`;for(let i=e.length-1;i>=0;i-=1)s=`${e[i]} { ${s} }`;return s}function VR(e,t,r){let n=r.map(({selector:i,declarations:o})=>`${i} { ${o.map(([a,l])=>`${a}: ${l}`).join("; ")} }`).join(" "),s=`@keyframes ${t} { ${n} }`;for(let i=e.length-1;i>=0;i-=1)s=`${e[i]} { ${s} }`;return s}function WR(e){let t=Object.keys(e).filter((n)=>Qi(n));if(t.length===0)return e;let r={...e};for(let n of t)delete r[n];return r}function BR(e){let r=Zc(e).at(-1),n=r===void 0?e:e.slice(r+1);return n===""||n.startsWith(":")||n.startsWith(".")||n.startsWith("[")}function qs(e,t={}){let{scope:r=null,mediaQueries:n={},transposeValue:s=(y)=>y,transposeSelector:i=(y)=>y,resolveValue:o}=t,a=[],l=(y)=>y!==null&&typeof y==="object"&&!Array.isArray(y)&&!Ce(y),c=(y,v)=>{if(l(v))return[v];if(!Xi(y)||!Array.isArray(v)||v.length===0)return[];return v.every((j)=>l(j))?v:[]},d=(y,v,j,S)=>{if(v===void 0||v===null)return null;if(Ce(v))return j?o?.(y,v,S)??null:null;if(F(v))return null;let P=String(v);if(pe(P))return j?o?.(y,P,S)??null:null;return s(P)},p=(y,v,j=!0,S="self")=>{let P=[];for(let[E,O]of Object.entries(y)){if(c(E,O).length>0)continue;if(v&&(E.startsWith("@")||On(E)))continue;if(E.startsWith("$"))continue;let R=d(E,O,j,S);if(R!==null)P.push([eu(E),R])}return P},h=(y,v,j,S,P)=>{if(j.length===0)return;let E=v;if(E!==null){let k=i(E);if(k===null)return;E=k}let O=vh(y,E,j),R={text:O,conditions:[...y],selector:E,declarations:j,target:S,key:Ra(O)};if(N(P)&&P!=="")R.description=P;a.push(R)},m=(y,v,j)=>{let S=y.slice(10).trim();if(S==="")return;let P=[];for(let[O,R]of Object.entries(v)){if(!l(R))continue;let k=p(R,!0,!1,"unscoped");if(k.length>0)P.push({declarations:k,selector:O.trim()})}if(P.length===0)return;let E=VR(j,S,P);a.push({blocks:P,conditions:[...j],declarations:[],key:Ra(E),selector:null,target:"unscoped",text:E})},b=(y,v,j,S,P)=>{if(y==="@--")return;if(Xi(y)){h([...S,y],null,p(v,!1,!0,"unscoped"),"unscoped",v.$description);return}if(Qi(y)){m(y,v,S);return}let E=xh(y,n),O=E===null?y:`@media ${E}`,R=E===null?null:wr(E);if(R!==null&&j!==null){let{auto:k,forced:I}=Qc(j,R);g(v,k,[...S,O],P),g(WR(v),I,S,P);return}g(v,j,[...S,O],P)};function g(y,v,j,S){h(j,v,p(y,!0,!0,S),S,y.$description);for(let[P,E]of Object.entries(y))for(let O of c(P,E))if(P.startsWith("@"))b(P,O,v,j,S);else if(v!==null)g(O,$h(v,P),j,BR(P)?S:"descendant")}return g(e,r,[],"self"),a}var FR,vr="data-color-scheme",Oa="jx-color-scheme";var eo=q(()=>{ve();FR=new Set(["all","print","screen","speech"])});function Eh(){return`the Intl helpers ${ru.join(", ")}`}var Ir="en-US",tu="UTC",wh,ru,Sh;var nu=q(()=>{wh=[{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."}],ru=wh.map((e)=>e.path),Sh=Object.fromEntries(wh.map((e)=>[e.path,e.params.indexOf("locale")]))});function UR(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function dt(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function cn(e){if(e==="")return[];return e.split("/").map((t)=>UR(t))}function mt(e,t){let r=e;for(let n of cn(t))r=r?.[n];return r}function Pe(e,t){let r=e;for(let n of cn(t))r+=su.test(n)?`.${n}`:`[${JSON.stringify(n)}]`;return r}function _h(e,t){let r=e;for(let[n,s]of cn(t).entries()){let i=n===0?"":"?.";r+=su.test(s)?`${n===0?".":i}${s}`:`${i}[${JSON.stringify(s)}]`}return r}function un(e){return su.test(e)?e:JSON.stringify(e)}function Ph(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var su;var Hs=q(()=>{su=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function iu(e){let t=e.$map;return F(t)?t:void 0}function Ah(e){return F(e)&&!Array.isArray(e)&&"operator"in e}function to(e){return F(e)&&!Array.isArray(e)&&"$ref"in e}function YR(e,t,r){let n=Sh[e];if(n===void 0||n<0||t[n]!=null)return t;let s=mt(r.$page,"locale");if(!N(s)||s==="")return t;let i=[...t];return i[n]=s,i}function Nh(e){return e.startsWith("window#/")&&GR.has(e.slice(8))}function dn(e){return Oh.has(e)}function Ke(e,t){if(!e)return;let r=(e.depth??0)+1;if(r>XR)return;return{depth:r,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function Fe(e,t,r,n,s){if(e===null||e===void 0)return e;if(Ah(e))return ir(e,t,r,n,s);if(to(e)){let i=Ca(e.$ref,t,r,n);return s?.report(s.path??[],i),i}if(Array.isArray(e))return Ih(e,t,r,n,s);return s?.report(s.path??[],e),e}function Ih(e,t,r,n,s){return e.map((i,o)=>Fe(i,t,r,n,Ke(s,o)))}function ZR(e,t,r,n){let s=(i)=>{if(!e.slice(i.length).includes("/"))return t;return Ca(e.slice(0,e.lastIndexOf("/")),t,r,n)};if(e.startsWith("#/state/"))return s("#/state/");if(e.startsWith("parent#/"))return s("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?Ca(e.slice(0,e.lastIndexOf("/")),t,r,n):void 0;return}function Ca(e,t,r,n){if(e==="$reduce/acc")return n?.acc;if(e.startsWith("$reduce/"))return n?.acc;if(e.startsWith("$args/")){let s=e.slice(6).split("/"),i=n?.args?.[s[0]];return s.length>1?mt(i,s.slice(1).join("/")):i}if(e.startsWith("event#/")){let s=e.slice(7);return mt(r,s)}if(e.startsWith("$map/")){let s=e.split("/"),[,i]=s,o,a=iu(t);if(i==="item")o=n?.item??a?.item??t["$map/item"];else if(i==="index")o=n?.index??a?.index??t["$map/index"];else o=a?.[i]??t[`$map/${i}`];return s.length>2?mt(o,s.slice(2).join("/")):o}if(e.startsWith("#/state/"))return mt(t,e.slice(8));if(e.startsWith("parent#/"))return mt(t,e.slice(8));if(e.startsWith("window#/"))return mt(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return mt(globalThis.document,e.slice(10));return mt(t,e)??null}function QR(e,t,r,n){if(e.startsWith("$map/")){let s=e.split("/"),[,i]=s,o,a=iu(t);if(i==="item")o=n?.item??a?.item??t["$map/item"];else if(i==="index")o=n?.index??a?.index??t["$map/index"];else o=a?.[i]??t[`$map/${i}`];if(s.length>2){let l=s.slice(2),c=l.pop(),d=l.length>0?mt(o,l.join("/")):o;return{key:c,obj:d}}return{key:i==="item"?"$map/item":"$map/index",obj:iu(t)??t}}if(e.startsWith("#/state/")){let s=e.slice(8);if(s.indexOf("/")===-1)return{key:s,obj:t};let o=cn(s),a=o.pop(),l=t;for(let c of o)l=l[c];return{key:a,obj:l}}return{key:e,obj:t}}function ir(e,t,r,n,s){let i=eA(e,t,r,n,s);return s?.report(s.path??[],i),i}function kh(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 eA(e,t,r,n,s){let{operator:i,target:o,value:a,initial:l}=e;if(!zR.has(i))throw Error(`$expression: unknown operator "${i}"`);if(ou.has(i)&&!("value"in e)){let c=Fe(o,t,r,n,Ke(s,"target"));if(i==="!")return!c;if(i==="-")return-c}if(i==="call"){let c=to(o)?o.$ref:void 0;if(!N(c))throw TypeError("$expression: call target must be a $ref pointer");let d=(n?.callDepth??0)+1;if(d>jh)throw Error(`$expression: call depth exceeded (${jh})`);let p=Array.isArray(a)?a.map((m,b)=>Fe(m,t,r,n,Ke(s,["value",b]))):[];if(c.startsWith("window#/")){if(!Nh(c))throw Error(`$expression: "${c}" is not a blessed pure global`);let m=c.slice(8),b=KR.get(m);if(b)return b(...YR(m,p,t));let g=mt(globalThis.window,m),y=m.lastIndexOf("/"),v=y===-1?globalThis.window:mt(globalThis.window,m.slice(0,y));return g.apply(v,p)}let h=Ca(c,t,r,n);if(vt(h))return h.apply(ZR(c,t,r,n),p);if(F(h)&&"$expression"in h){let m=h,b={};for(let[g,y]of(m.parameters??[]).entries()){let v=N(y)?y:y?.name??"";if(!v)continue;b[v]=p[g]===void 0&&F(y)&&"default"in y?y.default:p[g]}return ir(m.$expression,t,r,{args:b,callDepth:d})}throw TypeError(`$expression: call target "${c}" is not callable`)}if(cu.has(i)){if(i==="?:"){let m=Fe(o,t,r,n,Ke(s,"target"));if(s){let b=Fe(a,t,r,n,Ke(s,"value")),g=Fe(l,t,r,n,Ke(s,"initial"));return m?b:g}return m?Fe(a,t,r,n):Fe(l,t,r,n)}let c=Fe(o,t,r,n,Ke(s,"target")),d=String(c),p=e.cases??{},h=Object.hasOwn(p,d);if(s){let m;for(let[g,y]of Object.entries(p)){let v=Fe(y,t,r,n,Ke(s,["cases",g]));if(g===d)m=v}let b=Fe(e.default,t,r,n,Ke(s,"default"));return h?m:b}return h?Fe(p[d],t,r,n):Fe(e.default,t,r,n)}if(au.has(i)){let c=Fe(o,t,r,n,Ke(s,"target")),d=Fe(a,t,r,n,Ke(s,"value"));switch(i){case"===":return c===d;case"!==":return c!==d;case"&&":return c&&d;case"||":return c||d;case"??":return c??d;default:return kh(i,c,d)}}if(Ch.has(i)){let c=Fe(a,t,r,n,Ke(s,"value")),{obj:d,key:p}=QR(o.$ref,t,r,n);d[p]=i==="="?c:kh(i.slice(0,-1),d[p],c);return}if(Th.has(i)){let c=Fe(o,t,r,n,Ke(s,"target"));switch(i){case"push":return c.push(Fe(a,t,r,n,Ke(s,"value")));case"unshift":return c.unshift(Fe(a,t,r,n,Ke(s,"value")));case"pop":return c.pop();case"shift":return c.shift();case"splice":{let d=Fe(a,t,r,n,Ke(s,"value"));return c.splice(...d)}default:break}}if(uu.has(i)){let c=Fe(o,t,r,n,Ke(s,"target")),d=a===void 0?[]:Array.isArray(a)?Ih(a,t,r,n,Ke(s,"value")):[Fe(a,t,r,n,Ke(s,"value"))],p=mt(c,i);if(!vt(p))return;return p.apply(c,d)}if(lu.has(i)){let c=Fe(o,t,r,n,Ke(s,"target")),d=a;if(i==="reduce"){let p=Fe(l,t,r,n,Ke(s,"initial"));for(let[h,m]of c.entries())p=ir(d,t,r,{acc:p,index:h,item:m},h===0?Ke(s,"value"):void 0);return p}if(i==="map")return c.map((p,h)=>ir(d,t,r,{...n,index:h,item:p},h===0?Ke(s,"value"):void 0));if(i==="filter")return c.filter((p,h)=>ir(d,t,r,{...n,index:h,item:p},h===0?Ke(s,"value"):void 0))}return}function Ze(e,t){if(e===null)return"null";if(e===void 0)return"undefined";if(Ah(e))return Ot(e,t);if(to(e))return du(e.$ref,t);if(Array.isArray(e))return e.map((r)=>Ze(r,t)).join(", ");return JSON.stringify(e)}function tA(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function du(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 Pe("_args",e.slice(6));if(e.startsWith("event#/"))return Pe(n,e.slice(7));if(e.startsWith("$map/")){let s=e.split("/"),[,i]=s;if(i==="item")return s.length>2?Pe("_item",s.slice(2).join("/")):"_item";if(i==="index")return"_index";return`_${i}`}if(e.startsWith("#/state/"))return Pe(r,e.slice(8));if(e.startsWith("parent#/"))return Pe(r,e.slice(8));if(e.startsWith("window#/"))return Pe("window",e.slice(8));if(e.startsWith("document#/"))return Pe("document",e.slice(10));return Pe(r,e)}function Rh(e,t){if(to(e))return du(e.$ref,t);return Ze(e,t)}function rA(e,t,r){let n=(o)=>t[o]??"undefined",s=`(${r.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(Ir)})`,i=JSON.stringify(tu);switch(e){case"Intl/formatNumber":return`new Intl.NumberFormat(${n(1)} ?? ${s}, ${n(2)}).format(${n(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${n(1)} ?? ${s}, {timeZone: ${i}, ...${n(2)}}).format(new Date(${n(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${n(2)} ?? ${s}, ${n(3)}).format(${n(0)}, ${n(1)})`;case"Intl/formatList":return`new Intl.ListFormat(${n(1)} ?? ${s}, ${n(2)}).format(${n(0)})`;case"Intl/plural":return`new Intl.PluralRules(${n(1)} ?? ${s}, ${n(2)}).select(${n(0)})`;case"Intl/compare":return`new Intl.Collator(${n(2)} ?? ${s}, ${n(3)}).compare(${n(0)}, ${n(1)})`;case"Intl/displayName":return`new Intl.DisplayNames(${n(2)} ?? ${s}, {...${n(3)}, type: ${n(1)} ?? 'language'}).of(${n(0)})`;case"Intl/segment":return`[...new Intl.Segmenter(${n(2)} ?? ${s}, {granularity: ${n(1)} ?? 'grapheme'}).segment(${n(0)})].map((p) => p.segment)`;default:return null}}function Ot(e,t={}){let{operator:r,target:n,value:s,initial:i}=e;if(ou.has(r)&&!("value"in e)){let o=Ze(n,t);if(r==="!")return`!(${o})`;if(r==="-")return`-(${o})`}if(r==="call"){let o=(to(n)?n.$ref:void 0)??"",a=Array.isArray(s)?s.map((l)=>Ze(l,t)):[];if(o.startsWith("window#/")){if(!Nh(o))throw Error(`$expression: "${o}" is not a blessed pure global`);let l=rA(o.slice(8),a,t);if(l)return l;return`window.${o.slice(8).replaceAll("/",".")}(${a.join(", ")})`}if(o.startsWith("#/state/")){let l=o.slice(8),c=t.formulaParams?.[l];if(c){let d=c.map((p,h)=>`${JSON.stringify(p)}: ${a[h]??"undefined"}`).join(", ");return`${tA(l)}(${t.statePrefix??"state"}, { ${d} })`}}return`${du(o,t)}(${a.join(", ")})`}if(cu.has(r)){if(r==="?:"){let c=Ze(n,t),d=Ze(s,t),p=Ze(i,t);return`(${c} ? ${d} : ${p})`}let o=Ze(n,t),a=Object.entries(e.cases??{}).map(([c,d])=>`_d === ${JSON.stringify(c)} ? ${Ze(d,t)} : `).join(""),l="default"in e?Ze(e.default,t):"undefined";return`((_d) => ${a}${l})(String(${o}))`}if(au.has(r)){let o=Ze(n,t),a=Ze(s,t);return`(${o} ${r} ${a})`}if(Ch.has(r)){let o=Rh(n,t),a=Ze(s,t);return`${o} ${r} ${a}`}if(Th.has(r)){let o=Rh(n,t);switch(r){case"push":return`${o}.push(${Ze(s,t)})`;case"unshift":return`${o}.unshift(${Ze(s,t)})`;case"pop":return`${o}.pop()`;case"shift":return`${o}.shift()`;case"splice":{let a=Array.isArray(s)?s.map((l)=>Ze(l,t)).join(", "):Ze(s,t);return`${o}.splice(${a})`}default:break}}if(uu.has(r)){let o=Ze(n,t),a=s===void 0?"":Array.isArray(s)?s.map((l)=>Ze(l,t)).join(", "):Ze(s,t);return`(${o})?.${r}?.(${a})`}if(lu.has(r)){let o=Ze(n,t),a=Ot(s,t);if(r==="reduce"){let l=Ze(i,t);return`${o}.reduce((_acc, _item, _index) => ${a}, ${l})`}if(r==="map")return`${o}.map((_item, _index) => ${a})`;if(r==="filter")return`${o}.filter((_item, _index) => ${a})`}return"undefined"}function Vs(e,t,r,n){return Fe(e,t,r,n)}function fn(e,t={}){return Ze(e,t)}var Oh,ou,au,Ch,Th,lu,cu,uu,zR,GR,KR,jh=64,XR=64;var ro=q(()=>{nu();ve();Hs();Oh=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),ou=new Set(["!","-"]),au=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Ch=new Set(["=","+=","-=","*=","/="]),Th=new Set(["push","pop","shift","unshift","splice"]),lu=new Set(["reduce","map","filter"]),cu=new Set(["?:","switch"]),uu=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"]),zR=new Set([...Oh,...ou,...au,...lu,...cu,...uu,"call"]),GR=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",...ru]),KR=new Map([["Intl/compare",(e,t,r,n)=>new Intl.Collator(r??Ir,n).compare(e,t)],["Intl/displayName",(e,t,r,n)=>new Intl.DisplayNames(r??Ir,{...n,type:t??"language"}).of(e)],["Intl/formatDate",(e,t,r)=>new Intl.DateTimeFormat(t??Ir,{timeZone:tu,...r}).format(new Date(e))],["Intl/formatList",(e,t,r)=>new Intl.ListFormat(t??Ir,r).format(e)],["Intl/formatNumber",(e,t,r)=>new Intl.NumberFormat(t??Ir,r).format(e)],["Intl/formatRelativeTime",(e,t,r,n)=>new Intl.RelativeTimeFormat(r??Ir,n).format(e,t)],["Intl/plural",(e,t,r)=>new Intl.PluralRules(t??Ir,r).select(e)],["Intl/segment",(e,t,r)=>[...new Intl.Segmenter(r??Ir,{granularity:t??"grapheme"}).segment(e)].map((n)=>n.segment)]])});function Mh(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 nA(e){return(F(e)||vt(e))&&"then"in e&&vt(e.then)}async function Ws(e,t,r,n={}){let s=n.args?{args:n.args}:void 0;for(let i of e){let o=Mh(i);switch(o.kind){case"expression":{let a=ir(o.node,t,r,s);if(nA(a))await a;break}case"if":{let a=o.node,l=Vs(a.if,t,r,s)?a.then:a.else;if(Array.isArray(l))await Ws(l,t,r,n);break}case"switch":{let a=o.node,l=String(Vs(a.$switch,t,r,s)),c=a.cases??{},d=Object.hasOwn(c,l)?c[l]:a.default;if(Array.isArray(d))await Ws(d,t,r,n);break}case"dispatch":{let a=o.node,l=vt(n.target)?n.target():n.target,c=r?.currentTarget??l;if(!c)break;let d={};if("detail"in a)d.detail=Vs(a.detail,t,r,s);if(a.bubbles!==void 0)d.bubbles=a.bubbles;if(a.composed!==void 0)d.composed=a.composed;c.dispatchEvent(new CustomEvent(a.dispatchEvent,d));break}case"stopPropagation":{r?.stopPropagation();break}case"preventDefault":{r?.preventDefault();break}default:break}}}function fr(e,t={}){let r=t.indent??"",n=[];for(let s of e){let i=Mh(s);switch(i.kind){case"expression":{n.push(`${r}${Ot(i.node,t)};`);break}case"if":{let o=i.node,a=fn(o.if,t),l={...t,indent:`${r} `};if(n.push(`${r}if (${a}) {`,fr(o.then??[],l)),o.else)n.push(`${r}} else {`,fr(o.else,l));n.push(`${r}}`);break}case"switch":{let o=i.node,a=fn(o.$switch,t),l={...t,indent:`${r} `};n.push(`${r}switch (String(${a})) {`);for(let[c,d]of Object.entries(o.cases??{}))n.push(`${r} case ${JSON.stringify(c)}: {`,fr(d,l),`${r} break;`,`${r} }`);if(o.default)n.push(`${r} default: {`,fr(o.default,l),`${r} }`);n.push(`${r}}`);break}case"dispatch":{let o=i.node,a=t.eventParam??"event",l=t.dispatchTarget??`(${a} && ${a}.currentTarget)`,c=[];if("detail"in o)c.push(`detail: ${fn(o.detail,t)}`);if(o.bubbles!==void 0)c.push(`bubbles: ${JSON.stringify(o.bubbles)}`);if(o.composed!==void 0)c.push(`composed: ${JSON.stringify(o.composed)}`);let d=c.length>0?`, { ${c.join(", ")} }`:"";n.push(`${r}${l}?.dispatchEvent(new CustomEvent(${JSON.stringify(o.dispatchEvent)}${d}));`);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 Ta=q(()=>{ve();ro()});function Bs(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 Dh(){return[...Jh].toSorted()}function gs(e,t){let r=e.toLowerCase();if(r.startsWith("aria-")||Jh.has(r))return String(t);return t?"":null}var pn,Jh,fu=32,Na,Ia="jx-slot",no="data-jx-slots",pu="jx.slot.group",Vz;var Us=q(()=>{eo();ro();Hs();ve();nr();Ta();eo();pn=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"]),Jh=new Set(["contenteditable","draggable","spellcheck"]);Na=/^[\t\n\f\r ]+$/u,Vz=(()=>{let e=Symbol.for(pu),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function Lh(e,t,r,n,s=iA){let i=[],o=(p,h)=>{let m={mediaQueries:t,scope:h,transposeValue:r};if(n)m.resolveValue=(b,g)=>n(b,g,h);for(let b of qs(p,m))i.push(b.text)},a={},l={},c=[],d=[];for(let[p,h]of Object.entries(e)){if(F(h)&&!Array.isArray(h)){if(p.startsWith("@"))c.push([p,h]);else if(!p.startsWith("--"))d.push([p,h]);continue}if(On(p)||p.startsWith("@"))continue;if(p.startsWith("--")||p==="colorScheme"||p==="color-scheme")a[p]=h;else l[p]=h}o(a,s.root),o(l,s.body);for(let[p,h]of d)if(p.startsWith("&"))o({[p]:h},s.root);else o(h,p);for(let[p,h]of c){if(Xi(p)||Qi(p)){o({[p]:h},null);continue}let m={},b={},g=[];for(let[y,v]of Object.entries(h)){if(F(v)&&!Array.isArray(v)){if(!y.startsWith("@"))g.push([y,v]);continue}if(y.startsWith("--"))m[y]=v;else b[y]=v}o({[p]:m},s.root),o({[p]:b},s.body);for(let[y,v]of g)o({[p]:v},y)}if(Object.values(t).some((p)=>wr(p)!==null)&&!("colorScheme"in e))i.push(`${s.root} { color-scheme: light dark }`,`${s.root}:where([${vr}="light"]) { color-scheme: light }`,`${s.root}:where([${vr}="dark"]) { color-scheme: dark }`);return i.join(`
76
+ `)}var iA;var Fh=q(()=>{eo();ve();iA={body:"body",root:":root"}});function qh(e){return e===!1||e==="open"||e==="closed"}function ys(e,t){let r=e?.$shadow;if(qh(r))return r===!1?null:r;let n=t?.shadow;return qh(n)&&n!==!1?n:null}function Hh(e,t){return t===null?e:":host"}function io(e,t){let r=[];for(let[n,s]of(e.parameters??[]).entries()){let i=Vh(s);if(!i)continue;let o=Wh(s)?`_a[${n}] === undefined ? ${JSON.stringify(s.default)} : _a[${n}]`:`_a[${n}]`;r.push(`${JSON.stringify(i)}: ${o}`)}return`(..._a) => { const _args = { ${r.join(", ")} }; return ${t}; }`}function Vh(e){return N(e)?e:e?.name??""}function Wh(e){return F(e)&&"default"in e}function Da(e,t){let r=bu(e,t);return r===e?e:`${r} as ${e}`}function bu(e,t){let r=t?.$export;return N(r)&&r!==""?r:e}function La(e,t,r={}){let{statePrefix:n="state",indent:s="",collect:i}=r,{url:o}=t,a=pe(o),l=t.method??"GET";if(t.manual)return`${s}// ${e}: manual Request — fetch triggered by user action`;let c=[`// ${e}: auto-fetch from ${a?"(dynamic URL)":o}`,i?`${i}.push(effect(() => {`:"effect(() => {"];if(a)c.push(` const url = \`${aA(o,n)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else c.push(` const url = ${JSON.stringify(o)};`);let d=[];if(l!=="GET")d.push(`method: ${JSON.stringify(l)}`);if(t.headers)d.push(`headers: ${JSON.stringify(t.headers)}`);if(t.body){let h=F(t.body)?JSON.stringify(JSON.stringify(t.body)):JSON.stringify(t.body);d.push(`body: ${h}`)}let p=d.length>0?`, { ${d.join(", ")} }`:"";return c.push(` fetch(url${p})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${n}.${e} = d; })`,` .catch(e => { ${n}.${e} = { error: String(e) }; });`,i?"}));":"});"),c.map((h)=>`${s}${h}`).join(`
77
+ `)}function Fa(e,t,r={}){let{statePrefix:n="state",indent:s="",collect:i,serverBaseUrl:o="/_jx/server"}=r,a=JSON.stringify(`${o}/${t.$export}`),l=Object.entries(t.arguments??{}),c=l.map(([g,y])=>{if(!Ce(y))return`${un(g)}: ${JSON.stringify(y)}`;if(oA.some((v)=>y.$ref.startsWith(v)))throw Error(`Server function "${e}": argument "${g}" references "${y.$ref}", which a state entry cannot read. Use a #/state/, parent#/, window#/ or document#/ reference.`);return`${un(g)}: ${fn({$ref:y.$ref},{statePrefix:n})}`}),d=l.some(([,g])=>Ce(g)),p=`${Xh}(${a}, ${c.length>0?`{ ${c.join(", ")} }`:"{}"})`,h=Pe(n,dt(e)),m=`console.error(${JSON.stringify(`Jx server function ${t.$export}:`)}, e)`;return(d?[`// ${e}: server function ${t.$export}, called again when an argument changes`,"{"," let _jxSeq = 0;",i?` ${i}.push(effect(() => {`:" effect(() => {"," const _seq = ++_jxSeq;",` ${p}`,` .then((d) => { if (_seq === _jxSeq) ${h} = d; })`,` .catch((e) => { if (_seq === _jxSeq) ${m}; });`,i?" }));":" });","}"]:[`// ${e}: server function ${t.$export}, called once`,p,` .then((d) => { ${h} = d; })`,` .catch((e) => { ${m}; });`]).map((g)=>`${s}${g}`).join(`
78
+ `)}function aA(e,t){if(t==="state")return e;return e.replaceAll(/\$\{([^}]*)\}/g,(r,n)=>`\${${n.replaceAll(/(?<!this\.)\bstate\./g,`${t}.`)}}`)}function qa(e){if(!F(e))return!1;if(e.state)for(let[t,r]of Object.entries(e.state)){if(t==="$site"||t==="$page")continue;if(!F(r)||Array.isArray(r))return!0;if(r.timing==="compiler")continue;if(r.$prototype)return!0;if("default"in r)return!0;if(_n(r))continue;return!0}if(e.$switch)return!0;if(Qe(e)||jc(e.children))return!0;if(Array.isArray(e.children)&&e.children.some((t)=>qa(t)))return!0;for(let[t,r]of Object.entries(e)){if(pn.has(t))continue;if(Ce(r))return!0;if(pe(r))return!0}if(F(e.style)){for(let t of Object.values(e.style))if(pe(t))return!0}if(F(e.attributes)){for(let t of Object.values(e.attributes))if(pe(t))return!0}return!1}function Uh(e){if(!F(e))return!1;if(e.$switch)return!0;if(Qe(e)||jc(e.children))return!0;for(let[t,r]of Object.entries(e)){if(pn.has(t))continue;if(Ce(r))return!0;if(pe(r))return!0}if(F(e.style)){for(let t of Object.values(e.style))if(pe(t))return!0}if(F(e.attributes)){for(let t of Object.values(e.attributes))if(pe(t))return!0}return!1}function Xs(e,t=null,r={},n={}){let s=e?.state?zs(e.state,t):t??zh();return{media:n,scope:s,scopeDefs:r}}function zh(e=null){return Object.create(e)}function Gh(e){return e[Bh]}function gu(e,t){if(N(e)){for(let i of e.matchAll(lA))t.add(i[1]);for(let i of e.matchAll(cA))t.add(i[1]);return}if(Array.isArray(e)){for(let i of e)gu(i,t);return}if(!F(e))return;let r=e,{operator:n,target:s}=r;if(N(n)&&dn(n)&&Ce(s)&&s.$ref.startsWith("#/state/"))t.add(s.$ref.slice(8).split("/")[0]);for(let i of Object.values(r))gu(i,t)}function zs(e={},t=null){let r=zh(t),n=t?Gh(t):void 0,s=new Set(n);Object.defineProperty(r,Bh,{configurable:!0,enumerable:!1,value:s,writable:!0});let i=new Set;for(let c of Object.values(e))if(er(c)||tr(c))gu(c.body??c.$expression,i);for(let c of i)if(c in e)s.add(c);for(let[c,d]of Object.entries(e)){if(!F(d)||Array.isArray(d)){mn(r,c,Ma(d));continue}if("default"in d){mn(r,c,Ma(d.default));continue}if(rn(d)){s.add(c);continue}if(!d.$prototype&&!("$expression"in d)&&!_n(d))mn(r,c,Ma(d))}let o=[],a=[];for(let[c,d]of Object.entries(e)){if(pe(d)){o.push([c,d]);continue}if(!F(d))continue;if(tr(d)){let p=d.$expression;if(rs(d)){let h=d.parameters;mn(r,c,(...m)=>{let b={};for(let[g,y]of h.entries()){let v=Vh(y);if(!v)continue;b[v]=m[g]===void 0&&Wh(y)?y.default:m[g]}return ir(p,r,null,{args:b})})}else if(dn(p.operator))mn(r,c,(h,m)=>ir(p,h,m));else mu(r,c,()=>ir(p,r,null));continue}if(er(d)){if(En(d)){let{body:p}=d;mn(r,c,(h,m)=>{Ws(p,h??r,m??null)})}else if(N(d.body)){let p=d.parameters?nn(d.parameters):d.arguments??[],{body:h}=d,m=p.includes("state")?p:["state",...p],b=Function(...m,h),g=(y,v)=>b(...m.map((j)=>j==="state"?y:v));if(ns(h))mu(r,c,()=>g(r)),a.push([c,h]);else mn(r,c,g)}else mn(r,c,()=>{}),s.add(c);continue}if(Cr(d)&&(d.$prototype==="LocalStorage"||d.$prototype==="SessionStorage")){mn(r,c,Ma(d.default??null));continue}if(Cr(d)&&d.$prototype==="Request")s.add(c)}let l=!0;while(l){l=!1;for(let[c,d]of[...a,...o])if(!s.has(c)&&Kh(d,r))s.add(c),l=!0}for(let[c,d]of o)mu(r,c,()=>wt(d,r));return r}function mn(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}function mu(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:r})}function Me(e,t){if(Ce(e))return xu(e.$ref,t);if(pe(e))return wt(e,t);return e}function Wt(e){return Ce(e)}function xu(e,t){if(!N(e))return e;if(e.startsWith("$map/")){let r=e.split("/"),n=r[1],i=t.$map?.[n]??t[`$map/${n}`];return r.length>2?hu(i,r.slice(2).join("/")):i}if(e.startsWith("#/state/"))return hu(t,e.slice(8));return hu(t,e)??null}function Kh(e,t){if(!t)return!1;let r=Gh(t);for(let n of e.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(n[2])continue;let s=n[1];if(r?.has(s))return!0;let i;try{i=t[s]}catch{continue}if(vt(i))return!0}return!1}function Ha(e){return Bs(e)?`(${e.slice(2,-1)})`:`\`${e}\``}function wt(e,t){if(Kh(e,t))return null;let r=["state","$map","$site","$page"],n=[t,t?.$map,t?.$site,t?.$page];try{let s=Bs(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function(...r,s)(...n)}catch{return null}}function hu(e,t){return mt(e,t)}function Ma(e){if(!F(e))return e;return structuredClone(e)}function uA(e,t){if(!e||!t)return"";return Object.entries(e).filter(([r,n])=>!r.startsWith(":")&&!r.startsWith(".")&&!r.startsWith("&")&&!r.startsWith("[")&&!r.startsWith("@")&&pe(n)).map(([r,n])=>{let s=Me(n,t);return s==null?null:`${Vt(r)}: ${s}`}).filter(Boolean).join("; ")}function bs(e,t,r=""){let n="",s=Me(e.id,t),i=Me(e.className,t),o=Me(e.hidden,t),a=Me(e.tabIndex,t),l=Me(e.title,t),c=Me(e.lang,t),d=Me(e.dir,t);if(s)n+=` id="${$e(String(s))}"`;if(i)n+=` class="${$e(String(i))}"`;if(o)n+=" hidden";if(a!==void 0&&a!==null)n+=` tabindex="${$e(String(a))}"`;if(l)n+=` title="${$e(String(l))}"`;if(c)n+=` lang="${$e(String(c))}"`;if(d)n+=` dir="${$e(String(d))}"`;let p=[uA(e.style,t),r].filter(Boolean).join("; ");if(p)n+=` style="${$e(p)}"`;if(e.attributes)for(let[h,m]of Object.entries(e.attributes)){let b=Me(m,t);if($t(b)){let g=gs(h,b);if(g!==null)n+=g===""?` ${h}`:` ${h}="${$e(g)}"`;continue}if(N(b)||lr(b))n+=` ${h}="${$e(String(b))}"`}if(e.$static)n+=" data-jx-static";else if(e.$prerendered)n+=" data-jx-prerendered";return n}function oo(e,t=" "){return e?"":`
79
+ ${t}`}function Zs(){let e=JSON.stringify(Oa),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 Ja(e,t,r,n){for(let s of qs(t,{mediaQueries:n,resolveValue:(i,o)=>Yh(i,o,r),scope:r}))e.push(s.text)}function Yh(e,t,r){let n=N(t)?t:t.$ref;return dA.push({property:e,selector:r,source:n}),null}function Va(){return`const __jxEnumAttrs = new Set(${JSON.stringify(Dh())});
80
+ function ${Qs}(n, v) {
80
81
  if (typeof v !== 'boolean') return v;
81
82
  const l = n.toLowerCase();
82
83
  if (l.startsWith('aria-') || __jxEnumAttrs.has(l)) return String(v);
83
84
  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>
86
- ${tl(n.join(`
85
+ }`}function Wa(){return[`async function ${Xh}(url, args) {`," const r = await fetch(url, {"," method: 'POST',"," headers: { 'Content-Type': 'application/json' },"," body: JSON.stringify(args),"," });"," const text = await r.text();"," let body = null;"," if (text !== '') {"," try { body = JSON.parse(text); } catch (e) { if (r.ok) throw e; }"," }"," if (!r.ok) throw new Error((body && body.error) || text || r.statusText);"," return body;","}"].join(`
86
+ `)}function Zh(){let e=`new RegExp(${JSON.stringify(Na.source)}, ${JSON.stringify(Na.flags)})`,t=`Symbol.for(${JSON.stringify(pu)})`,r=JSON.stringify(no),n=JSON.stringify(Ia);return[`const __jxSlotWs = ${e};`,`const __jxSlotRec = globalThis[${t}] || (globalThis[${t}] = new WeakMap());`,`function ${$u}(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 ${vu}(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(`
87
+ `)}function Cn(e){for(let t of wu(e)){if(Qe(t)){if(t.map&&Cn([t.map]))return!0;continue}if(!Ft(t))continue;if(t.tagName==="slot")return!0;let r=Object.values(t.cases??{}).filter((n)=>Ft(n)&&!Wt(n));if(Cn(r)||Cn(t.children))return!0}return!1}function wu(e){if(Qe(e))return[e];if(!Array.isArray(e))return[];return e}function ti(e,t={},r=null){let n=[],s=Lh(F(r)?r:{},t,(o)=>o,Yh);if(s!=="")n.push(s);if(Tn(e,n,t,"",{n:0}),n.length===0)return"";return`<style>
88
+ ${Ba(n.join(`
87
89
  `))}
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(`
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(`
90
+ </style>`}function Ba(e){return e.replaceAll(/<\/(?=style)/gi,String.raw`<\/`)}function Tn(e,t,r,n="",s,i="jx"){let o=s??{n:0};if(!F(e))return;if(e.style&&!e.id&&!e.className)e.className=`${i}-${o.n}`,o.n+=1;let a=Ms(e.tagName).join(", ")||"*",l=e.id?`#${e.id}`:e.className?`.${e.className.split(" ")[0]}`:a;if(e.style)Ja(t,e.style,l,r);if(Array.isArray(e.children))for(let c of e.children)Tn(c,t,r,l,o,i);if(F(e.cases))for(let c of Object.values(e.cases))Tn(c,t,r,l,o,i)}function $e(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Ua(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function Qh(e){let t=[];return eg(e,t),t}function eg(e,t){if(!F(e))return;if(e.state){for(let[r,n]of Object.entries(e.state))if(rn(n))t.push({exportName:n.$export,key:r,src:n.$src})}if(Array.isArray(e.children))for(let r of e.children)eg(r,t)}function Eu(e,t){if(N(e))return e;let r=Ms(e);if(r.length===0)return"div";if(!Tr(e))return r[0];let n=e.$expression,s=n.target;if(n.operator==="?:")return Me(s,t)?n.value:n.initial;let i=Me(s,t);return n.cases[String(i)]??n.default}function _u(e){if(!e?.slotIds)return null;return e.slotIds.n+=1,e.slotIds.n}function Pu(e,t,r,n=null){let s=new Map;for(let i of wu(e)){let o="",a=!0,l;if(N(i)||lr(i)||$t(i)){if(l=r(i),Na.test(l))continue;a=l!==""}else if(Qe(i))l="";else if(!Ft(i))l=r(i),a=l!=="";else{let d=Me(i.attributes?.slot,t),p=N(i.slot)?Me(i.slot,t):null;if(N(d)&&d!=="")o=d,l=r(i);else if(N(p)&&p!==""){o=p;let{slot:h,...m}=i;l=r({...m,attributes:{...m.attributes,slot:p}})}else l=r(i)}let c=s.get(o);if(c)c.html=c.html===""?l:`${c.html}
91
+ ${l}`,c.content||=a;else s.set(o,{content:a,html:l})}return{groups:s,id:n,taken:new Set}}function tg(e,t,r){for(let n of wu(e)){if(Qe(n)||!Ft(n))continue;if(n.tagName==="slot"){let s=Me(n.attributes?.name,t);r.taken.add(N(s)?s:"")}tg(n.children,t,r)}}function ju(e){let t=null,r={};for(let[n,s]of Object.entries(e??{}))if(n.startsWith("props.")&&n.length>6)t??={},t[n.slice(6)]=s;else r[n]=s;return{lifted:t,rest:r}}function za(e,t){if(!t)return zs(e.state??{},null);let r={...e.state};for(let[n,s]of Object.entries(t)){let i=r[n];r[n]=F(i)&&!Array.isArray(i)&&"default"in i?{...i,default:s}:s}return zs(r,null)}function ku(e,t){return Object.fromEntries(Object.entries(e??{}).flatMap(([r,n])=>{if(!pe(n))return[];let s=Me(n,t);return s==null?[]:[[r,s]]}))}function so(e,t,r,n){if(e.textContent!==void 0){let s=Me(e.textContent,t);return s!=null?$e(String(s)):""}if(e.innerHTML){let s=Me(e.innerHTML,t);return s!=null?String(s):e.innerHTML}if(Array.isArray(e.children))return e.children.map((s)=>Gs(s,t,r,n)).join(`
92
+ `);return""}function Gs(e,t,r=null,n=null){if(N(e)){if(pe(e)&&t){let a=wt(e,t);return a!=null?$e(String(a)):$e(e)}return $e(e)}if(lr(e)||$t(e))return $e(String(e));if(Array.isArray(e))return e.map((a)=>Gs(a,t,r,n)).join(`
93
+ `);if(!F(e))return"";if(e.$prototype==="Array")return"";if(e.$switch){let a=e.tagName??"div",l=bs(e,t),c=Me(e.$switch,t),d=c==null?void 0:e.cases?.[String(c)],p=d!==void 0&&!Wt(d)?Gs(d,t,r,n):"";return`<${a}${l}>${p}</${a}>`}let s=Eu(e.tagName,t);if(s==="slot"&&r){let a=Me(e.attributes?.name,t),l=N(a)?a:"",c;if(!r.taken.has(l))r.taken.add(l),c=r.groups.get(l);let d=c?.html??"";if(d!==""&&r.id!==null)d=`<!--${Ia} ${r.id} ${encodeURIComponent(l)}-->${d}<!--/${Ia} ${r.id}-->`;if(c?.content)return tg(e.children,t,r),d;let p=so(e,t,r,n);return d===""?p:p===""?d:`${d}
94
+ ${p}`}let i=n?.componentDefs.get(s);if(i&&n)return fA(e,i,t,r,n);let o=bs(e,t);if(Su.has(s))return`<${s}${o}>`;return`<${s}${o}>${so(e,t,r,n)}</${s}>`}function fA(e,t,r,n,s){let i=t.tagName,{lifted:o,rest:a}=ju(e.attributes),l={...o,...e.$props},c={};for(let[k,I]of Object.entries(l))c[k]=Me(I,r)??I;let d=Object.keys(c).length>0,p=s.path??[],h={key:JSON.stringify(c),tag:i},m=[...p.map((k)=>k.tag),i].join(" → ");if(p.some((k)=>k.tag===h.tag&&k.key===h.key))throw Error(`Component <${i}> renders itself: ${m}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(p.length>=fu)throw Error(`Component nesting exceeds ${fu} levels: ${m}. A component that renders itself with changing props needs a case that stops.`);let b={...s,path:[...p,h]},{children:g}=e,y=(k)=>Gs(k,r,n,s),v=ys(t,s.defaults),j=Ga(t),S=za(t,d?c:null),P,E=null;if(v){let k=Array.isArray(g)?g.map((I)=>y(I)).join(`
95
+ `):"";P=`<template shadowrootmode="${v}"><link rel="stylesheet" href="/components/${i}.css">${so(t,S,null,b)}</template>${k}`}else{E=!j&&Cn(t.children)?_u(s):null;let k=Pu(g,r,y,E);P=so(t,S,k,b)}let O=Object.entries(ku(t.style,S)).map(([k,I])=>`${Vt(k)}: ${I}`).join("; "),R={...e};if(delete R.$props,delete R.children,R.attributes=!j&&d?{...a,"data-jx-props":JSON.stringify(c)}:a,E!==null)R.attributes={...R.attributes,[no]:String(E)};if(j)R.$static=!0;else R.$prerendered=!0;return`<${i}${bs(R,r,O)}>${P}</${i}>`}function rg(e,t=null,r=null,n=null){return so(e,za(e,t),r,n)}function Ga(e){return yu(e)}function yu(e){if(!F(e))return!0;if(Array.isArray(e))return e.every((t)=>yu(t));if(e.$prototype)return!1;if(e.$ref)return!1;if(e.state)for(let t of Object.values(e.state)){if(!F(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)=>yu(t));if(Qe(e.children))return!1;return!0}function mA(e,t){return Zi(e).map((r)=>hA(r,t)).join(", ")}function hA(e,t){let r=Aa(e,t);if(r!==null)return r;if(e.startsWith(":host")){let n=/^:host\((.*)\)$/.exec(e)?.[1];if(t===":host")return e;return n===void 0?t:`${t}${n}`}if(t===":host"&&pA.test(e))return e;return`${t}${e}`}function ng(e,t,r=null,n={},s=null){let i=[],o=Hh(e,s);if(F(t)){let a={},l=[];for(let[c,d]of Object.entries(t))if(Ce(d))a[c]=d;else if(F(d)&&!Array.isArray(d))l.push([c,d]);else if(!c.startsWith("@")&&!On(c))a[c]=d;Ja(i,a,o,n);for(let[c,d]of l)if(c.startsWith("@"))Ja(i,{[c]:d},o,n);else if(On(c))Ja(i,d,mA(c,o),n)}if(r&&Array.isArray(r.children)){let a={n:0};for(let l of r.children)Tn(l,i,n,"",a,e)}return i.length>0?`${i.join(`
94
96
  `)}
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(`
97
+ `:""}var oA,Bh,Ks="https://esm.sh/@vue/reactivity@3.5.40",Ys="https://esm.sh/lit-html@3.3.0",lA,cA,Nn,dA,Qs="__jxAttrText",Xh="__jxServerCall",$u="__jxCaptureSlotted",vu="__jxDistributeSlots",ei="<!---->",Su,pA;var Mr=q(()=>{Us();eo();ro();Ta();Fh();ve();Hs();Us();ro();Ta();ve();oA=["$map/","event#/","$args/","$reduce/"];Bh=Symbol("jx.runtimeOnlyStateKeys");lA=/\bstate\.([A-Za-z_$][\w$]*)\s*(?:\+\+|--|(?:\*\*|\|\||&&|\?\?|<<|>>>|>>|[-+*/%&|^])?=(?!=))/g,cA=/\bstate\.([A-Za-z_$][\w$]*)\s*\.\s*(?:push|pop|shift|unshift|splice|sort|reverse|fill|copyWithin)\s*\(/g;Nn=new Set(["pre","textarea","listing","plaintext","xmp"]);dA=[];Su=new Set(["input","br","hr","img","meta","link","area","col","source"]);pA=/^(?:::slotted\(|::part\()/});import{relative as gA,sep as yA}from"node:path";function ao(e){return e===bA}function ri(e,t){if(e==="/")return"/";if(t==="always")return e.endsWith("/")?e:`${e}/`;if(t==="never")return e.replace(/\/+$/,"")||"/";return e}function Ka(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 sg(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(Ka(n,"name")?.trim().toLowerCase()!=="robots")continue;let s=new Set((Ka(n,"content")??"").toLowerCase().split(",").map((i)=>i.trim()));if(s.has("noindex")||s.has("none"))return!0}return!1}function ig(e){let t=e.search(/<\/head\s*>/i);return{end:t,head:t===-1?e:e.slice(0,t)}}function xA(e,t){let r=t.trim().toLowerCase();for(let[n]of ig(e).head.matchAll(/<link\b[^>]*>/gi)){let s=(Ka(n,"rel")??"").toLowerCase().split(/\s+/),i=(Ka(n,"type")??"").split(";")[0]?.trim().toLowerCase();if(s.includes("alternate")&&i===r)return!0}return!1}function og(e,t){let{end:r}=ig(e);if(r===-1||xA(e,t.type))return e;let n=`<link href="${$e(t.href)}" rel="alternate" type="${$e(t.type)}">`;return`${e.slice(0,r)}${n}
98
+ ${e.slice(r)}`}function ag(e,t){return new URL(`/${gA(e,t).split(yA).join("/")}`,"http://localhost").pathname}var bA="/404";var Ru=q(()=>{Mr()});function lg(e,t){if(t===null||t.routing!=="prefix-always")return[];let r=[];for(let n of e){if(n.urlPattern==="/")continue;let s=n.urlPattern.split("/").find(Boolean),i=dr(s);if(i===null||!t.locales.includes(i))r.push(n.urlPattern)}return r}function cg(e,t){if(t===null)return null;let r=e.split("/").find(Boolean),n=dr(r);if(r===void 0||n===null||t.locales.includes(n))return null;let s=t.locales.find((i)=>i!==n&&i.split("-")[0]===n.split("-")[0]);return s===void 0?null:{meant:s,segment:r}}function $A(e,t){let r=e.split("/").filter(Boolean),n=dr(r[0]);if(t!==null&&n!==null&&t.locales.includes(n))return r.slice(1).join("/");return r.join("/")}function Au(e,t){let r=new Map,n=[];if(t===null)return{conflicts:n,sets:r};let s=new Map,i=new Set;for(let o of e){let a=o.translationKey===void 0?$A(o.urlPattern,t):o.translationKey.replaceAll(/^\/+|\/+$/g,"");if(o.translationKey!==void 0)i.add(o.urlPattern);let l=Nr(o.urlPattern,t);if(l===null)continue;let c=s.get(a)??[],d=c.find((p)=>p.locale===l);if(d===void 0)c.push({locale:l,urlPattern:o.urlPattern});else n.push({declared:i.has(d.urlPattern)||o.translationKey!==void 0,key:a,locale:l,urlPatterns:[d.urlPattern,o.urlPattern]});s.set(a,c)}for(let o of s.values()){let a=o.toSorted((l,c)=>l.locale===c.locale?0:l.locale<c.locale?-1:1);for(let l of o)r.set(l.urlPattern,a)}return{conflicts:n,sets:r}}function ug(e,t,r,n){let s=new Map;if(t===null||r==="")return s;let i=new Map;for(let[o,a]of Au(e,t).sets){if(a.length<2)continue;let l=i.get(a);if(l===void 0){l=a.map((d)=>({href:Rn(ri(d.urlPattern,n),r),hreflang:d.locale}));let c=a.find((d)=>d.locale===t.defaultLocale);if(c!==void 0)l.push({href:Rn(ri(c.urlPattern,n),r),hreflang:"x-default"});i.set(a,l)}s.set(o,l)}return s}function dg({pageLang:e,pageDir:t,routeLocale:r,defaults:n}){let s=e??r??n?.lang??"en",i=t??n?.dir;if(i!==void 0)return{dir:i,lang:s};return Yi(s)==="rtl"?{dir:"rtl",lang:s}:{lang:s}}var Ou=q(()=>{nr();ms();Ru();ms();ms()});import{readFileSync as Cu,readdirSync as vA}from"node:fs";import{extname as fg,join as wA,relative as SA,resolve as EA}from"node:path";async function xs(e,t){let r=Cu(e,"utf8");if(e.endsWith(".json"))return Pn(r,e);let n=fg(e).toLowerCase(),s=t?.byExtension(n,"parse");if(!s)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 s.parseDocument(r)}async function pg(e,t){let r=new Map,n=new Map;for(let s of e){if(!n.has(s.sourcePath))n.set(s.sourcePath,await PA(s.sourcePath,t));let i=n.get(s.sourcePath);if(i!==null&&i!==void 0)r.set(s.urlPattern,_A(i,s._pathParams))}return r}function _A(e,t){if(!e.includes("${"))return e;return e.replaceAll(/\$\{(\w+)\}/g,(r,n)=>t?.[n]??r)}async function PA(e,t){if(!Cu(e,"utf8").includes("$translationKey"))return null;let r;try{r=await xs(e,t)}catch{return null}return N(r.$translationKey)&&r.$translationKey!==""?r.$translationKey:null}async function mg(e,t){let r=[],n=new Set([".json",...t?.documentExtensions("page")??[]]);return await hg(e,e,r,n,t),r.sort(gh),r}async function hg(e,t,r,n,s){let i=vA(e,{withFileTypes:!0});for(let o of i){let a=wA(e,o.name);if(o.isDirectory()){if(o.name.startsWith("_"))continue;await hg(a,t,r,n,s);continue}let l=fg(o.name).toLowerCase();if(!n.has(l))continue;if(o.name.startsWith("_"))continue;let c=SA(t,a);r.push(await jA(c,a,s))}}async function jA(e,t,r){let{isCatchAll:n,isDynamic:s,params:i,urlPattern:o}=hh(e),a=null;try{let c=(await xs(t,r)).$layout;if(N(c))a=c}catch{}return{$layout:a,isCatchAll:n,isDynamic:s,params:i,relativePath:e,sourcePath:t,urlPattern:o}}function kA(e){let t=e[gg];if(!ee(t))return null;let{mtime:r}=t;return N(r)&&r!==""?r:null}function RA(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 yg(e,t,r={},n,s,i){let o=[],a=e.flatMap((l)=>l.isDynamic?[l.urlPattern]:[]);for(let l of e){if(!l.isDynamic){o.push(l);continue}let c;try{c=await xs(l.sourcePath,n?.formats)}catch{o.push(l);continue}if(!c.$paths){console.warn(`Warning: dynamic route ${l.urlPattern} has no $paths — skipping`);continue}let d=await AA(c.$paths,t,r,n,s,Nr(l.urlPattern,i??null),l,a);for(let p of d){let h=l.urlPattern,m={};for(let[v,j]of Object.entries(p)){if(v===gg)continue;m[v]=String(j),h=h.replace(`:${v}`,m[v]),h=h.replace("*",m[v])}let b=RA(h);if(b!==null){console.warn(`Warning: $paths for ${l.urlPattern} produced "${h}", which ${b}; skipping it`);continue}let g=kA(p),y={...l,_pathParams:m,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:h};if(g!==null)y.sourceMtime=g;o.push(y)}}return o}async function AA(e,t,r,n,s,i,o,a){if(Array.isArray(e))return e;if("values"in e&&Array.isArray(e.values)){let l=N(e.param)?e.param:"value";return e.values.map((c)=>({[l]:c}))}if("$ref"in e&&N(e.$ref)&&e.$ref){let l=e.$ref,c=EA(t,l),d;try{d=JSON.parse(Cu(c,"utf8"))}catch(m){return console.warn(`Warning: $paths.$ref could not load "${l}": ${Ee(m)}`),[]}if(!Array.isArray(d))return console.warn(`Warning: $paths.$ref "${l}" must be a JSON array`),[];let p=N(e.param)?e.param:"id",h=N(e.field)?e.field:"id";return d.map((m)=>{if(m===null)throw TypeError(`$paths.$ref "${l}" contains a null entry`);return{[p]:(ee(m)?m[h]??m.id:void 0)??String(m)}})}for(let l of Object.keys(e)){let c=n?.byPathsDiscriminator(l);if(!c?.project)continue;let d={data:r[c.project.key],locale:i,projectConfig:s,root:t};if(o!==void 0)d.params=o.params,d.urlPattern=o.urlPattern;if(a!==void 0)d.patterns=a;return await c.call("resolvePaths",e,d)}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var gg="_meta";var bg=q(()=>{ve();rr();yh();Ou()});import{createHash as OA}from"node:crypto";function xg(){return{fontOrigins:new Set,frameOrigins:new Set,imgOrigins:new Set,scriptHashes:new Set,scriptOrigins:new Set,styleOrigins:new Set}}function $s(e,t){let r=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return r?.[2]??r?.[3]}function Tu(e){if(e===void 0||!/^https?:\/\//i.test(e))return null;try{return new URL(e).origin}catch{return null}}function LA(e){return`'sha256-${OA("sha256").update(e,"utf8").digest("base64")}'`}function $g(e,t){for(let r of e.matchAll(TA)){let n=r[1]??"",s=$s(n,"src"),i=($s(n,"type")??"").trim().toLowerCase();if(s!==void 0){let o=Tu(s);if(o)t.scriptOrigins.add(o);continue}if(CA.has(i))t.scriptHashes.add(LA(r[2]??""))}for(let r of e.matchAll(NA)){let n=r[1]??"",s=($s(n,"rel")??"").toLowerCase(),i=$s(n,"href"),o=Tu(i);if(!o)continue;if(s.includes("stylesheet"))t.styleOrigins.add(o);if(DA.test(i??"")||($s(n,"as")??"")==="font")t.fontOrigins.add(o)}for(let[r,n]of[[IA,t.imgOrigins],[MA,t.imgOrigins],[JA,t.frameOrigins]])for(let s of e.matchAll(r)){let i=s[1]??"";for(let o of[$s(i,"src"),...FA($s(i,"srcset"))]){let a=Tu(o);if(a)n.add(a)}}}function FA(e){return e===void 0?[]:e.split(",").map((t)=>t.trim().split(/\s+/)[0]??"").filter(Boolean)}function vg(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 wg(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 s=Object.entries(n).filter(([,o])=>o!==!1&&o!=="").toSorted(([o],[a])=>o<a?-1:1).map(([o,a])=>`${o} ${String(a)}`).join("; "),i=t.mode==="report-only"?{"Content-Security-Policy-Report-Only":s}:{"Content-Security-Policy":s};if(t.reportUri!==void 0&&t.reportUri!=="")i["Reporting-Endpoints"]=`csp-endpoint="${t.reportUri}"`;return i}var CA,TA,NA,IA,MA,JA,DA;var Nu=q(()=>{CA=new Set(["","module","importmap","text/javascript","module-shim"]),TA=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,NA=/<link\b([^>]*)>/gi,IA=/<img\b([^>]*)>/gi,MA=/<source\b([^>]*)>/gi,JA=/<iframe\b([^>]*)>/gi,DA=/\.(woff2?|ttf|otf|eot)(\?|#|$)/i});import{existsSync as Ya,readFileSync as qA,writeFileSync as Eg}from"node:fs";import{join as Xa}from"node:path";function _g(e,t){let r=e?.headers??{},n=[];if(r.enabled===!1)return{errors:n,rules:[]};let s=r.security??{},i={};if(s.contentTypeOptions!==!1)i["X-Content-Type-Options"]="nosniff";if(s.referrerPolicy!==!1)i["Referrer-Policy"]=s.referrerPolicy??"strict-origin-when-cross-origin";if(s.permissionsPolicy!==!1)i["Permissions-Policy"]=s.permissionsPolicy??"camera=(), microphone=(), geolocation=()";if(s.frameOptions!==!1)i["X-Frame-Options"]=s.frameOptions??"SAMEORIGIN";let{hsts:o}=s;if(o){let d=o===!0?{}:o,p=d.maxAge??Sg,h=d.includeSubDomains??!0,m=d.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 i["Strict-Transport-Security"]=[`max-age=${p}`,h?"includeSubDomains":null,m?"preload":null].filter(Boolean).join("; ")}let a=vg(s);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(i,wg(t,a));let l=r.cache??"auto";if(l==="auto")i["Cache-Control"]="public, max-age=0, must-revalidate";let c=[];if(Object.keys(i).length>0)c.push({headers:i,pattern:"/*"});if(l==="auto")c.push({headers:{"Cache-Control":`public, max-age=${Sg}, immutable`},pattern:HA});for(let[d,p]of Object.entries(r.rules??{}))c.push({headers:p,pattern:d});return{errors:n,rules:c}}function Pg(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,s]of t)if(Ya(Xa(e,n)))r.push({headers:{"Content-Type":s},pattern:`/${n}`});if(Ya(Xa(e,"feed","archive")))r.push({headers:{"Content-Type":"application/atom+xml; charset=utf-8"},pattern:"/feed/archive/*"});return r}function jg(e,t){if(t==="")return[...e];return e.map((r)=>({headers:r.headers,pattern:Ie(t,r.pattern)}))}function BA(e){let t=e.map((r)=>{let n=Object.entries(r.headers).map(([s,i])=>` ${s}: ${i}`);return[r.pattern,...n].join(`
99
+ `)});return`${[VA,"",...t].join(`
98
100
  `)}
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}
101
+ `}function kg(e,t){if(t.length===0)return 0;let r=Xa(e,"_headers"),n=Ya(r)?qA(r,"utf8").trim():"",s=BA(t),i=n===""?s:`${s}
102
+ ${WA}
101
103
  ${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}".
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}
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}
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
-
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,`
117
- `),c=a===""?[]:(a.endsWith(`
118
- `)?a.slice(0,-1):a).split(`
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+=`
120
- `.repeat(u?1+d:d);else if(h)h=!1,l+=`
121
- `.repeat(d+1);else if(d===0){if(u)l+=" "}else l+=`
122
- `.repeat(d);else l+=`
123
- `.repeat(u?1+d:d);l+=g,u=!0,d=0}if(i===jr.KEEP)l+=`
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(`
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]}.
129
- Too many redirects:
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`
104
+ `;return Eg(r,i,"utf8"),1}function Rg(e){let t=Xa(e,".nojekyll");if(Ya(t))return 0;return Eg(t,"","utf8"),1}var HA="/images/_optimized/*",Sg=31536000,VA="# Generated by @jxsuite/compiler — configure via build.headers in project.json.",WA="# ─── public/_headers (hand-authored; these rules override the block above) ───";var Ag=q(()=>{nr();Nu()});async function Og(e,t,r,n={}){let s={},i=Nc(e);for(let o of r.projectContributions()){let a=o.project?.key;if(!a||!o.capabilities.projectData)continue;if(!t||!(a in t))continue;s[a]=await o.call("projectData",t[a],{io:i,projectConfig:t,registry:r,root:e,...n.lazy===!0&&{lazy:!0}})}return s}var Cg=q(()=>{sn()});import{cpSync as UA,existsSync as zA,mkdirSync as GA}from"node:fs";import{dirname as KA,resolve as YA}from"node:path";async function Tg(e,t,r){let n=[],s=[],i=new Map;for(let o of e.assetProviders()){let a=o.project?.key,l=a?t[a]:void 0;if(a&&(l==null||F(l)&&Object.keys(l).length===0))continue;try{let c=await o.call("assets",l??null,{projectConfig:t,root:r});for(let d of c??[]){if(!F(d)||!d.urlPrefix||!d.dir)continue;let p={dir:d.dir,urlPrefix:ha(d.urlPrefix)};if(vt(d.filter))p.filter=d.filter;let h=i.get(p.urlPrefix);if(h){if(h.dir!==p.dir)s.push(`Asset mount conflict: "${p.urlPrefix}" is claimed by both "${h.dir}" and "${p.dir}"`);continue}i.set(p.urlPrefix,p),n.push(p)}}catch(c){s.push(`Error in ${o.name}.assets: ${Ee(c)}`)}}return{errors:s,mounts:n}}function Iu(e,t,r){if(t.length===0||!e)return;for(let n of Cm(e,t))r.add(n)}function Ng(e,t,r){let n=0,s=[];for(let i of e){let o=ga(t,i);if(!o||!zA(o)){s.push(i);continue}let a=YA(r,decodeURIComponent(i).replace(/^\//,""));GA(KA(a),{recursive:!0}),UA(o,a),n+=1}return{copied:n,missing:s}}var Ig=q(()=>{nr();ve();rr()});async function Mu(e,t,r){let n=e.$layout??t.defaults?.layout??null;if(!n)return e;let s=await r(n);if(s.$layout)s=await Mu(s,t,r);let i=e.children??[],o=N(i)?[i]:Array.isArray(i)?i:[],a=ZA(s);if(XA(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 XA(e,t){let r=new Map,n=[];for(let s of t){let i=F(s)?s.attributes?.slot:void 0;if(i){let o=r.get(i);if(!o)o=[],r.set(i,o);o.push(s)}else n.push(s)}Mg(e,r,n)}function Mg(e,t,r){if(!F(e))return;if(!Array.isArray(e.children))return;let n=[];for(let s of e.children)if(F(s)&&s.tagName==="slot"){let i=s.attributes?.name,o=i?t.get(i):void 0;if(i&&o)n.push(...o),t.delete(i);else if(!i&&r.length>0)n.push(...r);else if(Array.isArray(s.children))n.push(...s.children)}else Mg(s,t,r),n.push(s);e.children=n}function ZA(e){return structuredClone(e)}var Jg=q(()=>{ve()});import{existsSync as QA,readFileSync as eO}from"node:fs";import{resolve as Dg}from"node:path";function Lg(e){return(t)=>{let r=Dg(e,t);if(!QA(r))throw Error(`Layout not found: ${t} (resolved to ${r})`);try{return Pn(eO(r,"utf8"),r)}catch(n){throw Error(`Invalid layout JSON at ${r}: ${Ee(n)}`,{cause:n})}}}function Fg(e,t,r){return Mu(e,t,Lg(r))}function qg(e,t,r){let n=Lg(r),s=[],i=e.$layout??t.defaults?.layout;while(i){let o=Dg(r,i);if(s.some((l)=>l.path===o))break;let a=n(i);s.push({doc:a,path:o}),i=a.$layout}return s}var Hg=q(()=>{rr();Jg()});import{dirname as tO,relative as rO,resolve as nO,sep as sO}from"node:path";function Vg(e,t){return rO(t,e).split(sO).join("/")}function iO(e,t,r){if(!e.startsWith("./")&&!e.startsWith("../"))return e;return`./${Vg(nO(t,e),r)}`}function lo(e,t,r){let n=tO(t),s=Vg(t,r);return Qh(e).map((i)=>({exportName:i.exportName,src:iO(i.src,n,r),declaredIn:s}))}function Wg(e){let t=new Map;for(let{exportName:s,src:i,declaredIn:o}of e){let a=t.get(s)??new Map;if(t.set(s,a),!a.has(i))a.set(i,o)}let r=[],n=[];for(let[s,i]of t){let o=[...i];if(r.push({exportName:s,src:o[0][0]}),o.length>1){let a=o.map(([l,c])=>`${l} (declared in ${c})`);n.push(`Server function "${s}" is exported by ${o.length} different modules: ${a.join(", ")}. The site worker serves one function per export name, at /_jx/server/${s}, so a call meant for any but the first would get the first's answer. Rename the export in all but one module, and the $export that names it.`)}}return{entries:r,errors:n}}var Bg=q(()=>{Mr()});function Ug(e,t){if(!N(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function zg(e=[],t=[],r=[],n={}){let s=[{attributes:{charset:n.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],i=new Map;for(let a of[...s,...e,...t,...r]){let l=Ju(a);i.set(l,a)}let o=n.title??n.siteName??"Jx Site";if(i.set("title",{children:[o],tagName:"title"}),n.pageUrl&&n.siteUrl){let a=Rn(n.pageUrl,n.siteUrl);if(![...i.values()].some((c)=>F(c)&&c.tagName==="link"&&c.attributes?.rel==="canonical")){let c={attributes:{href:a,rel:"canonical"},tagName:"link"};i.set(Ju(c),c)}if(!i.has("meta:og:url"))i.set("meta:og:url",{attributes:{content:a,property:"og:url"},tagName:"meta"})}if(n.siteName&&!i.has("meta:og:site_name"))i.set("meta:og:site_name",{attributes:{content:n.siteName,property:"og:site_name"},tagName:"meta"});for(let a of n.alternates??[]){let l={attributes:{href:a.href,hreflang:a.hreflang,rel:"alternate"},tagName:"link"},c=Ju(l);if(!i.has(c))i.set(c,l)}return[...i.values()]}function Ju(e){if(!F(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,s=F(n)?JSON.stringify(n):n??"";return`style:${oO(s)}`}return`${t}:${JSON.stringify(e)}`}function oO(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 Gg(e){return e.map((t)=>aO(t)).join(`
105
+ `)}function aO(e){if(N(e))return e;if(!F(e))return"";let t=e.tagName,r=e.attributes??{},n=Object.entries(r).map(([l,c])=>c===!0?l:`${l}="${lO(c)}"`).join(" "),s=n?`<${t} ${n}>`:`<${t}>`;if(t!==void 0&&new Set(["meta","link","base","br","hr","img","input"]).has(t))return s;let o=Array.isArray(e.children)?e.children.join(""):e.textContent,a=F(o)?JSON.stringify(o,null,2):o??"";return`${s}${a}</${t}>`}function lO(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var Kg=q(()=>{nr();ve()});function dO(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 fO(e){if(!N(e))return[];return e.split(/\s+/).filter((t)=>{if(t==="")return!1;let r=t.toLowerCase();return!cO.has(r)&&!uO.has(r)&&!dO(t)})}function Yg(e){let t=new Set;for(let r of e){if(!F(r)||r.tagName!=="link")continue;for(let n of fO(r.attributes?.rel))t.add(n)}return[...t]}var cO,uO;var Xg=q(()=>{ve();cO=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"]),uO=new Set(["shortcut"])});function Zg(e,t,r,n=null,s=null,i=[]){if(!e.state)e.state={};let o={};if(s!==null)o.defaultLocale=s.defaultLocale,o.locales=s.locales;e.state.$site={name:t.name??"Jx Site",url:t.url??"",...o,...t.state};let a=(N(e.$lang)?e.$lang:void 0)??Nr(r.urlPattern,s)??t.defaults?.lang,l=i.map((d)=>({code:d.locale,current:d.urlPattern===r.urlPattern,dir:Yi(d.locale),label:bh(d.locale),url:d.urlPattern})),c={params:r._pathParams??{},title:e.title??e._pageTitle??t.name??"",url:r.urlPattern};if(l.length>0)c.alternates=l;if(a!==void 0)c.dir=Yi(a),c.locale=a;if(e.state.$page=c,t.state){for(let[d,p]of Object.entries(t.state))if(d!=="$site"&&d!=="$page"&&!(d in e.state))e.state[d]=p}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[d,p]of Object.entries(t.imports))if(!(d in e.imports))e.imports[d]=n&&(p.startsWith("./")||p.startsWith("../"))?n(p,r):p}if(t.$elements?.length)if(!e.$elements?.length)e.$elements=[...t.$elements];else{let d=new Set,p=[];for(let h of[...t.$elements,...e.$elements]){let m=N(h)?h:F(h)?h.$ref:void 0;if(m&&!d.has(m))d.add(m),p.push(h)}e.$elements=p}return e}var Qg=q(()=>{ve();ms()});import{dirname as pO,relative as mO,resolve as hO}from"node:path";function gO(e){return(t,r)=>{if(!r.sourcePath)return t;return`./${mO(pO(r.sourcePath),hO(e,t))}`}}function ey(e,t,r,n=null,s=null,i=[]){return Zg(e,t,r,n===null?null:gO(n),s,i)}var ty=q(()=>{Qg()});async function el(e,t={}){let{resolveElementPath:r,$media:n,formats:s}=t,i=[],o=new Set;async function a(l,c){let d,p;if(N(l)){let{readFileSync:P}=await import("node:fs"),{resolve:E}=await import("node:path");if(p=c?E(c,l):E(l),o.has(p))return;if(o.add(p),p.endsWith(".json"))d=Pn(P(p,"utf8"),p);else{let{extname:O}=await import("node:path"),R=O(p).toLowerCase(),k=s?.byExtension(R,"parse");if(!k){await Promise.resolve().then(() => sn());throw pa(p,R)}d=await k.parseDocument(P(p,"utf8"))}}else{if(d=l,p=null,d.tagName&&o.has(d.tagName))return;if(d.tagName)o.add(d.tagName)}let{tagName:h}=d;if(!h||!h.includes("-"))throw Error(`compileElement: tagName "${h}" must contain a hyphen`);let{dirname:m}=await import("node:path"),b=p?m(p):null,g=[];if(Array.isArray(d.$elements))for(let P of d.$elements){let E=Ce(P)?P.$ref:P;if(!N(E))continue;if(b)await a(E,b);let O=r?r(E,b):E.replace(/\.json$/,".js");g.push(O)}let y=Ua(h);if(n)d.$media={...n,...d.$media};let{rewriteSrc:v}=t,j=co(d,y,g,v?(P)=>v(P,b):void 0,ys(d,t.defaults),t.serverBaseUrl),S=p?p.replace(/\.json$/,".js"):`${h}.js`;i.push({content:j,path:S,tagName:h})}return await a(e,t.basePath??null),{files:i}}async function yO(e,t={}){let{title:r="Jx App",reactivitySrc:n="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:s="https://esm.sh/lit-html@3.3.0"}=t,i=await el(e,t),o=i.files.at(-1);if(!o)throw Error("compileElementPage: no element modules were produced");let{basename:a}=await import("node:path"),l=a(o.path),c=`<!DOCTYPE html>
106
+ <html lang="en">
107
+ <head>
108
+ <meta charset="utf-8">
109
+ <meta name="viewport" content="width=device-width, initial-scale=1">
110
+ <title>${$e(r)}</title>
111
+ <script type="importmap">
112
+ {
113
+ "imports": {
114
+ "@vue/reactivity": "${n}",
115
+ "lit-html": "${s}"
116
+ }
117
+ }
118
+ </script>
119
+ </head>
120
+ <body>
121
+ <${o.tagName}></${o.tagName}>
122
+ <script type="module" src="./${l}"></script>
123
+ </body>
124
+ </html>`;return{files:i.files,html:c}}function bO(e){if(!F(e)||Array.isArray(e))return JSON.stringify(e);if("default"in e)return JSON.stringify(e.default);if(_n(e))return;if(e.$prototype==="LocalStorage"||e.$prototype==="SessionStorage")return JSON.stringify(e.default??null);if(e.$prototype==="Request")return"null";if(rn(e))return"null";return JSON.stringify(e)}function xO(e){let t=new Set,r=new Set,n=(i)=>{if(i.startsWith("#/state/"))t.add(i.slice(8).split("/")[0])},s=(i)=>{if(N(i)){for(let a of i.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))t.add(a[1]);return}if(!F(i)||r.has(i))return;if(r.add(i),Array.isArray(i)){for(let a of i)s(a);return}let o=i;if(o.operator==="call"&&Ce(o.target))n(o.target.$ref);for(let[a,l]of Object.entries(o)){if(a.startsWith("on")&&a!=="observedAttributes"&&Ce(l))n(l.$ref);s(l)}};return s(e.children),s(e.state),t}function co(e,t,r,n,s=null,i="/_jx/server"){let o=["// Generated by @jxsuite/compiler — do not edit manually"];if(e.$id)o.push(`// Source: ${e.$id}`);for(let R of r)o.push(`import '${R}';`);let a=new Map,l=new Map,c=e.state??{},d=xO(e);for(let[R,k]of Object.entries(c))if(er(k)&&k.$src){let I=k.$src;if(k.$lazy===!0){if(!d.has(R)&&!ry.has(R))throw Error(`"${R}" 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 ${R}() from a handler instead of binding its value.`);let M=l.get(I);if(!M)M=[],l.set(I,M);M.push({binding:R,exportName:bu(R,k)});continue}let D=a.get(I);if(!D)D=[],a.set(I,D);D.push(Da(R,k))}for(let[R,k]of a){let I=n?n(R):R;o.push(`import { ${k.join(", ")} } from '${I}';`)}let p=Object.entries(c).flatMap(([R,k])=>Cr(k)&&k.$prototype==="Request"?[[R,k]]:[]),h=Object.entries(c).flatMap(([R,k])=>rn(k)?[[R,k]]:[]);if(o.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html, nothing } from 'lit-html';",Va()),h.length>0)o.push(Wa());let m=s===null&&Cn(e.children);if(m)o.push(Zh());let b=0;for(let[R,k]of l){let I=n?n(R):R,D=`_jxLazy${b}`;b+=1,o.push(`let ${D};`,`const ${D}Load = () => (${D} ??= import('${I}'));`,...k.map(({binding:M,exportName:L})=>`const ${M} = (...args) => ${D}Load().then((m) => m.${L}(...args));`))}o.push("",`class ${t} extends HTMLElement {`," #effects = [];",...s===null?[]:[" #root = null;"],""," constructor() {"," super();");let g=[],y=[],v=[],j=[],S=[];for(let[R,k]of Object.entries(c))if(tr(k))if(rs(k))j.push([R,k]);else if(dn(k.$expression.operator))v.push([R,k]);else y.push([R,k]);else if(er(k))if(k.$src&&!N(k.body))if(d.has(R)||ry.has(R))v.push([R,k]);else y.push([R,k]);else if(N(k.body)&&ns(k.body))y.push([R,k]);else v.push([R,k]);else if(N(k)&&k.includes("${"))S.push([R,k]);else{let I=bO(k);if(I!==void 0)g.push([R,I])}o.push(" this.state = reactive({");for(let[R,k]of g)o.push(` ${un(R)}: ${k},`);o.push(" });");for(let[R,k]of v)if(o.push(""),tr(k)){let I=Ot(k.$expression,{eventParam:"e",statePrefix:"s"});o.push(` ${Pe("this.state",dt(R))} = (s, e) => { ${I}; };`)}else if(En(k)){let I=fr(k.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});o.push(` ${Pe("this.state",dt(R))} = (s, e) => {`,I," };")}else{let I=k.parameters?nn(k.parameters):k.arguments??["state"],D=I.join(", "),M=N(k.body)?k.body:"";if(I[0]==="state")if(k.$src)o.push(` ${Pe("this.state",dt(R))} = (${D}) => ${R}(${D});`);else o.push(` ${Pe("this.state",dt(R))} = (${D}) => {`,` ${M}`," };");else{let L=I.map((B)=>B==="state"?"state":"e").join(", ");if(k.$src)o.push(` ${Pe("this.state",dt(R))} = (state, e) => ${R}(${L});`);else o.push(` ${Pe("this.state",dt(R))} = (state, e) => {`,` const _fn = (${D}) => {`,` ${M}`," };",` return _fn(${L});`," };")}}for(let[R,k]of j){o.push("");let I=Ot(k.$expression,{eventParam:"e",statePrefix:"this.state"});o.push(` ${Pe("this.state",dt(R))} = ${io(k,I)};`)}for(let[R,k]of S)o.push("",` ${Pe("this.state",dt(R))} = computed(() => ${Ha(k.replaceAll("state.","this.state."))});`);for(let[R,k]of y)if(o.push(""),tr(k)){let I=Ot(k.$expression,{eventParam:"e",statePrefix:"this.state"});o.push(` ${Pe("this.state",dt(R))} = computed(() => ${I});`)}else if(k.$src)o.push(` ${Pe("this.state",dt(R))} = computed(() => ${R}(this.state));`);else{o.push(` ${Pe("this.state",dt(R))} = computed(() => {`);let I=(N(k.body)?k.body:"").replaceAll("state.","this.state.");o.push(` ${I}`," });")}o.push(" }","");let P=[];if(Array.isArray(e.children)){let R={n:0};for(let k of e.children)Tn(k,P,e.$media??{},"",R,e.tagName)}let E=iy(),O=!Array.isArray(e.children)&&e.textContent!==void 0?` ${tl(e.textContent)}`:Qa(e.children,e.style," ",!1,!1,E);o.push(" template() {"," const s = this.state;",...E.decls," return html`",O," `;"," }","",...s===null?[]:[" #renderRoot() {"," if (this.#root) return this.#root;",s==="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[R,k]of p)o.push(La(R,k,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));for(let[R,k]of h)o.push(Fa(R,k,{collect:"this.#effects",indent:" ",serverBaseUrl:i,statePrefix:"this.state"}));if(F(e.style)){let R=[];for(let[k,I]of Object.entries(e.style)){if(k.startsWith(":")||k.startsWith(".")||k.startsWith("&")||k.startsWith("[")||k.startsWith("@"))continue;if(N(I)&&I.includes("${"))R.push([Vt(k),I])}if(R.length>0){o.push(" this.#effects.push(effect(() => {");for(let[k,I]of R){let D=I.replaceAll(/\$\{([^}]+)\}/g,(M,L)=>`\${${L.replaceAll("state.","this.state.")}}`);o.push(` this.style['${k}'] = \`${D}\`;`)}o.push(" }));")}}if(m)o.push(` const _slotted = ${$u}(this);`);if(o.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"),s===null)o.push(" this.replaceChildren();"," this.#effects.push(effect(() => render(this.template(), this)));");else o.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(m)o.push(` ${vu}(this, _slotted);`);return o.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});`,""),o.join(`
125
+ `)}function iy(){return{byText:new Map,decls:[]}}function oy(e,t){let r=e.byText.get(t);if(r)return r;let n=`_c${e.decls.length}`;e.decls.push(` const ${n} = html\`
126
+ ${t}
127
+ \`;`);let s=`\${${n}}`;return e.byText.set(t,s),s}function Qa(e,t,r,n=!1,s=!1,i=null,o=!1){if(!e)return"";let a=o?ei:"";if(Qe(e))return`${sy(e,r)}${a}`;if(!Array.isArray(e))return"";return e.map((l)=>{if(Qe(l))return`${sy(l,r)}${a}`;let c=Lu(l,n?"":r,n,s,i);return N(l)&&l.includes("${")||F(l)&&Tr(l.tagName)?`${c}${a}`:c}).join(n?"":`
128
+ `)}function Lu(e,t,r=!1,n=!1,s=null,i=null){if(N(e)){if(e.includes("${"))return`${t}${tl(e)}`;return`${t}${$e(e)}`}if(lr(e)||$t(e))return`${t}${$e(String(e))}`;if(!F(e))return"";if(Tr(e.tagName)){let g=e.tagName.$expression,y=fn(g.target,{eventParam:"e",statePrefix:"s"}),v=g.operator==="?:"?[[!0,g.value],[!1,g.initial]]:[...Object.entries(g.cases),["__default__",g.default]],j=v.map(([,k])=>k),S=j.map((k)=>r||Nn.has(k)),P=null;if(s&&S.every((k)=>k===S[0])){let k=ny(e,`${t} `,S[0]===!0,n,s,j.some((I)=>I.includes("-")));if(k.trim()!=="")P=oy(s,k)}let E=v.map(([k,I])=>{let D={...e,tagName:I};return[k,Lu(D,`${t} `,r,n,s,P)]});if(g.operator==="?:"){let[,k]=E[0],[,I]=E[1];return`${t}\${${y}
129
+ ? html\`
130
+ ${k}
131
+ \`
132
+ : html\`
133
+ ${I}
134
+ \`}`}let O=E.flatMap(([k,I])=>k==="__default__"?[]:[` ${JSON.stringify(k)}: html\`
135
+ ${I}
136
+ \``]),[,R]=E.at(-1);return`${t}\${{
137
+ ${O.join(`,
138
+ `)}
139
+ }[String(${y})] ?? html\`
140
+ ${R}
141
+ \`}`}let o=e.tagName??"div",a=r||Nn.has(o),l=[];if(e.attributes)for(let[g,y]of Object.entries(e.attributes))if(Ce(y))l.push(`${g}="\${${Qs}('${g}', ${Jr(y.$ref)}) ?? nothing}"`);else if(N(y)&&$O(y))l.push(`${g}="\${${Qs}('${g}', ${or(y).slice(2,-1)}) ?? nothing}"`);else if(N(y)&&y.includes("${"))l.push(`${g}="${or(y)}"`);else if($t(y)){let v=gs(g,y);if(v!==null)l.push(v===""?g:`${g}="${v}"`)}else l.push(`${g}="${y}"`);if(e.id)l.push(`id="${or(String(e.id))}"`);if(e.className)l.push(`class="${or(String(e.className))}"`);for(let[g,y]of Object.entries(e)){if(pn.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(Za(y))l.push(`.${g}="\${${Jr(y.$ref)}}"`);else if(N(y)&&y.includes("${"))l.push(`.${g}="${or(y)}"`);else l.push(`.${g}="\${${JSON.stringify(y)}}"`)}if(e.$props)for(let[g,y]of Object.entries(e.$props))if(Za(y))l.push(`.${g}="\${${Jr(y.$ref)}}"`);else if(N(y)&&y.includes("${"))l.push(`.${g}="${or(y)}"`);else l.push(`.${g}="\${${JSON.stringify(y)}}"`);let c=n?"s.$map = $map; ":"";for(let[g,y]of Object.entries(e)){if(!g.startsWith("on")||g==="observedAttributes")continue;let v=g.slice(2).toLowerCase();if(Za(y))l.push(c?`@${v}="\${(e) => { ${c}${Jr(y.$ref)}(s, e); }}"`:`@${v}="\${(e) => ${Jr(y.$ref)}(s, e)}"`);else if(F(y)&&"$expression"in y){let j=Ot(y.$expression,{eventParam:"e",statePrefix:"s"});l.push(`@${v}="\${(e) => { ${c}${j}; }}"`)}else if(er(y))l.push(`@${v}="\${(e) => { ${c}${vO(y)} }}"`)}let d=ly(e.style);if(d)l.push(`style="${d}"`);let p=l.length>0?`
142
+ ${t} ${l.join(`
143
+ ${t} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(o))return`${t}<${o}${p}
144
+ ${t}>`;let m=i??ny(e,t,a,n,s,o.includes("-")),b=o==="slot"?ei:"";return a?`${b}<${o}${p}>${m}${b}</${o}>`:`${t}${b}<${o}${p}
145
+ ${t}>${m}${b}</${o}>`}function ny(e,t,r,n,s,i=!1){if(e.$switch){let o=Ce(e.$switch)?e.$switch.$ref:e.$switch,a=Jr(o),l=[];for(let[h,m]of Object.entries(e.cases??{})){if(!m||Ce(m))continue;l.push([h,Lu(m,`${t} `,!1,n,s)])}let c=l.map(([,h])=>h),d=new Set(c.filter((h,m)=>c.indexOf(h)!==m&&h.trim()!==""));return`\${{
146
+ ${l.map(([h,m])=>{let b=s&&d.has(m)?oy(s,m):m;return` ${JSON.stringify(h)}: html\`
147
+ ${b}
148
+ \``}).join(`,
149
+ `)}
150
+ }[${a}]}`}if(e.textContent!==void 0){let o=tl(e.textContent),a=Ce(e.textContent)||N(e.textContent)&&e.textContent.includes("${");return i&&a?`${o}${ei}`:o}if(e.innerHTML!==void 0)return e.innerHTML;if(e.children)return r?Qa(e.children,e.style,"",!0,n,s,i):`
151
+ ${Qa(e.children,e.style,`${t} `,!1,n,s,i)}
152
+ ${t}`;return""}function sy(e,t){let r=Ce(e.items)?Jr(e.items.$ref):"ITEMS",n=e.map;if(!n)return"";let s=n.tagName??"div",i=[];if(n.attributes)for(let[m,b]of Object.entries(n.attributes))if(Ce(b))i.push(`${m}="\${${Du(b.$ref)}}"`);else if(N(b)&&b.includes("${"))i.push(`${m}="${or(b)}"`);else i.push(`${m}="${b}"`);if(n.id)i.push(`id="${or(String(n.id))}"`);if(n.className)i.push(`class="${or(String(n.className))}"`);for(let[m,b]of Object.entries(n)){if(pn.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(Za(b))i.push(`.${m}="\${${Du(b.$ref)}}"`);else if(N(b)&&b.includes("${"))i.push(`.${m}="${or(b)}"`);else i.push(`.${m}="\${${JSON.stringify(b)}}"`)}if(n.$props)for(let[m,b]of Object.entries(n.$props))if(Ce(b))i.push(`.${m}="\${${Du(b.$ref)}}"`);else if(N(b)&&b.includes("${"))i.push(`.${m}="${or(b)}"`);else i.push(`.${m}="\${${JSON.stringify(b)}}"`);let o=ly(n.style);if(o)i.push(`style="${o}"`);for(let[m,b]of Object.entries(n)){if(!m.startsWith("on"))continue;let g=m.slice(2).toLowerCase();if(Ce(b))i.push(`@${g}="\${(e) => { s.$map = $map; ${Jr(b.$ref)}(s, e); }}"`);else if(tr(b)){let y=Ot(b.$expression,{eventParam:"e",statePrefix:"s"});i.push(`@${g}="\${(e) => { s.$map = $map; ${y}; }}"`)}}let a=i.length>0?`
153
+ ${t} ${i.join(`
154
+ ${t} `)}`:"",l=iy(),c="";if(n.textContent!==void 0)c=tl(n.textContent);else if(n.children)c=`
155
+ ${Qa(n.children,null,`${t} `,!1,!0,l)}
156
+ ${t} `;let d=`html\`
157
+ ${t} <${s}${a}
158
+ ${t} >${c}</${s}>
159
+ ${t}\``,p=(d.includes("$map")?"const $map = { item, index }; ":"")+l.decls.map((m)=>`${m.trim()} `).join(""),h=p?`(item, index) => { ${p}return ${d}; }`:`(item, index) => ${d}`;return`${t}\${${r}.map(${h})}`}function Za(e){return Ce(e)&&e.$ref!==""}function Jr(e){if(e.startsWith("#/state/"))return Pe("s",e.slice(8));if(e.startsWith("$map/"))return ay(e.slice(5));if(e.startsWith("parent#/"))return Pe("s",e.slice(8));if(e.startsWith("window#/"))return Pe("window",e.slice(8));if(e.startsWith("document#/"))return Pe("document",e.slice(10));return Pe("s",e)}function ay(e){let[t,...r]=cn(e);return Pe(t??"",r.map((n)=>dt(n)).join("/"))}function Du(e){if(e.startsWith("$map/"))return ay(e.slice(5));return Jr(e)}function or(e){return e.replaceAll("state.","s.")}function $O(e){return e.startsWith("${")&&e.endsWith("}")&&!e.slice(2).includes("${")}function tl(e){if(Ce(e))return`\${${Jr(e.$ref)}}`;if(N(e)&&e.includes("${"))return or(e);return String(e)}function vO(e){if(En(e))return fr(e.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let t=N(e.body)?e.body:"",r=e.parameters?nn(e.parameters):e.arguments??[];if(r.length>0){let n=r.map((s)=>s==="state"?"s":"e").join(", ");return`((${r.join(", ")}) => { ${t} })(${n});`}return t.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function ly(e){if(!F(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(N(n)&&n.includes("${")){let s=Vt(r);t.push(`${s}: ${or(n)}`)}}return t.join("; ")}var ry;var uo=q(()=>{Us();Mr();ve();rr();Hs();ry=new Set(["onMount","onUnmount","onAdopted"])});function cy(e,t){let{title:r="Jx App",reactivitySrc:n,litHtmlSrc:s}=t,i=Xs(e,null,e.state??{},e.$media??{}),o=ti(e,e.$media??{},t.projectStyle??null),a=[],l=uy(e,!1,i,a),c=[],d="",p="";if(a.length>0){for(let b of a){let g=co(b.def,b.className,[],t.rewriteSrc);c.push({content:g,path:`_islands/${b.tagName}.js`,tagName:b.tagName})}d=`<script type="importmap">
160
+ {
161
+ "imports": {
162
+ "@vue/reactivity": "${n}",
163
+ "lit-html": "${s}"
164
+ }
165
+ }
166
+ </script>`,p=c.map((b)=>`<script type="module" src="./${b.path}"></script>`).join(`
167
+ `)}let h=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((b)=>wr(String(b))!==null)?`<script>${Zs()}</script>
168
+ `:"",m=`<!DOCTYPE html>
169
+ <html lang="en">
170
+ <head>
171
+ <meta charset="utf-8">
172
+ <meta name="viewport" content="width=device-width, initial-scale=1">
173
+ <title>${$e(r)}</title>
174
+ ${h}${d}
175
+ ${o}
176
+ </head>
177
+ <body>
178
+ ${l}
179
+ ${p}
180
+ </body>
181
+ </html>`;return{files:c,html:m}}function uy(e,t,r,n){if(N(e))return $e(e);if(lr(e)||$t(e))return $e(String(e));if(!F(e))return"";let s=Xs(e,r.scope,e.state??r.scopeDefs,e.$media??r.media);if(t){let c=n.length,d=`jx-island-${c}`,p=`JxIsland${c}`,h={...e,tagName:d};return n.push({className:p,def:h,tagName:d}),`<${d}></${d}>`}let i=Eu(e.tagName,s.scope),o=bs(e,s.scope);if(Su.has(i))return`<${i}${o}>`;let a=r.preformatted===!0||Nn.has(i),l=wO(e,{...s,preformatted:a},n);return`<${i}${o}>${l}</${i}>`}function wO(e,t,r){if(e.textContent!==void 0){let n=Me(e.textContent,t.scope);return n==null?"":$e(String(n))}if(e.innerHTML){let n=Me(e.innerHTML,t.scope);return n==null?e.innerHTML:String(n)}if(Array.isArray(e.children))return e.children.map((n)=>uy(n,Uh(n),t,r)).join(oo(t.preformatted));return""}var dy=q(()=>{Mr();uo();ve()});function Vu(e,t){let{title:r="Jx App",reactivitySrc:n=Ks,litHtmlSrc:s=Ys,modulePath:i="app.js",serverBaseUrl:o="/_jx/server"}=t,a=Xs(e,null,e.state??{},e.$media??{}),l=ti(e,e.$media??{},t.projectStyle??null),c={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},d=new Map,p=new Map,h=[],m=[],b=[],g=[],y=[],v=[],j=new Map,S=e.state??{};for(let[I,D]of Object.entries(S)){if(!F(D)||Array.isArray(D)){if(pe(D))m.push([I,`() => ${Ha(D)}`]);else h.push([I,D]);continue}if(tr(D)){let M=D.$expression,L=Ot(M,{eventParam:"e",statePrefix:"state"});if(rs(D))y.push(`state[${JSON.stringify(I)}] = ${io(D,L)};`);else if(dn(M.operator))g.push([I,{args:["state","e"],body:L}]);else m.push([I,`() => ${L}`]);continue}if(er(D)){let M=D.parameters?nn(D.parameters):D.arguments,{body:L}=D;if(Array.isArray(L)){let B=fr(L,{eventParam:"e",statePrefix:"state"});if(D.parameters&&D.parameters.length>0)y.push(`state[${JSON.stringify(I)}] = ${io(D,`(() => {
182
+ ${B}
183
+ })()`)};`);else g.push([I,{args:["state","e"],body:B}])}else if(D.$src){let B=j.get(D.$src);if(!B)B=new Set,j.set(D.$src,B);B.add(Da(I,D)),m.push([I,`() => { return ${I}(state); }`])}else if(N(L)&&ns(L))m.push([I,`() => { ${L} }`]);else g.push([I,{args:M??["state"],body:L}]);continue}if(_n(D))continue;if(Gp(D)){h.push([I,D.default]);continue}if(Cr(D)){if(D.$prototype==="LocalStorage"||D.$prototype==="SessionStorage"){let M=D.$prototype==="LocalStorage"?"localStorage":"sessionStorage",L=D.key??I,B=D.default??null;h.push([I,null]),y.push(EO(I,M,L,B));continue}if(D.$prototype==="Request"){h.push([I,null]),y.push(La(I,D));continue}if(D.$prototype==="Cookie"){h.push([I,null]),y.push(_O(I,D.name??I,D.default??null));continue}}if(rn(D)){h.push([I,null]),v.push(Fa(I,D,{serverBaseUrl:o}));continue}h.push([I,D])}let P=fy(e,a,d,p,c);for(let[I,D]of d)if(!b.some(([M])=>M===I))b.push([I,D]);for(let[I,D]of p)if(!g.some(([M])=>M===I))g.push([I,D]);let E=SO(h,m,b,g,y,v,j,c,n,t.rewriteSrc),O=[` "@vue/reactivity": "${n}"`,` "lit-html": "${s}"`],R=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((I)=>wr(String(I))!==null)?`<script>${Zs()}</script>
184
+ `:"",k=`<!DOCTYPE html>
185
+ <html lang="en">
186
+ <head>
187
+ <meta charset="utf-8">
188
+ <meta name="viewport" content="width=device-width, initial-scale=1">
189
+ <title>${$e(r)}</title>
190
+ ${R}<script type="importmap">
191
+ {
192
+ "imports": {
193
+ ${O.join(`,
194
+ `)}
195
+ }
196
+ }
197
+ </script>
198
+ ${l}
199
+ <script type="module" src="./${i}"></script>
200
+ </head>
201
+ <body>
202
+ ${P}
203
+ </body>
204
+ </html>`;return{files:[{content:E,path:i}],html:k}}function fy(e,t,r,n,s){if(N(e))return $e(e);if(lr(e)||$t(e))return $e(String(e));if(!F(e))return"";let i=Xs(e,t.scope,e.state??t.scopeDefs,e.$media??t.media);if(Tr(e.tagName))throw Error(`A tag chosen at creation is not supported on a dynamic page yet (candidates: ${Ms(e.tagName).join(", ")}). Move the element into a component, or give it a literal tagName.`);let o=e.tagName??"div";i.preformatted=t.preformatted===!0||Nn.has(o);let a=[],l=!1;if(e.textContent!==void 0){let g=e.textContent;if(Wt(g)){let y=ni(g.$ref);a.push(`:text-content="${y}"`),Fu(r,y,g.$ref),l=!0}else if(pe(g)){let y=`_t${s.t}`;s.t+=1,a.push(`:text-content="${y}"`),r.set(y,`() => \`${g}\``),l=!0}}for(let[g,y]of Object.entries(e)){if(!g.startsWith("on")||g==="observedAttributes")continue;let v=g.slice(2).toLowerCase();if(Wt(y)){let j=ni(y.$ref);a.push(`@${v}="${j}"`),l=!0}else if(er(y)){let j=`_h${s.h}`;s.h+=1,a.push(`@${v}="${j}"`);let{body:S}=y;n.set(j,Array.isArray(S)?{args:["state","e"],body:fr(S,{eventParam:"e",statePrefix:"state"})}:{args:y.parameters?nn(y.parameters):y.arguments??["state","event"],body:S}),l=!0}else if(tr(y)){let j=`_h${s.h}`;s.h+=1,a.push(`@${v}="${j}"`);let S=Ot(y.$expression,{eventParam:"e",statePrefix:"state"});n.set(j,{args:["state","e"],body:S}),l=!0}}if(F(e.style))for(let[g,y]of Object.entries(e.style)){if(g.startsWith(":")||g.startsWith(".")||g.startsWith("&")||g.startsWith("[")||g.startsWith("@"))continue;if(my(y))continue;if(pe(y)){let v=`_s${s.s}`;s.s+=1,a.push(`:style.${Vt(g)}="${v}"`),r.set(v,`() => \`${y}\``),l=!0}}if(F(e.attributes)){for(let[g,y]of Object.entries(e.attributes))if(Wt(y)){let v=ni(y.$ref);a.push(`:attr.${g}="${v}"`),Fu(r,v,y.$ref),l=!0}else if(pe(y)){let v=`_t${s.t}`;s.t+=1,a.push(`:attr.${g}="${v}"`),r.set(v,`() => \`${y}\``),l=!0}}for(let[g,y]of Object.entries(e)){if(pn.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(Wt(y)){let v=ni(y.$ref);a.push(`:${Vt(g)}="${v}"`),Fu(r,v,y.$ref),l=!0}else if(pe(y)){let v=`_t${s.t}`;s.t+=1,a.push(`:${Vt(g)}="${v}"`),r.set(v,`() => \`${y}\``),l=!0}}let c=bs(e,i.scope),d=l?" data-bind":"",p=a.length>0?` ${a.join(" ")}`:"",h="",m=e;if(m.$switch){s.needsLit=!0;let g=`_sw${s.sw}`;s.sw+=1;let y=Wt(m.$switch)?Hu(m.$switch.$ref):`\`${String(m.$switch)}\``,v=m.cases??{},j=Object.entries(v).filter(([,P])=>P&&!Wt(P)).map(([P,E])=>`${JSON.stringify(P)}: html\`${qu(E,i.preformatted)}\``);r.set(g,`() => ({${j.join(", ")}})[String(${y})] ?? html\`\``),a.push(`:render="${g}"`);let S=` ${a.join(" ")}`;return`<${o}${c} data-bind${S}></${o}>`}if(m.textContent!==void 0&&!l){let g=Me(m.textContent,i.scope);h=g==null?"":$e(String(g))}else if(m.textContent!==void 0&&l){let g=Me(m.textContent,i.scope);h=g==null?"":$e(String(g))}else if(m.innerHTML){let g=Me(m.innerHTML,i.scope);h=g==null?m.innerHTML:String(g)}else if(Qe(m.children)){s.needsLit=!0;let g=`_list${s.l}`;s.l+=1;let y=m.children,v=Wt(y.items)?Hu(y.items.$ref):JSON.stringify(y.items),j=Wu(y.map);r.set(g,`() => (${v} ?? []).map((item, index) => html\`${j}\`)`),a.push(`:render="${g}"`),l=!0;let S=" data-bind",P=` ${a.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${c}${S}${P}>`;return`<${o}${c}${S}${P}></${o}>`}else if(Array.isArray(m.children)&&m.children.some((g)=>Qe(g))){s.needsLit=!0;let g=`_children${s.l}`;s.l+=1;let y=m.children.map((j)=>qu(j,i.preformatted)).join(oo(i.preformatted," "));r.set(g,i.preformatted?`() => html\`${y}\``:`() => html\`
205
+ ${y}
206
+ \``),a.push(`:render="${g}"`),l=!0;let v=` ${a.join(" ")}`;return`<${o}${c} data-bind${v}></${o}>`}else if(Array.isArray(m.children))h=m.children.map((g)=>fy(g,i,r,n,s)).join(oo(i.preformatted));if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${c}${d}${p}>`;return`<${o}${c}${d}${p}>${h}</${o}>`}function Wu(e,t=!1){if(!e)return"";if(Tr(e.tagName))throw Error(`A tag chosen at creation is not supported inside a dynamic page's repeater yet (candidates: ${Ms(e.tagName).join(", ")}). Move the item into a component, or give it a literal tagName.`);let r=e.tagName??"div",n=t||Nn.has(r),s="";if(e.id)s+=` id="${e.id}"`;if(e.className)s+=` class="${In(e.className)}"`;if(F(e.$props))for(let[l,c]of Object.entries(e.$props))if(Wt(c))s+=` .${l}="\${${PO(c.$ref)}}"`;else if(pe(c))s+=` .${l}="${In(c)}"`;else s+=` .${l}="\${${JSON.stringify(c)}}"`;if(F(e.attributes))for(let[l,c]of Object.entries(e.attributes)){if(pe(c)){s+=` ${l}="${In(c)}"`;continue}if($t(c)){let d=gs(l,c);if(d!==null)s+=d===""?` ${l}`:` ${l}="${$e(d)}"`;continue}s+=` ${l}="${$e(String(c))}"`}if(F(e.style)){let l=[];for(let[c,d]of Object.entries(e.style)){if(c.startsWith(":")||c.startsWith(".")||c.startsWith("&")||c.startsWith("[")||c.startsWith("@"))continue;if(my(d))continue;let p=Vt(c);if(pe(String(d)))l.push(`${p}: ${In(String(d))}`);else l.push(`${p}: ${d}`)}if(l.length>0)s+=` style="${l.join("; ")}"`}for(let[l,c]of Object.entries(e)){if(!l.startsWith("on")||l==="observedAttributes")continue;let d=l.slice(2).toLowerCase();if(Wt(c)){let p=ni(c.$ref);s+=` @${d}=\${(e) => { state.$map = { item, index }; on.${p}(e); }}`}else if(En(c)){let p=fr(c.body,{eventParam:"e",statePrefix:"state"});s+=` @${d}=\${(e) => { state.$map = { item, index }; ${p} }}`}else if(er(c)){let p=In(c.body);s+=` @${d}=\${(e) => { ${p} }}`}else if(F(c)&&"$expression"in c){let p=Ot(c.$expression,{eventParam:"e",statePrefix:"state"});s+=` @${d}=\${(e) => { state.$map = { item, index }; ${p}; }}`}}if(e.contentEditable)s+=` contenteditable="${e.contentEditable}"`;let i=r.includes("-")?ei:"",o="";if(e.textContent!==void 0){let l=String(e.textContent);if(pe(l))o=`${In(l)}${i}`;else if(Wt(e.textContent))o=`\${state.${ni(e.textContent.$ref)}}${i}`;else o=$e(l)}else if(e.innerHTML)o=In(String(e.innerHTML));else if(Qe(e.children))o=`
207
+ ${py(e.children)}${i}
208
+ `;else if(Array.isArray(e.children)){let l=e.children.map((c)=>{let d=qu(c,n);return Qe(c)||N(c)&&pe(c)?`${d}${i}`:d});o=n?l.join(""):`
209
+ ${l.join(`
210
+ `)}
211
+ `}if(new Set(["input","br","hr","img","meta","link"]).has(r))return`<${r}${s}>`;return`<${r}${s}>${o}</${r}>`}function qu(e,t=!1){if(N(e))return pe(e)?In(e):$e(e);if(lr(e)||$t(e))return $e(String(e));if(Qe(e))return py(e);return Wu(e,t)}function py(e){let{items:t}=e,r=Wt(t)?Hu(t.$ref):JSON.stringify(t??[]),n=Wu(e.map);return`\${(${r} ?? []).map((item, index) => html\`${n}\`)}`}function In(e){return e.replaceAll("$map.","")}function SO(e,t,r,n,s,i,o,a,l,c){let d=[],{needsLit:p}=a,h=t.length>0;d.push("// Generated by @jxsuite/compiler — do not edit manually");let m=["reactive","effect"];if(h)m.push("computed");if(d.push(`import { ${m.join(", ")} } from '@vue/reactivity';`),p)d.push("import { html, render } from 'lit-html';");for(let[b,g]of o){let y=c?c(b):b;d.push(`import { ${[...g].join(", ")} } from '${y}';`)}if(d.push("",Va()),i.length>0)d.push("",Wa());d.push("","const state = reactive({");for(let[b,g]of e)d.push(` ${un(b)}: ${JSON.stringify(g)},`);if(d.push("});",""),s.length>0){for(let b of s)d.push(b);d.push("")}if(t.length>0){for(let[b,g]of t)d.push(`${Pe("state",dt(b))} = computed(${g});`);d.push("")}if(i.length>0){for(let b of i)d.push(b);d.push("")}if(r.length>0){d.push("const bind = {");for(let[b,g]of r)d.push(` ${un(b)}: ${g},`);d.push("};")}else d.push("const bind = {};");if(d.push(""),n.length>0){d.push("const on = {");for(let[b,g]of n){let y=g.args??["state"],v=y.map((j)=>j==="state"?"state":"e").join(", ");d.push(` ${un(b)}: (e) => { const fn = (${y.join(", ")}) => { ${g.body} }; fn(${v}); },`)}d.push("};")}else d.push("const on = {};");if(d.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;"),p)d.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else d.push(" if (parts[0] === 'style' && parts.length > 1) {");return d.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => {",` const _t = ${Qs}(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);",""),d.join(`
212
+ `)}function EO(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(`
213
+ `)}function _O(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(`
214
+ `)}function my(e){return e===null||F(e)}function PO(e){if(e.startsWith("$map/")){let[t,...r]=cn(e.slice(5));return Pe(t??"",r.map((n)=>dt(n)).join("/"))}if(e.startsWith("#/state/"))return Pe("state",e.slice(8));return Pe("state",e)}function Hu(e){return _h("state",e.startsWith("#/state/")?e.slice(8):e)}function ni(e){return Ph(e.startsWith("#/state/")?e.slice(8):e)}function Fu(e,t,r){if(e.has(t))return;e.set(t,`() => ${Pe("state",r.startsWith("#/state/")?r.slice(8):r)}`)}var Bu=q(()=>{Us();Mr();ve();Hs()});function jO(e,t){if(t.routing==="prefix-except-default"&&e===t.defaultLocale)return"/";return`/${e.toLowerCase()}/`}function hy(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((s)=>[s,jO(s,e)])));return`
132
215
  // ─── Locale negotiation (RFC 4647 Lookup over Accept-Language) ───────────────
133
216
  const JX_LOCALES = ${t}
134
217
  const JX_DEFAULT_LOCALE = ${r}
@@ -197,223 +280,101 @@ app.use('/', async (c, next) => {
197
280
  res.headers.set('Content-Language', locale)
198
281
  c.res = res
199
282
  })
200
- `}async function $a(e,t={}){let{baseUrl:r="/_jx/server"}=t,n=await b0(e),i=nl(n);if(i.length===0)return null;let s=i.map(({exportName:a,src:c})=>`import { ${a} } from '${c}'`).join(`
201
- `),o=i.map(({exportName:a})=>v0(a,r)).join(`
202
- `);return`// Generated by @jxsuite/compiler — do not edit manually
203
- // Deploy as a Cloudflare Worker, Node server, or Bun process.
204
- // Requires: npm install hono
205
-
206
- import { Hono } from 'hono'
207
- ${s}
208
-
209
- const app = new Hono()
210
- ${o}
211
-
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(`
215
- `),d=r==="cloudflare-workers"||r==="cloudflare-pages"?`
283
+ `}function rl(e,t="/_jx/server"){return Ie(e,t)}function Uu(e,t={}){let{adapter:r=null,mounts:n=[],connectors:s=[],i18n:i=null,base:o=""}=t,a=rl(o,t.baseUrl);if(e.length===0&&n.length===0&&!r)return null;let l=e.map(({exportName:m,src:b})=>`import { ${m} } from '${b}'`).join(`
284
+ `),c=kO(n,s),d=e.map(({exportName:m})=>RO(m,a)).join(`
285
+ `),p=r==="cloudflare-workers"||r==="cloudflare-pages"?`
216
286
  app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
217
287
  `:`
218
- `,h=$0(s);return`// Generated by @jxsuite/compiler — do not edit manually
288
+ `,h=hy(i);return`// Generated by @jxsuite/compiler — do not edit manually
219
289
  import { Hono } from 'hono'
220
- ${c}${l.imports}
290
+ ${l}${c.imports}
221
291
 
222
292
  const app = new Hono()
223
- ${h}${l.routes}${u}
224
- ${d}
293
+ ${h}${c.routes}${d}
294
+ ${p}
225
295
  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:`
296
+ `}function kO(e,t){if(e.length===0)return{imports:"",routes:""};let r=e.toSorted((i,o)=>i.order-o.order),n=[];for(let i of r)n.push(`import { ${i.className} } from '${i.module}'`);for(let i of t)n.push(`import { ${i.className} } from '${i.module}'`);let s=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${t.map((i)=>`${JSON.stringify(i.provider)}: ${i.className}`).join(", ")} }`];for(let[i,o]of r.entries()){let a=JSON.stringify(o.options);s.push(`const jxMount${i} = await ${o.className}.mount({ ...${a}, connectors: jxConnectors }, jxCtx)`,`app.all('${o.basePath}/*', (c) => jxMount${i}(c.req.raw, c.env))`,`app.all('${o.basePath}', (c) => jxMount${i}(c.req.raw, c.env))`)}return{imports:`
227
297
  ${n.join(`
228
- `)}`,routes:`${i.join(`
298
+ `)}`,routes:`${s.join(`
229
299
  `)}
230
- `}}function v0(e,t){return`
300
+ `}}function RO(e,t){return`
231
301
  app.post('${t}/${e}', async (c) => {
232
302
  const args = await c.req.json().catch(() => ({}))
233
303
  try {
234
- return c.json(await ${e}(args, c.env))
304
+ return c.json((await ${e}(args, c.env)) ?? null)
235
305
  } catch (e) {
236
306
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
237
307
  }
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>
239
- <html lang="en">
240
- <head>
241
- <meta charset="utf-8">
242
- <meta name="viewport" content="width=device-width, initial-scale=1">
243
- <title>${Se(r)}</title>
244
- <script type="importmap">
245
- {
246
- "imports": {
247
- "@vue/reactivity": "${n}",
248
- "lit-html": "${i}"
249
- }
250
- }
251
- </script>
252
- </head>
253
- <body>
254
- <${o.tagName}></${o.tagName}>
255
- <script type="module" src="./${c}"></script>
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(`
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
- ${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}
262
- ? html\`
263
- ${j}
264
- \`
265
- : html\`
266
- ${D}
267
- \`}`}let P=w.flatMap(([j,D])=>j==="__default__"?[]:[` ${JSON.stringify(j)}: html\`
268
- ${D}
269
- \``]),[,R]=w.at(-1);return`${t}\${{
270
- ${P.join(`,
271
- `)}
272
- }[String(${b})] ?? html\`
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?`
275
- ${t} ${c.join(`
276
- ${t} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(o))return`${t}<${o}${d}
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`\${{
279
- ${c.map(([h,m])=>{let y=i&&u.has(m)?P0(i,m):m;return` ${JSON.stringify(h)}: html\`
280
- ${y}
281
- \``}).join(`,
282
- `)}
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
- ${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?`
286
- ${t} ${s.join(`
287
- ${t} `)}`:"",c=_0(),l="";if(n.textContent!==void 0)l=Il(n.textContent);else if(n.children)l=`
288
- ${Ol(n.children,null,`${t} `,!1,!0,c)}
289
- ${t} `;let u=`html\`
290
- ${t} <${i}${a}
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">
293
- {
294
- "imports": {
295
- "@vue/reactivity": "${n}",
296
- "lit-html": "${i}"
297
- }
298
- }
299
- </script>`,d=l.map((y)=>`<script type="module" src="./${y.path}"></script>`).join(`
300
- `)}let h=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((y)=>Wr(String(y))!==null)?`<script>${Ls()}</script>
301
- `:"",m=`<!DOCTYPE html>
302
- <html lang="en">
303
- <head>
304
- <meta charset="utf-8">
305
- <meta name="viewport" content="width=device-width, initial-scale=1">
306
- <title>${Se(r)}</title>
307
- ${h}${u}
308
- ${o}
309
- </head>
310
- <body>
311
- ${c}
312
- ${d}
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,`(() => {
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>
318
- <html lang="en">
319
- <head>
320
- <meta charset="utf-8">
321
- <meta name="viewport" content="width=device-width, initial-scale=1">
322
- <title>${Se(r)}</title>
323
- ${w}<script type="importmap">
324
- {
325
- "imports": {
326
- ${E.join(`,
327
- `)}
328
- }
329
- }
330
- </script>
331
- ${a}
332
- <script type="module" src="./${s}"></script>
333
- </head>
334
- <body>
335
- ${_}
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\`
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=`
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(""):`
342
- ${c.join(`
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>
308
+ })`}var zu=q(()=>{nr()});function yy(e){let t=e.title;if(!t)throw Error("compileClassJson: missing title (class name)");let r=OO(e.extends),n=e.$defs,s=n?.fields??{},i=n?.constructor,o=AO(i)?i:void 0,a=n?.methods??{},l=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(e.$id)l.push(`// Source: ${e.$id}`);l.push("");let c=r!=="Object"?` extends ${r}`:"";l.push(`class ${t}${c} {`);for(let[d,p]of Object.entries(s)){if(p.scope!=="static")continue;let h=p.identifier??d,m=p.access==="private"?"#":"",b=p.initializer!==void 0?JSON.stringify(p.initializer):p.default!==void 0?JSON.stringify(p.default):"null";l.push(` static ${m}${h} = ${b};`)}for(let[d,p]of Object.entries(s)){if(p.scope==="static")continue;if(p.access!=="private")continue;let h=p.identifier??d;l.push(` #${h};`)}if(Object.keys(s).length>0)l.push("");if(l.push(" constructor(config = {}) {"),o?.superCall||r!=="Object"){let d=o?.superCall?.arguments?o.superCall.arguments.join(", "):"";l.push(` super(${d});`)}for(let[d,p]of Object.entries(s)){if(p.scope==="static")continue;let h=p.identifier??d,m=p.access==="private"?"#":"",b=p.initializer!==void 0?JSON.stringify(p.initializer):p.default!==void 0?JSON.stringify(p.default):"null";l.push(` this.${m}${h} = config.${h} !== undefined ? config.${h} : ${b};`)}if(o?.body){let d=Array.isArray(o.body)?o.body:[o.body];for(let p of d)l.push(` ${p}`)}l.push(" }");for(let[d,p]of Object.entries(a)){let h=p.identifier??d,m=p.scope==="static",g=p.access==="private"?"#":"",y=m?"static ":"",v=p.returnType?.$ref?.includes("Promise")||TO(p)?"async ":"",j=gy(p.parameters??[]),S=CO(p.body);if(l.push(""),p.role==="accessor"){if(p.getter)l.push(` ${y}get ${g}${h}() {`,` ${p.getter.body}`," }");if(p.setter){let P=gy(p.setter.parameters??[]);l.push(` ${y}set ${g}${h}(${P}) {`,` ${p.setter.body}`," }")}}else{l.push(` ${y}${v}${g}${h}(${j}) {`);for(let P of S)l.push(` ${P}`);l.push(" }")}}return l.push("}","",`export { ${t} };`,`export default ${t};`,""),l.join(`
309
+ `)}function AO(e){return typeof e==="object"}function OO(e){if(!e)return"Object";if(N(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 gy(e){return e.map((t)=>{if(t.$ref)return t.$ref.split("/").pop();let r=t.identifier??t.name;return N(r)?r:"arg"}).join(", ")}function CO(e){if(!e)return[""];return Array.isArray(e)?e:[e]}function TO(e){return(Array.isArray(e.body)?e.body.join(`
310
+ `):e.body??"").includes("await ")}var by=q(()=>{ve()});import{readFileSync as NO}from"node:fs";async function Gu(e,t={}){let{title:r="Jx App",reactivitySrc:n=Ks,litHtmlSrc:s=Ys,projectStyle:i=null}=t,o;if(N(e)){let l=NO(e,"utf8");if(e.endsWith(".json"))o=Pn(l,e);else{let{extname:c}=await import("node:path"),d=c(e).toLowerCase(),p=t.formats?.byExtension(d,"parse");if(!p){await Promise.resolve().then(() => sn());throw pa(e,d)}o=await p.parseDocument(l)}}else o=e;if(Yp(o)){await Promise.resolve().then(() => by());let c=yy(o),d=N(e)?e.replace(/\.class\.json$/,".js"):`${o.title}.js`;return{files:[{content:c,path:d}],html:""}}if(!qa(o))return cy(o,{litHtmlSrc:s,projectStyle:i,reactivitySrc:n,...xy(t),title:r});if(o.tagName&&o.tagName.includes("-")){let{tagName:l}=o,c=Ua(l),p={content:co(o,c,[],t.rewriteSrc,null,t.serverBaseUrl),path:`${l}.js`,tagName:l},h=ti(o,o.$media??{},i),m=`<!DOCTYPE html>
350
311
  <html lang="en">
351
312
  <head>
352
313
  <meta charset="utf-8">
353
314
  <meta name="viewport" content="width=device-width, initial-scale=1">
354
- <title>${Se(r)}</title>
315
+ <title>${$e(r)}</title>
355
316
  <script type="importmap">
356
317
  {
357
318
  "imports": {
358
319
  "@vue/reactivity": "${n}",
359
- "lit-html": "${i}"
320
+ "lit-html": "${s}"
360
321
  }
361
322
  }
362
323
  </script>
363
- ${d}
324
+ ${h}
364
325
  </head>
365
326
  <body>
366
- <${a}></${a}>
367
- <script type="module" src="./${a}.js"></script>
327
+ <${l}></${l}>
328
+ <script type="module" src="./${l}.js"></script>
368
329
  </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(()=>{/*!
330
+ </html>`;return{files:[p],html:m}}let a={litHtmlSrc:s,projectStyle:i,reactivitySrc:n,...xy(t),title:r};if(t.serverBaseUrl!==void 0)a.serverBaseUrl=t.serverBaseUrl;return Vu(o,a)}function xy(e){let t={};if(e.prePaintScheme===!1)t.prePaintScheme=!1;if(e.rewriteSrc)t.rewriteSrc=e.rewriteSrc;return t}async function J9(e,t){let r=await Gu(e),{writeFileSync:n,mkdirSync:s}=await import("node:fs"),{dirname:i,join:o}=await import("node:path");if(t){n(t,r.html,"utf8"),console.error(`Written to ${t}`);let a=i(t);for(let l of r.files){let c=o(a,l.path);s(i(c),{recursive:!0}),n(c,l.content,"utf8"),console.error(`Written to ${c}`)}}else process.stdout.write(r.html)}var $y=q(()=>{Mr();uo();dy();Bu();ve();rr();Mr();zu();uo();Bu()});import{readFileSync as IO}from"node:fs";import{dirname as Ku,resolve as nl}from"node:path";import{createRequire as MO}from"node:module";function LO(e){return vt(e.resolve)}async function vy(e,t,r,n={}){let s=e.imports??{},{state:i}=e;if(!i)return;for(let[o,a]of Object.entries(i)){if(!Cr(a))continue;if(JO.has(a.$prototype))continue;if(a.timing&&a.timing!=="compiler"){let l=n.registry?.byName(a.$prototype);if(l?.capabilities.lower)try{let c=await l.call("lower",a,{projectConfig:n.config,root:r,route:t});if(ee(c)){let d=c.$bundle;if(Array.isArray(d)){for(let p of d)if(N(p))n.registerBundle?.(p)}delete c.$bundle}i[o]=c}catch(c){console.warn(`prototype-resolver: failed to lower "${o}" ($prototype: "${a.$prototype}"):`,Ee(c))}continue}if(!a.$src){let l=s[a.$prototype]??FO(n,a.$prototype);if(!l)continue;a.$src=l}try{let l=await qO(a,t,r,i,n);if(a.timing&&ee(l))l.timing=a.timing;i[o]=l}catch(l){console.warn(`prototype-resolver: failed to resolve "${o}" ($prototype: "${a.$prototype}"):`,Ee(l))}}}function FO(e,t){return e.registry?.byName(t)?.classPath}async function qO(e,t,r,n,s){let i=e.$src;if(!i)throw Error(`$prototype "${e.$prototype}" has no $src to resolve`);let o;if(i.startsWith("./")||i.startsWith("../"))o=t.sourcePath?nl(Ku(t.sourcePath),i):nl(r,i);else o=MO(nl(r,"package.json")).resolve(i);let a=IO(o,"utf8"),l=im(a,o);if(!l.$implementation)throw Error(`${i} has no $implementation field`);let c=nl(Ku(o),l.$implementation),d=await Tc(c),p=e.$export??l.title??e.$prototype,h=d[p]??d.default?.[p];if(!h)throw Error(`Module ${l.$implementation} does not export "${p}"`);let m={};for(let[g,y]of Object.entries(e))if(!DO.has(g))m[g]=y;if(m.src&&!m.basePath&&t.sourcePath)m.basePath=Ku(t.sourcePath);m._project={config:s.config??null,root:r,...s.sections},m._document={route:t,state:n};let b=new h(m);if(LO(b))return await b.resolve();return b}var JO,DO;var wy=q(()=>{sn();ve();rr();JO=new Set(["Function","LocalStorage","SessionStorage","Array"]),DO=new Set(["$prototype","$src","$export","timing","default","description"])});var Sy=(e)=>typeof e<"u"&&e!==null,HO=(e)=>typeof e==="object",VO=(e)=>Object.prototype.toString.call(e)==="[object Object]",WO=(e)=>typeof e==="function",BO=(e)=>typeof e==="boolean",UO=(e)=>e instanceof Buffer,zO=(e)=>{if(Sy(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},GO=(e)=>e instanceof ArrayBuffer,KO=(e)=>typeof e==="string"&&e.length>0,YO=(e)=>typeof e==="number"&&Number.isFinite(e),XO=(e)=>Number.isInteger(e),ZO=(e,t,r)=>e>=t&&e<=r,QO=(e,t)=>t.includes(e),eC=(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}`)},tC=(e,t)=>(t.message=e.message,t),u;var Dr=q(()=>{/*!
370
331
  Copyright 2013 Lovell Fuller and others.
371
332
  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);/*!
333
+ */u={defined:Sy,object:HO,plainObject:VO,fn:WO,bool:BO,buffer:UO,typedArray:zO,arrayBuffer:GO,string:KO,number:YO,integer:XO,inRange:ZO,inArray:QO,invalidParameterError:eC,nativeError:tC}});var Py=C(function(X9,_y){var Ey=()=>process.platform==="linux",sl=null,rC=()=>{if(!sl)if(Ey()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,sl=process.report.getReport(),process.report.excludeNetwork=e}else sl={};return sl};_y.exports={isLinux:Ey,getReport:rC}});var ky=C(function(Z9,jy){var si=Te("fs"),nC=(e)=>{let t=si.openSync(e,"r"),r=Buffer.alloc(2048),n=si.readSync(t,r,0,2048,0);return si.close(t,()=>{}),r.subarray(0,n)},sC=(e)=>new Promise((t,r)=>{si.open(e,"r",(n,s)=>{if(n)r(n);else{let i=Buffer.alloc(2048);si.read(s,i,0,2048,0,(o,a)=>{t(i.subarray(0,a)),si.close(s,()=>{})})}})});jy.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:nC,readFile:sC}});var Ay=C(function(Q9,Ry){var iC=(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 s=0;s<n;s++){let i=t+s*r;if(e.readUInt32LE(i)===3){let a=e.readUInt32LE(i+8),l=e.readUInt32LE(i+32);return e.subarray(a,a+l).toString().replace(/\0.*$/g,"")}}return null};Ry.exports={interpreterPath:iC}});var ol=C(function(eG,zy){var Cy=Te("child_process"),{isLinux:ii,getReport:Ty}=Py(),{LDD_PATH:il,SELF_PATH:Ny,readFile:Yu,readFileSync:Xu}=ky(),{interpreterPath:Iy}=Ay(),Lr,Fr,qr,Mn="",My=()=>{if(!Mn)return new Promise((e)=>{Cy.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(t,r)=>{Mn=t?" ":r,e(Mn)})});return Mn},Jy=()=>{if(!Mn)try{Mn=Cy.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(e){Mn=" "}return Mn},hn="glibc",Dy=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,vs="musl",oC=(e)=>e.includes("libc.musl-")||e.includes("ld-musl-"),Ly=()=>{let e=Ty();if(e.header&&e.header.glibcVersionRuntime)return hn;if(Array.isArray(e.sharedObjects)){if(e.sharedObjects.some(oC))return vs}return null},Fy=(e)=>{let[t,r]=e.split(/[\r\n]+/);if(t&&t.includes(hn))return hn;if(r&&r.includes(vs))return vs;return null},qy=(e)=>{if(e){if(e.includes("/ld-musl-"))return vs;else if(e.includes("/ld-linux-"))return hn}return null},Hy=(e)=>{if(e=e.toString(),e.includes("musl"))return vs;if(e.includes("GNU C Library"))return hn;return null},aC=async()=>{if(Fr!==void 0)return Fr;Fr=null;try{let e=await Yu(il);Fr=Hy(e)}catch(e){}return Fr},lC=()=>{if(Fr!==void 0)return Fr;Fr=null;try{let e=Xu(il);Fr=Hy(e)}catch(e){}return Fr},cC=async()=>{if(Lr!==void 0)return Lr;Lr=null;try{let e=await Yu(Ny),t=Iy(e);Lr=qy(t)}catch(e){}return Lr},uC=()=>{if(Lr!==void 0)return Lr;Lr=null;try{let e=Xu(Ny),t=Iy(e);Lr=qy(t)}catch(e){}return Lr},Vy=async()=>{let e=null;if(ii()){if(e=await cC(),!e){if(e=await aC(),!e)e=Ly();if(!e){let t=await My();e=Fy(t)}}}return e},Wy=()=>{let e=null;if(ii()){if(e=uC(),!e){if(e=lC(),!e)e=Ly();if(!e){let t=Jy();e=Fy(t)}}}return e},dC=async()=>ii()&&await Vy()!==hn,fC=()=>ii()&&Wy()!==hn,pC=async()=>{if(qr!==void 0)return qr;qr=null;try{let t=(await Yu(il)).match(Dy);if(t)qr=t[1]}catch(e){}return qr},mC=()=>{if(qr!==void 0)return qr;qr=null;try{let t=Xu(il).match(Dy);if(t)qr=t[1]}catch(e){}return qr},By=()=>{let e=Ty();if(e.header&&e.header.glibcVersionRuntime)return e.header.glibcVersionRuntime;return null},Oy=(e)=>e.trim().split(/\s+/)[1],Uy=(e)=>{let[t,r,n]=e.split(/[\r\n]+/);if(t&&t.includes(hn))return Oy(t);if(r&&n&&r.includes(vs))return Oy(n);return null},hC=async()=>{let e=null;if(ii()){if(e=await pC(),!e)e=By();if(!e){let t=await My();e=Uy(t)}}return e},gC=()=>{let e=null;if(ii()){if(e=mC(),!e)e=By();if(!e){let t=Jy();e=Uy(t)}}return e};zy.exports={GLIBC:hn,MUSL:vs,family:Vy,familySync:Wy,isNonGlibcLinux:dC,isNonGlibcLinuxSync:fC,version:hC,versionSync:gC}});var oi=C(function(tG,Gy){var yC=Number.MAX_SAFE_INTEGER||9007199254740991,bC=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Gy.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:yC,RELEASE_TYPES:bC,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var fo=C(function(rG,Ky){var xC=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Ky.exports=xC});var ai=C(function(Hr,Yy){var{MAX_SAFE_COMPONENT_LENGTH:Zu,MAX_SAFE_BUILD_LENGTH:$C,MAX_LENGTH:vC}=oi(),wC=fo();Hr=Yy.exports={};var SC=Hr.re=[],EC=Hr.safeRe=[],X=Hr.src=[],_C=Hr.safeSrc=[],Z=Hr.t={},PC=0,Qu="[a-zA-Z0-9-]",jC=[["\\s",1],["\\d",vC],[Qu,$C]],kC=(e)=>{for(let[t,r]of jC)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},be=(e,t,r)=>{let n=kC(t),s=PC++;wC(e,s,t),Z[e]=s,X[s]=t,_C[s]=n,SC[s]=new RegExp(t,r?"g":void 0),EC[s]=new RegExp(n,r?"g":void 0)};be("NUMERICIDENTIFIER","0|[1-9]\\d*");be("NUMERICIDENTIFIERLOOSE","\\d+");be("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Qu}*`);be("MAINVERSION",`(${X[Z.NUMERICIDENTIFIER]})\\.(${X[Z.NUMERICIDENTIFIER]})\\.(${X[Z.NUMERICIDENTIFIER]})`);be("MAINVERSIONLOOSE",`(${X[Z.NUMERICIDENTIFIERLOOSE]})\\.(${X[Z.NUMERICIDENTIFIERLOOSE]})\\.(${X[Z.NUMERICIDENTIFIERLOOSE]})`);be("PRERELEASEIDENTIFIER",`(?:${X[Z.NONNUMERICIDENTIFIER]}|${X[Z.NUMERICIDENTIFIER]})`);be("PRERELEASEIDENTIFIERLOOSE",`(?:${X[Z.NONNUMERICIDENTIFIER]}|${X[Z.NUMERICIDENTIFIERLOOSE]})`);be("PRERELEASE",`(?:-(${X[Z.PRERELEASEIDENTIFIER]}(?:\\.${X[Z.PRERELEASEIDENTIFIER]})*))`);be("PRERELEASELOOSE",`(?:-?(${X[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${X[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);be("BUILDIDENTIFIER",`${Qu}+`);be("BUILD",`(?:\\+(${X[Z.BUILDIDENTIFIER]}(?:\\.${X[Z.BUILDIDENTIFIER]})*))`);be("FULLPLAIN",`v?${X[Z.MAINVERSION]}${X[Z.PRERELEASE]}?${X[Z.BUILD]}?`);be("FULL",`^${X[Z.FULLPLAIN]}$`);be("LOOSEPLAIN",`[v=\\s]*${X[Z.MAINVERSIONLOOSE]}${X[Z.PRERELEASELOOSE]}?${X[Z.BUILD]}?`);be("LOOSE",`^${X[Z.LOOSEPLAIN]}$`);be("GTLT","((?:<|>)?=?)");be("XRANGEIDENTIFIERLOOSE",`${X[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);be("XRANGEIDENTIFIER",`${X[Z.NUMERICIDENTIFIER]}|x|X|\\*`);be("XRANGEPLAIN",`[v=\\s]*(${X[Z.XRANGEIDENTIFIER]})(?:\\.(${X[Z.XRANGEIDENTIFIER]})(?:\\.(${X[Z.XRANGEIDENTIFIER]})(?:${X[Z.PRERELEASE]})?${X[Z.BUILD]}?)?)?`);be("XRANGEPLAINLOOSE",`[v=\\s]*(${X[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Z.XRANGEIDENTIFIERLOOSE]})(?:${X[Z.PRERELEASELOOSE]})?${X[Z.BUILD]}?)?)?`);be("XRANGE",`^${X[Z.GTLT]}\\s*${X[Z.XRANGEPLAIN]}$`);be("XRANGELOOSE",`^${X[Z.GTLT]}\\s*${X[Z.XRANGEPLAINLOOSE]}$`);be("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Zu}})(?:\\.(\\d{1,${Zu}}))?(?:\\.(\\d{1,${Zu}}))?`);be("COERCE",`${X[Z.COERCEPLAIN]}(?:$|[^\\d])`);be("COERCEFULL",X[Z.COERCEPLAIN]+`(?:${X[Z.PRERELEASE]})?(?:${X[Z.BUILD]})?(?:$|[^\\d])`);be("COERCERTL",X[Z.COERCE],!0);be("COERCERTLFULL",X[Z.COERCEFULL],!0);be("LONETILDE","(?:~>?)");be("TILDETRIM",`(\\s*)${X[Z.LONETILDE]}\\s+`,!0);Hr.tildeTrimReplace="$1~";be("TILDE",`^${X[Z.LONETILDE]}${X[Z.XRANGEPLAIN]}$`);be("TILDELOOSE",`^${X[Z.LONETILDE]}${X[Z.XRANGEPLAINLOOSE]}$`);be("LONECARET","(?:\\^)");be("CARETTRIM",`(\\s*)${X[Z.LONECARET]}\\s+`,!0);Hr.caretTrimReplace="$1^";be("CARET",`^${X[Z.LONECARET]}${X[Z.XRANGEPLAIN]}$`);be("CARETLOOSE",`^${X[Z.LONECARET]}${X[Z.XRANGEPLAINLOOSE]}$`);be("COMPARATORLOOSE",`^${X[Z.GTLT]}\\s*(${X[Z.LOOSEPLAIN]})$|^$`);be("COMPARATOR",`^${X[Z.GTLT]}\\s*(${X[Z.FULLPLAIN]})$|^$`);be("COMPARATORTRIM",`(\\s*)${X[Z.GTLT]}\\s*(${X[Z.LOOSEPLAIN]}|${X[Z.XRANGEPLAIN]})`,!0);Hr.comparatorTrimReplace="$1$2$3";be("HYPHENRANGE",`^\\s*(${X[Z.XRANGEPLAIN]})\\s+-\\s+(${X[Z.XRANGEPLAIN]})\\s*$`);be("HYPHENRANGELOOSE",`^\\s*(${X[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${X[Z.XRANGEPLAINLOOSE]})\\s*$`);be("STAR","(<|>)?=?\\s*\\*");be("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");be("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var al=C(function(nG,Xy){var RC=Object.freeze({loose:!0}),AC=Object.freeze({}),OC=(e)=>{if(!e)return AC;if(typeof e!=="object")return RC;return e};Xy.exports=OC});var ed=C(function(sG,eb){var Zy=/^[0-9]+$/,Qy=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Zy.test(e),n=Zy.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},CC=(e,t)=>Qy(t,e);eb.exports={compareIdentifiers:Qy,rcompareIdentifiers:CC}});var ht=C(function(iG,rb){var ll=fo(),{MAX_LENGTH:tb,MAX_SAFE_INTEGER:cl}=oi(),{safeRe:ul,t:dl}=ai(),TC=al(),{compareIdentifiers:td}=ed(),NC=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(td(e[n],r[n])!==0)return!1;return!0};class Sr{constructor(e,t){if(t=TC(t),e instanceof Sr)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>tb)throw TypeError(`version is longer than ${tb} characters`);ll("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?ul[dl.LOOSE]:ul[dl.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>cl||this.major<0)throw TypeError("Invalid major version");if(this.minor>cl||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>cl||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 s=+n;if(s>=0&&s<cl)return s}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(ll("SemVer.compare",this.version,this.options,e),!(e instanceof Sr)){if(typeof e==="string"&&e===this.version)return 0;e=new Sr(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Sr))e=new Sr(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 Sr))e=new Sr(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(ll("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 td(r,n)}while(++t)}compareBuild(e){if(!(e instanceof Sr))e=new Sr(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(ll("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 td(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?ul[dl.PRERELEASELOOSE]:ul[dl.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 s=this.prerelease.length;while(--s>=0)if(typeof this.prerelease[s]==="number")this.prerelease[s]++,s=-2;if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let s=[t,n];if(r===!1)s=[t];if(NC(this.prerelease,t)){let i=this.prerelease[t.split(".").length];if(isNaN(i))this.prerelease=s}else this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}rb.exports=Sr});var Jn=C(function(oG,sb){var nb=ht(),IC=(e,t,r=!1)=>{if(e instanceof nb)return e;try{return new nb(e,t)}catch(n){if(!r)return null;throw n}};sb.exports=IC});var ob=C(function(aG,ib){var MC=Jn(),JC=(e,t)=>{let r=MC(e,t);return r?r.version:null};ib.exports=JC});var lb=C(function(lG,ab){var DC=Jn(),LC=(e,t)=>{let r=DC(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};ab.exports=LC});var db=C(function(cG,ub){var cb=ht(),FC=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new cb(e instanceof cb?e.version:e,r).inc(t,n,s).version}catch(i){return null}};ub.exports=FC});var mb=C(function(uG,pb){var fb=Jn(),qC=(e,t)=>{let r=fb(e,null,!0),n=fb(t,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let d=l?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};pb.exports=qC});var gb=C(function(dG,hb){var HC=ht(),VC=(e,t)=>new HC(e,t).major;hb.exports=VC});var bb=C(function(fG,yb){var WC=ht(),BC=(e,t)=>new WC(e,t).minor;yb.exports=BC});var $b=C(function(pG,xb){var UC=ht(),zC=(e,t)=>new UC(e,t).patch;xb.exports=zC});var wb=C(function(mG,vb){var GC=Jn(),KC=(e,t)=>{let r=GC(e,t);return r&&r.prerelease.length?r.prerelease:null};vb.exports=KC});var pr=C(function(hG,Eb){var Sb=ht(),YC=(e,t,r)=>new Sb(e,r).compare(new Sb(t,r));Eb.exports=YC});var Pb=C(function(gG,_b){var XC=pr(),ZC=(e,t,r)=>XC(t,e,r);_b.exports=ZC});var kb=C(function(yG,jb){var QC=pr(),eT=(e,t)=>QC(e,t,!0);jb.exports=eT});var fl=C(function(bG,Ab){var Rb=ht(),tT=(e,t,r)=>{let n=new Rb(e,r),s=new Rb(t,r);return n.compare(s)||n.compareBuild(s)};Ab.exports=tT});var Cb=C(function(xG,Ob){var rT=fl(),nT=(e,t)=>e.sort((r,n)=>rT(r,n,t));Ob.exports=nT});var Nb=C(function($G,Tb){var sT=fl(),iT=(e,t)=>e.sort((r,n)=>sT(n,r,t));Tb.exports=iT});var po=C(function(vG,Ib){var oT=pr(),aT=(e,t,r)=>oT(e,t,r)>0;Ib.exports=aT});var pl=C(function(wG,Mb){var lT=pr(),cT=(e,t,r)=>lT(e,t,r)<0;Mb.exports=cT});var rd=C(function(SG,Jb){var uT=pr(),dT=(e,t,r)=>uT(e,t,r)===0;Jb.exports=dT});var nd=C(function(EG,Db){var fT=pr(),pT=(e,t,r)=>fT(e,t,r)!==0;Db.exports=pT});var ml=C(function(_G,Lb){var mT=pr(),hT=(e,t,r)=>mT(e,t,r)>=0;Lb.exports=hT});var hl=C(function(PG,Fb){var gT=pr(),yT=(e,t,r)=>gT(e,t,r)<=0;Fb.exports=yT});var sd=C(function(jG,qb){var bT=rd(),xT=nd(),$T=po(),vT=ml(),wT=pl(),ST=hl(),ET=(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 bT(e,r,n);case"!=":return xT(e,r,n);case">":return $T(e,r,n);case">=":return vT(e,r,n);case"<":return wT(e,r,n);case"<=":return ST(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};qb.exports=ET});var Vb=C(function(kG,Hb){var _T=ht(),PT=Jn(),{safeRe:gl,t:yl}=ai(),jT=(e,t)=>{if(e instanceof _T)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?gl[yl.COERCEFULL]:gl[yl.COERCE]);else{let l=t.includePrerelease?gl[yl.COERCERTLFULL]:gl[yl.COERCERTL],c;while((c=l.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||c.index+c[0].length!==r.index+r[0].length)r=c;l.lastIndex=c.index+c[1].length+c[2].length}l.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return PT(`${n}.${s}.${i}${o}${a}`,t)};Hb.exports=jT});var Bb=C(function(RG,Wb){var kT=Jn(),RT=oi(),AT=ht(),OT=(e,t,r)=>{if(!RT.RELEASE_TYPES.includes(t))return null;let n=CT(e,r);return n&&TT(n,t)},CT=(e,t)=>{let r=e instanceof AT?e.version:e;return kT(r,t)},TT=(e,t)=>{if(NT(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()},NT=(e)=>e.startsWith("pre");Wb.exports=OT});var Gb=C(function(AG,zb){class Ub{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}}zb.exports=Ub});var mr=C(function(OG,Zb){var IT=/\s+/g;class mo{constructor(e,t){if(t=JT(t),e instanceof mo)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new mo(e.raw,t);if(e instanceof id)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(IT," "),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)=>!Yb(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&&UT(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(BT,"");let r=((this.options.includePrerelease&&VT)|(this.options.loose&&WT))+":"+e,n=Kb.get(r);if(n)return n;let s=this.options.loose,i=s?Ct[gt.HYPHENRANGELOOSE]:Ct[gt.HYPHENRANGE];e=e.replace(i,nN(this.options.includePrerelease)),qe("hyphen replace",e),e=e.replace(Ct[gt.COMPARATORTRIM],FT),qe("comparator trim",e),e=e.replace(Ct[gt.TILDETRIM],qT),qe("tilde trim",e),e=e.replace(Ct[gt.CARETTRIM],HT),qe("caret trim",e);let o=e.split(" ").map((d)=>zT(d,this.options)).join(" ").split(/\s+/).map((d)=>rN(d,this.options));if(s)o=o.filter((d)=>(qe("loose invalid filter",d,this.options),!!d.match(Ct[gt.COMPARATORLOOSE])));qe("range list",o);let a=new Map,l=o.map((d)=>new id(d,this.options));for(let d of l){if(Yb(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let c=[...a.values()];return Kb.set(r,c),c}intersects(e,t){if(!(e instanceof mo))throw TypeError("a Range is required");return this.set.some((r)=>Xb(r,t)&&e.set.some((n)=>Xb(n,t)&&r.every((s)=>n.every((i)=>s.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new DT(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(sN(this.set[t],e,this.options))return!0;return!1}}Zb.exports=mo;var MT=Gb(),Kb=new MT,JT=al(),id=ho(),qe=fo(),DT=ht(),{safeRe:Ct,src:LT,t:gt,comparatorTrimReplace:FT,tildeTrimReplace:qT,caretTrimReplace:HT}=ai(),{FLAG_INCLUDE_PRERELEASE:VT,FLAG_LOOSE:WT}=oi(),BT=new RegExp(LT[gt.BUILD],"g"),Yb=(e)=>e.value==="<0.0.0-0",UT=(e)=>e.value==="",Xb=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();while(r&&n.length)r=n.every((i)=>s.intersects(i,t)),s=n.pop();return r},zT=(e,t)=>(e=e.replace(Ct[gt.BUILD],""),qe("comp",e,t),e=XT(e,t),qe("caret",e),e=KT(e,t),qe("tildes",e),e=QT(e,t),qe("xrange",e),e=tN(e,t),qe("stars",e),e),at=(e)=>!e||e.toLowerCase()==="x"||e==="*",GT=(e,t,r)=>at(e)&&!at(t)||at(t)&&r&&!at(r),KT=(e,t)=>e.trim().split(/\s+/).map((r)=>YT(r,t)).join(" "),YT=(e,t)=>{let r=t.loose?Ct[gt.TILDELOOSE]:Ct[gt.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(s,i,o,a,l)=>{qe("tilde",e,s,i,o,a,l);let c;if(at(i))c="";else if(at(o))c=`>=${i}.0.0${n} <${+i+1}.0.0-0`;else if(at(a))c=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`;else if(l)qe("replaceTilde pr",l),c=`>=${i}.${o}.${a}-${l} <${i}.${+o+1}.0-0`;else c=`>=${i}.${o}.${a} <${i}.${+o+1}.0-0`;return qe("tilde return",c),c})},XT=(e,t)=>e.trim().split(/\s+/).map((r)=>ZT(r,t)).join(" "),ZT=(e,t)=>{qe("caret",e,t);let r=t.loose?Ct[gt.CARETLOOSE]:Ct[gt.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,i,o,a,l)=>{qe("caret",e,s,i,o,a,l);let c;if(at(i))c="";else if(at(o))c=`>=${i}.0.0${n} <${+i+1}.0.0-0`;else if(at(a))if(i==="0")c=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`;else c=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`;else if(l)if(qe("replaceCaret pr",l),i==="0")if(o==="0")c=`>=${i}.${o}.${a}-${l} <${i}.${o}.${+a+1}-0`;else c=`>=${i}.${o}.${a}-${l} <${i}.${+o+1}.0-0`;else c=`>=${i}.${o}.${a}-${l} <${+i+1}.0.0-0`;else if(qe("no pr"),i==="0")if(o==="0")c=`>=${i}.${o}.${a} <${i}.${o}.${+a+1}-0`;else c=`>=${i}.${o}.${a} <${i}.${+o+1}.0-0`;else c=`>=${i}.${o}.${a} <${+i+1}.0.0-0`;return qe("caret return",c),c})},QT=(e,t)=>(qe("replaceXRanges",e,t),e.split(/\s+/).map((r)=>eN(r,t)).join(" ")),eN=(e,t)=>{e=e.trim();let r=t.loose?Ct[gt.XRANGELOOSE]:Ct[gt.XRANGE];return e.replace(r,(n,s,i,o,a,l)=>{if(qe("xRange",e,n,s,i,o,a,l),GT(i,o,a))return e;let c=at(i),d=c||at(o),p=d||at(a),h=p;if(s==="="&&h)s="";if(l=t.includePrerelease?"-0":"",c)if(s===">"||s==="<")n="<0.0.0-0";else n="*";else if(s&&h){if(d)o=0;if(a=0,s===">")if(s=">=",d)i=+i+1,o=0,a=0;else o=+o+1,a=0;else if(s==="<=")if(s="<",d)i=+i+1;else o=+o+1;if(s==="<")l="-0";n=`${s+i}.${o}.${a}${l}`}else if(d)n=`>=${i}.0.0${l} <${+i+1}.0.0-0`;else if(p)n=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`;return qe("xRange return",n),n})},tN=(e,t)=>(qe("replaceStars",e,t),e.trim().replace(Ct[gt.STAR],"")),rN=(e,t)=>(qe("replaceGTE0",e,t),e.trim().replace(Ct[t.includePrerelease?gt.GTE0PRE:gt.GTE0],"")),nN=(e)=>(t,r,n,s,i,o,a,l,c,d,p,h)=>{if(at(n))r="";else if(at(s))r=`>=${n}.0.0${e?"-0":""}`;else if(at(i))r=`>=${n}.${s}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(at(c))l="";else if(at(d))l=`<${+c+1}.0.0-0`;else if(at(p))l=`<${c}.${+d+1}.0-0`;else if(h)l=`<=${c}.${d}.${p}-${h}`;else if(e)l=`<${c}.${d}.${+p+1}-0`;else l=`<=${l}`;return`${r} ${l}`.trim()},sN=(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(qe(e[n].semver),e[n].semver===id.ANY)continue;if(e[n].semver.prerelease.length>0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}}return!1}return!0}});var ho=C(function(CG,sx){var go=Symbol("SemVer ANY");class bl{static get ANY(){return go}constructor(e,t){if(t=Qb(t),e instanceof bl)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),ad("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===go)this.value="";else this.value=this.operator+this.semver.version;ad("comp",this)}parse(e){let t=this.options.loose?ex[tx.COMPARATORLOOSE]:ex[tx.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=go;else this.semver=new rx(r[2],this.options.loose)}toString(){return this.value}test(e){if(ad("Comparator.test",e,this.options.loose),this.semver===go||e===go)return!0;if(typeof e==="string")try{e=new rx(e,this.options)}catch(t){return!1}return od(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof bl))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new nx(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new nx(this.value,t).test(e.semver)}if(t=Qb(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(od(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(od(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}sx.exports=bl;var Qb=al(),{safeRe:ex,t:tx}=ai(),od=sd(),ad=fo(),rx=ht(),nx=mr()});var yo=C(function(TG,ix){var iN=mr(),oN=(e,t,r)=>{try{t=new iN(t,r)}catch(n){return!1}return t.test(e)};ix.exports=oN});var ax=C(function(NG,ox){var aN=mr(),lN=(e,t)=>new aN(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));ox.exports=lN});var cx=C(function(IG,lx){var cN=ht(),uN=mr(),dN=(e,t,r)=>{let n=null,s=null,i=null;try{i=new uN(t,r)}catch(o){return null}return e.forEach((o)=>{if(i.test(o)){if(!n||s.compare(o)===-1)n=o,s=new cN(n,r)}}),n};lx.exports=dN});var dx=C(function(MG,ux){var fN=ht(),pN=mr(),mN=(e,t,r)=>{let n=null,s=null,i=null;try{i=new pN(t,r)}catch(o){return null}return e.forEach((o)=>{if(i.test(o)){if(!n||s.compare(o)===1)n=o,s=new fN(n,r)}}),n};ux.exports=mN});var mx=C(function(JG,px){var ld=ht(),hN=mr(),fx=po(),gN=(e,t)=>{e=new hN(e,t);let r=new ld("0.0.0");if(e.test(r))return r;if(r=new ld("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let s=e.set[n],i=null;if(s.forEach((o)=>{let a=new ld(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(!i||fx(a,i))i=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||fx(r,i)))r=i}if(r&&e.test(r))return r;return null};px.exports=gN});var gx=C(function(DG,hx){var yN=mr(),bN=(e,t)=>{try{return new yN(e,t).range||"*"}catch(r){return null}};hx.exports=bN});var xl=C(function(LG,$x){var xN=ht(),xx=ho(),{ANY:$N}=xx,vN=mr(),wN=yo(),yx=po(),bx=pl(),SN=hl(),EN=ml(),_N=(e,t,r,n)=>{e=new xN(e,n),t=new vN(t,n);let s,i,o,a,l;switch(r){case">":s=yx,i=SN,o=bx,a=">",l=">=";break;case"<":s=bx,i=EN,o=yx,a="<",l="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(wN(e,t,n))return!1;for(let c=0;c<t.set.length;++c){let d=t.set[c],p=null,h=null;if(d.forEach((m)=>{if(m.semver===$N)m=new xx(">=0.0.0");if(p=p||m,h=h||m,s(m.semver,p.semver,n))p=m;else if(o(m.semver,h.semver,n))h=m}),p.operator===a||p.operator===l)return!1;if((!h.operator||h.operator===a)&&i(e,h.semver))return!1;else if(h.operator===l&&o(e,h.semver))return!1}return!0};$x.exports=_N});var wx=C(function(FG,vx){var PN=xl(),jN=(e,t,r)=>PN(e,t,">",r);vx.exports=jN});var Ex=C(function(qG,Sx){var kN=xl(),RN=(e,t,r)=>kN(e,t,"<",r);Sx.exports=RN});var jx=C(function(HG,Px){var _x=mr(),AN=(e,t,r)=>(e=new _x(e,r),t=new _x(t,r),e.intersects(t,r));Px.exports=AN});var Rx=C(function(VG,kx){var ON=yo(),CN=pr();kx.exports=(e,t,r)=>{let n=[],s=null,i=null,o=e.sort((d,p)=>CN(d,p,r));for(let d of o)if(ON(d,t,r)){if(i=d,!s)s=d}else{if(i)n.push([s,i]);i=null,s=null}if(s)n.push([s,null]);let a=[];for(let[d,p]of n)if(d===p)a.push(d);else if(!p&&d===o[0])a.push("*");else if(!p)a.push(`>=${d}`);else if(d===o[0])a.push(`<=${p}`);else a.push(`${d} - ${p}`);let l=a.join(" || "),c=typeof t.raw==="string"?t.raw:String(t);return l.length<c.length?l:t}});var Ix=C(function(WG,Nx){var Ax=mr(),dd=ho(),{ANY:cd}=dd,ud=yo(),fd=pr(),TN=(e,t,r={})=>{if(e===t)return!0;e=new Ax(e,r),t=new Ax(t,r);let n=!1;e:for(let s of e.set){for(let i of t.set){let o=IN(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},NN=[new dd(">=0.0.0-0")],Ox=[new dd(">=0.0.0")],IN=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===cd)if(t.length===1&&t[0].semver===cd)return!0;else if(r.includePrerelease)e=NN;else e=Ox;if(t.length===1&&t[0].semver===cd)if(r.includePrerelease)return!0;else t=Ox;let n=new Set,s,i;for(let m of e)if(m.operator===">"||m.operator===">=")s=Cx(s,m,r);else if(m.operator==="<"||m.operator==="<=")i=Tx(i,m,r);else n.add(m.semver);if(n.size>1)return null;let o;if(s&&i){if(o=fd(s.semver,i.semver,r),o>0)return null;else if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let m of n){if(s&&!ud(m,String(s),r))return null;if(i&&!ud(m,String(i),r))return null;for(let b of t)if(!ud(m,String(b),r))return!1;return!0}let a,l,c,d,p=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(p&&p.prerelease.length===1&&i.operator==="<"&&p.prerelease[0]===0)p=!1;for(let m of t){if(d=d||m.operator===">"||m.operator===">=",c=c||m.operator==="<"||m.operator==="<=",s){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=Cx(s,m,r),a===m&&a!==s)return!1}else if(s.operator===">="&&!m.test(s.semver))return!1}if(i){if(p){if(m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===p.major&&m.semver.minor===p.minor&&m.semver.patch===p.patch)p=!1}if(m.operator==="<"||m.operator==="<="){if(l=Tx(i,m,r),l===m&&l!==i)return!1}else if(i.operator==="<="&&!m.test(i.semver))return!1}if(!m.operator&&(i||s)&&o!==0)return!1}if(s&&c&&!i&&o!==0)return!1;if(i&&d&&!s&&o!==0)return!1;if(h||p)return!1;return!0},Cx=(e,t,r)=>{if(!e)return t;let n=fd(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Tx=(e,t,r)=>{if(!e)return t;let n=fd(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Nx.exports=TN});var Lx=C(function(BG,Dx){var pd=ai(),Mx=oi(),MN=ht(),Jx=ed(),JN=Jn(),DN=ob(),LN=lb(),FN=db(),qN=mb(),HN=gb(),VN=bb(),WN=$b(),BN=wb(),UN=pr(),zN=Pb(),GN=kb(),KN=fl(),YN=Cb(),XN=Nb(),ZN=po(),QN=pl(),eI=rd(),tI=nd(),rI=ml(),nI=hl(),sI=sd(),iI=Vb(),oI=Bb(),aI=ho(),lI=mr(),cI=yo(),uI=ax(),dI=cx(),fI=dx(),pI=mx(),mI=gx(),hI=xl(),gI=wx(),yI=Ex(),bI=jx(),xI=Rx(),$I=Ix();Dx.exports={parse:JN,valid:DN,clean:LN,inc:FN,diff:qN,major:HN,minor:VN,patch:WN,prerelease:BN,compare:UN,rcompare:zN,compareLoose:GN,compareBuild:KN,sort:YN,rsort:XN,gt:ZN,lt:QN,eq:eI,neq:tI,gte:rI,lte:nI,cmp:sI,coerce:iI,truncate:oI,Comparator:aI,Range:lI,satisfies:cI,toComparators:uI,maxSatisfying:dI,minSatisfying:fI,minVersion:pI,validRange:mI,outside:hI,gtr:gI,ltr:yI,intersects:bI,simplifyRange:xI,subset:$I,SemVer:MN,re:pd.re,src:pd.src,tokens:pd.t,SEMVER_SPEC_VERSION:Mx.SEMVER_SPEC_VERSION,RELEASE_TYPES:Mx.RELEASE_TYPES,compareIdentifiers:Jx.compareIdentifiers,rcompareIdentifiers:Jx.rcompareIdentifiers}});var gn;var $l=q(()=>{gn={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 bo}from"node:child_process";import{createHash as wI}from"node:crypto";var xo,hd,SI,qx,EI,gd,_I=(e)=>{if(e instanceof Error)console.error(`sharp: Installation error: ${e.message}`);else console.log(`sharp: ${e}`)},Hx=()=>hd.default.isNonGlibcLinuxSync()?hd.default.familySync():"",PI=()=>`${process.platform}${Hx()}-${process.arch}`,li=()=>{if(Vx())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r==="string"?r:Hx();return`${t||process.platform}${n}-${e||process.arch}`},jI=()=>{try{return Te(`@img/sharp-libvips-dev-${li()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},kI=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},RI=()=>{try{return Te(`@img/sharp-libvips-dev-${li()}/lib`)}catch{try{return Te(`@img/sharp-libvips-${li()}/lib`)}catch{}}return""},AI=()=>{if(process.release?.name==="node"&&process.versions){if(!xo.default.satisfies(process.versions.node,gn.engines.node))return{found:process.versions.node,expected:gn.engines.node}}},Vx=()=>{let{CC:e}=process.env;return Boolean(e?.endsWith("/emcc"))},OI=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(bo("sysctl sysctl.proc_translated",gd).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},Fx=(e)=>wI("sha512").update(e).digest("hex"),CI=()=>{try{let e=Fx(`imgsharp-libvips-${li()}`),t=xo.default.coerce(gn.optionalDependencies[`@img/sharp-libvips-${li()}`],{includePrerelease:!0}).version;return Fx(`${e}npm:${t}`).slice(0,10)}catch{}return""},TI=()=>bo(`node-gyp rebuild --directory=src ${Vx()?"--nodedir=emscripten":""}`,{...gd,stdio:"inherit"}).status,Wx=()=>{if(process.platform!=="win32")return(bo("pkg-config --modversion vips-cpp",{...gd,env:{...process.env,PKG_CONFIG_PATH:Bx()}}).stdout||"").trim();else return""},NI=()=>{try{let e=(bo("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch(e){}return},II=()=>{try{let e=(bo("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch(e){}return},Bx=()=>{if(process.platform!=="win32")return[NI(),II(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},md=(e,t,r)=>{if(r)r(`Detected ${t}, skipping search for globally-installed libvips`);return e},MI=(e)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return md(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return md(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(OI())return md(!1,"Rosetta",e);let t=Wx();return!!t&&xo.default.gte(t,qx)},vl;var yd=q(()=>{$l();xo=kt(Lx(),1),hd=kt(ol(),1);/*!
373
334
  Copyright 2013 Lovell Fuller and others.
374
335
  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);/*!
336
+ */SI=process.env.npm_package_config_libvips||gn.config.libvips,qx=xo.default.coerce(SI).version,EI=["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"],gd={encoding:"utf8",shell:!0},vl={minimumLibvipsVersion:qx,prebuiltPlatforms:EI,buildPlatformArch:li,buildSharpLibvipsIncludeDir:jI,buildSharpLibvipsCPlusPlusDir:kI,buildSharpLibvipsLibDir:RI,isUnsupportedNodeRuntime:AI,runtimePlatformArch:PI,log:_I,yarnLocator:CI,spawnRebuild:TI,globalLibvipsVersion:Wx,pkgConfigPath:Bx,useGlobalLibvips:MI}});import{createRequire as JI}from"node:module";var wl,lt,zx,DI,Ux,LI,FI,yn,Je,Dn,Oe;var $o=q(()=>{yd();$l();wl=kt(ol(),1);/*!
376
337
  Copyright 2013 Lovell Fuller and others.
377
338
  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();/*!
339
+ */lt=JI(import.meta.url),{version:zx}=gn,{runtimePlatformArch:DI,isUnsupportedNodeRuntime:Ux,prebuiltPlatforms:LI,minimumLibvipsVersion:FI}=vl,yn=DI(),Dn=[];try{Je=lt(`../src/build/Release/sharp-${yn}-${zx}.node`)}catch(e){Dn.push(e)}if(!Je)try{Je=lt(`../src/build/Release/sharp-wasm32-${zx}.node`)}catch(e){Dn.push(e)}if(!Je)try{switch(yn){case"darwin-arm64":Je=lt("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":Je=lt("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":Je=lt("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":Je=lt("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":Je=lt("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":Je=lt("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":Je=lt("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":Je=lt("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":Je=lt("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":Je=lt("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":Je=lt("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":Je=lt("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":Je=lt("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":Je=lt("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":Je=lt("@img/sharp-webcontainers-wasm32/sharp.node");break}if(Je&&["linux-x64","linuxmusl-x64"].includes(yn)&&!Je._isUsingX64V2()){let e=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",Dn.push(e),Je=null}if(Je&&process.versions.electron&&yn.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){Dn.push(e)}if(!Je)try{Je=lt("@img/sharp-wasm32/sharp.node")}catch(e){Dn.push(e)}if(!Je){let[e,t,r]=["linux","darwin","win32"].map((i)=>yn.startsWith(i)),n=[`Could not load the "sharp" module using the ${yn} runtime`];Dn.forEach((i)=>{if(!i.code?.endsWith("MODULE_NOT_FOUND"))n.push(i.code?`${i.code}: ${i.message}`:i.message)});let s=Dn.map((i)=>i.message).join(" ");if(n.push("Possible solutions:"),Ux()){let{found:i,expected:o}=Ux();n.push("- Please upgrade Node.js:",` Found ${i}`,` Requires ${o}`)}else if(LI.includes(yn)&&!/libstdc\+\+\.so/.test(s)){let[i,o]=yn.split("-"),a=i.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=${i.replace("musl","")}${a} --cpu=${o} sharp`)}else n.push(`- Manually install libvips >= ${FI}`," 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(s))try{let{config:i}=lt(`@img/sharp-libvips-${yn}/package`),o=`${wl.familySync()} ${wl.versionSync()}`,a=`${i.musl?"musl":"glibc"} ${i.musl||i.glibc}`;n.push("- Update your OS:",` Found ${o}`,` Requires ${a}`)}catch(i){}if(e&&/\/snap\/core[0-9]{2}/.test(s))n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(t&&/Incompatible library version/.test(s))n.push("- Update Homebrew:"," brew update && brew upgrade vips");if(Dn.some((i)=>i.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(s))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(`
340
+ `))}Oe=Je});import qI from"node:util";import bd from"node:stream";function WI(){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 HI,VI=(e)=>{ws.queue.emit("change",e)},ws=function(e,t){if(arguments.length===1&&!u.defined(e))throw Error("Invalid input");if(!(this instanceof ws))return new ws(e,t);return bd.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),HI(r)},queueListener:VI},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this},Vr;var Gx=q(()=>{Dr();$o();/*!
380
341
  Copyright 2013 Lovell Fuller and others.
381
342
  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();/*!
343
+ */HI=qI.debuglog("sharp");Object.setPrototypeOf(ws.prototype,bd.Duplex.prototype);Object.setPrototypeOf(ws,bd.Duplex);Object.assign(ws.prototype,{clone:WI});Vr=ws});function Kx(e){let t=UI.filter((r)=>u.defined(e[r])).map((r)=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function zI(e,t,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(u.string(e))n.file=e;else if(u.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");n.buffer=e}else if(u.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(e,0,e.byteLength)}else if(u.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(u.plainObject(e)&&!u.defined(t)){if(t=e,Kx(t))n.buffer=[]}else if(!u.defined(e)&&!u.defined(t)&&u.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((s)=>this._createInputDescriptor(s));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}${u.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(u.object(t)){if(u.defined(t.failOn))if(u.string(t.failOn)&&u.inArray(t.failOn,["none","truncated","error","warning"]))n.failOn=t.failOn;else throw u.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(u.defined(t.autoOrient))if(u.bool(t.autoOrient))n.autoOrient=t.autoOrient;else throw u.invalidParameterError("autoOrient","boolean",t.autoOrient);if(u.defined(t.density))if(u.number(t.density)&&u.inRange(t.density,1,1e5))n.density=t.density;else throw u.invalidParameterError("density","number between 1 and 100000",t.density);if(u.defined(t.ignoreIcc))if(u.bool(t.ignoreIcc))n.ignoreIcc=t.ignoreIcc;else throw u.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(u.defined(t.limitInputPixels))if(u.bool(t.limitInputPixels))n.limitInputPixels=t.limitInputPixels?268402689:0;else if(u.integer(t.limitInputPixels)&&u.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=t.limitInputPixels;else throw u.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(u.defined(t.limitInputChannels))if(u.bool(t.limitInputChannels))n.limitInputChannels=t.limitInputChannels?5:0;else if(u.integer(t.limitInputChannels)&&u.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=t.limitInputChannels;else throw u.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(u.defined(t.unlimited))if(u.bool(t.unlimited))n.unlimited=t.unlimited;else throw u.invalidParameterError("unlimited","boolean",t.unlimited);if(u.defined(t.sequentialRead))if(u.bool(t.sequentialRead))n.sequentialRead=t.sequentialRead;else throw u.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(u.defined(t.raw)){if(u.object(t.raw)&&u.integer(t.raw.width)&&u.inRange(t.raw.width,1,1e8)&&u.integer(t.raw.height)&&u.inRange(t.raw.height,1,1e8)&&u.integer(t.raw.channels)&&u.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,u.defined(t.raw.premultiplied))if(u.bool(t.raw.premultiplied))n.rawPremultiplied=t.raw.premultiplied;else throw u.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(n.rawPageHeight=0,u.defined(t.raw.pageHeight))if(u.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 u.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(u.defined(t.animated))if(u.bool(t.animated))n.pages=t.animated?-1:1;else throw u.invalidParameterError("animated","boolean",t.animated);if(u.defined(t.pages))if(u.integer(t.pages)&&u.inRange(t.pages,-1,1e5))n.pages=t.pages;else throw u.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(u.defined(t.page))if(u.integer(t.page)&&u.inRange(t.page,0,1e5))n.page=t.page;else throw u.invalidParameterError("page","integer between 0 and 100000",t.page);if(u.object(t.openSlide)&&u.defined(t.openSlide.level))if(u.integer(t.openSlide.level)&&u.inRange(t.openSlide.level,0,256))n.openSlideLevel=t.openSlide.level;else throw u.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(u.defined(t.level))if(u.integer(t.level)&&u.inRange(t.level,0,256))n.openSlideLevel=t.level;else throw u.invalidParameterError("level","integer between 0 and 256",t.level);if(u.object(t.tiff)&&u.defined(t.tiff.subifd))if(u.integer(t.tiff.subifd)&&u.inRange(t.tiff.subifd,-1,1e5))n.tiffSubifd=t.tiff.subifd;else throw u.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(u.defined(t.subifd))if(u.integer(t.subifd)&&u.inRange(t.subifd,-1,1e5))n.tiffSubifd=t.subifd;else throw u.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(u.object(t.svg)){if(u.defined(t.svg.stylesheet))if(u.string(t.svg.stylesheet))n.svgStylesheet=t.svg.stylesheet;else throw u.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(u.defined(t.svg.highBitdepth))if(u.bool(t.svg.highBitdepth))n.svgHighBitdepth=t.svg.highBitdepth;else throw u.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(u.object(t.pdf)&&u.defined(t.pdf.background))n.pdfBackground=this._getBackgroundColourOption(t.pdf.background);else if(u.defined(t.pdfBackground))n.pdfBackground=this._getBackgroundColourOption(t.pdfBackground);if(u.object(t.jp2)&&u.defined(t.jp2.oneshot))if(u.bool(t.jp2.oneshot))n.jp2Oneshot=t.jp2.oneshot;else throw u.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(u.defined(t.create))if(u.object(t.create)&&u.integer(t.create.width)&&u.inRange(t.create.width,1,1e8)&&u.integer(t.create.height)&&u.inRange(t.create.height,1,1e8)&&u.integer(t.create.channels)){if(n.createWidth=t.create.width,n.createHeight=t.create.height,n.createChannels=t.create.channels,n.createPageHeight=0,u.defined(t.create.pageHeight))if(u.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 u.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(u.defined(t.create.noise)){if(!u.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,!u.inRange(t.create.channels,1,4))throw u.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(n.createNoiseMean=128,u.defined(t.create.noise.mean))if(u.number(t.create.noise.mean)&&u.inRange(t.create.noise.mean,0,1e4))n.createNoiseMean=t.create.noise.mean;else throw u.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(n.createNoiseSigma=30,u.defined(t.create.noise.sigma))if(u.number(t.create.noise.sigma)&&u.inRange(t.create.noise.sigma,0,1e4))n.createNoiseSigma=t.create.noise.sigma;else throw u.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(u.defined(t.create.background)){if(!u.inRange(t.create.channels,3,4))throw u.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(u.defined(t.text))if(u.object(t.text)&&u.string(t.text.text)){if(n.textValue=t.text.text,u.defined(t.text.height)&&u.defined(t.text.dpi))throw Error("Expected only one of dpi or height");if(u.defined(t.text.font))if(u.string(t.text.font))n.textFont=t.text.font;else throw u.invalidParameterError("text.font","string",t.text.font);if(u.defined(t.text.fontfile))if(u.string(t.text.fontfile))n.textFontfile=t.text.fontfile;else throw u.invalidParameterError("text.fontfile","string",t.text.fontfile);if(u.defined(t.text.width))if(u.integer(t.text.width)&&u.inRange(t.text.width,1,1e6))n.textWidth=t.text.width;else throw u.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(u.defined(t.text.height))if(u.integer(t.text.height)&&u.inRange(t.text.height,1,1e6))n.textHeight=t.text.height;else throw u.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(u.defined(t.text.align))if(u.string(t.text.align)&&u.string(this.constructor.align[t.text.align]))n.textAlign=this.constructor.align[t.text.align];else throw u.invalidParameterError("text.align","valid alignment",t.text.align);if(u.defined(t.text.justify))if(u.bool(t.text.justify))n.textJustify=t.text.justify;else throw u.invalidParameterError("text.justify","boolean",t.text.justify);if(u.defined(t.text.dpi))if(u.integer(t.text.dpi)&&u.inRange(t.text.dpi,1,1e6))n.textDpi=t.text.dpi;else throw u.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(u.defined(t.text.rgba))if(u.bool(t.text.rgba))n.textRgba=t.text.rgba;else throw u.invalidParameterError("text.rgba","bool",t.text.rgba);if(u.defined(t.text.spacing))if(u.integer(t.text.spacing)&&u.inRange(t.text.spacing,-1e6,1e6))n.textSpacing=t.text.spacing;else throw u.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(u.defined(t.text.wrap))if(u.string(t.text.wrap)&&u.inArray(t.text.wrap,["word","char","word-char","none"]))n.textWrap=t.text.wrap;else throw u.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(u.defined(t.join))if(u.defined(this.options.join)){if(u.defined(t.join.animated))if(u.bool(t.join.animated))n.joinAnimated=t.join.animated;else throw u.invalidParameterError("join.animated","boolean",t.join.animated);if(u.defined(t.join.across))if(u.integer(t.join.across)&&u.inRange(t.join.across,1,1e6))n.joinAcross=t.join.across;else throw u.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(u.defined(t.join.shim))if(u.integer(t.join.shim)&&u.inRange(t.join.shim,0,1e6))n.joinShim=t.join.shim;else throw u.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(u.defined(t.join.background))n.joinBackground=this._getBackgroundColourOption(t.join.background);if(u.defined(t.join.halign))if(u.string(t.join.halign)&&u.string(this.constructor.align[t.join.halign]))n.joinHalign=this.constructor.align[t.join.halign];else throw u.invalidParameterError("join.halign","valid alignment",t.join.halign);if(u.defined(t.join.valign))if(u.string(t.join.valign)&&u.string(this.constructor.align[t.join.valign]))n.joinValign=this.constructor.align[t.join.valign];else throw u.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(u.defined(t))throw Error(`Invalid input options ${t}`);return n}function GI(e,t,r){if(Array.isArray(this.options.input.buffer))if(u.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 KI(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function YI(){return Array.isArray(this.options.input.buffer)}function XI(e){if(this.writableFinished)e();else this.once("finish",e)}function ZI(e){let t=Error();if(u.fn(e)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Oe.metadata(this.options,(r,n)=>{if(r)e(u.nativeError(r,t));else e(null,n)})});else Oe.metadata(this.options,(r,n)=>{if(r)e(u.nativeError(r,t));else e(null,n)});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Oe.metadata(this.options,(s,i)=>{if(s)n(u.nativeError(s,t));else r(i)})})});else return new Promise((r,n)=>{Oe.metadata(this.options,(s,i)=>{if(s)n(u.nativeError(s,t));else r(i)})})}function QI(e){let t=Error();if(u.fn(e)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Oe.stats(this.options,(r,n)=>{if(r)e(u.nativeError(r,t));else e(null,n)})});else Oe.stats(this.options,(r,n)=>{if(r)e(u.nativeError(r,t));else e(null,n)});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Oe.stats(this.options,(s,i)=>{if(s)n(u.nativeError(s,t));else r(i)})})});else return new Promise((r,n)=>{Oe.stats(this.options,(s,i)=>{if(s)n(u.nativeError(s,t));else r(i)})})}var BI,UI,Yx=(e)=>{Object.assign(e.prototype,{_inputOptionsFromObject:Kx,_createInputDescriptor:zI,_write:GI,_flattenBufferIn:KI,_isStreamInput:YI,_whenStreamInFinished:XI,metadata:ZI,stats:QI}),e.align=BI};var Xx=q(()=>{Dr();$o();/*!
383
344
  Copyright 2013 Lovell Fuller and others.
384
345
  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();/*!
346
+ */BI={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},UI=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function $d(e){return e.angle%360!==0||e.rotationAngle!==0}function Sl(e){return e.width!==-1||e.height!==-1}function r2(e,t,r){if(Sl(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(u.defined(e))if(u.object(e)&&!u.defined(r))r=e;else if(u.integer(e)&&u.inRange(e,1,1e8))this.options.width=e;else throw u.invalidParameterError("width","positive integer between 1 and 100000000",e);else this.options.width=-1;if(u.defined(t))if(u.integer(t)&&u.inRange(t,1,1e8))this.options.height=t;else throw u.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(u.object(r)){if(u.defined(r.width))if(u.integer(r.width)&&u.inRange(r.width,1,1e8))this.options.width=r.width;else throw u.invalidParameterError("width","positive integer between 1 and 100000000",r.width);if(u.defined(r.height))if(u.integer(r.height)&&u.inRange(r.height,1,1e8))this.options.height=r.height;else throw u.invalidParameterError("height","positive integer between 1 and 100000000",r.height);if(u.defined(r.fit)){let n=t2[r.fit];if(u.string(n))this.options.canvas=n;else throw u.invalidParameterError("fit","valid fit",r.fit)}if(u.defined(r.position)){let n=u.integer(r.position)?r.position:t$[r.position]||e$[r.position]||Qx[r.position];if(u.integer(n)&&(u.inRange(n,0,8)||u.inRange(n,16,17)))this.options.position=n;else throw u.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),u.defined(r.kernel))if(u.string(xd[r.kernel]))this.options.kernel=xd[r.kernel];else throw u.invalidParameterError("kernel","valid kernel name",r.kernel);if(u.defined(r.withoutEnlargement))this._setBooleanOption("withoutEnlargement",r.withoutEnlargement);if(u.defined(r.withoutReduction))this._setBooleanOption("withoutReduction",r.withoutReduction);if(u.defined(r.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}if($d(this.options)&&Sl(this.options))this.options.rotateBefore=!0;return this}function n2(e){if(u.integer(e))if(u.inRange(e,1,1e8))this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else throw u.invalidParameterError("extend","integer between 1 and 100000000",e);else if(u.object(e)){if(u.defined(e.top))if(u.integer(e.top)&&u.inRange(e.top,0,1e8))this.options.extendTop=e.top;else throw u.invalidParameterError("top","integer between 0 and 100000000",e.top);if(u.defined(e.bottom))if(u.integer(e.bottom)&&u.inRange(e.bottom,0,1e8))this.options.extendBottom=e.bottom;else throw u.invalidParameterError("bottom","integer between 0 and 100000000",e.bottom);if(u.defined(e.left))if(u.integer(e.left)&&u.inRange(e.left,0,1e8))this.options.extendLeft=e.left;else throw u.invalidParameterError("left","integer between 0 and 100000000",e.left);if(u.defined(e.right))if(u.integer(e.right)&&u.inRange(e.right,0,1e8))this.options.extendRight=e.right;else throw u.invalidParameterError("right","integer between 0 and 100000000",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),u.defined(e.extendWith))if(u.string(Zx[e.extendWith]))this.options.extendWith=Zx[e.extendWith];else throw u.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw u.invalidParameterError("extend","integer or object",e);return this}function s2(e){let t=Sl(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(u.integer(n)&&u.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=n;else throw u.invalidParameterError(r,"integer between 0 and 100000000",n)},this),$d(this.options)&&!Sl(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 i2(e){if(this.options.trimThreshold=10,u.defined(e))if(u.object(e)){if(u.defined(e.background))this._setBackgroundColourOption("trimBackground",e.background);if(u.defined(e.threshold))if(u.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw u.invalidParameterError("threshold","positive number",e.threshold);if(u.defined(e.lineArt))this._setBooleanOption("trimLineArt",e.lineArt);if(u.defined(e.margin))if(u.integer(e.margin)&&u.inRange(e.margin,0,1e7))this.options.trimMargin=e.margin;else throw u.invalidParameterError("margin","integer between 0 and 10000000",e.margin)}else throw u.invalidParameterError("trim","object",e);if($d(this.options))this.options.rotateBefore=!0;return this}var Qx,e$,Zx,t$,xd,e2,t2,r$=(e)=>{Object.assign(e.prototype,{resize:r2,extend:n2,extract:s2,trim:i2}),e.gravity=Qx,e.strategy=t$,e.kernel=xd,e.fit=e2,e.position=e$};var n$=q(()=>{Dr();/*!
386
347
  Copyright 2013 Lovell Fuller and others.
387
348
  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();/*!
349
+ */Qx={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},e$={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},Zx={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},t$={entropy:16,attention:17},xd={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},e2={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},t2={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function o2(e){if(!Array.isArray(e))throw u.invalidParameterError("images to composite","array",e);return this.options.composite=e.map((t)=>{if(!u.object(t))throw u.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(u.defined(t.blend))if(u.string(vd[t.blend]))n.blend=vd[t.blend];else throw u.invalidParameterError("blend","valid blend name",t.blend);if(u.defined(t.tile))if(u.bool(t.tile))n.tile=t.tile;else throw u.invalidParameterError("tile","boolean",t.tile);if(u.defined(t.left))if(u.integer(t.left)&&u.inRange(t.left,-1e8,1e8))n.left=t.left;else throw u.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(u.defined(t.top))if(u.integer(t.top)&&u.inRange(t.top,-1e8,1e8))n.top=t.top;else throw u.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(u.defined(t.top)!==u.defined(t.left))throw Error("Expected both left and top to be set");else n.hasOffset=u.integer(t.top)&&u.integer(t.left);if(u.defined(t.gravity))if(u.integer(t.gravity)&&u.inRange(t.gravity,0,8))n.gravity=t.gravity;else if(u.string(t.gravity)&&u.integer(this.constructor.gravity[t.gravity]))n.gravity=this.constructor.gravity[t.gravity];else throw u.invalidParameterError("gravity","valid gravity",t.gravity);if(u.defined(t.premultiplied))if(u.bool(t.premultiplied))n.premultiplied=t.premultiplied;else throw u.invalidParameterError("premultiplied","boolean",t.premultiplied);return n}),this}var vd,s$=(e)=>{e.prototype.composite=o2,e.blend=vd};var i$=q(()=>{Dr();/*!
389
350
  Copyright 2013 Lovell Fuller and others.
390
351
  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();/*!
352
+ */vd={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 a2(e,t){if(!u.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(u.integer(e)&&!(e%90))this.options.angle=e;else if(u.number(e)){if(this.options.rotationAngle=e,u.object(t)&&t.background)this._setBackgroundColourOption("rotationBackground",t.background)}else throw u.invalidParameterError("angle","numeric",e);return this}function l2(){return this.options.input.autoOrient=!0,this}function c2(e){return this.options.flip=u.bool(e)?e:!0,this}function u2(e){return this.options.flop=u.bool(e)?e:!0,this}function d2(e,t){let n=Array.isArray(e)&&(e.length===4&&e.every(u.number)||e.length===2&&e.every((s)=>Array.isArray(s)&&s.length===2))?e.flat():[];if(n.length===4&&n.every(u.number))this.options.affineMatrix=n;else throw u.invalidParameterError("matrix","1x4 or 2x2 array",e);if(u.defined(t))if(u.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),u.defined(t.idx))if(u.number(t.idx))this.options.affineIdx=t.idx;else throw u.invalidParameterError("options.idx","number",t.idx);if(u.defined(t.idy))if(u.number(t.idy))this.options.affineIdy=t.idy;else throw u.invalidParameterError("options.idy","number",t.idy);if(u.defined(t.odx))if(u.number(t.odx))this.options.affineOdx=t.odx;else throw u.invalidParameterError("options.odx","number",t.odx);if(u.defined(t.ody))if(u.number(t.ody))this.options.affineOdy=t.ody;else throw u.invalidParameterError("options.ody","number",t.ody);if(u.defined(t.interpolator))if(u.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw u.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw u.invalidParameterError("options","object",t);return this}function f2(e){if(u.plainObject(e)){if(u.number(e.sigma)&&u.inRange(e.sigma,0.000001,10))this.options.sharpenSigma=e.sigma;else throw u.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(u.defined(e.m1))if(u.number(e.m1)&&u.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw u.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(u.defined(e.m2))if(u.number(e.m2)&&u.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw u.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(u.defined(e.x1))if(u.number(e.x1)&&u.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw u.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(u.defined(e.y2))if(u.number(e.y2)&&u.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw u.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(u.defined(e.y3))if(u.number(e.y3)&&u.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw u.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else this.options.sharpenSigma=-1;return this}function p2(e){if(!u.defined(e))this.options.medianSize=3;else if(u.integer(e)&&u.inRange(e,1,1000))this.options.medianSize=e;else throw u.invalidParameterError("size","integer between 1 and 1000",e);return this}function m2(e){let t;if(u.number(e))t=e;else if(u.plainObject(e)){if(!u.number(e.sigma))throw u.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(u.string(o$[e.precision]))this.options.precision=o$[e.precision];else throw u.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(u.number(e.minAmplitude)&&u.inRange(e.minAmplitude,0.001,1))this.options.minAmpl=e.minAmplitude;else throw u.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!u.defined(e))this.options.blurSigma=-1;else if(u.bool(e))this.options.blurSigma=e?-1:0;else if(u.number(t)&&u.inRange(t,0.3,1000))this.options.blurSigma=t;else throw u.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function h2(e){if(!u.defined(e))this.options.dilateWidth=1;else if(u.integer(e)&&u.inRange(e,1,65536))this.options.dilateWidth=e;else throw u.invalidParameterError("width","integer between 1 and 65536",e);return this}function g2(e){if(!u.defined(e))this.options.erodeWidth=1;else if(u.integer(e)&&u.inRange(e,1,65536))this.options.erodeWidth=e;else throw u.invalidParameterError("width","integer between 1 and 65536",e);return this}function y2(e){if(this.options.flatten=u.bool(e)?e:!0,u.object(e))this._setBackgroundColourOption("flattenBackground",e.background);return this}function b2(){return this.options.unflatten=!0,this}function x2(e,t){if(!u.defined(e))this.options.gamma=2.2;else if(u.number(e)&&u.inRange(e,1,3))this.options.gamma=e;else throw u.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!u.defined(t))this.options.gammaOut=this.options.gamma;else if(u.number(t)&&u.inRange(t,1,3))this.options.gammaOut=t;else throw u.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function $2(e){if(this.options.negate=u.bool(e)?e:!0,u.plainObject(e)&&"alpha"in e)if(!u.bool(e.alpha))throw u.invalidParameterError("alpha","should be boolean value",e.alpha);else this.options.negateAlpha=e.alpha;return this}function v2(e){if(u.plainObject(e)){if(u.defined(e.lower))if(u.number(e.lower)&&u.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw u.invalidParameterError("lower","number between 0 and 99",e.lower);if(u.defined(e.upper))if(u.number(e.upper)&&u.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw u.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw u.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function w2(e){return this.normalise(e)}function S2(e){if(u.plainObject(e)){if(u.integer(e.width)&&u.inRange(e.width,1,65536))this.options.claheWidth=e.width;else throw u.invalidParameterError("width","integer between 1 and 65536",e.width);if(u.integer(e.height)&&u.inRange(e.height,1,65536))this.options.claheHeight=e.height;else throw u.invalidParameterError("height","integer between 1 and 65536",e.height);if(u.defined(e.maxSlope))if(u.integer(e.maxSlope)&&u.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw u.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw u.invalidParameterError("options","plain object",e);return this}function E2(e){if(!u.object(e)||!Array.isArray(e.kernel)||!u.integer(e.width)||!u.integer(e.height)||!u.inRange(e.width,3,1001)||!u.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length||!e.kernel.every(u.number))throw Error("Invalid convolution kernel");if(!u.integer(e.scale))e.scale=e.kernel.reduce((t,r)=>t+r,0);if(e.scale<1)e.scale=1;if(!u.integer(e.offset))e.offset=0;return this.options.convKernel=e,this}function _2(e,t){if(!u.defined(e))this.options.threshold=128;else if(u.bool(e))this.options.threshold=e?128:0;else if(u.integer(e)&&u.inRange(e,0,255))this.options.threshold=e;else throw u.invalidParameterError("threshold","integer between 0 and 255",e);if(!u.object(t)||t.greyscale===!0||t.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function P2(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),u.string(t)&&u.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw u.invalidParameterError("operator","one of: and, or, eor",t);return this}function j2(e,t){if(!u.defined(e)&&u.number(t))e=1;else if(u.number(e)&&!u.defined(t))t=0;if(!u.defined(e))this.options.linearA=[];else if(u.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&u.inRange(e.length,1,1e6)&&e.every(u.number))this.options.linearA=e;else throw u.invalidParameterError("a","number or array of numbers",e);if(!u.defined(t))this.options.linearB=[];else if(u.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&u.inRange(t.length,1,1e6)&&t.every(u.number))this.options.linearB=t;else throw u.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 k2(e){if(!Array.isArray(e))throw u.invalidParameterError("inputMatrix","array",e);let t=e.length;if(t!==3&&t!==4)throw u.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!e.every((n)=>Array.isArray(n)&&n.length===t))throw u.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,e);let r=e.flat();if(!r.every(u.number))throw u.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function R2(e){if(!u.plainObject(e))throw u.invalidParameterError("options","plain object",e);if("brightness"in e)if(u.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw u.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(u.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw u.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(u.integer(e.hue))this.options.hue=e.hue%360;else throw u.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(u.number(e.lightness))this.options.lightness=e.lightness;else throw u.invalidParameterError("lightness","number",e.lightness);return this}var o$,a$=(e)=>{Object.assign(e.prototype,{autoOrient:l2,rotate:a2,flip:c2,flop:u2,affine:d2,sharpen:f2,erode:g2,dilate:h2,median:p2,blur:m2,flatten:y2,unflatten:b2,gamma:x2,negate:$2,normalise:v2,normalize:w2,clahe:S2,convolve:E2,threshold:_2,boolean:P2,linear:j2,recomb:k2,modulate:R2})};var l$=q(()=>{Dr();/*!
392
353
  Copyright 2013 Lovell Fuller and others.
393
354
  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);/*!
355
+ */o$={integer:"integer",float:"float",approximate:"approximate"}});var m$=C(function(gK,p$){var{defineProperty:Pd,getOwnPropertyDescriptor:A2,getOwnPropertyNames:O2}=Object,C2=Object.prototype.hasOwnProperty,T2=(e,t)=>{for(var r in t)Pd(e,r,{get:t[r],enumerable:!0})},N2=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let s of O2(t))if(!C2.call(e,s)&&s!==r)Pd(e,s,{get:()=>t[s],enumerable:!(n=A2(t,s))||n.enumerable})}return e},I2=(e)=>N2(Pd({},"__esModule",{value:!0}),e),c$={};T2(c$,{default:()=>K2});p$.exports=I2(c$);var wd={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 wd)Object.freeze(wd[e]);var Wr=Object.freeze(wd),u$=Object.create(null);for(let e in Wr)if(Object.hasOwn(Wr,e))u$[Wr[e]]=e;var Bt={to:{},get:{}};Bt.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=Bt.get.hsl(e),n="hsl";break}case"hwb":{r=Bt.get.hwb(e),n="hwb";break}default:{r=Bt.get.rgb(e),n="rgb";break}}if(!r)return null;return{model:n,value:r}};Bt.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,s=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,i=/^(\w+)$/,o=[0,0,0,1],a,l,c;if(a=e.match(r)){c=a[2],a=a[1];for(l=0;l<3;l++){let d=l*2;o[l]=Number.parseInt(a.slice(d,d+2),16)}if(c)o[3]=Number.parseInt(c,16)/255}else if(a=e.match(t)){a=a[1],c=a[3];for(l=0;l<3;l++)o[l]=Number.parseInt(a[l]+a[l],16);if(c)o[3]=Number.parseInt(c+c,16)/255}else if(a=e.match(n)){for(l=0;l<3;l++)o[l]=Number.parseFloat(a[l+1]);if(a[4])o[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.match(s)){for(l=0;l<3;l++)o[l]=Math.round(Number.parseFloat(a[l+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(i)){if(a[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(Wr,a[1]))return null;return o=Wr[a[1]].slice(),o[3]=1,o}else return null;for(l=0;l<3;l++)o[l]=Ln(o[l],0,255);return o[3]=Ln(o[3],0,1),o};Bt.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]),s=(Number.parseFloat(r[1])%360+360)%360,i=Ln(Number.parseFloat(r[2]),0,100),o=Ln(Number.parseFloat(r[3]),0,100),a=Ln(Number.isNaN(n)?1:n,0,1);return[s,i,o,a]}return null};Bt.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]),s=(Number.parseFloat(r[1])%360+360)%360,i=Ln(Number.parseFloat(r[2]),0,100),o=Ln(Number.parseFloat(r[3]),0,100),a=Ln(Number.isNaN(n)?1:n,0,1);return[s,i,o,a]}return null};Bt.to.hex=function(...e){return"#"+El(e[0])+El(e[1])+El(e[2])+(e[3]<1?El(Math.round(e[3]*255)):"")};Bt.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]+")"};Bt.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]+")"};Bt.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]+")"};Bt.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+")"};Bt.to.keyword=function(...e){return u$[e.slice(0,3)]};function Ln(e,t,r){return Math.min(Math.max(t,e),r)}function El(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var ci=Bt,d$={};for(let e of Object.keys(Wr))d$[Wr[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"]}},Ss=K,bn=0.008856451679035631;function di(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 fi(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,s=Math.min(t,r,n),i=Math.max(t,r,n),o=i-s,a,l;switch(i){case s:{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 c=(s+i)/2;if(i===s)l=0;else if(c<=0.5)l=o/(i+s);else l=o/(2-i-s);return[a,l*100,c*100]};K.rgb.hsv=function(e){let t,r,n,s,i,o=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(o,a,l),d=c-Math.min(o,a,l),p=function(h){return(c-h)/6/d+0.5};if(d===0)s=0,i=0;else{switch(i=d/c,t=p(o),r=p(a),n=p(l),c){case o:{s=n-r;break}case a:{s=0.3333333333333333+t-n;break}case l:{s=0.6666666666666666+r-t;break}}if(s<0)s+=1;else if(s>1)s-=1}return[s*360,i*100,c*100]};K.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],s=K.rgb.hsl(e)[0],i=0.00392156862745098*Math.min(t,Math.min(r,n));return n=1-0.00392156862745098*Math.max(t,Math.max(r,n)),[s,i*100,n*100]};K.rgb.oklab=function(e){let t=fi(e[0]/255),r=fi(e[1]/255),n=fi(e[2]/255),s=Math.cbrt(0.4122214708*t+0.5363325363*r+0.0514459929*n),i=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*s+0.793617785*i-0.0040720468*o,l=1.9779984951*s-2.428592205*i+0.4505937099*o,c=0.0259040371*s+0.7827717662*i-0.808675766*o;return[a*100,l*100,c*100]};K.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,s=Math.min(1-t,1-r,1-n),i=(1-t-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,a=(1-n-s)/(1-s)||0;return[i*100,o*100,a*100,s*100]};function M2(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=d$[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let s of Object.keys(Wr)){let i=Wr[s],o=M2(e,i);if(o<r)r=o,n=s}return n};K.keyword.rgb=function(e){return[...Wr[e]]};K.rgb.xyz=function(e){let t=fi(e[0]/255),r=fi(e[1]/255),n=fi(e[2]/255),s=t*0.4124564+r*0.3575761+n*0.1804375,i=t*0.2126729+r*0.7151522+n*0.072175,o=t*0.0193339+r*0.119192+n*0.9503041;return[s*100,i*100,o*100]};K.rgb.lab=function(e){let t=K.rgb.xyz(e),r=t[0],n=t[1],s=t[2];r/=95.047,n/=100,s/=108.883,r=r>bn?r**0.3333333333333333:7.787*r+0.13793103448275862,n=n>bn?n**0.3333333333333333:7.787*n+0.13793103448275862,s=s>bn?s**0.3333333333333333:7.787*s+0.13793103448275862;let i=116*n-16,o=500*(r-n),a=200*(n-s);return[i,o,a]};K.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,s,i;if(r===0)return i=n*255,[i,i,i];let o=n<0.5?n*(1+r):n+r-n*r,a=2*n-o,l=[0,0,0];for(let c=0;c<3;c++){if(s=t+0.3333333333333333*-(c-1),s<0)s++;if(s>1)s--;if(6*s<1)i=a+(o-a)*6*s;else if(2*s<1)i=o;else if(3*s<2)i=a+(o-a)*(0.6666666666666666-s)*6;else i=a;l[c]=i*255}return l};K.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,s=r,i=Math.max(n,0.01);n*=2,r*=n<=1?n:2-n,s*=i<=1?i:2-i;let o=(n+r)/2,a=n===0?2*s/(i+s):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,s=Math.floor(t)%6,i=t-Math.floor(t),o=255*n*(1-r),a=255*n*(1-r*i),l=255*n*(1-r*(1-i));switch(n*=255,s){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,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,s=Math.max(n,0.01),i,o;o=(2-r)*n;let a=(2-r)*s;return i=r*s,i/=a<=1?a:2-a,i=i||0,o/=2,[t,i*100,o*100]};K.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,s=r+n,i;if(s>1)r/=s,n/=s;let o=Math.floor(6*t),a=1-n;if(i=6*t-o,(o&1)!==0)i=1-i;let l=r+i*(a-r),c,d,p;switch(o){default:case 6:case 0:{c=a,d=l,p=r;break}case 1:{c=l,d=a,p=r;break}case 2:{c=r,d=a,p=l;break}case 3:{c=r,d=l,p=a;break}case 4:{c=l,d=r,p=a;break}case 5:{c=a,d=r,p=l;break}}return[c*255,d*255,p*255]};K.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,s=e[3]/100,i=1-Math.min(1,t*(1-s)+s),o=1-Math.min(1,r*(1-s)+s),a=1-Math.min(1,n*(1-s)+s);return[i*255,o*255,a*255]};K.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,s,i,o;return s=t*3.2404542+r*-1.5371385+n*-0.4985314,i=t*-0.969266+r*1.8760108+n*0.041556,o=t*0.0556434+r*-0.2040259+n*1.0572252,s=di(s),i=di(i),o=di(o),[s*255,i*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>bn?t**0.3333333333333333:7.787*t+0.13793103448275862,r=r>bn?r**0.3333333333333333:7.787*r+0.13793103448275862,n=n>bn?n**0.3333333333333333:7.787*n+0.13793103448275862;let s=116*r-16,i=500*(t-r),o=200*(r-n);return[s,i,o]};K.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,s=Math.cbrt(0.8189330101*t+0.3618667424*r-0.1288597137*n),i=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*s+0.793617785*i-0.0040720468*o,l=1.9779984951*s-2.428592205*i+0.4505937099*o,c=0.0259040371*s+0.7827717662*i-0.808675766*o;return[a*100,l*100,c*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,s=(0.999999998*t+0.396337792*r+0.215803758*n)**3,i=(1.000000008*t-0.105561342*r-0.063854175*n)**3,o=(1.000000055*t-0.089484182*r-1.291485538*n)**3,a=1.227013851*s-0.55779998*i+0.281256149*o,l=-0.040580178*s+1.11225687*i-0.071676679*o,c=-0.076381285*s-0.421481978*i+1.58616322*o;return[a*100,l*100,c*100]};K.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,s=(t+0.3963377774*r+0.2158037573*n)**3,i=(t-0.1055613458*r-0.0638541728*n)**3,o=(t-0.0894841775*r-1.291485548*n)**3,a=di(4.0767416621*s-3.3077115913*i+0.2309699292*o),l=di(-1.2684380046*s+2.6097574011*i-0.3413193965*o),c=di(-0.0041960863*s-0.7034186147*i+1.707614701*o);return[a*255,l*255,c*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],s,i,o;i=(t+16)/116,s=r/500+i,o=i-n/200;let a=i**3,l=s**3,c=o**3;return i=a>bn?a:(i-0.13793103448275862)/7.787,s=l>bn?l:(s-0.13793103448275862)/7.787,o=c>bn?c:(o-0.13793103448275862)/7.787,s*=95.047,i*=100,o*=108.883,[s,i,o]};K.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],s;if(s=Math.atan2(n,r)*360/2/Math.PI,s<0)s+=360;let o=Math.sqrt(r*r+n*n);return[t,o,s]};K.lch.lab=function(e){let t=e[0],r=e[1],s=e[2]/360*2*Math.PI,i=r*Math.cos(s),o=r*Math.sin(s);return[t,i,o]};K.rgb.ansi16=function(e,t=null){let[r,n,s]=e,i=t===null?K.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),i===0)return 30;let o=30+(Math.round(s/255)<<2|Math.round(n/255)<<1|Math.round(r/255));if(i===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,s=(t>>1&1)*r*255,i=(t>>2&1)*r*255;return[n,s,i]};K.ansi256.rgb=function(e){if(e=e[0],e>=232){let i=(e-232)*10+8;return[i,i,i]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,s=t%6/5*255;return[r,n,s]};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),s=n>>16&255,i=n>>8&255,o=n&255;return[s,i,o]};K.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,s=Math.max(Math.max(t,r),n),i=Math.min(Math.min(t,r),n),o=s-i,a,l=o<1?i/(1-o):0;if(o<=0)a=0;else if(s===t)a=(r-n)/o%6;else if(s===r)a=2+(n-t)/o;else a=4+(t-r)/o;return a/=6,a%=1,[a*360,o*100,l*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),s=0;if(n<1)s=(r-0.5*n)/(1-n);return[e[0],n*100,s*100]};K.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,s=0;if(n<1)s=(r-n)/(1-n);return[e[0],n*100,s*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 s=[0,0,0],i=t%1*6,o=i%1,a=1-o,l=0;switch(Math.floor(i)){case 0:{s[0]=1,s[1]=o,s[2]=0;break}case 1:{s[0]=a,s[1]=1,s[2]=0;break}case 2:{s[0]=0,s[1]=1,s[2]=o;break}case 3:{s[0]=0,s[1]=a,s[2]=1;break}case 4:{s[0]=o,s[1]=0,s[2]=1;break}default:s[0]=1,s[1]=0,s[2]=a}return l=(1-r)*n,[(r*s[0]+l)*255,(r*s[1]+l)*255,(r*s[2]+l)*255]};K.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),s=0;if(n>0)s=t/n;return[e[0],s*100,n*100]};K.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+0.5*t,s=0;if(n>0&&n<0.5)s=t/(2*n);else if(n>=0.5&&n<1)s=t/(2*(1-n));return[e[0],s*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,s=n-t,i=0;if(s<1)i=(n-s)/(1-s);return[e[0],s*100,i*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 J2(){let e={},t=Object.keys(Ss);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function D2(e){let t=J2(),r=[e];t[e].distance=0;while(r.length>0){let n=r.pop(),s=Object.keys(Ss[n]);for(let{length:i}=s,o=0;o<i;o++){let a=s[o],l=t[a];if(l.distance===-1)l.distance=t[n].distance+1,l.parent=n,r.unshift(a)}}return t}function L2(e,t){return function(r){return t(e(r))}}function F2(e,t){let r=[t[e].parent,e],n=Ss[t[e].parent][e],s=t[e].parent;while(t[s].parent)r.unshift(t[s].parent),n=L2(Ss[t[s].parent][s],n),s=t[s].parent;return n.conversion=r,n}function q2(e){let t=D2(e),r={},n=Object.keys(t);for(let{length:s}=n,i=0;i<s;i++){let o=n[i];if(t[o].parent===null)continue;r[o]=F2(o,t)}return r}var H2=q2,ui={},V2=Object.keys(Ss);function W2(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 B2(e){let t=function(...r){let n=r[0];if(n===void 0||n===null)return n;if(n.length>1)r=n;let s=e(r);if(typeof s==="object")for(let{length:i}=s,o=0;o<i;o++)s[o]=Math.round(s[o]);return s};if("conversion"in e)t.conversion=e.conversion;return t}for(let e of V2){ui[e]={},Object.defineProperty(ui[e],"channels",{value:Ss[e].channels}),Object.defineProperty(ui[e],"labels",{value:Ss[e].labels});let t=H2(e),r=Object.keys(t);for(let n of r){let s=t[n];ui[e][n]=B2(s),ui[e][n].raw=W2(s)}}var ar=ui,f$=["keyword","gray","hex"],Sd={};for(let e of Object.keys(ar))Sd[[...ar[e].labels].sort().join("")]=e;var Ed={};function ft(e,t){if(!(this instanceof ft))return new ft(e,t);if(t&&t in f$)t=null;if(t&&!(t in ar))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 ft)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let s=ci.get(e);if(s===null)throw Error("Unable to parse color from string: "+e);this.model=s.model,n=ar[this.model].channels,this.color=s.value.slice(0,n),this.valpha=typeof s.value[n]==="number"?s.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=ar[this.model].channels;let s=Array.prototype.slice.call(e,0,n);this.color=_d(s,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 s=Object.keys(e);if("alpha"in e)s.splice(s.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let i=s.sort().join("");if(!(i in Sd))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Sd[i];let{labels:o}=ar[this.model],a=[];for(r=0;r<o.length;r++)a.push(e[o[r]]);this.color=_d(a)}if(Ed[this.model]){n=ar[this.model].channels;for(r=0;r<n;r++){let s=Ed[this.model][r];if(s)this.color[r]=s(this.color[r])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}ft.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in ci.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return ci.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 ci.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=ar[this.model],{labels:r}=ar[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 ft([...this.color.map(z2(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new ft([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:et("rgb",0,ct(255)),green:et("rgb",1,ct(255)),blue:et("rgb",2,ct(255)),hue:et(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:et("hsl",1,ct(100)),lightness:et("hsl",2,ct(100)),saturationv:et("hsv",1,ct(100)),value:et("hsv",2,ct(100)),chroma:et("hcg",1,ct(100)),gray:et("hcg",2,ct(100)),white:et("hwb",1,ct(100)),wblack:et("hwb",2,ct(100)),cyan:et("cmyk",0,ct(100)),magenta:et("cmyk",1,ct(100)),yellow:et("cmyk",2,ct(100)),black:et("cmyk",3,ct(100)),x:et("xyz",0,ct(95.047)),y:et("xyz",1,ct(100)),z:et("xyz",2,ct(108.833)),l:et("lab",0,ct(100)),a:et("lab",1),b:et("lab",2),keyword(e){if(e!==void 0)return new ft(e);return ar[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new ft(e);return ci.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new ft(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();if(r.length===1)r="0"+r;return ci.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 s=n/255;t[r]=s<=0.04045?s/12.92:((s+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 ft.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(),s=t===void 0?0.5:t,i=2*s-1,o=r.alpha()-n.alpha(),a=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,l=1-a;return ft.rgb(a*r.red()+l*n.red(),a*r.green()+l*n.green(),a*r.blue()+l*n.blue(),r.alpha()*s+n.alpha()*(1-s))}};for(let e of Object.keys(ar)){if(f$.includes(e))continue;let{channels:t}=ar[e];ft.prototype[e]=function(...r){if(this.model===e)return new ft(this);if(r.length>0)return new ft(r,e);return new ft([...G2(ar[this.model][e].raw(this.color)),this.valpha],e)},ft[e]=function(...r){let n=r[0];if(typeof n==="number")n=_d(r,t);return new ft(n,e)}}function U2(e,t){return Number(e.toFixed(t))}function z2(e){return function(t){return U2(t,e)}}function et(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(Ed[n]||=[])[t]=r;return e=e[0],function(n){let s;if(n!==void 0){if(r)n=r(n);return s=this[e](),s.color[t]=n,s}if(s=this[e]().color[t],r)s=r(s);return s}}function ct(e){return function(t){return Math.max(0,Math.min(e,t))}}function G2(e){return Array.isArray(e)?e:[e]}function _d(e,t){for(let r=0;r<t;r++)if(typeof e[r]!=="number")e[r]=0;return e}var K2=ft});var g$=C(function(yK,h$){h$.exports=m$().default});function Y2(e){return this._setBackgroundColourOption("tint",e),this}function X2(e){return this.options.greyscale=u.bool(e)?e:!0,this}function Z2(e){return this.greyscale(e)}function Q2(e){if(!u.string(e))throw u.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function eM(e){return this.pipelineColourspace(e)}function tM(e){if(!u.string(e))throw u.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function rM(e){return this.toColourspace(e)}function x$(e){if(u.object(e)||u.string(e)&&e.length>=3&&e.length<=200){let t=b$.default(e),r=t.red(),n=t.green(),s=t.blue(),i=Math.round(t.alpha()*255);for(let[o,a]of[["red",r],["green",n],["blue",s],["alpha",i]])if(!u.number(a))throw u.invalidParameterError(`background.${o}`,"number",a);return[r,n,s,i]}else throw u.invalidParameterError("background","object or string",e)}function nM(e,t){if(u.defined(t))this.options[e]=x$(t)}var b$,y$,$$=(e)=>{Object.assign(e.prototype,{tint:Y2,greyscale:X2,grayscale:Z2,pipelineColourspace:Q2,pipelineColorspace:eM,toColourspace:tM,toColorspace:rM,_getBackgroundColourOption:x$,_setBackgroundColourOption:nM}),e.colourspace=y$,e.colorspace=y$};var v$=q(()=>{Dr();b$=kt(g$(),1);/*!
395
356
  Copyright 2013 Lovell Fuller and others.
396
357
  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();/*!
358
+ */y$={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function iM(){return this.options.removeAlpha=!0,this}function oM(e){if(u.defined(e))if(u.number(e)&&u.inRange(e,0,1))this.options.ensureAlpha=e;else throw u.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function aM(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e))e=t[e];if(u.integer(e)&&u.inRange(e,0,4))this.options.extractChannel=e;else throw u.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function lM(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 cM(e){if(u.string(e)&&u.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw u.invalidParameterError("boolOp","one of: and, or, eor",e);return this}var sM,w$=(e)=>{Object.assign(e.prototype,{removeAlpha:iM,ensureAlpha:oM,extractChannel:aM,joinChannel:lM,bandbool:cM}),e.bool=sM};var S$=q(()=>{Dr();/*!
398
359
  Copyright 2013 Lovell Fuller and others.
399
360
  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();/*!
361
+ */sM={and:"and",or:"or",eor:"eor"}});import jd from"node:path";function dM(e,t){let r;if(!u.string(e))r=Error("Missing output file path");else if(u.string(this.options.input.file)&&jd.resolve(this.options.input.file)===jd.resolve(e))r=Error("Cannot use same file for input and output");else if(uM.test(jd.extname(e))&&!this.constructor.format.jp2.output.file)r=_$();if(r)if(u.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 fM(e,t){if(u.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(u.fn(e)?e:t,r)}function pM(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function mM(e){if(u.number(e)&&e>0)this.options.withMetadataDensity=e;else throw u.invalidParameterError("density","positive number",e);return this.keepExif()}function hM(){return this.options.keepMetadata|=1,this}function gM(e){if(u.object(e))for(let[t,r]of Object.entries(e))if(u.object(r))for(let[n,s]of Object.entries(r))if(u.string(s))this.options.withExif[`exif-${t.toLowerCase()}-${n}`]=s;else throw u.invalidParameterError(`${t}.${n}`,"string",s);else throw u.invalidParameterError(t,"object",r);else throw u.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function yM(e){return this.withExif(e),this.options.withExifMerge=!0,this}function bM(){return this.options.keepMetadata|=8,this}function xM(e,t){if(u.string(e))this.options.withIccProfile=e;else throw u.invalidParameterError("icc","string",e);if(this.keepIccProfile(),u.object(t)){if(u.defined(t.attach))if(u.bool(t.attach)){if(!t.attach)this.options.keepMetadata&=-9}else throw u.invalidParameterError("attach","boolean",t.attach)}return this}function $M(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function vM(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function wM(){return this.options.keepMetadata|=2,this}function SM(e){if(u.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw u.invalidParameterError("xmp","non-empty string",e);return this}function EM(){return this.options.keepMetadata|=31,this}function _M(e){if(this.keepMetadata(),this.withIccProfile("srgb"),u.object(e)){if(u.defined(e.orientation))if(u.integer(e.orientation)&&u.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw u.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(u.defined(e.density))if(u.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw u.invalidParameterError("density","positive number",e.density);if(u.defined(e.icc))this.withIccProfile(e.icc);if(u.defined(e.exif))this.withExifMerge(e.exif)}return this}function PM(e,t){let r=E$.get((u.object(e)&&u.string(e.id)?e.id:e).toLowerCase());if(!r)throw u.invalidParameterError("format",`one of: ${[...E$.keys()].join(", ")}`,e);return this[r](t)}function jM(e){if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.progressive))this._setBooleanOption("jpegProgressive",e.progressive);if(u.defined(e.chromaSubsampling))if(u.string(e.chromaSubsampling)&&u.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw u.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=u.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(u.defined(t))this._setBooleanOption("jpegOptimiseCoding",t);if(u.defined(e.mozjpeg))if(u.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 u.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=u.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;if(u.defined(r))this._setBooleanOption("jpegTrellisQuantisation",r);if(u.defined(e.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let n=u.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;if(u.defined(n)){if(this._setBooleanOption("jpegOptimiseScans",n),n)this.options.jpegProgressive=!0}let s=u.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(u.defined(s))if(u.integer(s)&&u.inRange(s,0,8))this.options.jpegQuantisationTable=s;else throw u.invalidParameterError("quantisationTable","integer between 0 and 8",s)}return this._updateFormatOut("jpeg",e)}function kM(e){if(u.object(e)){if(u.defined(e.progressive))this._setBooleanOption("pngProgressive",e.progressive);if(u.defined(e.compressionLevel))if(u.integer(e.compressionLevel)&&u.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw u.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);if(u.defined(e.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(u.defined(t))if(u.integer(t)&&u.inRange(t,2,256))this.options.pngBitdepth=P$(t);else throw u.invalidParameterError("colours","integer between 2 and 256",t);if(u.defined(e.palette))this._setBooleanOption("pngPalette",e.palette);else if([e.quality,e.effort,e.colours,e.colors,e.dither].some(u.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw u.invalidParameterError("quality","integer between 0 and 100",e.quality);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw u.invalidParameterError("effort","integer between 1 and 10",e.effort);if(u.defined(e.dither))if(u.number(e.dither)&&u.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw u.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function RM(e){if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.alphaQuality))if(u.integer(e.alphaQuality)&&u.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw u.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(u.defined(e.lossless))this._setBooleanOption("webpLossless",e.lossless);if(u.defined(e.nearLossless))this._setBooleanOption("webpNearLossless",e.nearLossless);if(u.defined(e.smartSubsample))this._setBooleanOption("webpSmartSubsample",e.smartSubsample);if(u.defined(e.smartDeblock))this._setBooleanOption("webpSmartDeblock",e.smartDeblock);if(u.defined(e.preset))if(u.string(e.preset)&&u.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw u.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw u.invalidParameterError("effort","integer between 0 and 6",e.effort);if(u.defined(e.minSize))this._setBooleanOption("webpMinSize",e.minSize);if(u.defined(e.mixed))this._setBooleanOption("webpMixed",e.mixed);if(u.defined(e.exact))this._setBooleanOption("webpExact",e.exact)}return kd(e,this.options),this._updateFormatOut("webp",e)}function AM(e){if(u.object(e)){if(u.defined(e.reuse))this._setBooleanOption("gifReuse",e.reuse);if(u.defined(e.progressive))this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(u.defined(t))if(u.integer(t)&&u.inRange(t,2,256))this.options.gifBitdepth=P$(t);else throw u.invalidParameterError("colours","integer between 2 and 256",t);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw u.invalidParameterError("effort","integer between 1 and 10",e.effort);if(u.defined(e.dither))if(u.number(e.dither)&&u.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw u.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(u.defined(e.interFrameMaxError))if(u.number(e.interFrameMaxError)&&u.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw u.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(u.defined(e.interPaletteMaxError))if(u.number(e.interPaletteMaxError)&&u.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw u.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(u.defined(e.keepDuplicateFrames))if(u.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw u.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return kd(e,this.options),this._updateFormatOut("gif",e)}function OM(e){if(!this.constructor.format.jp2.output.buffer)throw _$();if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.lossless))if(u.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw u.invalidParameterError("lossless","boolean",e.lossless);if(u.defined(e.tileWidth))if(u.integer(e.tileWidth)&&u.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw u.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(u.defined(e.tileHeight))if(u.integer(e.tileHeight)&&u.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw u.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(u.defined(e.chromaSubsampling))if(u.string(e.chromaSubsampling)&&u.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw u.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function kd(e,t){if(u.object(e)&&u.defined(e.loop))if(u.integer(e.loop)&&u.inRange(e.loop,0,65535))t.loop=e.loop;else throw u.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(u.object(e)&&u.defined(e.delay))if(u.integer(e.delay)&&u.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&u.inRange(e.delay.length,1,1e6)&&e.delay.every(u.integer)&&e.delay.every((r)=>u.inRange(r,0,65535)))t.delay=e.delay;else throw u.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function CM(e){if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.bitdepth))if(u.integer(e.bitdepth)&&u.inArray(e.bitdepth,[1,2,4]))this.options.tiffBitdepth=e.bitdepth;else throw u.invalidParameterError("bitdepth","1, 2 or 4",e.bitdepth);if(u.defined(e.tile))this._setBooleanOption("tiffTile",e.tile);if(u.defined(e.tileWidth))if(u.integer(e.tileWidth)&&u.inRange(e.tileWidth,1,32768))this.options.tiffTileWidth=e.tileWidth;else throw u.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(u.defined(e.tileHeight))if(u.integer(e.tileHeight)&&u.inRange(e.tileHeight,1,32768))this.options.tiffTileHeight=e.tileHeight;else throw u.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(u.defined(e.miniswhite))this._setBooleanOption("tiffMiniswhite",e.miniswhite);if(u.defined(e.pyramid))this._setBooleanOption("tiffPyramid",e.pyramid);if(u.defined(e.xres))if(u.number(e.xres)&&u.inRange(e.xres,0.001,1e6))this.options.tiffXres=e.xres;else throw u.invalidParameterError("xres","number between 0.001 and 1000000",e.xres);if(u.defined(e.yres))if(u.number(e.yres)&&u.inRange(e.yres,0.001,1e6))this.options.tiffYres=e.yres;else throw u.invalidParameterError("yres","number between 0.001 and 1000000",e.yres);if(u.defined(e.compression))if(u.string(e.compression)&&u.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw u.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(u.defined(e.bigtiff))this._setBooleanOption("tiffBigtiff",e.bigtiff);if(u.defined(e.predictor))if(u.string(e.predictor)&&u.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw u.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(u.defined(e.resolutionUnit))if(u.string(e.resolutionUnit)&&u.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw u.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function TM(e){return this.heif({...e,compression:"av1"})}function NM(e){if(u.object(e)){if(u.string(e.compression)&&u.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw u.invalidParameterError("compression","one of: av1, hevc",e.compression);if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.lossless))if(u.bool(e.lossless))this.options.heifLossless=e.lossless;else throw u.invalidParameterError("lossless","boolean",e.lossless);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw u.invalidParameterError("effort","integer between 0 and 9",e.effort);if(u.defined(e.chromaSubsampling))if(u.string(e.chromaSubsampling)&&u.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw u.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(u.defined(e.bitdepth))if(u.integer(e.bitdepth)&&u.inArray(e.bitdepth,[8,10,12]))this.options.heifBitdepth=e.bitdepth;else throw u.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth);if(u.defined(e.tune))if(u.string(e.tune)&&u.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 u.invalidParameterError("tune","one of: auto, iq, psnr, ssim",e.tune)}else throw u.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function IM(e){if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.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 u.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(u.defined(e.distance))if(u.number(e.distance)&&u.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw u.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(u.defined(e.decodingTier))if(u.integer(e.decodingTier)&&u.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw u.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(u.defined(e.lossless))if(u.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw u.invalidParameterError("lossless","boolean",e.lossless);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw u.invalidParameterError("effort","integer between 1 and 9",e.effort)}return kd(e,this.options),this._updateFormatOut("jxl",e)}function MM(e){if(u.object(e)){if(u.defined(e.depth))if(u.string(e.depth)&&u.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw u.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth)}return this._updateFormatOut("raw")}function JM(e){if(u.object(e)){if(u.defined(e.size))if(u.integer(e.size)&&u.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw u.invalidParameterError("size","integer between 1 and 8192",e.size);if(u.defined(e.overlap))if(u.integer(e.overlap)&&u.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw u.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw u.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(u.defined(e.container))if(u.string(e.container)&&u.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw u.invalidParameterError("container","one of: fs, zip",e.container);if(u.defined(e.layout))if(u.string(e.layout)&&u.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw u.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(u.defined(e.angle))if(u.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw u.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),u.defined(e.depth))if(u.string(e.depth)&&u.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw u.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(u.defined(e.skipBlanks))if(u.integer(e.skipBlanks)&&u.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw u.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else if(u.defined(e.layout)&&e.layout==="google")this.options.tileSkipBlanks=5;let t=u.bool(e.center)?e.center:e.centre;if(u.defined(t))this._setBooleanOption("tileCentre",t);if(u.defined(e.id))if(u.string(e.id))this.options.tileId=e.id;else throw u.invalidParameterError("id","string",e.id);if(u.defined(e.basename))if(u.string(e.basename))this.options.tileBasename=e.basename;else throw u.invalidParameterError("basename","string",e.basename)}if(u.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw u.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function DM(e){if(!u.plainObject(e))throw u.invalidParameterError("options","object",e);if(u.integer(e.seconds)&&u.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw u.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function LM(e,t){if(!(u.object(t)&&t.force===!1))this.options.formatOut=e;return this}function FM(e,t){if(u.bool(t))this.options[e]=t;else throw u.invalidParameterError(e,"boolean",t)}function qM(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function HM(e,t){if(typeof e==="function"){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Oe.pipeline(this.options,(r,n,s)=>{if(r)e(u.nativeError(r,t));else e(null,n,s)})});else Oe.pipeline(this.options,(r,n,s)=>{if(r)e(u.nativeError(r,t));else e(null,n,s)});return this}else if(this.options.streamOut){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Oe.pipeline(this.options,(r,n,s)=>{if(r)this.emit("error",u.nativeError(r,t));else this.emit("info",s),this.push(n);this.push(null),this.on("end",()=>this.emit("close"))})});else Oe.pipeline(this.options,(r,n,s)=>{if(r)this.emit("error",u.nativeError(r,t));else this.emit("info",s),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(),Oe.pipeline(this.options,(s,i,o)=>{if(s)n(u.nativeError(s,t));else if(this.options.resolveWithObject)r({data:i,info:o});else r(i)})})});else return new Promise((r,n)=>{Oe.pipeline(this.options,(s,i,o)=>{if(s)n(u.nativeError(s,t));else if(this.options.resolveWithObject)r({data:i,info:o});else r(i)})})}var E$,uM,_$=()=>Error("JP2 output requires libvips with support for OpenJPEG"),P$=(e)=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1),j$=(e)=>{Object.assign(e.prototype,{toFile:dM,toBuffer:fM,toUint8Array:pM,withDensity:mM,keepExif:hM,withExif:gM,withExifMerge:yM,keepIccProfile:bM,withIccProfile:xM,keepGainMap:$M,withGainMap:vM,keepXmp:wM,withXmp:SM,keepMetadata:EM,withMetadata:_M,toFormat:PM,jpeg:jM,jp2:OM,png:kM,webp:RM,tiff:CM,avif:TM,heif:NM,jxl:IM,gif:AM,raw:MM,tile:JM,timeout:DM,_updateFormatOut:LM,_setBooleanOption:FM,_read:qM,_pipeline:HM})};var k$=q(()=>{Dr();$o();/*!
401
362
  Copyright 2013 Lovell Fuller and others.
402
363
  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);/*!
364
+ */E$=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"]]),uM=/\.(jp[2x]|j2[kc])$/i});import VM from"node:events";import{createRequire as WM}from"node:module";import{availableParallelism as BM}from"node:os";function A$(e){if(u.bool(e))if(e)return Oe.cache(50,20,100);else return Oe.cache(0,0,0);else if(u.object(e)){for(let t of["memory","files","items"]){let r=e[t];if(u.defined(r)&&!(u.integer(r)&&r>=0))throw u.invalidParameterError(t,"a positive integer",r)}return Oe.cache(e.memory,e.files,e.items)}else return Oe.cache()}function zM(e){return Oe.concurrency(u.integer(e)?e:null)}function KM(){return Oe.counters()}function YM(e){return Oe.simd(u.bool(e)?e:null)}function XM(e){if(u.object(e))if(Array.isArray(e.operation)&&e.operation.every(u.string))Oe.block(e.operation,!0);else throw u.invalidParameterError("operation","Array<string>",e.operation);else throw u.invalidParameterError("options","object",e)}function ZM(e){if(u.object(e))if(Array.isArray(e.operation)&&e.operation.every(u.string))Oe.block(e.operation,!1);else throw u.invalidParameterError("operation","Array<string>",e.operation);else throw u.invalidParameterError("options","object",e)}var vo,Rd,R$,Ad,Fn,UM,pi,GM,O$=(e)=>{e.cache=A$,e.concurrency=zM,e.counters=KM,e.simd=YM,e.format=Fn,e.interpolators=UM,e.versions=pi,e.queue=GM,e.block=XM,e.unblock=ZM};var C$=q(()=>{Dr();yd();$o();$l();vo=kt(ol(),1);/*!
404
365
  Copyright 2013 Lovell Fuller and others.
405
366
  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();/*!
367
+ */Rd=WM(import.meta.url),R$=vl.runtimePlatformArch(),Ad=Oe.libvipsVersion(),Fn=Oe.format();Fn.heif.output.alias=["avif","heic"];Fn.jpeg.output.alias=["jpe","jpg"];Fn.tiff.output.alias=["tif"];Fn.jp2.output.alias=["j2c","j2k","jp2","jpx"];UM={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},pi={vips:Ad.semver};if(!Ad.isGlobal)if(!Ad.isWasm)try{pi=Rd(`@img/sharp-${R$}/versions`)}catch(e){try{pi=Rd(`@img/sharp-libvips-${R$}/versions`)}catch(t){}}else try{pi=Rd("@img/sharp-wasm32/versions")}catch(e){}pi.sharp=gn.version;if(pi.heif&&Fn.heif)Fn.heif.input.fileSuffix=[".avif"],Fn.heif.output.alias=["avif"];A$(!0);if(!process.env.MALLOC_ARENA_MAX&&vo.default.familySync()===vo.default.GLIBC&&!Oe._isUsingJemalloc())Oe.concurrency(1);else if(vo.default.familySync()===vo.default.MUSL&&Oe.concurrency()===1024)Oe.concurrency(BM());GM=new VM.EventEmitter});var QM;var T$=q(()=>{Gx();Xx();n$();i$();l$();v$();S$();k$();C$();/*!
407
368
  Copyright 2013 Lovell Fuller and others.
408
369
  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=`/*
370
+ */Yx(Vr);r$(Vr);s$(Vr);a$(Vr);$$(Vr);w$(Vr);j$(Vr);O$(Vr);QM=Vr});import{createHash as N$}from"node:crypto";import{existsSync as eJ,mkdirSync as tJ,readFileSync as rJ}from"node:fs";import{basename as nJ,extname as sJ,resolve as Od}from"node:path";import{createRequire as iJ}from"node:module";async function I$(){if(mi)return mi;try{let e=await Promise.resolve().then(() => (T$(),{}));return mi=QM,mi}catch{}try{return mi=iJ(Od(process.cwd(),"package.json"))("sharp"),mi}catch(e){throw Error(`Sharp is required for image optimization but failed to load: ${Ee(e)}`,{cause:e})}}async function Cd(e){let r=await(await I$())(e).metadata();return{format:r.format??"unknown",height:r.height??0,width:r.width??0}}function wo(e){let t=rJ(e);return N$("md5").update(t).digest("hex").slice(0,8)}function Td(e){let t=JSON.stringify({formats:e.formats,quality:e.quality,v:aJ,widths:e.widths});return N$("md5").update(t).digest("hex").slice(0,8)}function lJ(e,t,r,n){return`${e}-${t}-${r}.${n}`}async function M$(e,t,r){let n=await I$(),s=await Cd(e),i=wo(e),o=nJ(e,sJ(e)),a=Od(t,"_optimized");tJ(a,{recursive:!0});let l=[],c=r.widths.length>0?Math.max(...r.widths):s.width,d=r.widths.filter((m)=>m<=s.width);if(s.width<c&&!d.includes(s.width))d.push(s.width);if(d.length===0)d.push(s.width);d.sort((m,b)=>m-b);let p=[];for(let m of d)for(let b of r.formats){let g=lJ(o,m,i,b),y=`/${oJ}/${g}`,v=Od(a,g);if(l.push({absolutePath:v,format:b,outputPath:y,width:m}),eJ(v))continue;let j=r.quality[b]??80,S=n(e).resize(m).toFormat(b,{quality:j}).toFile(v).then(()=>{});p.push(S)}let h=4;for(let m=0;m<p.length;m+=h)await Promise.all(p.slice(m,m+h));return{contentHash:i,original:{format:s.format,height:s.height,width:s.width},variants:l}}function J$(e,t){return e.flatMap((r)=>r.format===t?[`${r.outputPath} ${r.width}w`]:[]).join(", ")}var mi=null,oJ="images/_optimized",aJ=2;var Nd=q(()=>{rr()});import{existsSync as cJ,mkdirSync as uJ,readFileSync as dJ,rmSync as fJ,writeFileSync as pJ}from"node:fs";import{basename as mJ,resolve as _l}from"node:path";import{execSync as hJ}from"node:child_process";import{tmpdir as gJ}from"node:os";function hi(e){if(So===void 0)try{let t=hJ("npm config get cache",{cwd:gJ(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();So=t&&t!=="undefined"?t:null}catch{So=null}if(So)return _l(So,"jxsuite-images",mJ(e));return _l(e,".cache/images")}function D$(e){let t=_l(hi(e),"manifest.json");if(!cJ(t))return{entries:{},touched:new Set,version:1};try{let r=JSON.parse(dJ(t,"utf8"));return r.touched=new Set,r}catch{return{entries:{},touched:new Set,version:1}}}function L$(e,t,r={}){if(r.prune&&t.touched)yJ(t,t.touched);let n=hi(e);uJ(n,{recursive:!0}),pJ(_l(n,"manifest.json"),JSON.stringify({entries:t.entries,version:t.version},null,2),"utf8")}function yJ(e,t){let r=new Set,n=Object.entries(e.entries);for(let[s,i]of n)if(t.has(s))for(let o of i.manifest.variants??[])r.add(o.absolutePath);for(let[s,i]of n){if(t.has(s))continue;for(let o of i.manifest.variants??[])if(!r.has(o.absolutePath))fJ(o.absolutePath,{force:!0});delete e.entries[s]}}function F$(e,t){e.touched?.add(t);let r=e.entries[t];if(!r)return null;return r.manifest}function q$(e,t,r,n){e.touched?.add(t),e.entries[t]={manifest:n,source:r,timestamp:Date.now()}}var So;var Id=q(()=>{Nd()});function Md(e,t){if(!t||H$(e.loading))return{};if(String(e.fetchpriority??"").toLowerCase()==="high")return{};return H$(e.decoding)?{loading:"lazy"}:{decoding:"async",loading:"lazy"}}var H$=(e)=>e!==void 0&&e!==null&&e!=="";import{existsSync as G$}from"node:fs";import{basename as bJ,extname as K$,resolve as V$}from"node:path";async function $J(e,t){let r=t.get(e);if(!r){let n=wo(e);try{let s=await Cd(e);r={width:s.width,height:s.height,hash:n}}catch(s){if(!W$)W$=!0,console.warn(`Could not read image dimensions (${Ee(s)}) — `+"emitting srcsets without width/height attributes.");r={width:null,height:null,hash:n}}t.set(e,r)}return r}function B$(e,t,r,n){let s=t.quality.webp??80,i=e.startsWith("/")?"":"/",o=n?`?v=${n}`:"";return t.widths.filter((a)=>a<=r).toSorted((a,l)=>a-l).map((a)=>`/cdn-cgi/image/width=${a},quality=${s},fit=scale-down,format=auto${i}${e}${o} ${a}w`).join(", ")}async function vJ(e,t,r,n,s){let i=`${wo(e)}:${Td(r)}`,o=F$(s,i);if(o){if(o.variants.every((c)=>G$(c.absolutePath)))return o}if(!o)console.log(` Optimizing ${bJ(e)}...`);let a=await M$(e,hi(n),r);return q$(s,i,t,a),a}function wJ(e){if(!e)return!0;if(e.includes("${"))return!0;if(xJ.some((t)=>e.startsWith(t)))return!0;if(Y$.has(K$(e).toLowerCase()))return!0;return!1}function SJ(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(Y$.has(K$(r.pathname).toLowerCase()))return!1;return t.remoteDomains.includes(r.hostname)}catch{return!1}}function EJ(e,t,r){let n=r?.length?ga(r,e):null;if(n)return n;if(e.startsWith("/"))return V$(t,"public",e.slice(1));return V$(t,e)}async function X$(e,t,r,n,s,i=[]){let o=new Map;return await Z$(e,t,r,n,s??new Map,o,i),{imageRefs:o}}async function Z$(e,t,r,n,s,i,o,a=null){if(e.tagName==="img"){if(await AJ(e,t,r,n,s,i,o,a))return}if(N(e.innerHTML)&&e.innerHTML.includes("<img"))e.innerHTML=await IJ(e.innerHTML,t,r,n,s,i,o);if(Array.isArray(e.children)){let l=ev(e,a);for(let c of e.children){if(!Ft(c))continue;await Z$(c,t,r,n,s,i,o,l)}}}async function Q$(e,t,r,n,s,i,o,a){if(!N(e)||t)return null;let l=SJ(e,r);if(!l&&wJ(e))return null;if(l)return{dims:null,sources:[],srcset:B$(e,r,1/0,null)};let c=EJ(e,n,a);if(!G$(c))return null;if(r.service==="cloudflare"){let g=await $J(c,i),y=B$(e,r,g.width??1/0,g.hash);return{dims:g.width&&g.height?{height:g.height,width:g.width}:null,sources:[],srcset:y}}let d=o.get(c);if(!d)d=await vJ(c,e,r,n,s),o.set(c,d);let h=[...U$.filter((g)=>r.formats.includes(g)),...r.formats.filter((g)=>!U$.includes(g))].flatMap((g)=>{let y=J$(d.variants,g);return y===""?[]:[{srcset:y,type:_J.get(g)??`image/${g}`}]}),m=d.original?.width&&d.original.height?{height:d.original.height,width:d.original.width}:null,b=r.picture!==!1&&h.length>1;return{dims:m,fallbackSrc:jJ(d.variants,r.formats),sources:b?h:[],srcset:h[0]?.srcset??""}}function jJ(e,t){let r=PJ.find((s)=>t.includes(s));if(r===void 0)return;let n;for(let s of e)if(s.format===r&&(n===void 0||s.width>n.width))n=s;return n?.outputPath}function z$(e){if(!N(e))return null;let t=kJ.exec(e.trim());if(!t)return null;let r=Number(t[1]);return t[2]==="rem"?r*16:r}function ev(e,t){let{style:r}=e;if(!F(r))return t;let n=z$(r.maxWidth)??z$(r.width);if(n===null)return t;return t===null?n:Math.min(t,n)}function RJ(e){if(e===null)return;let t=Math.round(e);return`(max-width: ${t}px) 100vw, ${t}px`}async function AJ(e,t,r,n,s,i,o,a=null){if(!e.attributes)e.attributes={};let l=e.attributes;if(l.src===void 0&&N(e.src))l.src=e.src,delete e.src;let c=t.optimize?await Q$(l.src,l["data-no-optimize"]!==void 0,t,r,n,s,i,o):null,d=ev(e,a),p=l.sizes??RJ(d)??t.sizes;if(c){if(c.srcset!==""){if(l.srcset=c.srcset,l.sizes=p,c.fallbackSrc!==void 0)l.src=c.fallbackSrc}if(c.dims&&l.width===void 0&&l.height===void 0)l.width=String(c.dims.width),l.height=String(c.dims.height)}if(Object.assign(l,Md(l,t.lazyLoad)),c&&c.sources.length>0)return OJ(e,c.sources,p),!0;return!1}function OJ(e,t,r){let n={...e.attributes},s=n.sizes??r;delete n.srcset,delete n.sizes;let i={attributes:n,tagName:"img"};if(e.style!==void 0)i.style=e.style,delete e.style;let o=t.map((a)=>{let l={};if(s!=="")l.sizes=s;return l.srcset=a.srcset,l.type=a.type,{attributes:l,tagName:"source"}});o.push(i),e.tagName="picture",e.attributes={},e.children=o}async function IJ(e,t,r,n,s,i,o){let a=[];for(let c of e.matchAll(CJ)){let d=c[0],p=c[1],h=(Eo(p,"src")??"").replaceAll("&amp;","&"),m=TJ.test(p),b=t.optimize&&h!==""&&!m?await Q$(h,NJ.test(p),t,r,n,s,i,o):null,g="";if(b&&b.srcset!=="")g+=` srcset="${b.srcset}" sizes="${t.sizes}"`;if(b?.dims&&!/\bwidth=/.test(p)&&!/\bheight=/.test(p))g+=` width="${b.dims.width}" height="${b.dims.height}"`;let y=Md({decoding:Eo(p,"decoding"),fetchpriority:Eo(p,"fetchpriority"),loading:Eo(p,"loading")},t.lazyLoad);for(let[j,S]of Object.entries(y))g+=` ${j}="${S}"`;if(g==="")continue;let v=b&&b.sources.length>0?MJ(p,b.sources,t.sizes,g):`<img${p}${g}>`;a.push({match:d,replacement:v})}let l=e;for(let{match:c,replacement:d}of a)l=l.replace(c,d);return l}function MJ(e,t,r,n){let s=Eo(e,"sizes")??r,i=n.replace(/ srcset="[^"]*"/,"").replace(/ sizes="[^"]*"/,"");return`<picture>${t.map((a)=>`<source type="${a.type}" srcset="${a.srcset}" sizes="${s}">`).join("")}<img${e}${i}></picture>`}function Eo(e,t){return new RegExp(`\\b${t}="([^"]*)"`,"i").exec(e)?.[1]}var Y$,xJ,W$=!1,U$,_J,PJ,kJ,CJ,TJ,NJ;var tv=q(()=>{Nd();Id();nr();ve();rr();Y$=new Set([".svg",".gif"]),xJ=["http://","https://","data:","//"];U$=["avif","webp","jpeg","png"],_J=new Map([["avif","image/avif"],["jpeg","image/jpeg"],["png","image/png"],["webp","image/webp"]]);PJ=["jpeg","png"];kJ=/^(\d+(?:\.\d+)?)(px|rem)$/;CJ=/<img\b([^>]*)>/gi,TJ=/\bsrcset="/,NJ=/\bdata-no-optimize\b/});import{createHash as JJ}from"node:crypto";import{existsSync as DJ}from"node:fs";import{join as rv}from"node:path";function FJ(e,t){let r=e.replace(/^\//,"");return e.endsWith("/")||r===""?rv(t,r,"index.html"):rv(t,r)}function Dd(e){if(e===void 0)return null;if(e===!1)return!1;if(e===!0)return{};return e.enabled===!1?!1:e}function qJ(e){let t=JSON.stringify({fallback:e.offlineFallback??null,precache:[...e.precache??[]].toSorted(),scope:e.scope??"/"});return JJ("sha256").update(t,"utf8").digest("hex").slice(0,8)}function nv(e,t,r=""){let n=[],s=[],i=[...e.precache??[]],o=e.offlineFallback;if(o!==void 0&&!i.includes(o))i.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 i)if(!h.startsWith("/"))s.push(`serviceWorker.precache: "${h}" must be a site-absolute URL starting with /.`);else if(!DJ(FJ(h,t)))s.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=i.map((h)=>Ie(r,h)),l=Ie(r,LJ),c=o===void 0?null:Ie(r,o),d=`jx-${qJ(e)}`,p=`/*
410
371
  * Generated by @jxsuite/compiler — configure via \`serviceWorker\` in project.json.
411
372
  * Set \`"serviceWorker": false\` to replace this with a worker that removes itself.
412
373
  */
413
- const CACHE = ${JSON.stringify(u)};
374
+ const CACHE = ${JSON.stringify(d)};
414
375
  const PRECACHE = ${JSON.stringify(a)};
415
- const CACHE_FIRST = ${JSON.stringify(c)};
416
- const OFFLINE_FALLBACK = ${JSON.stringify(l)};
376
+ const CACHE_FIRST = ${JSON.stringify(l)};
377
+ const OFFLINE_FALLBACK = ${JSON.stringify(c)};
417
378
 
418
379
  self.addEventListener("install", (event) => {
419
380
  // Take over as soon as possible: a half-updated pair of workers is harder to reason about than
@@ -496,7 +457,7 @@ self.addEventListener("fetch", (event) => {
496
457
  })(),
497
458
  );
498
459
  });
499
- `;return{errors:i,path:fm,source:d,warnings:n}}function SE(){return{errors:[],path:fm,source:`/*
460
+ `;return{errors:s,path:Jd,source:p,warnings:n}}function sv(){return{errors:[],path:Jd,source:`/*
500
461
  * Generated by @jxsuite/compiler. This site had a service worker and no longer does.
501
462
  *
502
463
  * A worker is sticky: removing the file would leave every previous visitor running the old one
@@ -519,95 +480,95 @@ self.addEventListener("activate", (event) => {
519
480
  })(),
520
481
  );
521
482
  });
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)}
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(`
483
+ `,warnings:[]}}function iv(e,t=""){return`if('serviceWorker' in navigator){addEventListener('load',function(){navigator.serviceWorker.register('${Ie(t,`/${Jd}`)}',{scope:${JSON.stringify(Ie(t,e))}}).catch(function(){})})}`}var Jd="sw.js",LJ="/images/_optimized/";var ov=q(()=>{nr()});import{mkdirSync as HJ,writeFileSync as VJ}from"node:fs";import{dirname as WJ,join as BJ}from"node:path";function qn(e,t,r){if(r!==void 0)e[t]=r}function av(e){let t=e.manifest,r=[],n=[];if(t===void 0||t.enabled===!1)return{errors:r,files:[],warnings:n};let s=t.name??e.name??"Jx Site",i=os(e.url),o=[];for(let d of t.icons??[])o.push(N(d.src)?{...d,src:Ie(i,d.src)}:d);let a={display:t.display??"standalone",icons:o,name:s,short_name:t.shortName??s,start_url:Ie(i,t.startUrl??"/")};qn(a,"description",t.description),qn(a,"theme_color",t.themeColor),qn(a,"background_color",t.backgroundColor),qn(a,"scope",t.scope===void 0?void 0:Ie(i,t.scope)),qn(a,"orientation",t.orientation),qn(a,"lang",t.lang),qn(a,"dir",t.dir),qn(a,"categories",t.categories);let l=new Set(o.flatMap((d)=>(d.sizes??"").split(/\s+/).map((p)=>Math.trunc(Number(p.split("x")[0]))))),c=UJ.filter((d)=>!l.has(d));if(c.length>0)n.push(`manifest: no ${c.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)}
484
+ `,path:"manifest.webmanifest"}],warnings:n}}function lv(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 cv(e,t){let r=e.securityTxt,n=[],s=[];if(r===void 0||r.enabled===!1)return{errors:n,files:[],warnings:s};let i=r.contact??[];if(i.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 l=new Date(r.expires);if(Number.isNaN(l.getTime()))n.push(`securityTxt: \`expires\` is not a valid date: "${r.expires}".`);else if(l.getTime()<=t.getTime())n.push(`securityTxt: \`expires\` is in the past (${l.toISOString()}) — an expired `+"security.txt tells a reporter not to trust what it says.")}let o=[];for(let l of r.preferredLanguages??[]){let c=dr(l);if(c===null)n.push(`securityTxt.preferredLanguages: "${l}" is not a well-formed language tag.`);else o.push(c)}if(n.length>0)return{errors:n,files:[],warnings:s};let a=["# Generated by @jxsuite/compiler — configure via securityTxt in project.json.",...i.map((l)=>`Contact: ${l}`),`Expires: ${new Date(r.expires).toISOString().replace(/\.\d{3}Z$/,"Z")}`,...(r.encryption??[]).map((l)=>`Encryption: ${l}`),...(r.acknowledgments??[]).map((l)=>`Acknowledgments: ${l}`),...o.length>0?[`Preferred-Languages: ${o.join(", ")}`]:[],...r.canonical===void 0?[]:[`Canonical: ${r.canonical}`],...(r.policy??[]).map((l)=>`Policy: ${l}`),...(r.hiring??[]).map((l)=>`Hiring: ${l}`)];return{errors:n,files:[{content:`${a.join(`
524
485
  `)}
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">
486
+ `,path:".well-known/security.txt"}],warnings:s}}function uv(e,t,r){let n=0,s=[];for(let i of e){let o=BJ(t,i.path);if(r(o)){s.push(i.path);continue}HJ(WJ(o),{recursive:!0}),VJ(o,i.content,"utf8"),n+=1}return{skipped:s,written:n}}var UJ;var dv=q(()=>{nr();ms();ve();UJ=[192,512]});import{existsSync as zJ,mkdirSync as Fd,readFileSync as GJ,readdirSync as KJ,writeFileSync as YJ}from"node:fs";import{createRequire as XJ}from"node:module";import{dirname as _o,join as pv,relative as ZJ,resolve as Po}from"node:path";function QJ(e){return e.endsWith("/")}function mv(e=qd){let t={},r=[],n=[];for(let s of Pl)if(eD(s.specifier,e))t[s.specifier]=s.assetPath,t[`${s.specifier}/`]=s.assetDir,n.push(s.assetPath);else t[s.specifier]=s.fallback,r.push(`Could not resolve "${s.specifier}" — the import map falls back to ${s.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 hv(e,t,r=qd,n=!0){let s=[],i=0;for(let o of Pl){if(!e.assetPaths.includes(o.assetPath))continue;let a=Po(t,o.assetPath.replace(/^\//,""));Fd(_o(a),{recursive:!0});try{await ps(`export * from ${JSON.stringify(o.specifier)};
487
+ `,{outfile:a,resolveDir:r},{minify:n,target:"browser"}),i+=1}catch(l){s.push(`Bundling client runtime "${o.specifier}": ${Ee(l)}`)}}return{errors:s,written:i}}function Hd(e){return Object.entries(e).filter(([t,r])=>!QJ(t)&&r.startsWith("/")).map(([,t])=>t)}function gv(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 s=ee(n)?n.imports:void 0;if(!F(s))continue;let i=Object.entries(s).flatMap(([o,a])=>N(a)?[[o,a]]:[]);t.push(...Hd(Object.fromEntries(i)))}return t}function yv(e){return`<script type="importmap">
527
488
  {
528
489
  "imports": {
529
490
  ${Object.entries(e).map(([r,n])=>` ${JSON.stringify(r)}: ${JSON.stringify(n)}`).join(`,
530
491
  `)}
531
492
  }
532
493
  }
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(`
494
+ </script>`}function eD(e,t){try{if(Ki())XJ(pv(t,"x.js")).resolve(e);else Bun.resolveSync(e,t);return!0}catch{return!1}}async function bv(e,t=qd,r=!0){let n=[],s=new Set,i=new Map,o=new Map,a=Po(e,"assets"),l=0,c=async(p)=>{if(!o.has(p.specifier))o.set(p.specifier,await ph(p.specifier,t,{target:"browser"}));return o.get(p.specifier)},d=async(p)=>[...GJ(p,"utf8").matchAll(/(?:from|import)\s*["']([^"']+)["']/g)].map((m)=>m[1]);for(let p=0;p<fv;p++){let h=0,m=[];try{m=KJ(a,{recursive:!0}).map(String).filter((b)=>b.endsWith(".js")).map((b)=>pv(a,b))}catch{return Ld(e,i,n,l)}for(let b of m){let g=[];try{g=await d(b)}catch{continue}for(let y of g){let v=Pl.find((P)=>y.startsWith(`${P.specifier}/`));if(!v||s.has(y))continue;s.add(y);let j=y.slice(v.specifier.length+1),S=Po(e,`${v.assetDir.replace(/^\//,"")}${j}`);Fd(_o(S),{recursive:!0});try{await ps(`export * from ${JSON.stringify(y)};
495
+ `,{outfile:S,resolveDir:t},{minify:r,resolver:tD(v,S,await c(v),i),target:"browser"}),l+=1,h+=1}catch(P){n.push(`Bundling runtime subpath "${y}": ${Ee(P)}`)}}}if(h===0)return Ld(e,i,n,l)}return n.push(`Runtime subpath resolution did not settle in ${fv} passes — a package subpath `+"graph this deep is more likely a cycle in the scan than a real dependency chain."),Ld(e,i,n,l)}function tD(e,t,r,n){return{filter:/.*/,resolve:({importer:s,path:i})=>{if(Kc(s))return;if(Pl.find((a)=>i===a.specifier||i.startsWith(`${a.specifier}/`))!==void 0)return{external:!0,path:i};if(r===void 0||!i.startsWith("."))return;if(Po(_o(s),i)!==r)return;return n.set(Po(_o(t),i),e.specifier),{external:!0,path:i}}}}function Ld(e,t,r,n){let s=n;for(let[i,o]of t){if(zJ(i))continue;try{Fd(_o(i),{recursive:!0}),YJ(i,`export * from ${JSON.stringify(o)};
496
+ `,"utf8"),s+=1}catch(a){r.push(`Writing shared core stub ${ZJ(e,i)}: ${Ee(a)}`)}}return{errors:r,written:s}}var Pl,qd,fv=10;var xv=q(()=>{Yc();Mr();ve();rr();Pl=[{assetDir:"/assets/@vue/reactivity/",assetPath:"/assets/vue-reactivity.js",fallback:Ks,specifier:"@vue/reactivity"},{assetDir:"/assets/lit-html/",assetPath:"/assets/lit-html.js",fallback:Ys,specifier:"lit-html"}];qd=import.meta.dirname});import{cpSync as jl,existsSync as xn,mkdirSync as Er,readFileSync as rD,readdirSync as nD,rmSync as sD,statSync as iD,writeFileSync as hr}from"node:fs";import{createHash as oD}from"node:crypto";import{basename as aD,dirname as Br,join as Hn,relative as lD,resolve as Ye,sep as cD}from"node:path";async function Sv(e,t={}){let{clean:r=!0,verbose:n=!1}=t,s=[],i=n?console.log.bind(console):()=>{};i("Loading project.json...");let{config:o}=kn(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=Ye(e,o.build.outDir),l=Ye(e,"pages"),c=Ye(e,"public"),d=o.build.trailingSlash??"always",p=o.build.minify!==!1,h=new Map,m=new Map,b=new Map,g=(J)=>{let H=J.toSorted(),ie=`/assets/elements-${oD("sha1").update(H.join("\x00")).digest("hex").slice(0,12)}.js`;return b.set(ie,H),ie},y=mv(),v=y.imports,j=new Set,S=xg(),{errors:P,i18n:E}=Xc(o);for(let J of P)s.push(J),console.error(J);for(let J of y.warnings)console.warn(J);let O=new Map,R=(J,H,V)=>{let ie=O.get(J);if(ie!==void 0&&ie.entryPath!==H)throw Error(`"${V}" and "${ie.specifier}" both map to ${J} — rename one`);O.set(J,{entryPath:H,specifier:V})},k=(J,H)=>{if(!uh(J))return J;try{let V=zc(J,H??e,e);if(!is(J)&&!xn(V))return console.warn(`Sidecar "${J}" not found at ${V} — emitting unbundled`),J;let ie=is(J)?J:`./${lD(e,V)}`,Se=Rm(ie);return R(Se,V,J),h.set(Se,{entryPath:V,specifier:J}),Se}catch(V){return s.push(`Sidecar "${J}": ${Ee(V)}`),J}},I=(J)=>{let H=Am(J);try{let V=zc(`npm:${J}`,e,e);return R(H,V,J),m.set(H,V),H}catch(V){return s.push(`$head specifier "${J}": ${Ee(V)}`),J}},D=await jn(e,o),M=D.formats;if(M.entries.length>0)i(` Registered ${M.entries.length} format(s): ${M.entries.map((J)=>J.name).join(", ")}`);let L=D.serverMounts().filter((J)=>{if(!J.project)return!0;let H=o[J.project.key];return F(H)&&Object.keys(H).length>0});if(L.length>0&&!o.build.adapter){let J=L.map((H)=>H.project?`"${H.project.key}"`:`"${H.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${J} served by extension mounts, but `+`build.adapter is "static". Dynamic tables need a server-capable adapter — ${$v}`)}if(r&&xn(a))sD(a,{force:!0,recursive:!0});if(Er(a,{recursive:!0}),!xn(l))throw Error(`pages/ directory not found in ${e}`);i("Discovering pages...");let B=await mg(l,M);i(` Found ${B.length} page(s)`),i("Loading project sections...");let se=await Og(e,o,D),ue=Object.keys(se);if(ue.length>0)i(` Loaded ${ue.length} section(s): ${ue.join(", ")}`);let{errors:oe,mounts:Q}=await Tg(D,o,e);s.push(...oe);for(let J of oe)console.error(J);if(Q.length>0)i(` Mounted ${Q.length} asset dir(s): ${Q.map((J)=>J.urlPrefix).join(", ")}`);let ae=new Set,ke=await fD(D,o,e),le=(await yg(B,e,se,D,o,E)).map((J)=>Object.assign(J,{locale:Nr(J.urlPattern,E)}));i(` ${le.length} route(s) after expansion`);let z=0,te=Ye(e,"components"),Le=[],fe=new Map,We=new Map,G=new Map;if(xn(te)){i("Compiling components...");let J=[".json",...M.documentExtensions("component")],H=nD(te).filter((ze)=>J.some((Ne)=>ze.endsWith(Ne))),V=Ye(a,"components");Er(V,{recursive:!0});let ie=new Map;for(let ze of H){let Ne=Ye(te,ze);try{let{tagName:he}=await xs(Ne,M);if(he)ie.set(Ne,he)}catch{}}let Se=os(o.url),Or=rl(Se);for(let ze of H)try{let Ne=Ye(te,ze),he={formats:M,resolveElementPath:(ot,Zt)=>{let f=Zt?Ye(Zt,ot):Ye(ot),x=ie.get(f);return x?`./${x}.js`:ot.replace(/\.json$/,".js")},rewriteSrc:(ot,Zt)=>Ie(Se,k(ot,Zt)),serverBaseUrl:Or};if(o.$media)he.$media=o.$media;let xt=await el(Ne,he);for(let ot of xt.files){let Zt=ot.tagName?`${ot.tagName}.js`:aD(ot.path);if(!Le.includes(ot.tagName))hr(Ye(V,Zt),ot.content,"utf8"),Le.push(ot.tagName),z+=1}let st=await xs(Ne,M);if(st.tagName){We.set(st.tagName,st),G.set(st.tagName,Ne);let ot=ys(st,o.defaults),Zt=ng(st.tagName,st.style,st,o.$media??{},ot);if(Zt){if(ot===null)fe.set(st.tagName,Zt);Iu(Zt,Q,ae),hr(Ye(V,`${st.tagName}.css`),Zt,"utf8"),z+=1}}}catch(Ne){let he=Ee(Ne);s.push(`Error compiling component ${ze}: ${he}`),console.error(`Error compiling component ${ze}: ${he}`)}i(` Compiled ${Le.length} component(s): ${Le.join(", ")}`)}let Be=[];for(let[J,H]of We)Be.push(...lo(H,G.get(J),e));if(o.state)Be.push(...lo({state:o.state},Ye(e,"project.json"),e));let Xe=o.images.optimize&&o.images.service==="cloudflare",pt=o.images.optimize&&!Xe?D$(e):null,ut=Xe?new Map:null;if(Xe)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 Ue=o.url,bt=os(Ue),Jt=Boolean(Ue)&&o.build.sitemap!==!1,Zr=[],Sn=le.filter((J)=>!J.urlPattern.includes(":")&&!J.urlPattern.includes("*")),Ii=E===null?new Map:await pg(Sn,M),Dt=Sn.map((J)=>({translationKey:Ii.get(J.urlPattern),urlPattern:J.urlPattern})),Qr=ug(Dt,E,Ue,d),{conflicts:Mi,sets:Ns}=Au(Dt,E);for(let J of Mi){let[H,V]=J.urlPatterns,ie=J.declared?"Give one of them a different $translationKey.":"Move one out of the locale tree, or give it its own $translationKey.",Se=`${V} and ${H} are both the "${J.locale}" version of "${J.key}". A translation set names one URL per language, so ${V} is `+`dropped from it — it carries no alternates and no switcher. ${ie}`;if(J.declared)s.push(Se),console.error(Se);else console.warn(Se)}let es=lg(le,E);if(es.length>0)console.warn(`i18n.routing is "prefix-always", but ${es.length} route(s) sit outside the locale tree and are served as "${E?.defaultLocale}": ${es.slice(0,10).join(", ")}${es.length>10?`, and ${es.length-10} more`:""}. Move them under a locale directory, or use "prefix-except-default".`);if(E!==null&&E.routing==="prefix-always"&&!o.build.adapter&&!le.some((J)=>J.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 "/${E.defaultLocale.toLowerCase()}/", set build.adapter, or use "prefix-except-default".`);let Is=new Set,ca=new Set;for(let J of le){let H=cg(J.urlPattern,E);if(H&&!Is.has(H.segment))Is.add(H.segment),console.warn(`Routes under /${H.segment}/ are served as "${E?.defaultLocale}" — `+`i18n.locales declares "${H.meant}", not "${H.segment}". Rename the directory to "${H.meant.toLowerCase()}" or declare the shorter tag.`);try{i(` Compiling ${J.urlPattern} ...`);let V=await uD(J,o,e,se,pt,We,ut,M,D,k,Q,ke,I,{alternates:Qr.get(J.urlPattern)??[],i18n:E,translations:Ns.get(J.urlPattern)??[]},v,g);Be.push(...V.serverEntries);for(let he of V.unregisteredRelations)if(!ca.has(he))ca.add(he),console.warn(`<link rel="${he}"> — "${he}" 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 ie=new Set;for(let[he,xt]of We)if(Ga(xt))ie.add(he);if(Le.length>0)V.html=hD(V.html,Le,fe,ie,V.files.map((he)=>he.content).join(`
497
+ `),v);for(let he of gv(V.html))j.add(he);Iu(V.html,Q,ae),$g(V.html,S);let Se=jv(J.urlPattern,a,d);Er(Br(Se),{recursive:!0});let Or=!J.urlPattern.includes(":")&&!J.urlPattern.includes("*"),ze=!ao(J.urlPattern)&&!sg(V.html);if(Jt&&!V.excludeFromSitemap&&ze&&Or){let he=Qr.get(J.urlPattern)??[];Zr.push({lastmod:N(J.sourceMtime)&&J.sourceMtime!==""?J.sourceMtime:xD(iD(J.sourcePath).mtime),loc:Rn(ri(J.urlPattern,d),Ue),...he.length>0&&{alternates:he}})}let Ne=[];for(let he of M.withCapability("serialize")){if(!he.exportTarget||ao(J.urlPattern))continue;try{let xt=await he.call("serialize",V.doc,{buildScope:(st)=>zs(st,null),componentDefs:We,evaluateTemplate:(st,ot)=>{if(!pe(st))return;return wt(st,ot)??st},mode:"export"});if(xt){let st=Se.replace(/\.html$/,he.extensions[0]);Ne.push({content:xt,path:st,type:he.mediaTypeEssence})}}catch(xt){s.push(`Error exporting ${he.name} for ${J.urlPattern}: ${Ee(xt)}`)}}for(let he of Ne)if(he.type!==null)V.html=og(V.html,{href:ag(a,he.path),type:he.type});hr(Se,Nm(V.html,bt),"utf8"),z+=1;for(let he of Ne)hr(he.path,he.content,"utf8"),z+=1;for(let he of V.files){let xt=Ye(Br(Se),he.path);Er(Br(xt),{recursive:!0}),hr(xt,he.content,"utf8"),z+=1}}catch(V){let ie=`Error compiling ${J.urlPattern}: ${Ee(V)}`;s.push(ie),console.error(ie)}}if(pt&&o.images.optimize){L$(e,pt,{prune:s.length===0});let J=Ye(hi(e),"_optimized");if(xn(J)){let V=Ye(a,"images/_optimized");Er(V,{recursive:!0}),jl(J,V,{recursive:!0})}let H=Object.keys(pt.entries).length;if(H>0)i(` Optimized ${H} image(s)`)}let en=[];if(!o.build.adapter&&Be.length>0){let H=`timing: "server" entries ${[...new Set(Be.map(({exportName:V,declaredIn:ie})=>`${V} (${ie})`))].join(", ")} need a server-capable adapter, but `+`build.adapter is "static": a static deployment has nothing to serve /_jx/server — ${$v}`;s.push(H),console.error(H)}if(o.build.adapter){let{adapter:J}=o.build;i("Generating site-wide server worker...");let{entries:H,errors:V}=Wg(Be);en=H;for(let Ne of V)s.push(Ne),console.error(Ne);let{mounts:ie,connectors:Se}=dD(L,D,o);if(ie.length>0)i(` Mounting ${ie.length} extension route(s): ${ie.map((Ne)=>Ne.basePath).join(", ")}`);let ze=J==="cloudflare-pages"&&en.length===0&&ie.length===0?null:Uu(en,{adapter:J,base:bt,connectors:Se,i18n:E,mounts:ie});if(ze){let Ne=J==="cloudflare-pages"?"_worker.js":"worker.js";try{await mh(ze,{adapter:J,outfile:Ye(a,Ne),projectRoot:e}),z+=1,i(` Generated dist/${Ne} (bundled, ${en.length} server function(s))`)}catch(he){let xt=`Error bundling dist/${Ne}: ${Ee(he)}`;s.push(xt),console.error(xt)}if(J==="cloudflare-pages")hr(Ye(a,"_routes.json"),`${JSON.stringify({exclude:[],include:(E&&E.locales.length>1?["/","/_jx/*"]:["/_jx/*"]).map((he)=>Ie(bt,he)),version:1},null,2)}
498
+ `,"utf8"),z+=1}}if(j.size>0){i(`Bundling ${j.size} client runtime module(s)...`);let J=await hv({...y,assetPaths:[...j]},a,void 0,p);z+=J.written;for(let H of J.errors)s.push(H),console.error(H)}if(m.size>0){i(`Copying ${m.size} package asset(s)...`);for(let[J,H]of m){let V=Ye(a,J.replace(/^\//,""));Er(Br(V),{recursive:!0}),jl(H,V),z+=1,i(` ${H} → ${J}`)}}if(h.size>0){i(`Bundling ${h.size} client sidecar module(s)...`);for(let[J,H]of h)try{let V=Ye(a,J.replace(/^\//,""));Er(Br(V),{recursive:!0}),await Gc({entryPath:H.entryPath,outfile:V},{external:ch,minify:p,target:"browser"}),z+=1,i(` ${H.specifier} → ${J}`)}catch(V){let ie=`Error bundling sidecar "${H.specifier}": ${Ee(V)}`;s.push(ie),console.error(ie)}}if(b.size>0){i(`Bundling ${b.size} npm element set(s)...`);for(let[J,H]of b){let V=Ye(a,J.replace(/^\//,""));Er(Br(V),{recursive:!0});try{await ps(`${H.map((ie)=>`import ${JSON.stringify(ie)};`).join(`
538
499
  `)}
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>
541
- ${tl(N.rules.join(`
500
+ `,{outfile:V,resolveDir:e},{minify:p,target:"browser"}),z+=1,i(` ${H.length} element(s) → ${J}`)}catch(ie){let Se=`Error bundling npm $elements [${H.join(", ")}]: ${Ee(ie)}`;s.push(Se),console.error(Se)}}}if(j.size>0){let J=await bv(a,void 0,p);if(J.written>0)i(`Bundling ${J.written} runtime subpath module(s)...`);z+=J.written;for(let H of J.errors)s.push(H),console.error(H)}for(let J of D.emitters()){let H=J.project?.key,V=H?o[H]:void 0;if(H&&(V==null||F(V)&&Object.keys(V).length===0))continue;try{let ie=await J.call("emit",V??null,{projectConfig:o,root:e,routes:le,sections:se});for(let Se of ie??[]){let Or=Ye(a,Se.path.replace(/^\//,""));if(!Or.startsWith(a+cD))throw Error(`emit path escapes outDir: ${Se.path}`);Er(Br(Or),{recursive:!0}),hr(Or,Se.content),z+=1,i(` ${J.name} emitted ${Se.path}`)}}catch(ie){let Se=`Error in ${J.name}.emit: ${Ee(ie)}`;s.push(Se),console.error(Se)}}if(o.redirects&&Object.keys(o.redirects).length>0){i("Generating redirects...");let J=new Set(le.map((V)=>V.urlPattern)),H=bD(o.redirects,a,{basePath:bt,compiledUrls:J,trailingSlash:o.build.trailingSlash});z+=H.files,s.push(...H.errors)}if(Jt)i(`Generating sitemap (${Zr.length} URL(s))...`),z+=vD(Zr,a);else if(!Ue&&o.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(ae.size>0){let{copied:J,missing:H}=Ng(ae,Q,a);z+=J,i(`Copying ${J} mounted asset(s)...`);for(let V of H)console.warn(`Referenced asset not found: ${V}`)}if(xn(c))i("Copying public/ assets..."),jl(c,a,{recursive:!0});if(Jt)z+=wD(a,Ue);{let J=[av(o),cv(o,new Date)];for(let ie of J){for(let Se of ie.errors)s.push(Se),console.error(Se);for(let Se of ie.warnings)console.warn(Se)}let{skipped:H,written:V}=uv(J.flatMap((ie)=>ie.files),a,xn);z+=V;for(let ie of H)i(` ${ie} — kept the copy from public/`)}{let J=Dd(o.serviceWorker);if(J!==null){let H=J===!1?sv():nv(J,a,bt);for(let V of H.warnings)console.warn(V);for(let V of H.errors)s.push(V),console.error(V);if(H.path!==null)hr(Hn(a,H.path),H.source,"utf8"),z+=1,i(J===!1?" sw.js — tombstone (unregisters and clears)":" sw.js")}}{let{errors:J,rules:H}=_g(o.build,S);s.push(...J);let V=jg([...H,...Pg(a)],bt);if(V.length>0){i("Writing response headers..."),z+=kg(a,V);let{adapter:ie,deploy:Se}=o.build;if(ie==="node"||ie==="bun")console.warn(`The "${ie}" 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(ie===void 0&&Se===void 0)if(xn(Ye(c,"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 i(" note: _headers is read by Cloudflare Pages, Cloudflare Workers assets and Netlify; other static hosts ignore it and serve their own Cache-Control.")}z+=Rg(a)}if(o.copy){i("Copying mapped files...");for(let[J,H]of Object.entries(o.copy)){if(!N(H))throw TypeError(`project.json copy["${J}"] must be a destination path string`);let V=Ye(e,J),ie=Ye(a,H);Er(Br(ie),{recursive:!0}),jl(V,ie)}}if(i(`
501
+ Build complete: ${le.length} routes, ${z} files`),s.length>0)i(` ${s.length} error(s)`);return{errors:s,files:z,routes:le.length,serverEntries:en}}async function uD(e,t,r,n,s,i,o,a,l,c,d,p,h,m,b,g){let y=os(t.url),v=await xs(e.sourcePath,a),j=await Fg(v,t,r),S=[...lo(v,e.sourcePath,r),...qg(v,t,r).flatMap((fe)=>lo(fe.doc,fe.path,r))],P=Ug(v.$head??j._pageHead??[],v.description),E=j.$head??[],O=v.title??j._pageTitle??null;delete j._pageHead,delete j._pageTitle,ey(j,t,e,r,m.i18n,m.translations);let R=dg({defaults:t.defaults,pageDir:N(v.$dir)?v.$dir:void 0,pageLang:N(v.$lang)?v.$lang:void 0,routeLocale:Nr(e.urlPattern,m.i18n)});await vy(j,e,r,{config:t,registerBundle:(fe)=>{c(fe,null)},registry:l,sections:n});let k=zs(j.state??{}),I=O??t.name;if(pe(I))I=wt(I,k)??I;let D=Vd(vv(P,k),h),M=Vd(vv(E,k),h);jo(j,k);let L={counter:{n:0},media:{...t.$media,...j.$media},rules:[]},B={n:0};if(Gd(j,i,L,t.defaults,B),j.state){let fe=new Set;for(let[G,Be]of Object.entries(j.state)){if(G==="$site"||G==="$page")continue;if(ee(Be)&&Be.timing==="compiler")delete j.state[G];else if(Array.isArray(Be))fe.add(G)}let We=!0;while(We){We=!1;let G={...j.state};for(let Xe of fe)delete G[Xe];let Be=JSON.stringify({children:j.children,state:G});for(let Xe of fe)if(mD(Be,Xe))fe.delete(Xe),We=!0}for(let G of fe)delete j.state[G]}let se=Dd(t.serviceWorker),ue=se===null||se===!1?[]:[{tagName:"script",textContent:iv(se.scope??"/",y)}],oe=[...lv(t),...ue,...p,...Vd(t.$head??[],h)],Q=zg(oe,M,D,{title:I,charset:t.defaults.charset??"utf8",siteName:t.name,siteUrl:t.url,...m.alternates.length>0&&{alternates:m.alternates},...!ao(e.urlPattern)&&{pageUrl:ri(e.urlPattern,t.build.trailingSlash)}});if(t.$media)j.$media={...t.$media,...j.$media};if(Object.values(j.$media??{}).some((fe)=>wr(String(fe))!==null))Q.splice(2,0,{tagName:"script",textContent:Zs()});let ae=t.images;await X$(j,ae,r,s,o??void 0,d);let ke={lang:R.lang,prePaintScheme:!1,projectStyle:t.style??null,rewriteSrc:(fe)=>Ie(y,c(fe,Br(e.sourcePath))),serverBaseUrl:rl(y),title:I},U=b["@vue/reactivity"];if(U!==void 0)ke.reactivitySrc=U;let le=b["lit-html"];if(le!==void 0)ke.litHtmlSrc=le;let z=await Gu(j,ke);if(L.rules.length>0)z.html=z.html.replace("</head>",`<style>
502
+ ${Ba(L.rules.join(`
542
503
  `))}
543
504
  </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(`
546
- `),u=l===""?"":`<style>
547
- ${tl(l)}
548
- </style>`,d=(k)=>{let E=k.filter(Boolean).join(`
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(`
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+=`
555
- ${c.join(`
556
- `)}`;let l=s[1].match(/<script[\s\S]*?<\/script>/gi);if(l)o+=`
505
+ </head>`);z.html=yD(z.html,Q,R);let te=(fe)=>typeof fe==="string"&&!fe.startsWith("./")&&!fe.startsWith("../"),Le=[...new Set([...j.$elements??[],...v.$elements??[]].filter((fe)=>te(fe)))];if(Le.length>0)z.html=gD(z.html,g(Le));return{doc:j,excludeFromSitemap:v.$sitemap===!1,files:z.files,html:z.html,unregisteredRelations:Yg(Q),serverEntries:S}}function dD(e,t,r){if(e.length===0)return{connectors:[],mounts:[]};let n=os(r.url),s={};for(let l of t.projectContributions()){let{key:c}=l.project;if(c in r)s[c]=r[c]}let i=e.map((l)=>{let c=l.server,{module:d}=c;if(!N(d)||d==="")throw Error(`Extension class "${l.name}": server.module (a bare import specifier) is required to generate a deployable worker`);let p=Ie(n,c.basePath);return{basePath:p,className:l.classDef.title??l.name,module:d,options:{basePath:p,sections:s},order:c.order??100}}),o=new Set;for(let l of Object.values(s)){if(!ee(l))continue;for(let c of Object.values(l)){let d=ee(c)?c.provider:void 0;if(N(d))o.add(d)}}let a=[];for(let l of t.connectors()){let c=String(l.connector.provider);if(!o.has(c))continue;let{module:d}=l.connector;if(!N(d)||d==="")throw Error(`Connector class "${l.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);a.push({className:l.classDef.title??l.name,module:d,provider:c})}return{connectors:a,mounts:i}}async function fD(e,t,r){let n=[];for(let s of e.headProviders()){let i=s.project?.key,o=i===void 0?null:t[i];if(i!==void 0&&(o===void 0||o===null))continue;try{let a=await s.call("head",o??null,{projectConfig:t,root:r});n.push(...a??[])}catch(a){console.warn(`${s.name} head capability failed: ${Ee(a)}`)}}return n}function zd(e,t){if(Array.isArray(e))return e.map((r)=>zd(r,t));if(ee(e))return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,zd(n,t)]));if(pe(e))return wt(e,t)??e;return e}function vv(e,t){return e.map((r)=>{if(!F(r))return r;let n={...r};if(n.attributes){n.attributes={...n.attributes};for(let[s,i]of Object.entries(n.attributes))if(pe(i))n.attributes[s]=wt(i,t)??i}if(pe(n.textContent))n.textContent=wt(n.textContent,t)??n.textContent;else if(F(n.textContent))n.textContent=zd(n.textContent,t);return n})}function Vd(e,t){return e.map((r)=>{if(!F(r)||!r.attributes)return r;let n={...r,attributes:{...r.attributes}};for(let s of["href","src"]){let i=n.attributes[s];if(N(i)&&pD(i))n.attributes[s]=t(i)}return n})}function pD(e){return!e.startsWith("/")&&!e.startsWith("./")&&!e.startsWith("../")&&!e.startsWith("http")&&!e.startsWith("data:")}function Ev(e){return kv(e).replaceAll("${","&#36;{")}function _v(e){return e.replaceAll("${","$​{")}function Pv(e,t){if(!F(e))return e;let r={};for(let[n,s]of Object.entries(e))if(n==="children"&&Array.isArray(e.children))r.children=e.children.map((i)=>{if(N(i))return i;return Pv(i,t)});else if(n==="style"&&F(e.style)){let i={...e.style};for(let[o,a]of Object.entries(i))if(pe(a))i[o]=kl(a,t)??a;r.style=i}else if(n==="attributes"&&F(e.attributes)){let i={...e.attributes};for(let[o,a]of Object.entries(i))if(pe(a)){let l=kl(a,t);i[o]=N(l)&&l.includes("${")?_v(l):l??a}r.attributes=i}else if(n==="$props"&&F(e.$props)){let i={...e.$props};for(let[o,a]of Object.entries(i))if(pe(a)){let l=kl(a,t);i[o]=l!==null?l??null:a}r.$props=i}else if(pe(s)){let i=kl(s,t);if(n==="textContent"&&N(i)&&i.includes("${"))r.innerHTML=Ev(i);else r[n]=i??s}else r[n]=s;return r}function kl(e,t){try{let r=t.$map,n=F(r)&&"item"in r?r.item:void 0,s=F(r)&&"index"in r?r.index:void 0,i=Bs(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function("state","$map","item","index",i)(t,r,n,s)}catch{return null}}function jo(e,t){if(!F(e))return;if(pe(e.innerHTML)){let s=wt(e.innerHTML,t);if(s!=null)e.innerHTML=String(s).replaceAll("${","&#36;{")}let r=e.textContent;if(pe(r)){let s=wt(r,t);if(N(s)&&s.includes("${"))e.innerHTML=Ev(s),delete e.textContent;else e.textContent=s??r}if(F(e.style)){for(let[s,i]of Object.entries(e.style))if(pe(i))e.style[s]=wt(i,t)??i}if(F(e.attributes)){for(let[s,i]of Object.entries(e.attributes))if(pe(i)){let o=wt(i,t);e.attributes[s]=N(o)&&o.includes("${")?_v(o):o??i}}if(F(e.$props)){let s=e.$props;for(let[i,o]of Object.entries(s))if(pe(o))s[i]=wt(o,t)??o}let n=e.children;if(Qe(n)){let s=wv(n,t);if(s&&s.length>0){e.children=s;return}}if(pe(n)){let s=wt(n,t);if(Array.isArray(s)){let i=s;e.children=i;for(let o of i)jo(o,t)}}else if(Array.isArray(e.children)){let s=0;while(s<e.children.length){let i=e.children[s];if(pe(i)){let o=wt(i,t);if(Array.isArray(o)){let a=o;e.children.splice(s,1,...a);for(let l of a)jo(l,t);s+=a.length;continue}}if(Qe(i)){let o=wv(i,t);if(o&&o.length>0){e.children.splice(s,1,...o),s+=o.length;continue}}jo(i,t),s+=1}}}function mD(e,t){let r=t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`);return new RegExp(String.raw`\bstate\.${r}\b|#/state/${r}(?=["/])`).test(e)}function wv(e,t){let r=e.items,n=Ce(r)?xu(r.$ref,t):r,s=e.map;if(!Array.isArray(n)||!s)return null;return n.map((o,a)=>{let l=Object.create(t);l.$map={index:a,item:o},l["$map/item"]=o,l["$map/index"]=a;let c=Pv(s,l);return jo(c,l),c})}function Gd(e,t,r,n,s){if(!F(e))return;if(Array.isArray(e)){for(let a of e)Gd(a,t,r,n,s);return}if(Array.isArray(e.children))for(let a of e.children)Gd(a,t,r,n,s);let{tagName:i}=e;if(!N(i))return;let o=t.get(i);if(o){if(e.attributes){let{lifted:v,rest:j}=ju(e.attributes);if(v)e.attributes=j,e.$props={...v,...e.$props}}let a=(v)=>{if(r&&F(v)&&!Array.isArray(v))Tn(v,r.rules,r.media,"",r.counter,"jxs");return Gs(v,{},null)},l=ys(o,n),c=e.$props||null,d={componentDefs:t,defaults:n,path:[{key:JSON.stringify(c??{}),tag:i}],slotIds:s},p=Ga(o),{children:h}=e,m=!l&&!p&&Cn(o.children)?_u(d):null,b=l?(Array.isArray(h)?h:[]).map((v)=>a(v)).join(`
506
+ `):null,g=rg(o,c,l?null:Pu(h,{},a,m),d);if(m!==null)e.attributes={...e.attributes,[no]:String(m)};e.innerHTML=l?`<template shadowrootmode="${l}"><link rel="stylesheet" href="/components/${i}.css">${g}</template>${b??""}`:g,delete e.children;let y=ku(o.style,za(o,c));if(Object.keys(y).length>0)e.style={...e.style,...y};if(!p&&e.$props&&Object.keys(e.$props).length>0)e.attributes={...e.attributes,"data-jx-props":JSON.stringify(e.$props)};if(delete e.$props,p)e.$static=!0;else e.$prerendered=!0}}function hD(e,t,r=new Map,n=new Set,s="",i={}){let o=(S)=>e.includes(`<${S}`),a=(S)=>s.includes(`<${S}`),l=t.filter((S)=>o(S)||a(S));if(l.length===0)return e;let c=l.flatMap((S)=>{let P=r.get(S);return P===void 0||P===""?[]:[P]}).join(`
507
+ `),d=c===""?"":`<style>
508
+ ${Ba(c)}
509
+ </style>`,p=(S)=>{let P=S.filter(Boolean).join(`
510
+ `);return P===""?e:e.replace("</head>",` ${P}
511
+ </head>`)},h=l.filter((S)=>a(S)||!n.has(S));if(h.length===0)return p([d]);let m=yv(i),g=[...Hd(i),...h.map((S)=>`/components/${S}.js`)].map((S)=>`<link rel="modulepreload" href="${S}">`).join(`
512
+ `),y=e.includes('<script type="importmap">'),v=p([y?"":m,g,d]),j=h.map((S)=>`<script type="module" src="/components/${S}.js"></script>`).join(`
513
+ `);return v.replace("</body>",` ${j}
514
+ </body>`)}function gD(e,t){return e.replace("</body>",` <script type="module" src="${t}"></script>
515
+ </body>`)}function yD(e,t,r){let n=Gg(t),s=/<head>([\s\S]*?)<\/head>/i,i=e.match(s),o="";if(i){let l=i[1].match(/<style>[\s\S]*?<\/style>/gi);if(l)o+=`
557
516
  ${l.join(`
558
- `)}`}let a=e;if(i.test(a))a=a.replace(i,`<head>
517
+ `)}`;let c=i[1].match(/<script[\s\S]*?<\/script>/gi);if(c)o+=`
518
+ ${c.join(`
519
+ `)}`}let a=e;if(s.test(a))a=a.replace(s,`<head>
559
520
  ${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)}">`:`
562
- <meta name="robots" content="noindex">`,_=`<!DOCTYPE html>
521
+ </head>`);return a=a.replace(/<html\s[^>]*>/i,(l)=>{let c=/lang=/.test(l)?l.replace(/lang="[^"]*"/,`lang="${r.lang}"`):l.replace("<html",`<html lang="${r.lang}"`);if(r.dir!==void 0)c=/\sdir=/.test(c)?c.replace(/\sdir="[^"]*"/,` dir="${r.dir}"`):c.replace("<html",`<html dir="${r.dir}"`);return c}),a}function jv(e,t,r){if(e==="/")return Hn(t,"index.html");if(ao(e))return Hn(t,"404.html");let n=e.replace(/^\//,"");if(r==="always")return Hn(t,n,"index.html");return Hn(t,`${n}.html`)}function bD(e,t,r={}){let n=0,s=[],i=[],o=(c)=>c.length>1&&c.endsWith("/")?c.slice(0,-1):c,a=new Set([...r.compiledUrls??[]].map((c)=>o(c))),l=r.trailingSlash??"always";for(let[c,d]of Object.entries(e)){let p=N(d)?d:d.destination,h=!N(d)&&"rewrite"in d&&d.rewrite,m=h?200:!N(d)&&("status"in d)?d.status??301:301;if(!h&&!Wd.has(String(m))){s.push(`Redirect "${c}" has status ${m}, which is not an RFC 9110 §15.4 redirection `+`status. Use one of ${[...Wd.keys()].join(", ")}, or { destination, rewrite: true } for a proxy.`);continue}let b=r.basePath??"";if(i.push(`${Ie(b,c)} ${Ie(b,p)} ${m}`),c.includes(":")||c.includes("*"))continue;if(a.has(o(c)))console.warn(`The ${h?"rewrite":"redirect"} "${c}" collides with a compiled page at the same route — `+"remove one or the other.");if(h)continue;let g=Wd.get(String(m));if(!g.html)continue;let y=jv(c,t,l),v=g.canonical?`
522
+ <link rel="canonical" href="${Bd(p)}">`:`
523
+ <meta name="robots" content="noindex">`,j=`<!DOCTYPE html>
563
524
  <html>
564
525
  <head>
565
526
  <meta charset="utf-8">
566
- <meta http-equiv="refresh" content="0;url=${xm(d)}">${x}
527
+ <meta http-equiv="refresh" content="0;url=${Bd(p)}">${v}
567
528
  <title>Redirecting...</title>
568
529
  </head>
569
530
  <body>
570
- <p>Redirecting to <a href="${xm(d)}">${WE(d)}</a>...</p>
531
+ <p>Redirecting to <a href="${Bd(p)}">${kv(p)}</a>...</p>
571
532
  </body>
572
- </html>`;en(tn(b),{recursive:!0}),Cr(b,_,"utf8"),n+=1}if(s.length>0)Cr(vi(t,"_redirects"),`${s.join(`
533
+ </html>`;Er(Br(y),{recursive:!0}),hr(y,j,"utf8"),n+=1}if(i.length>0)hr(Hn(t,"_redirects"),`${i.join(`
573
534
  `)}
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(`
535
+ `,"utf8"),n+=1;return{errors:s,files:n}}function kv(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function Bd(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function Ud(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function xD(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}function vD(e,t){if(e.length===0)return 0;let r=e.map((i)=>{let o=(i.alternates??[]).map((a)=>` <xhtml:link rel="alternate" hreflang="${Ud(a.hreflang)}" href="${Ud(a.href)}"/>`).join(`
575
536
  `);return` <url>
576
- <loc>${$m(s.loc)}</loc>
577
- <lastmod>${s.lastmod}</lastmod>
537
+ <loc>${Ud(i.loc)}</loc>
538
+ <lastmod>${i.lastmod}</lastmod>
578
539
  ${o===""?"":`${o}
579
540
  `} </url>`}).join(`
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}"`:""}>
541
+ `),s=`<?xml version="1.0" encoding="UTF-8"?>
542
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((i)=>(i.alternates?.length??0)>0)?` xmlns:xhtml="${$D}"`:""}>
582
543
  ${r}
583
544
  </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: *
545
+ `;return hr(Hn(t,"sitemap.xml"),s,"utf8"),1}function wD(e,t){let r=Hn(e,"robots.txt"),n=xn(r),s=n?rD(r,"utf8"):`User-agent: *
585
546
  Allow: /
586
- `;if(/^Sitemap:/im.test(i))return 0;if(!i.endsWith(`
587
- `))i+=`
588
- `;return i+=`
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)}
591
- `,"utf8"),cu(i,`${JSON.stringify(t,null,2)}
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
- `,"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(`
595
- `);return Ti[Ti.length-1]}(ye(fe(-5),{precedes:!0})),qt=fe(5),nr=ye(qt),Do=Ne+nr.split(`
547
+ `;if(/^Sitemap:/im.test(s))return 0;if(!s.endsWith(`
548
+ `))s+=`
549
+ `;return s+=`
550
+ Sitemap: ${Rn("/sitemap.xml",t)}
551
+ `,hr(r,s,"utf8"),n?0:1}var $v='set build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".',Wd,$D="http://www.w3.org/1999/xhtml";var Rv=q(()=>{ve();rr();nr();Im();Yc();Hi();bg();Ag();sn();Cg();Ig();Hg();Bg();Kg();Xg();ty();$y();uo();zu();Mr();Us();wy();tv();Nu();ov();Ru();dv();Ou();xv();Id();Wd=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 SD}from"node:module";import{join as ED}from"node:path";import{spawn as _D}from"node:child_process";function PD(e){try{return SD(ED(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 Av(e,t,r=_D,n=process){let i=[PD(e),"--root",e];if(t!==void 0)i.push("--port",String(t));let o=r("bun",i,{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 Ov=()=>{};import{createServer as jD}from"node:http";import{existsSync as Rl,readFileSync as Cv,statSync as kD}from"node:fs";import{extname as RD,join as Kd,normalize as AD,resolve as Tv,sep as OD}from"node:path";function TD(e,t){let r=AD(t).replaceAll("\\","/"),n=Tv(e,`.${r.startsWith("/")?r:`/${r}`}`);if(n!==e&&!n.startsWith(e+OD))return null;if(Rl(n)){if(kD(n).isDirectory()){let i=Kd(n,"index.html");return Rl(i)?i:null}return n}let s=Kd(n,"index.html");return Rl(s)?s:null}function Nv(e,t){let r=Tv(e),n=jD((s,i)=>{let o=new URL(s.url??"/","http://localhost"),a=TD(r,decodeURIComponent(o.pathname));if(a){i.writeHead(200,{"Content-Type":CD.get(RD(a).toLowerCase())??"application/octet-stream"}),i.end(Cv(a));return}let l=Kd(r,"404.html");if(Rl(l)){i.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),i.end(Cv(l));return}i.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),i.end("Not found")});return n.listen(t),n}var CD;var Iv=q(()=>{Rc();CD=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",...hm}))});var ko="https://jxsuite.com/schema/project/fields/v2",Es="https://jxsuite.com/schema/document/paths/v2",Mv,Jv,Ro,Yd;var Al=q(()=>{Mv={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"},Jv={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"},Ro=[{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"}],Yd={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 ND(e){let{corePath:t,fragments:r,fieldSchemaRefs:n=[]}=e;return{$comment:qv,$defs:{Fields:{$id:ko,anyOf:[{$ref:`${Dv}#/$defs/JxFieldSchema`},{$ref:`${Dv}#/$defs/RelationshipRef`},...n.map((s)=>({$ref:s}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t},...r.map((s)=>({$ref:s}))],type:"object",unevaluatedProperties:!1}}async function Oo(e,t,r,n=[]){let s=structuredClone(e),i=new Map,o=new Set;Xd(s,o);let a=0,l=async(d)=>{let p=Ao(d),h=i.get(p);if(h!==void 0)return h;let m;try{m=structuredClone(await t(p))}catch(v){throw Error(`bundleSchema: cannot load $ref target "${p}": ${qD(v)}`,{cause:v})}let b=N(m.$id)&&Vn(m.$id)?m.$id:null;a+=b===null?1:0;let g=b??`urn:jx:bundled:${a}`;if(i.set(p,g),o.has(g))return g;o.add(g),m.$id=g,await c(m,FD(p),!0);let y=s.$defs??={};return y[g]=m,g},c=async(d,p,h=!1)=>{if(Array.isArray(d)){for(let y of d)await c(y,p);return}if(!ee(d))return;let m=d,b=p;if(!h&&N(m.$id)&&Vn(m.$id))b=null;let g=m.$ref;if(N(g)&&b!==null&&!g.startsWith("#")&&!Vn(g)){let y=g.indexOf("#"),v=y===-1?g:g.slice(0,y),j=y===-1?"":g.slice(y);if(v){let S=await l(`${b}/${v}`);m.$ref=`${S}${j}`}}for(let y of Object.values(m))await c(y,b)};await c(s,Ao(r),!0);for(let d of n)await l(`${Ao(r)}/${d}`);return s}function DD(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function*Lv(e,t){for(let r of ID){let n=e[r];if(Array.isArray(n)){for(let[s,i]of n.entries())if(ee(i))yield[i,`${t}/${r}/${s}`]}else if(ee(n))yield[n,`${t}/${r}`]}for(let r of MD){let n=e[r];if(!ee(n))continue;for(let[s,i]of Object.entries(n))if(ee(i))yield[i,`${t}/${r}/${DD(s)}`]}for(let r of JD){let n=e[r];if(!Array.isArray(n))continue;for(let[s,i]of n.entries())if(ee(i))yield[i,`${t}/${r}/${s}`]}}function LD(e,t){let r=e.replace(/^[a-zA-Z][a-zA-Z\d+.-]*:/,"");if(r.startsWith("//")){let i=r.indexOf("/",2);r=i===-1?"":r.slice(i+1)}r=r.replace(/^schema\//,"");let n=r.split(/[^a-zA-Z0-9]+/).filter(Boolean).join("-")||"resource",s=n;for(let i=2;t.has(s);i+=1)s=`${n}-${i}`;return t.add(s),s}function Co(e){let t=structuredClone(e);if(ee(t.$defs)){let i=new Set(Object.keys(t.$defs).filter((a)=>!Vn(a))),o={};for(let[a,l]of Object.entries(t.$defs)){let c=ee(l)&&N(l.$id)?l.$id:a;o[Vn(a)?LD(c,i):a]=l}t.$defs=o}let r=new Map,n=(i,o)=>{let{$id:a}=i;if(N(a)&&Vn(a)&&!r.has(a))r.set(a,o);for(let[l,c]of Lv(i,o))n(l,c)};n(t,"#");let s=(i,o)=>{let a=o,{$id:l}=i;if(N(l)&&Vn(l)){if(a=r.get(l)??o,a!=="#")delete i.$id}let c=i.$ref;if(N(c)){let d=c.indexOf("#"),p=d===-1?c:c.slice(0,d),h=d===-1?"":c.slice(d+1);if(p===""){if(h.startsWith("/"))i.$ref=`${a}${h}`}else{let m=r.get(p);if(m!==void 0)i.$ref=h?`${m}${h}`:m}}for(let[d]of Lv(i,a))s(d,a)};return s(t,"#"),t}function Xd(e,t){if(Array.isArray(e)){for(let n of e)Xd(n,t);return}if(!ee(e))return;let r=e;if(N(r.$id)&&Vn(r.$id))t.add(r.$id);for(let n of Object.values(r))Xd(n,t)}function Vn(e){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e)}function Ao(e){let t=e.replaceAll("\\","/"),r=t.startsWith("/"),n=[];for(let s of t.split("/")){if(s===""||s===".")continue;if(s===".."){if(n.length>0&&n.at(-1)!=="..")n.pop();else if(!r)n.push("..");continue}n.push(s)}return(r?"/":"")+n.join("/")}function FD(e){let t=e.lastIndexOf("/");if(t===-1)return".";return t===0?"/":e.slice(0,t)}function qD(e){return e instanceof Error?e.message:String(e)}function HD(e){let{corePath:t,pathsValueRefs:r}=e;return{$comment:qv,$defs:{PathsValue:{$id:Es,anyOf:[...Ro,...r.map((n)=>({$ref:n}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t}]}}async function Hv(e){let{baseDir:t,coreDocumentRef:r,coreProjectRef:n,extensions:s,loadJson:i}=e,o=[],a=[],l=[],c=[];for(let h of s){if(h.project)o.push(h.project);if(h.document){let m=await Fv(h.document,i,t);if(a.push(...m),m.length>0)l.push(h.document)}if(h.fields)c.push(...await Fv(h.fields,i,t)),o.push(h.fields)}let d=ND({corePath:n,fieldSchemaRefs:c,fragments:o}),p=HD({corePath:r,pathsValueRefs:a});return{document:Co(await Oo(p,i,t,l)),project:Co(await Oo(d,i,t))}}async function Fv(e,t,r){let n;try{n=await t(Ao(`${Ao(r)}/${e}`))}catch{return[]}let{$id:s}=n;if(!N(s)||!n.$defs)return[];return Object.keys(n.$defs).map((i)=>`${s}#/$defs/${i}`)}var Dv="https://jxsuite.com/schema/project/core/v2",qv="Generated by `jx schema` from project.json#/extensions — do not edit.",ID,MD,JD;var Vv=q(()=>{Al();ve();Al();ID=["additionalItems","additionalProperties","contains","contentSchema","else","if","items","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],MD=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"],JD=["allOf","anyOf","oneOf","prefixItems"]});import{existsSync as Uv,readFileSync as VD,statSync as Wv,writeFileSync as Ol}from"node:fs";import{createRequire as No}from"node:module";import{dirname as WD,isAbsolute as BD,relative as Qd,resolve as Ur,sep as ef}from"node:path";async function zv(e){let{config:t}=kn(e),r=await jn(e,t),n=Ur(e),{document:s,project:i}=await Hv({baseDir:n,coreDocumentRef:Bv(e,zD),coreProjectRef:Bv(e,UD),extensions:r.extensions.map((o)=>({document:o.schemas.document&&Zd(e,o,o.schemas.document),fields:o.schemas.fields&&Zd(e,o,o.schemas.fields),project:o.schemas.project&&Zd(e,o,o.schemas.project)})),loadJson:Yv(n)});return{documentSchema:s,projectSchema:i}}async function Gv(e){let{documentSchema:t,projectSchema:r}=await zv(e),n=Ur(e,"project.schema.json"),s=Ur(e,"document.schema.json");return Ol(n,`${JSON.stringify(r,null,2)}
552
+ `,"utf8"),Ol(s,`${JSON.stringify(t,null,2)}
553
+ `,"utf8"),{documentSchemaPath:s,projectSchemaPath:n}}async function Kv(e,t={}){let{write:r=!0}=t,n=Ur(e),s=Ur(n,"project.json"),i=Ur(n,"project.schema.json"),o=Ur(n,"document.schema.json"),a=(g)=>{if(!Uv(g))return!0;try{return Wv(s).mtimeMs>Wv(g).mtimeMs}catch{return!1}},c=a(i)||a(o)?await zv(n):null;if(c&&r)Ol(i,`${JSON.stringify(c.projectSchema,null,2)}
554
+ `,"utf8"),Ol(o,`${JSON.stringify(c.documentSchema,null,2)}
555
+ `,"utf8");let d=Yv(n),p=c?.projectSchema??To(i),h=c?.documentSchema??To(o),m=Co(await Oo(p,d,n));return{document:Co(await Oo(h,d,n)),project:m}}function To(e){let t=JSON.parse(VD(e,"utf8"));if(!ee(t))throw TypeError(`Schema file "${e}" is not a JSON object`);return t}function KD(e){return e.startsWith(GD)&&e.endsWith(".json")}function YD(e,t){try{return No(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 Yv(e){return async(t)=>{let r=Ur(t),n=Qd(e,r);if(n.startsWith("..")||BD(n))throw Error(`Schema ref "${t}" escapes the project root ${e}`);let s=n.split(ef).join("/"),i="node_modules/",o=s.lastIndexOf(i),a=o===-1?null:s.slice(o+i.length);if(a!==null&&KD(a))return To(YD(a,t));if(Uv(r))return To(r);if(a===null)throw Error(`Schema ref "${t}" does not exist`);let l;try{l=No(Ur(e,"package.json")).resolve(a)}catch{try{l=No(import.meta.url).resolve(a)}catch(c){throw Error(`Schema ref "${t}" does not exist and "${a}" is not resolvable from the project or the host`,{cause:c})}}return To(l)}}function Bv(e,t){let r=null;try{r=No(Ur(e,"package.json")).resolve(t)}catch{try{r=No(import.meta.url).resolve(t)}catch{r=null}}let n=`./node_modules/${t}`;return r?Xv(e,r,n):n}function Zd(e,t,r){let n=Qd(WD(t.manifestPath),r).split(ef).join("/"),s=`./node_modules/${t.specifier}/${n}`;return Xv(e,r,s)}function Xv(e,t,r){let n=Qd(e,t).split(ef).join("/");if(n.startsWith(".."))return r;return n.startsWith("./")?n:`./${n}`}var UD="@jxsuite/schema/schemas/project.core.schema.json",zD="@jxsuite/schema/schema.json",GD="@jxsuite/";var tf=q(()=>{Vv();ve();sn();Hi()});var tw=C(function(NY,ew){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/elements",Zv=Te("fs").promises,Qv=Te("path");async function XD({folder:e=__dirname}={}){let t={},r=await Zv.readdir(e);for(let n of r)if(n.endsWith(".json")&&n!=="package.json"){let s=await Zv.readFile(Qv.join(e,n),"utf8");t[Qv.basename(n,".json")]=JSON.parse(s)}return t}ew.exports={listAll:XD}});var sw=C(function(IY,nw){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/css",ZD=Te("fs").promises,QD=Te("path");async function rw({folder:e=__dirname}={}){let t=await ZD.readFile(QD.join(e,"css.json"),"utf8");return JSON.parse(t)}async function eL({folder:e=__dirname}={}){let t=await rw(e),r={};for(let[n,s]of Object.entries(t)){r[n]={};for(let i of s){let o=i.name,a=null;if(i.for)a=s.find((l)=>l!==i&&l.name===i.name);if(a)o+=" for "+i.for[0];if(r[n][o]=i,i.descriptors){let l=i.descriptors;i.descriptors={};for(let c of l)i.descriptors[c.name]=c}}}return r}nw.exports={listAll:rw,index:eL}});var iw=C(function(Cl,rf){(function(e,t){typeof Cl=="object"&&typeof rf=="object"?rf.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Cl=="object"?Cl.WebIDL2=t():e.WebIDL2=t()})(globalThis,()=>(()=>{var e={d:(f,x)=>{for(var w in x)e.o(x,w)&&!e.o(f,w)&&Object.defineProperty(f,w,{enumerable:!0,get:x[w]})},o:(f,x)=>Object.prototype.hasOwnProperty.call(f,x),r:(f)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(f,"__esModule",{value:!0})}},t={};function r(f,x,w,_,A,{level:W="error",autofix:Y,ruleName:de}={}){function ce(Qt){return Qt>0?f.slice(x,x+Qt):f.slice(Math.max(x+Qt,0),x)}function ge(Qt,{precedes:ts}={}){let tn=Qt.map((Li)=>Li.trivia+Li.value).join(""),Di=f[x];return Di.type==="eof"?tn:ts?tn+Di.trivia:tn.slice(Di.trivia.length)}let _e=f[x].type!=="eof"?f[x].line:f.length>1?f[x-1].line:1,Ae=function(Qt){let ts=Qt.split(`
556
+ `);return ts[ts.length-1]}(ge(ce(-5),{precedes:!0})),jt=ce(5),Lt=ge(jt),Ji=Ae+Lt.split(`
596
557
  `)[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(`
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(`
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
- `)||(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
605
- || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,ve._`+${i}`);return;case"integer":n.elseIf(ve._`${o} === "boolean" || ${i} === null
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},
558
+ `+(" ".repeat(Ae.length)+"^"),Pc=A==="Syntax"?"since":"inside",Wp=`${A} error at line ${_e}${f.name?` in ${f.name}`:""}${w&&w.name?`, ${Pc} \`${w.partial?"partial ":""}${function(Qt){let ts=[Qt];for(;Qt&&Qt.parent;){let{parent:tn}=Qt;ts.unshift(tn),Qt=tn}return ts.map((tn)=>function(Di,Li){let Bp=Di;return Li&&(Bp+=` ${Li}`),Bp}(tn.type,tn.name)).join(" -> ")}(w)}\``:""}:
559
+ ${Ji}`;return{message:`${Wp} ${_}`,bareMessage:_,context:Wp,line:_e,sourceName:f.name,level:W,ruleName:de,autofix:Y,input:Lt,tokens:jt}}function n(f,x,w,_){return r(f,x,w,_,"Syntax")}function s(f,x,w,_,A={}){return A.ruleName=w,r(x.source,f.index,x,_,"Validation",A)}e.r(t),e.d(t,{WebIDLParseError:()=>Ue,parse:()=>Or,validate:()=>Zt,write:()=>xt});class i{constructor({source:f,tokens:x}){Object.defineProperties(this,{source:{value:f},tokens:{value:x,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){let f={type:void 0,name:void 0,inheritance:void 0},x=this;for(;x!==Object.prototype;){let w=Object.getOwnPropertyDescriptors(x);for(let[_,A]of Object.entries(w))(A.enumerable||A.get)&&(f[_]=this[_]);x=Object.getPrototypeOf(x)}return f}}function o(f,x,{useNullableInner:w}={}){if(!f.union){let _=x.unique.get(f.idlType);if(!_)return;if(_.type==="typedef"){let{typedefIncludesDictionary:A}=x.cache;if(A.has(_))return A.get(_);x.cache.typedefIncludesDictionary.set(_,void 0);let W=o(_.idlType,x);if(x.cache.typedefIncludesDictionary.set(_,W),W)return{reference:f,dictionary:W.dictionary}}if(_.type==="dictionary"&&(w||!f.nullable))return{reference:f,dictionary:_}}for(let _ of f.subtype){let A=o(_,x);if(A)return _.union?A:{reference:_,dictionary:A.dictionary}}}function a(f,x){if(x.cache.dictionaryIncludesRequiredField.has(f))return x.cache.dictionaryIncludesRequiredField.get(f);x.cache.dictionaryIncludesRequiredField.set(f,void 0);let w=f.members.some((_)=>_.required);if(!w&&f.inheritance){let _=x.unique.get(f.inheritance);_?a(_,x)&&(w=!0):w=!0}return x.cache.dictionaryIncludesRequiredField.set(f,w),w}class l extends Array{constructor({source:f,tokens:x}){super(),Object.defineProperties(this,{source:{value:f},tokens:{value:x},parent:{value:null,writable:!0}})}}class c extends i{static parser(f,x){return()=>{let w=f.consumeKind(x);if(w)return new c({source:f.source,tokens:{value:w}})}}get value(){return M(this.tokens.value.value)}write(f){return f.ts.wrap([f.token(this.tokens.value),f.token(this.tokens.separator)])}}class d extends c{static parse(f){let x=f.consumeKind("eof");if(x)return new d({source:f.source,tokens:{value:x}})}get type(){return"eof"}}function p(f,x){return L(f,{parser:c.parser(f,x),listName:x+" list"})}let h=["identifier","decimal","integer","string"],m=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((f)=>[f,`Legacy${f}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function b(f){for(let x of h){let w=p(f,x);if(w.length)return w}f.error("Expected identifiers, strings, decimals, or integers but none found")}class g extends i{static parse(f){let x={assign:f.consume("=")},w=te(new g({source:f.source,tokens:x}));if(w.list=[],x.assign){if(x.asterisk=f.consume("*"),x.asterisk)return w.this;x.secondaryName=f.consumeKind(...h)}return x.open=f.consume("("),x.open?(w.list=w.rhsIsList?b(f):oe(f),x.close=f.consume(")")||f.error("Unexpected token in extended attribute argument list")):x.assign&&!x.secondaryName&&f.error("No right hand side to extended attribute assignment"),w.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(f){let{rhsType:x}=this;return f.ts.wrap([f.token(this.tokens.assign),f.token(this.tokens.asterisk),f.reference_token(this.tokens.secondaryName,this.parent),f.token(this.tokens.open),...this.list.map((w)=>x==="identifier-list"?f.identifier(w,this.parent):w.write(f)),f.token(this.tokens.close)])}}class y extends i{static parse(f){let x=f.consumeKind("identifier");if(x)return new y({source:f.source,tokens:{name:x},params:g.parse(f)})}constructor({source:f,tokens:x,params:w}){super({source:f,tokens:x}),w.parent=this,Object.defineProperty(this,"params",{value:w})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){let{rhsType:f,tokens:x,list:w}=this.params;if(!f)return null;return{type:f,value:this.params.rhsIsList?w:this.params.tokens.secondaryName?M(x.secondaryName.value):null}}get arguments(){let{rhsIsList:f,list:x}=this.params;return!x||f?[]:x}*validate(f){let{name:x}=this;if(x==="LegacyNoInterfaceObject")yield s(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(x)){let _=`\`[${x}]\` extended attribute is a legacy feature that is now renamed to \`[${m.get(x)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield s(this.tokens.name,this,"renamed-legacy",_,{level:"warning",autofix:(w=this,()=>{let{name:A}=w;w.tokens.name.value=m.get(A),A==="TreatNullAs"&&(w.params.tokens={})})})}var w;for(let _ of this.arguments)yield*_.validate(f)}write(f){return f.ts.wrap([f.ts.trivia(this.tokens.name.trivia),f.ts.extendedAttribute(f.ts.wrap([f.ts.extendedAttributeReference(this.name),this.params.write(f)])),f.token(this.tokens.separator)])}}class v extends l{static parse(f){let x={};x.open=f.consume("[");let w=new v({source:f.source,tokens:x});return x.open?(w.push(...L(f,{parser:y.parse,listName:"extended attribute"})),x.close=f.consume("]")||f.error("Expected a closing token for the extended attribute list"),w.length||(f.unconsume(x.close.index),f.error("An extended attribute list must not be empty")),f.probe("[")&&f.error("Illegal double extended attribute lists, consider merging them"),w):w}*validate(f){for(let x of this)yield*x.validate(f)}write(f){return this.length?f.ts.wrap([f.token(this.tokens.open),...this.map((x)=>x.write(f)),f.token(this.tokens.close)]):""}}function j(f,x){let w=f.consume("?");w&&(x.tokens.nullable=w),f.probe("?")&&f.error("Can't nullable more than once")}function S(f,x){let w=function(_,A){let W=_.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!W)return;let Y=te(new P({source:_.source,tokens:{base:W}}));switch(Y.tokens.open=_.consume("<")||_.error(`No opening bracket after ${W.value}`),W.value){case"Promise":{_.probe("[")&&_.error("Promise type cannot have extended attribute");let de=ae(_,A)||_.error("Missing Promise subtype");Y.subtype.push(de);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{let de=Q(_,A)||_.error(`Missing ${W.value} subtype`);Y.subtype.push(de);break}case"record":{_.probe("[")&&_.error("Record key cannot have extended attribute");let de=_.consume(...We)||_.error(`Record key must be one of: ${We.join(", ")}`),ce=new P({source:_.source,tokens:{base:de}});ce.tokens.separator=_.consume(",")||_.error("Missing comma after record key type"),ce.type=A;let ge=Q(_,A)||_.error("Error parsing generic type record");Y.subtype.push(ce,ge);break}}return Y.idlType||_.error(`Error parsing generic type ${W.value}`),Y.tokens.close=_.consume(">")||_.error(`Missing closing bracket after ${W.value}`),Y.this}(f,x)||ue(f);if(!w){let _=f.consumeKind("identifier")||f.consume(...We,...fe);if(!_)return;w=new P({source:f.source,tokens:{base:_}}),f.probe("<")&&f.error(`Unsupported generic type ${_.value}`)}return w.generic==="Promise"&&f.probe("?")&&f.error("Promise type cannot be nullable"),w.type=x||null,j(f,w),w.nullable&&w.idlType==="any"&&f.error("Type `any` cannot be made nullable"),w}class P extends i{static parse(f,x){return S(f,x)||function(w,_){let A={};if(A.open=w.consume("("),!A.open)return;let W=te(new P({source:w.source,tokens:A}));for(W.type=_||null;;){let Y=Q(w,_)||w.error("No type after open parenthesis or 'or' in union type");Y.idlType==="any"&&w.error("Type `any` cannot be included in a union type"),Y.generic==="Promise"&&w.error("Type `Promise` cannot be included in a union type"),W.subtype.push(Y);let de=w.consume("or");if(!de)break;Y.tokens.separator=de}return W.idlType.length<2&&w.error("At least two types are expected in a union type but found less"),A.close=w.consume(")")||w.error("Unterminated union type"),j(w,W),W.this}(f,x)}constructor({source:f,tokens:x}){super({source:f,tokens:x}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new v({source:f,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 M([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((f)=>f).map((f)=>f.value).join(" "))}*validate(f){if(yield*this.extAttrs.validate(f),this.idlType==="BufferSource")for(let A of[this.extAttrs,this.parent?.extAttrs])for(let W of A){if(W.name!=="AllowShared")continue;let Y="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield s(this.tokens.base,this,"migrate-allowshared",Y,{autofix:E(this,W,A)})}if(this.idlType==="void")yield s(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:(x=this,()=>{x.tokens.base.value="undefined"})});var x;let w=!this.union&&f.unique.get(this.idlType),_=this.union?this:w&&w.type==="typedef"?w.idlType:void 0;if(_&&this.nullable){let{reference:A}=o(_,f)||{};if(A){let W=(this.union?A:this).tokens.base;yield s(W,this,"no-nullable-union-dict","Nullable union cannot include a dictionary type.")}}else for(let A of this.subtype)yield*A.validate(f)}write(f){return f.ts.wrap([this.extAttrs.write(f),(()=>{if(this.union||this.generic)return f.ts.wrap([f.token(this.tokens.base,f.ts.generic),f.token(this.tokens.open),...this.subtype.map((A)=>A.write(f)),f.token(this.tokens.close)]);let x=this.tokens.prefix||this.tokens.base,w=this.tokens.prefix?[this.tokens.prefix.value,f.ts.trivia(this.tokens.base.trivia)]:[],_=f.reference(f.ts.wrap([...w,this.tokens.base.value,f.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return f.ts.wrap([f.ts.trivia(x.trivia),_])})(),f.token(this.tokens.nullable),f.token(this.tokens.separator)])}}function E(f,x,w){return()=>{let _=w.indexOf(x);w.splice(_,1),!w.length&&f.tokens.base.trivia.match(/^\s$/)&&(f.tokens.base.trivia=""),f.tokens.base.value="AllowSharedBufferSource"}}class O extends i{static parse(f){let x=f.consume("=");if(!x)return null;let w=B(f)||f.consumeKind("string")||f.consume("null","[","{")||f.error("No value for default"),_=[w];if(w.value==="["){let A=f.consume("]")||f.error("Default sequence value must be empty");_.push(A)}else if(w.value==="{"){let A=f.consume("}")||f.error("Default dictionary value must be empty");_.push(A)}return new O({source:f.source,tokens:{assign:x},expression:_})}constructor({source:f,tokens:x,expression:w}){super({source:f,tokens:x}),w.parent=this,Object.defineProperty(this,"expression",{value:w})}get type(){return se(this.expression[0]).type}get value(){return se(this.expression[0]).value}get negative(){return se(this.expression[0]).negative}write(f){return f.ts.wrap([f.token(this.tokens.assign),...this.expression.map((x)=>f.token(x))])}}class R extends i{static parse(f){let x=f.position,w={},_=te(new R({source:f.source,tokens:w}));return _.extAttrs=v.parse(f),w.optional=f.consume("optional"),_.idlType=Q(f,"argument-type"),_.idlType?(w.optional||(w.variadic=f.consume("...")),w.name=f.consumeKind("identifier")||f.consume(...G),w.name?(_.default=w.optional?O.parse(f):null,_.this):f.unconsume(x)):f.unconsume(x)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return M(this.tokens.name.value)}*validate(f){yield*this.extAttrs.validate(f),yield*this.idlType.validate(f);let x=o(this.idlType,f,{useNullableInner:!0});if(x){if(this.idlType.nullable)yield s(this.tokens.name,this,"no-nullable-dict-arg","Dictionary arguments cannot be nullable.");else if(this.optional){if(!this.default)yield s(this.tokens.name,this,"dict-arg-default","Optional dictionary arguments must have a default value of `{}`.",{autofix:k(this)})}else if(this.parent&&!a(x.dictionary,f)&&function(_){let A=_.parent.arguments||_.parent.list,W=A.indexOf(_);return!A.slice(W+1).some((de)=>!de.optional)}(this))yield s(this.tokens.name,this,"dict-arg-optional","Dictionary argument must be optional if it has no required fields",{autofix:(w=this,()=>{let A=z(w.idlType);w.tokens.optional={...A,type:"optional",value:"optional"},A.trivia=" ",k(w)()})})}var w}write(f){return f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.optional),f.ts.type(this.idlType.write(f)),f.token(this.tokens.variadic),f.name_token(this.tokens.name,{data:this}),this.default?this.default.write(f):"",f.token(this.tokens.separator)])}}function k(f){return()=>{f.default=O.parse(new ut(" = {}"))}}class I extends i{static parse(f,{special:x,regular:w}={}){let _={special:x},A=te(new I({source:f.source,tokens:_}));return x&&x.value==="stringifier"&&(_.termination=f.consume(";"),_.termination)?(A.arguments=[],A):(x||w||(_.special=f.consume("getter","setter","deleter")),A.idlType=ae(f)||f.error("Missing return type"),_.name=f.consumeKind("identifier")||f.consume("includes"),_.open=f.consume("(")||f.error("Invalid operation"),A.arguments=oe(f),_.close=f.consume(")")||f.error("Unterminated operation"),_.termination=f.consume(";")||f.error("Unterminated operation, expected `;`"),A.this)}get type(){return"operation"}get name(){let{name:f}=this.tokens;return f?M(f.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(f){if(yield*this.extAttrs.validate(f),!this.name&&["","static"].includes(this.special))yield s(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 s(this.idlType.tokens.base,this,"async-sequence-idl-to-js","async_sequence types cannot be returned by an operation.");yield*this.idlType.validate(f)}for(let x of this.arguments)yield*x.validate(f)}write(f){let{parent:x}=this,w=this.idlType?[f.ts.type(this.idlType.write(f)),f.name_token(this.tokens.name,{data:this,parent:x}),f.token(this.tokens.open),f.ts.wrap(this.arguments.map((_)=>_.write(f))),f.token(this.tokens.close)]:[];return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),this.tokens.name?f.token(this.tokens.special):f.token(this.tokens.special,f.ts.nameless,{data:this,parent:x}),...w,f.token(this.tokens.termination)]),{data:this,parent:x})}}class D extends i{static parse(f,{special:x,noInherit:w=!1,readonly:_=!1}={}){let A=f.position,W={special:x},Y=te(new D({source:f.source,tokens:W}));if(x||w||(W.special=f.consume("inherit")),Y.special==="inherit"&&f.probe("readonly")&&f.error("Inherited attributes cannot be read-only"),W.readonly=f.consume("readonly"),_&&!W.readonly&&f.probe("attribute")&&f.error("Attributes must be readonly in this context"),W.base=f.consume("attribute"),W.base)return Y.idlType=Q(f,"attribute-type")||f.error("Attribute lacks a type"),W.name=f.consumeKind("identifier")||f.consume("async","required")||f.error("Attribute lacks a name"),W.termination=f.consume(";")||f.error("Unterminated attribute, expected `;`"),Y.this;f.unconsume(A)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return M(this.tokens.name.value)}*validate(f){if(yield*this.extAttrs.validate(f),yield*this.idlType.validate(f),["async_sequence","sequence","record"].includes(this.idlType.generic)){let x=`Attributes cannot accept ${this.idlType.generic} types.`;yield s(this.tokens.name,this,"attr-invalid-type",x)}{let{reference:x}=o(this.idlType,f)||{};if(x){let w=(this.idlType.union?x:this.idlType).tokens.base;yield s(w,this,"attr-invalid-type","Attributes cannot accept dictionary types.")}}if(this.readonly&&function(x,w){if(x.union)return!1;if(x.extAttrs.some((A)=>A.name==="EnforceRange"))return!0;let _=w.unique.get(x.idlType);return _?.type==="typedef"&&_.idlType.extAttrs.some((A)=>A.name==="EnforceRange")}(this.idlType,f)){let x=this.idlType.tokens.base;yield s(x,this,"attr-invalid-type","Readonly attributes cannot accept [EnforceRange] extended attribute.")}}write(f){let{parent:x}=this;return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.special),f.token(this.tokens.readonly),f.token(this.tokens.base),f.ts.type(this.idlType.write(f)),f.name_token(this.tokens.name,{data:this,parent:x}),f.token(this.tokens.termination)]),{data:this,parent:x})}}function M(f){return f.startsWith("_")?f.slice(1):f}function L(f,{parser:x,allowDangler:w,listName:_="list"}){let A=x(f);if(!A)return[];A.tokens.separator=f.consume(",");let W=[A];for(;A.tokens.separator;){let Y=x(f);if(!Y){w||f.error(`Trailing comma in ${_}`);break}if(Y.tokens.separator=f.consume(","),W.push(Y),!Y.tokens.separator)break}return W}function B(f){return f.consumeKind("decimal","integer")||f.consume("true","false","Infinity","-Infinity","NaN")}function se({type:f,value:x}){switch(f){case"decimal":case"integer":return{type:"number",value:x};case"string":return{type:"string",value:x.slice(1,-1)}}switch(x){case"true":case"false":return{type:"boolean",value:x==="true"};case"Infinity":case"-Infinity":return{type:"Infinity",negative:x.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:x}}}function ue(f){let{source:x}=f,w=function(){let A=f.consume("unsigned"),W=f.consume("short","long");if(W){let Y=f.consume("long");return new P({source:x,tokens:{prefix:A,base:W,postfix:Y}})}A&&f.error("Failed to parse integer type")}()||function(){let A=f.consume("unrestricted"),W=f.consume("float","double");if(W)return new P({source:x,tokens:{prefix:A,base:W}});A&&f.error("Failed to parse float type")}();if(w)return w;let _=f.consume("bigint","boolean","byte","octet","undefined");return _?new P({source:x,tokens:{base:_}}):void 0}function oe(f){return L(f,{parser:R.parse,listName:"arguments list"})}function Q(f,x){let w=v.parse(f),_=P.parse(f,x);return _&&(te(_).extAttrs=w),_}function ae(f,x){let w=P.parse(f,x||"return-type");if(w)return w;let _=f.consume("void");if(_){let A=new P({source:f.source,tokens:{base:_}});return A.type="return-type",A}}function ke(f){let x=f.consume("stringifier");if(!x)return;return D.parse(f,{special:x})||I.parse(f,{special:x})||f.error("Unterminated stringifier")}function U(f){let x=f.split(`
560
+ `);if(x.length){let w=x[x.length-1].match(/^\s+/);if(w)return w[0]}return""}function le(f){return()=>{if(f.extAttrs.length){let x=new ut("Exposed=Window,"),w=y.parse(x);w.tokens.separator=x.consume(",");let _=f.extAttrs[0];/^\s/.test(_.tokens.name.trivia)||(_.tokens.name.trivia=` ${_.tokens.name.trivia}`),f.extAttrs.unshift(w)}else{te(f).extAttrs=v.parse(new ut("[Exposed=Window]"));let x=f.tokens.base.trivia;f.extAttrs.tokens.open.trivia=x,f.tokens.base.trivia=`
561
+ ${U(x)}`}}}function z(f){if(f.extAttrs.length)return f.extAttrs.tokens.open;if(f.type==="operation"&&!f.special)return z(f.idlType);return Object.values(f.tokens).sort((x,w)=>x.index-w.index)[0]}function te(f,x){if(x||(x=f),!f)return f;return new Proxy(f,{get(w,_){let A=w[_];return Array.isArray(A)&&_!=="source"?te(A,w):A},set(w,_,A){if(w[_]=A,!A)return!0;if(Array.isArray(A))for(let W of A)W.parent!==void 0&&(W.parent=x);else A.parent!==void 0&&(A.parent=x);return!0}})}let Le={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},fe=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],We=["ByteString","DOMString","USVString"],G=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],Be=["-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(G,We,fe),Xe=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],pt=["_constructor","toString","_toString"];class ut{constructor(f){this.source=function(x){let w=[],_=0,A="",W=1,Y=0;for(;_<x.length;){let ce=x.charAt(_),ge=-1;if(/[\t\n\r ]/.test(ce)?ge=de("whitespace",{noFlushTrivia:!0}):ce==="/"&&(ge=de("comment",{noFlushTrivia:!0})),ge!==-1){let _e=w.pop().value;W+=(_e.match(/\n/g)||[]).length,A+=_e,Y-=1}else if(/[-0-9.A-Z_a-z]/.test(ce)){if(ge=de("decimal"),ge===-1&&(ge=de("integer")),ge===-1){ge=de("identifier");let _e=w.length-1,Ae=w[_e];if(ge!==-1){if(pt.includes(Ae.value)){let jt=`${M(Ae.value)} is a reserved identifier and must not be used.`;throw new Ue(n(w,_e,null,jt))}Be.includes(Ae.value)&&(Ae.type="inline")}}}else ce==='"'&&(ge=de("string"));for(let _e of Xe)if(x.startsWith(_e,_)){w.push({type:"inline",value:_e,trivia:A,line:W,index:Y}),A="",_+=_e.length,ge=_;break}if(ge===-1&&(ge=de("other")),ge===-1)throw Error("Token stream not progressing");_=ge,Y+=1}return w.push({type:"eof",value:"",trivia:A,line:W,index:Y}),w;function de(ce,{noFlushTrivia:ge}={}){let _e=Le[ce];_e.lastIndex=_;let Ae=_e.exec(x);return Ae?(w.push({type:ce,value:Ae[0],trivia:A,line:W,index:Y}),ge||(A=""),_e.lastIndex):-1}}(f),this.position=0}error(f){throw new Ue(n(this.source,this.position,this.current,f))}probeKind(f){return this.source.length>this.position&&this.source[this.position].type===f}probe(f){return this.probeKind("inline")&&this.source[this.position].value===f}consumeKind(...f){for(let x of f){if(!this.probeKind(x))continue;let w=this.source[this.position];return this.position++,w}}consume(...f){if(!this.probeKind("inline"))return;let x=this.source[this.position];for(let w of f)if(x.value===w)return this.position++,x}consumeIdentifier(f){if(this.probeKind("identifier")&&this.source[this.position].value===f)return this.consumeKind("identifier")}unconsume(f){this.position=f}}class Ue extends Error{constructor({message:f,bareMessage:x,context:w,line:_,sourceName:A,input:W,tokens:Y}){super(f),this.name="WebIDLParseError",this.bareMessage=x,this.context=w,this.line=_,this.sourceName=A,this.input=W,this.tokens=Y}}class bt extends c{static parse(f){let x=f.consumeKind("string");if(x)return new bt({source:f.source,tokens:{value:x}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(f){let{parent:x}=this;return f.ts.wrap([f.ts.trivia(this.tokens.value.trivia),f.ts.definition(f.ts.wrap(['"',f.ts.name(this.value,{data:this,parent:x}),'"']),{data:this,parent:x}),f.token(this.tokens.separator)])}}class Jt extends i{static parse(f){let x={};if(x.base=f.consume("enum"),!x.base)return;x.name=f.consumeKind("identifier")||f.error("No name for enum");let w=te(new Jt({source:f.source,tokens:x}));return f.current=w.this,x.open=f.consume("{")||f.error("Bodyless enum"),w.values=L(f,{parser:bt.parse,allowDangler:!0,listName:"enumeration"}),f.probeKind("string")&&f.error("No comma between enum values"),x.close=f.consume("}")||f.error("Unexpected value in enum"),w.values.length||f.error("No value in enum"),x.termination=f.consume(";")||f.error("No semicolon after enum"),w.this}get type(){return"enum"}get name(){return M(this.tokens.name.value)}write(f){return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.base),f.name_token(this.tokens.name,{data:this}),f.token(this.tokens.open),f.ts.wrap(this.values.map((x)=>x.write(f))),f.token(this.tokens.close),f.token(this.tokens.termination)]),{data:this})}}class Zr extends i{static parse(f){let x=f.consumeKind("identifier");if(!x)return;let w={target:x};if(w.includes=f.consume("includes"),w.includes)return w.mixin=f.consumeKind("identifier")||f.error("Incomplete includes statement"),w.termination=f.consume(";")||f.error("No terminating ; for includes statement"),new Zr({source:f.source,tokens:w});f.unconsume(x.index)}get type(){return"includes"}get target(){return M(this.tokens.target.value)}get includes(){return M(this.tokens.mixin.value)}write(f){return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.reference_token(this.tokens.target,this),f.token(this.tokens.includes),f.reference_token(this.tokens.mixin,this),f.token(this.tokens.termination)]),{data:this})}}class Sn extends i{static parse(f){let x={},w=te(new Sn({source:f.source,tokens:x}));if(x.base=f.consume("typedef"),x.base)return w.idlType=Q(f,"typedef-type")||f.error("Typedef lacks a type"),x.name=f.consumeKind("identifier")||f.error("Typedef lacks a name"),f.current=w.this,x.termination=f.consume(";")||f.error("Unterminated typedef, expected `;`"),w.this}get type(){return"typedef"}get name(){return M(this.tokens.name.value)}*validate(f){yield*this.idlType.validate(f)}write(f){return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.base),f.ts.type(this.idlType.write(f)),f.name_token(this.tokens.name,{data:this}),f.token(this.tokens.termination)]),{data:this})}}class Ii extends i{static parse(f,x){let w={base:x},_=te(new Ii({source:f.source,tokens:w}));return w.name=f.consumeKind("identifier")||f.error("Callback lacks a name"),f.current=_.this,w.assign=f.consume("=")||f.error("Callback lacks an assignment"),_.idlType=ae(f)||f.error("Callback lacks a return type"),w.open=f.consume("(")||f.error("Callback lacks parentheses for arguments"),_.arguments=oe(f),w.close=f.consume(")")||f.error("Unterminated callback"),w.termination=f.consume(";")||f.error("Unterminated callback, expected `;`"),_.this}get type(){return"callback"}get name(){return M(this.tokens.name.value)}*validate(f){yield*this.extAttrs.validate(f);for(let x of this.arguments)if(yield*x.validate(f),x.idlType.generic==="async_sequence")yield s(x.tokens.name,x,"async-sequence-idl-to-js","async_sequence types cannot be returned as a callback argument.");yield*this.idlType.validate(f)}write(f){return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.base),f.name_token(this.tokens.name,{data:this}),f.token(this.tokens.assign),f.ts.type(this.idlType.write(f)),f.token(this.tokens.open),...this.arguments.map((x)=>x.write(f)),f.token(this.tokens.close),f.token(this.tokens.termination)]),{data:this})}}class Dt extends i{static parse(f,x,{inheritable:w,allowedMembers:_}){let{tokens:A,type:W}=x;for(A.name=f.consumeKind("identifier")||f.error(`Missing name in ${W}`),f.current=x,x=te(x),w&&Object.assign(A,function(Y){let de=Y.consume(":");return de?{colon:de,inheritance:Y.consumeKind("identifier")||Y.error("Inheritance lacks a type")}:{}}(f)),A.open=f.consume("{")||f.error(`Bodyless ${W}`),x.members=[];;){if(A.close=f.consume("}"),A.close)return A.termination=f.consume(";")||f.error(`Missing semicolon after ${W}`),x.this;let Y=v.parse(f),de;for(let[ce,...ge]of _)if(de=te(ce(f,...ge)),de)break;de||f.error("Unknown member"),de.extAttrs=Y,x.members.push(de.this)}}get partial(){return!!this.tokens.partial}get name(){return M(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?M(this.tokens.inheritance.value):null}*validate(f){for(let x of this.members)x.validate&&(yield*x.validate(f))}write(f){return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.callback),f.token(this.tokens.partial),f.token(this.tokens.base),f.token(this.tokens.mixin),f.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?f.ts.wrap([f.token(this.tokens.colon),f.ts.trivia(this.tokens.inheritance.trivia),f.ts.inheritance(f.reference(this.tokens.inheritance.value,{context:this}))]):"")(),f.token(this.tokens.open),f.ts.wrap(this.members.map((x)=>x.write(f))),f.token(this.tokens.close),f.token(this.tokens.termination)]),{data:this})}}class Qr extends i{static parse(f){let x={};if(x.base=f.consume("const"),!x.base)return;let w=ue(f);if(!w){let A=f.consumeKind("identifier")||f.error("Const lacks a type");w=new P({source:f.source,tokens:{base:A}})}f.probe("?")&&f.error("Unexpected nullable constant type"),w.type="const-type",x.name=f.consumeKind("identifier")||f.error("Const lacks a name"),x.assign=f.consume("=")||f.error("Const lacks value assignment"),x.value=B(f)||f.error("Const lacks a value"),x.termination=f.consume(";")||f.error("Unterminated const, expected `;`");let _=new Qr({source:f.source,tokens:x});return te(_).idlType=w,_}get type(){return"const"}get name(){return M(this.tokens.name.value)}get value(){return se(this.tokens.value)}write(f){let{parent:x}=this;return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.base),f.ts.type(this.idlType.write(f)),f.name_token(this.tokens.name,{data:this,parent:x}),f.token(this.tokens.assign),f.token(this.tokens.value),f.token(this.tokens.termination)]),{data:this,parent:x})}}class Mi extends i{static parse(f){let x=f.position,w=te(new Mi({source:f.source,tokens:{}})),{tokens:_}=w;if(_.readonly=f.consume("readonly"),_.readonly||(_.async=f.consume("async")),_.base=_.readonly?f.consume("maplike","setlike"):_.async?f.consume("iterable"):f.consume("iterable","async_iterable","maplike","setlike"),!_.base)return void f.unconsume(x);let{type:A}=w,W=A==="maplike",Y=W||A==="iterable"||A==="async_iterable",de=A==="async_iterable"||w.async&&A==="iterable";_.open=f.consume("<")||f.error(`Missing less-than sign \`<\` in ${A} declaration`);let ce=Q(f)||f.error(`Missing a type argument in ${A} declaration`);return w.idlType=[ce],w.arguments=[],Y&&(ce.tokens.separator=f.consume(","),ce.tokens.separator?w.idlType.push(Q(f)):W&&f.error(`Missing second type argument in ${A} declaration`)),_.close=f.consume(">")||f.error(`Missing greater-than sign \`>\` in ${A} declaration`),f.probe("(")&&(de?(_.argsOpen=f.consume("("),w.arguments.push(...oe(f)),_.argsClose=f.consume(")")||f.error("Unterminated async iterable argument list")):f.error("Arguments are only allowed for `async iterable`")),_.termination=f.consume(";")||f.error(`Missing semicolon after ${A} declaration`),w.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(f){if(this.async&&this.type==="iterable")yield s(this.tokens.async,this,"obsolete-async-iterable-syntax","`async iterable` is now changed to `async_iterable`.",{autofix:(x=this,()=>{let _=x.tokens.async;x.tokens.base={..._,type:"async_iterable",value:"async_iterable"},delete x.tokens.async})});var x;for(let w of this.idlType)yield*w.validate(f);for(let w of this.arguments)yield*w.validate(f)}write(f){return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.readonly),f.token(this.tokens.async),f.token(this.tokens.base,f.ts.generic),f.token(this.tokens.open),f.ts.wrap(this.idlType.map((x)=>x.write(f))),f.token(this.tokens.close),f.token(this.tokens.argsOpen),f.ts.wrap(this.arguments.map((x)=>x.write(f))),f.token(this.tokens.argsClose),f.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class Ns extends i{static parse(f){let x=f.consume("constructor");if(!x)return;let w={base:x};w.open=f.consume("(")||f.error("No argument list in constructor");let _=oe(f);w.close=f.consume(")")||f.error("Unterminated constructor"),w.termination=f.consume(";")||f.error("No semicolon after constructor");let A=new Ns({source:f.source,tokens:w});return te(A).arguments=_,A}get type(){return"constructor"}*validate(f){for(let x of this.arguments)yield*x.validate(f)}write(f){let{parent:x}=this;return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.base,f.ts.nameless,{data:this,parent:x}),f.token(this.tokens.open),f.ts.wrap(this.arguments.map((w)=>w.write(f))),f.token(this.tokens.close),f.token(this.tokens.termination)]),{data:this,parent:x})}}function es(f){let x=f.consume("static");if(!x)return;return D.parse(f,{special:x})||I.parse(f,{special:x})||f.error("No body in static member")}class Is extends Dt{static parse(f,x,{extMembers:w=[],partial:_=null}={}){let A={partial:_,base:x};return Dt.parse(f,new Is({source:f.source,tokens:A}),{inheritable:!_,allowedMembers:[...w,[Qr.parse],[Ns.parse],[es],[ke],[Mi.parse],[D.parse],[I.parse]]})}get type(){return"interface"}*validate(f){if(yield*this.extAttrs.validate(f),!this.partial&&this.extAttrs.every((w)=>w.name!=="Exposed"))yield s(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:le(this)});let x=this.extAttrs.filter((w)=>w.name==="Constructor");for(let w of x)yield s(w.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:ca(this,w)});if(this.extAttrs.some((w)=>w.name==="Global")){let w=this.extAttrs.filter((A)=>A.name==="LegacyFactoryFunction");for(let A of w)yield s(A.tokens.name,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have factory functions.");let _=this.members.filter((A)=>A.type==="constructor");for(let A of _)yield s(A.tokens.base,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have constructors.")}yield*super.validate(f),this.partial||(yield*function*(w,_){let A=function(ge){let _e=ce(ge);return{statics:new Set(_e.filter((Ae)=>Ae.special==="static").map((Ae)=>Ae.name)),nonstatics:new Set(_e.filter((Ae)=>Ae.special!=="static").map((Ae)=>Ae.name))}}(_),W=w.partials.get(_.name)||[],Y=w.mixinMap.get(_.name)||[];for(let ge of[...W,...Y]){let _e=ce(ge),Ae=_e.filter((Lt)=>Lt.special==="static"),jt=_e.filter((Lt)=>Lt.special!=="static");yield*de(Ae,A.statics,ge,_),yield*de(jt,A.nonstatics,ge,_),Ae.forEach((Lt)=>A.statics.add(Lt.name)),jt.forEach((Lt)=>A.nonstatics.add(Lt.name))}function*de(ge,_e,Ae,jt){for(let Lt of ge){let{name:Ji}=Lt;if(Ji&&_e.has(Ji)){let Pc=`The ${Lt.special==="static"?"static ":""}operation "${Ji}" has already been defined for the base interface "${jt.name}" either in itself or in a mixin`;yield s(Lt.tokens.name,Ae,"no-cross-overload",Pc)}}}function ce(ge){return ge.members.filter(({type:_e})=>_e==="operation")}}(f,this))}}function ca(f,x){return f=te(f),()=>{let w=U(f.extAttrs.tokens.open.trivia),_=f.members.length?U(z(f.members[0]).trivia):function(_e){let Ae=U(_e),jt=Ae.includes("\t")?"\t":" ";return Ae+jt}(w),A=Ns.parse(new ut(`
562
+ ${_}constructor();`));A.extAttrs=new v({source:f.source,tokens:{}}),te(A).arguments=x.arguments;let W=function(_e,Ae){let jt=_e.slice().reverse().findIndex(Ae);return jt===-1?jt:_e.length-jt-1}(f.members,(_e)=>_e.type==="constructor");f.members.splice(W+1,0,A);let{close:Y}=f.tokens;Y.trivia.includes(`
563
+ `)||(Y.trivia+=`
564
+ ${w}`);let{extAttrs:de}=f,ce=de.indexOf(x),ge=de.splice(ce,1);de.length?de.length===ce?de[ce-1].tokens.separator=void 0:de[ce].tokens.name.trivia.trim()||(de[ce].tokens.name.trivia=ge[0].tokens.name.trivia):de.tokens.open=de.tokens.close=void 0}}class en extends Dt{static parse(f,x,{extMembers:w=[],partial:_}={}){let A={partial:_,base:x};if(A.mixin=f.consume("mixin"),A.mixin)return Dt.parse(f,new en({source:f.source,tokens:A}),{allowedMembers:[...w,[Qr.parse],[ke],[D.parse,{noInherit:!0}],[I.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class J extends i{static parse(f){let x={},w=te(new J({source:f.source,tokens:x}));return w.extAttrs=v.parse(f),x.required=f.consume("required"),w.idlType=Q(f,"dictionary-type")||f.error("Dictionary member lacks a type"),x.name=f.consumeKind("identifier")||f.error("Dictionary member lacks a name"),w.default=O.parse(f),x.required&&w.default&&f.error("Required member must not have a default"),x.termination=f.consume(";")||f.error("Unterminated dictionary member, expected `;`"),w.this}get type(){return"field"}get name(){return M(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(f){yield*this.idlType.validate(f)}write(f){let{parent:x}=this;return f.ts.definition(f.ts.wrap([this.extAttrs.write(f),f.token(this.tokens.required),f.ts.type(this.idlType.write(f)),f.name_token(this.tokens.name,{data:this,parent:x}),this.default?this.default.write(f):"",f.token(this.tokens.termination)]),{data:this,parent:x})}}class H extends Dt{static parse(f,{extMembers:x=[],partial:w}={}){let _={partial:w};if(_.base=f.consume("dictionary"),_.base)return Dt.parse(f,new H({source:f.source,tokens:_}),{inheritable:!w,allowedMembers:[...x,[J.parse]]})}get type(){return"dictionary"}}class V extends Dt{static parse(f,{extMembers:x=[],partial:w}={}){let _={partial:w};if(_.base=f.consume("namespace"),_.base)return Dt.parse(f,new V({source:f.source,tokens:_}),{allowedMembers:[...x,[D.parse,{noInherit:!0,readonly:!0}],[Qr.parse],[I.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(f){if(!this.partial&&this.extAttrs.every((x)=>x.name!=="Exposed"))yield s(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:le(this)});yield*super.validate(f)}}class ie extends Dt{static parse(f,x,{extMembers:w=[]}={}){let _={callback:x};if(_.base=f.consume("interface"),_.base)return Dt.parse(f,new ie({source:f.source,tokens:_}),{allowedMembers:[...w,[Qr.parse],[I.parse,{regular:!0}]]})}get type(){return"callback interface"}}function Se(f,x){let w=f.source;function _(ce){f.error(ce)}function A(...ce){return f.consume(...ce)}function W(ce){let ge=A("interface");if(ge)return en.parse(f,ge,{...ce,...x?.extensions?.mixin})||Is.parse(f,ge,{...ce,...x?.extensions?.interface})||_("Interface has no proper body")}function Y(){if(x.productions)for(let ce of x.productions){let ge=ce(f);if(ge)return ge}return function(){let ce=A("callback");if(ce)return f.probe("interface")?ie.parse(f,ce,{...x?.extensions?.callbackInterface}):Ii.parse(f,ce)}()||W()||function(){let ce=A("partial");if(ce)return H.parse(f,{partial:ce,...x?.extensions?.dictionary})||W({partial:ce})||V.parse(f,{partial:ce,...x?.extensions?.namespace})||_("Partial doesn't apply to anything")}()||H.parse(f,x?.extensions?.dictionary)||Jt.parse(f)||Sn.parse(f)||Zr.parse(f)||V.parse(f,x?.extensions?.namespace)}let de=function(){if(!w.length)return[];let ce=[];for(;;){let _e=v.parse(f),Ae=Y();if(!Ae){_e.length&&_("Stray extended attributes");break}te(Ae).extAttrs=_e,ce.push(Ae)}let ge=d.parse(f);return x.concrete&&ce.push(ge),ce}();return f.position<w.length&&_("Unrecognised tokens"),de}function Or(f,x={}){let w=new ut(f);return x.sourceName!==void 0&&(w.source.name=x.sourceName),Se(w,x)}function ze(f){return f}let Ne={wrap:(f)=>f.join(""),trivia:ze,name:ze,reference:ze,type:ze,generic:ze,nameless:ze,inheritance:ze,definition:ze,extendedAttribute:ze,extendedAttributeReference:ze};class he{constructor(f){this.ts=Object.assign({},Ne,f)}reference(f,{unescaped:x,context:w}){return x||(x=f.startsWith("_")?f.slice(1):f),this.ts.reference(f,x,w)}token(f,x=ze,...w){if(!f)return"";let _=x(f.value,...w);return this.ts.wrap([this.ts.trivia(f.trivia),_])}reference_token(f,x){return this.token(f,this.reference.bind(this),{context:x})}name_token(f,x){return this.token(f,this.ts.name,x)}identifier(f,x){return this.ts.wrap([this.reference_token(f.tokens.value,x),this.token(f.tokens.separator)])}}function xt(f,{templates:x=Ne}={}){x=Object.assign({},Ne,x);let w=new he(x);return x.wrap(f.map((_)=>_.write(w)))}function st(f,x){let w=new Map,_=f.filter((A)=>A.type==="includes");for(let A of _){let W=x.get(A.includes);if(!W)continue;let Y=w.get(A.target);Y?Y.push(W):w.set(A.target,[W])}return w}function*ot(f){let x=function(w){let _=new Map,A=new Set,W=new Map;for(let Y of w)if(Y.partial){let de=W.get(Y.name);de?de.push(Y):W.set(Y.name,[Y])}else Y.name&&(_.has(Y.name)?A.add(Y):_.set(Y.name,Y));return{all:w,unique:_,partials:W,duplicates:A,mixinMap:st(w,_),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(f);for(let w of x.all)w.validate&&(yield*w.validate(x));yield*function*({unique:w,duplicates:_}){for(let A of _){let{name:W}=A,Y=`The name "${W}" of type "${w.get(W).type}" was already seen`;yield s(A.tokens.name,A,"no-duplicate",Y)}}(x)}function Zt(f){return[...ot((x=f,x.flat?x.flat():[].concat(...x)))];var x}return t})())});var dw=C(function(MY,uw){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",ow=Te("fs").promises,aw=Te("path"),tL=iw();class lw{constructor(e,t){this.filename=t,this.shortname=aw.basename(t,".idl"),this.path=aw.join(e,t)}async text(){return await ow.readFile(this.path,"utf8")}async parse(){let e=await this.text();return tL.parse(e)}}async function cw({folder:e=__dirname}={}){let t={},r=await ow.readdir(e);for(let n of r)if(n.endsWith(".idl")){let s=new lw(e,n);t[s.shortname]=s}return t}async function rL(e){let t=await cw(e);for(let[r,n]of Object.entries(t))t[r]=await n.parse();return t}uw.exports={listAll:cw,parseAll:rL}});var fw,pw;var mw=q(()=>{fw={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."},pw={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var hw;var gw=q(()=>{hw={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 yw,bw,xw;var $w=q(()=>{yw={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},bw={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},xw={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var vw;var ww=q(()=>{vw={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 Sw,Ew;var _w=q(()=>{Sw={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"},Ew={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 Pw;var jw=q(()=>{Pw={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var kw,Rw,Aw,Ow,Cw,Tw,Nw,Iw,Mw;var Jw=q(()=>{kw={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"},Rw={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},Aw={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"},Ow={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Cw={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},Tw={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"},Nw={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Iw={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"},Mw={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var Tl;var Dw=q(()=>{Tl={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 Lw,Fw;var qw=q(()=>{Lw={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"},Fw={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 Hw,Vw,Ww,Bw,Uw,nf;var zw=q(()=>{Hw={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},Vw={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"},Ww={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},Bw={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"},Uw={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"},nf={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 Gw;var Kw=q(()=>{Gw={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 Yw;var Xw=q(()=>{Yw={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 Zw,Qw;var e0=q(()=>{Zw={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"}]},Qw={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 t0;var r0=q(()=>{t0={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 n0;var s0=q(()=>{n0={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 i0,o0,a0,l0,c0,u0,d0,f0,p0,m0,h0,g0,y0,b0,x0,$0,v0;var w0=q(()=>{nu();i0={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"},o0={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."},a0={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."},l0={enum:["!","-"]},c0={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},u0={const:"?:"},d0={const:"switch"},f0={const:"call"},p0={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"]},m0={enum:["=","+=","-=","*=","/="]},h0={enum:["pop","shift"]},g0={enum:["push","unshift"]},y0={const:"splice"},b0={const:"reduce"},x0={enum:["map","filter"]},$0={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 "+`${Eh()}) — 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"},v0={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 S0,E0,_0,P0;var j0=q(()=>{S0={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"}]},E0={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},_0={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},P0={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 nL,sf,of,af,lf,cf,uf,df,ff,pf,k0;var R0=q(()=>{nL=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],sf={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"},of={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"},af={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"},lf={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:nL,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"},cf={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"},uf={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"},df={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"},ff={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"},pf={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"},k0={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 A0;var O0=q(()=>{A0={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 Nl;var C0=q(()=>{Nl={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 sL,mf;var T0=q(()=>{ms();sL=[301,302,303,307,308],mf={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:ka,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:ka,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:ka,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:[...sL],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 iL(){return N0??=oL(),N0}async function oL(){let[e,t,r]=await Promise.all([M0.listAll(),J0.default.listAll(),D0.default.parseAll()]),n=new Set;for(let{elements:c}of Object.values(e))for(let d of c)if(!d.obsolete)n.add(d.name);let s=[...n].toSorted(),i=new Set;for(let c of t.properties)for(let d of c.styleDeclaration??[])i.add(d);let o=[...i].toSorted(),a=new Set;for(let c of Object.values(r))for(let d of c){if(d.type!=="interface"&&d.type!=="interface mixin")continue;if(!d.members)continue;for(let p of d.members)if(p.type==="attribute"&&p.name?.startsWith("on")&&p.idlType?.idlType==="EventHandler")a.add(p.name)}let l=[...a].toSorted();return{cssProps:o,eventHandlers:l,tagExamples:s}}function aL(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 lL(e){let t={...Tl.properties};for(let r of e)t[r]={oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"}]};return t}async function cL(){let{tagExamples:e,cssProps:t,eventHandlers:r}=await iL();return{$defs:{DefsMap:_0,TypeDefEntry:P0,StateMap:E0,StateEntry:S0,TypedStateDef:Gw,PureTypeDef:n0,FunctionDef:Yw,ClassDef:k0,ClassParameterDef:sf,ClassFieldDef:of,ClassConstructorDef:af,ClassMethodDef:lf,FormatDef:cf,ProjectBlockDef:uf,ServerBlockDef:df,ConnectorBlockDef:ff,StudioHints:pf,ExternalClassDef:t0,ExpressionPointer:i0,ExpressionLiteral:o0,ExpressionOperand:a0,UnaryOperator:l0,BinaryOperator:c0,ConditionalOperator:u0,SwitchOperator:d0,CallOperator:f0,PureMethod:p0,AssignmentOperator:m0,NoArgMethod:h0,OneArgMethod:g0,SpliceMethod:y0,ReduceMethod:b0,MapFilterMethod:x0,ExpressionNode:$0,ExpressionEntry:v0,Statement:Zw,StatementList:Qw,ElementDef:{...nf,properties:{...nf.properties,...aL(r)}},ChildrenValue:Fw,ArrayNamespace:Lw,SwitchDef:Bw,SwitchNode:Uw,StyleObject:{...Tl,properties:lL(t)},AttributesObject:Hw,PropsObject:Vw,RefObject:Iw,AnyRef:Nw,InternalRef:kw,StateRef:Rw,ExternalRef:Aw,ExternalComponentRef:Mw,GlobalRef:Ow,ParentRef:Cw,MapRef:Tw,ElementPropertyValue:Ww,StringOrRef:yw,BoolOrRef:bw,NumberOrRef:xw,CemParameter:Sw,CemEvent:Ew,TagName:{...hw,examples:[...e,"my-counter","todo-app","user-card"]},TagExpression:fw,ElementTagName:pw,JsonSchemaType:Pw,HeadEntry:vw,ImageConfig:Nl,PathsValue:{$id:Es,anyOf:[...Ro,Yd],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:Es,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 uL(){return{$defs:{ImageConfig:Nl,StyleObject:L0},$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:mf.properties,title:"Jx Project",type:"object"}}function dL(){return{$defs:{ImageConfig:Nl,JxFieldSchema:Mv,RelationshipRef:Jv,StyleObject:L0},$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:mf.properties,title:"Jx Project Core",type:"object"}}function fL(){return{$id:ko,$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 pL(){return{$id:Es,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[...Ro,Yd],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 mL(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...A0}}function hf(){return{$defs:{ClassConstructorDef:af,ClassFieldDef:of,ClassMethodDef:lf,ClassParameterDef:sf,ConnectorBlockDef:ff,FormatDef:cf,ProjectBlockDef:uf,ServerBlockDef:df,StudioHints:pf},$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 hL(e){let{mkdirSync:t,writeFileSync:r}=await import("node:fs"),{resolve:n,dirname:s}=await import("node:path"),i=s(n(e,"..")),o=await cL(),a=uL(),l=hf(),c=dL(),d=mL(),p=fL(),h=pL(),m=JSON.stringify(o,null,2),b=JSON.stringify(a,null,2),g=JSON.stringify(l,null,2),y=JSON.stringify(c,null,2),v=JSON.stringify(d,null,2),j=JSON.stringify(p,null,2),S=JSON.stringify(h,null,2),[P]=process.argv.slice(2);if(P)r(P,m,"utf8"),console.error(`Jx component schema written to ${P}`);else{r(n(i,"schema.json"),m,"utf8"),r(n(i,"project-schema.json"),b,"utf8"),r(n(i,"class-schema.json"),g,"utf8"),t(n(i,"schemas"),{recursive:!0}),r(n(i,"schemas","project.core.schema.json"),y,"utf8"),r(n(i,"schemas","project.fields.schema.json"),j,"utf8"),r(n(i,"schemas","document.paths.schema.json"),S,"utf8"),r(n(i,"extension-manifest.schema.json"),v,"utf8");let E=Bun.spawnSync(["bunx","oxfmt",n(i,"schemas","project.core.schema.json"),n(i,"schemas","project.fields.schema.json"),n(i,"schemas","document.paths.schema.json")],{cwd:i});if(E.exitCode!==0){let O=E.stderr.toString()||E.stdout.toString()||`exit ${E.exitCode}${E.signalCode?`, signal ${E.signalCode}`:""}`;console.error(`Warning: skipped oxfmt reformat of generated schemas (${O})`)}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 M0,J0,D0,N0=null,L0,I0,kX;var F0=q(()=>{mw();gw();$w();ww();_w();jw();Jw();Dw();qw();zw();Kw();Xw();e0();r0();s0();w0();j0();R0();O0();Al();C0();T0();M0=kt(tw(),1),J0=kt(sw(),1),D0=kt(dw(),1);L0={...Tl,additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]}};[,I0]=process.argv,kX=I0?.endsWith("schema.ts")?hL(I0):void 0});var Mo=C(function(V0){Object.defineProperty(V0,"__esModule",{value:!0});V0.regexpCode=V0.getEsmExportName=V0.getProperty=V0.safeStringify=V0.stringify=V0.strConcat=V0.addCodeArg=V0.str=V0._=V0.nil=V0._Code=V0.Name=V0.IDENTIFIER=V0._CodeOrName=void 0;class Il{}V0._CodeOrName=Il;V0.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class gi extends Il{constructor(e){super();if(!V0.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}}}V0.Name=gi;class _r extends Il{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 gi)t[r.str]=(t[r.str]||0)+1;return t},{})}}V0._Code=_r;V0.nil=new _r("");function q0(e,...t){let r=[e[0]],n=0;while(n<t.length)yf(r,t[n]),r.push(e[++n]);return new _r(r)}V0._=q0;var gf=new _r("+");function H0(e,...t){let r=[Io(e[0])],n=0;while(n<t.length)r.push(gf),yf(r,t[n]),r.push(gf,Io(e[++n]));return gL(r),new _r(r)}V0.str=H0;function yf(e,t){if(t instanceof _r)e.push(...t._items);else if(t instanceof gi)e.push(t);else e.push(xL(t))}V0.addCodeArg=yf;function gL(e){let t=1;while(t<e.length-1){if(e[t]===gf){let r=yL(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function yL(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof gi||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 gi))return`"${e}${t.slice(1)}`;return}function bL(e,t){return t.emptyStr()?e:e.emptyStr()?t:H0`${e}${t}`}V0.strConcat=bL;function xL(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Io(Array.isArray(e)?e.join(","):e)}function $L(e){return new _r(Io(e))}V0.stringify=$L;function Io(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}V0.safeStringify=Io;function vL(e){return typeof e=="string"&&V0.IDENTIFIER.test(e)?new _r(`.${e}`):q0`[${e}]`}V0.getProperty=vL;function wL(e){if(typeof e=="string"&&V0.IDENTIFIER.test(e))return new _r(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}V0.getEsmExportName=wL;function SL(e){return new _r(e.toString())}V0.regexpCode=SL});var vf=C(function(z0){Object.defineProperty(z0,"__esModule",{value:!0});z0.ValueScope=z0.ValueScopeName=z0.Scope=z0.varKinds=z0.UsedValueState=void 0;var Ut=Mo();class B0 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Jl;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Jl||(z0.UsedValueState=Jl={}));z0.varKinds={const:new Ut.Name("const"),let:new Ut.Name("let"),var:new Ut.Name("var")};class xf{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Ut.Name?e:this.name(e)}name(e){return new Ut.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}}}z0.Scope=xf;class $f extends Ut.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=Ut._`.${new Ut.Name(t)}[${r}]`}}z0.ValueScopeName=$f;var ML=Ut._`\n`;class U0 extends xf{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ML:Ut.nil}}get(){return this._scope}name(e){return new $f(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:s}=n,i=(r=t.key)!==null&&r!==void 0?r:t.ref,o=this._values[s];if(o){let c=o.get(i);if(c)return c}else o=this._values[s]=new Map;o.set(i,n);let a=this._scope[s]||(this._scope[s]=[]),l=a.length;return a[l]=t.ref,n.setValue(t,{property:s,itemIndex:l}),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 Ut._`${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 s=Ut.nil;for(let i in e){let o=e[i];if(!o)continue;let a=r[i]=r[i]||new Map;o.forEach((l)=>{if(a.has(l))return;a.set(l,Jl.Started);let c=t(l);if(c){let d=this.opts.es5?z0.varKinds.var:z0.varKinds.const;s=Ut._`${s}${d} ${l} = ${c};${this.opts._n}`}else if(c=n===null||n===void 0?void 0:n(l))s=Ut._`${s}${c}${this.opts._n}`;else throw new B0(l);a.set(l,Jl.Completed)})}return s}}z0.ValueScope=U0});var ye=C(function(zt){Object.defineProperty(zt,"__esModule",{value:!0});zt.or=zt.and=zt.not=zt.CodeGen=zt.operators=zt.varKinds=zt.ValueScopeName=zt.ValueScope=zt.Scope=zt.Name=zt.regexpCode=zt.stringify=zt.getProperty=zt.nil=zt.strConcat=zt.str=zt._=void 0;var je=Mo(),Pr=vf(),Wn=Mo();Object.defineProperty(zt,"_",{enumerable:!0,get:function(){return Wn._}});Object.defineProperty(zt,"str",{enumerable:!0,get:function(){return Wn.str}});Object.defineProperty(zt,"strConcat",{enumerable:!0,get:function(){return Wn.strConcat}});Object.defineProperty(zt,"nil",{enumerable:!0,get:function(){return Wn.nil}});Object.defineProperty(zt,"getProperty",{enumerable:!0,get:function(){return Wn.getProperty}});Object.defineProperty(zt,"stringify",{enumerable:!0,get:function(){return Wn.stringify}});Object.defineProperty(zt,"regexpCode",{enumerable:!0,get:function(){return Wn.regexpCode}});Object.defineProperty(zt,"Name",{enumerable:!0,get:function(){return Wn.Name}});var Vl=vf();Object.defineProperty(zt,"Scope",{enumerable:!0,get:function(){return Vl.Scope}});Object.defineProperty(zt,"ValueScope",{enumerable:!0,get:function(){return Vl.ValueScope}});Object.defineProperty(zt,"ValueScopeName",{enumerable:!0,get:function(){return Vl.ValueScopeName}});Object.defineProperty(zt,"varKinds",{enumerable:!0,get:function(){return Vl.varKinds}});zt.operators={GT:new je._Code(">"),GTE:new je._Code(">="),LT:new je._Code("<"),LTE:new je._Code("<="),EQ:new je._Code("==="),NEQ:new je._Code("!=="),NOT:new je._Code("!"),OR:new je._Code("||"),AND:new je._Code("&&"),ADD:new je._Code("+")};class Bn{optimizeNodes(){return this}optimizeNames(e,t){return this}}class K0 extends Bn{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Pr.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=bi(this.rhs,e,t);return this}get names(){return this.rhs instanceof je._CodeOrName?this.rhs.names:{}}}class Ef extends Bn{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 je.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=bi(this.rhs,e,t),this}get names(){let e=this.lhs instanceof je.Name?{}:{...this.lhs.names};return Hl(e,this.rhs)}}class Y0 extends Ef{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class X0 extends Bn{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Z0 extends Bn{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Q0 extends Bn{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class eS extends Bn{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=bi(this.code,e,t),this}get names(){return this.code instanceof je._CodeOrName?this.code.names:{}}}class Wl extends Bn{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 s=r[n];if(s.optimizeNames(e,t))continue;FL(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>_s(e,t.names),{})}}class Un extends Wl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class tS extends Wl{}class Jo extends Un{}Jo.kind="else";class $n extends Un{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 Jo(r):r}if(t){if(e===!1)return t instanceof $n?t:t.nodes;if(this.nodes.length)return this;return new $n(oS(e),t instanceof $n?[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=bi(this.condition,e,t),this}get names(){let e=super.names;if(Hl(e,this.condition),this.else)_s(e,this.else.names);return e}}$n.kind="if";class yi extends Un{}yi.kind="for";class rS extends yi{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=bi(this.iteration,e,t),this}get names(){return _s(super.names,this.iteration.names)}}class nS extends yi{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Pr.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=Hl(super.names,this.from);return Hl(e,this.to)}}class wf extends yi{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=bi(this.iterable,e,t),this}get names(){return _s(super.names,this.iterable.names)}}class Dl extends Un{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)}}Dl.kind="func";class Ll extends Wl{render(e){return"return "+super.render(e)}}Ll.kind="return";class sS extends Un{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)_s(e,this.catch.names);if(this.finally)_s(e,this.finally.names);return e}}class Fl extends Un{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Fl.kind="catch";class ql extends Un{render(e){return"finally"+super.render(e)}}ql.kind="finally";class iS{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
565
+ `:""},this._extScope=e,this._scope=new Pr.Scope({parent:e}),this._nodes=[new tS]}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 s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new K0(e,s,r)),s}const(e,t,r){return this._def(Pr.varKinds.const,e,t,r)}let(e,t,r){return this._def(Pr.varKinds.let,e,t,r)}var(e,t,r){return this._def(Pr.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Ef(e,t,r))}add(e,t){return this._leafNode(new Y0(e,zt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==je.nil)this._leafNode(new eS(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(":"),je.addCodeArg(t,n)}return t.push("}"),new je._Code(t)}if(e,t,r){if(this._blockNode(new $n(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 $n(e))}else(){return this._elseNode(new Jo)}endIf(){return this._endBlockNode($n,Jo)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new rS(e),t)}forRange(e,t,r,n,s=this.opts.es5?Pr.varKinds.var:Pr.varKinds.let){let i=this._scope.toName(e);return this._for(new nS(s,i,t,r),()=>n(i))}forOf(e,t,r,n=Pr.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=t instanceof je.Name?t:this.var("_arr",t);return this.forRange("_i",0,je._`${i}.length`,(o)=>{this.var(s,je._`${i}[${o}]`),r(s)})}return this._for(new wf("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Pr.varKinds.var:Pr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,je._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new wf("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(yi)}label(e){return this._leafNode(new X0(e))}break(e){return this._leafNode(new Z0(e))}return(e){let t=new Ll;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Ll)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new sS;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Fl(s),t(s)}if(r)this._currNode=n.finally=new ql,this.code(r);return this._endBlockNode(Fl,ql)}throw(e){return this._leafNode(new Q0(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=je.nil,r,n){if(this._blockNode(new Dl(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Dl)}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 $n))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}}zt.CodeGen=iS;function _s(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Hl(e,t){return t instanceof je._CodeOrName?_s(e,t.names):e}function bi(e,t,r){if(e instanceof je.Name)return n(e);if(!s(e))return e;return new je._Code(e._items.reduce((i,o)=>{if(o instanceof je.Name)o=n(o);if(o instanceof je._Code)i.push(...o._items);else i.push(o);return i},[]));function n(i){let o=r[i.str];if(o===void 0||t[i.str]!==1)return i;return delete t[i.str],o}function s(i){return i instanceof je._Code&&i._items.some((o)=>o instanceof je.Name&&t[o.str]===1&&r[o.str]!==void 0)}}function FL(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function oS(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:je._`!${Sf(e)}`}zt.not=oS;var qL=aS(zt.operators.AND);function HL(...e){return e.reduce(qL)}zt.and=HL;var VL=aS(zt.operators.OR);function WL(...e){return e.reduce(VL)}zt.or=WL;function aS(e){return(t,r)=>t===je.nil?r:r===je.nil?t:je._`${Sf(t)} ${e} ${Sf(r)}`}function Sf(e){return e instanceof je.Name?e:je._`(${e})`}});var we=C(function(gS){Object.defineProperty(gS,"__esModule",{value:!0});gS.checkStrictMode=gS.getErrorPath=gS.Type=gS.useFunc=gS.setEvaluated=gS.evaluatedPropsToName=gS.mergeEvaluated=gS.eachItem=gS.unescapeJsonPointer=gS.escapeJsonPointer=gS.escapeFragment=gS.unescapeFragment=gS.schemaRefOrVal=gS.schemaHasRulesButRef=gS.schemaHasRules=gS.checkUnknownRules=gS.alwaysValidSchema=gS.toHash=void 0;var De=ye(),GL=Mo();function KL(e){let t={};for(let r of e)t[r]=!0;return t}gS.toHash=KL;function YL(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return dS(e,t),!fS(t,e.self.RULES.all)}gS.alwaysValidSchema=YL;function dS(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let i in t)if(!s[i])hS(e,`unknown keyword: "${i}"`)}gS.checkUnknownRules=dS;function fS(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}gS.schemaHasRules=fS;function XL(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}gS.schemaHasRulesButRef=XL;function ZL({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return De._`${r}`}return De._`${e}${t}${De.getProperty(n)}`}gS.schemaRefOrVal=ZL;function QL(e){return pS(decodeURIComponent(e))}gS.unescapeFragment=QL;function eF(e){return encodeURIComponent(Pf(e))}gS.escapeFragment=eF;function Pf(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}gS.escapeJsonPointer=Pf;function pS(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}gS.unescapeJsonPointer=pS;function tF(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}gS.eachItem=tF;function cS({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{let l=o===void 0?i:o instanceof De.Name?(i instanceof De.Name?e(s,i,o):t(s,i,o),o):i instanceof De.Name?(t(s,o,i),i):r(i,o);return a===De.Name&&!(l instanceof De.Name)?n(s,l):l}}gS.mergeEvaluated={props:cS({mergeNames:(e,t,r)=>e.if(De._`${r} !== true && ${t} !== undefined`,()=>{e.if(De._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,De._`${r} || {}`).code(De._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(De._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,De._`${r} || {}`),jf(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:mS}),items:cS({mergeNames:(e,t,r)=>e.if(De._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,De._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(De._`${r} !== true`,()=>e.assign(r,t===!0?!0:De._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function mS(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",De._`{}`);if(t!==void 0)jf(e,r,t);return r}gS.evaluatedPropsToName=mS;function jf(e,t,r){Object.keys(r).forEach((n)=>e.assign(De._`${t}${De.getProperty(n)}`,!0))}gS.setEvaluated=jf;var uS={};function rF(e,t){return e.scopeValue("func",{ref:t,code:uS[t.code]||(uS[t.code]=new GL._Code(t.code))})}gS.useFunc=rF;var _f;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(_f||(gS.Type=_f={}));function nF(e,t,r){if(e instanceof De.Name){let n=t===_f.Num;return r?n?De._`"[" + ${e} + "]"`:De._`"['" + ${e} + "']"`:n?De._`"/" + ${e}`:De._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?De.getProperty(e).toString():"/"+Pf(e)}gS.getErrorPath=nF;function hS(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}gS.checkStrictMode=hS});var gr=C(function(bS){Object.defineProperty(bS,"__esModule",{value:!0});var St=ye(),vF={data:new St.Name("data"),valCxt:new St.Name("valCxt"),instancePath:new St.Name("instancePath"),parentData:new St.Name("parentData"),parentDataProperty:new St.Name("parentDataProperty"),rootData:new St.Name("rootData"),dynamicAnchors:new St.Name("dynamicAnchors"),vErrors:new St.Name("vErrors"),errors:new St.Name("errors"),this:new St.Name("this"),self:new St.Name("self"),scope:new St.Name("scope"),json:new St.Name("json"),jsonPos:new St.Name("jsonPos"),jsonLen:new St.Name("jsonLen"),jsonPart:new St.Name("jsonPart")};bS.default=vF});var Do=C(function(wS){Object.defineProperty(wS,"__esModule",{value:!0});wS.extendErrors=wS.resetErrorsCount=wS.reportExtraError=wS.reportError=wS.keyword$DataError=wS.keywordError=void 0;var Re=ye(),Ul=we(),Tt=gr();wS.keywordError={message:({keyword:e})=>Re.str`must pass "${e}" keyword validation`};wS.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Re.str`"${e}" keyword must be ${t} ($data)`:Re.str`"${e}" keyword is invalid ($data)`};function SF(e,t=wS.keywordError,r,n){let{it:s}=e,{gen:i,compositeRule:o,allErrors:a}=s,l=vS(e,t,r);if(n!==null&&n!==void 0?n:o||a)xS(i,l);else $S(s,Re._`[${l}]`)}wS.reportError=SF;function EF(e,t=wS.keywordError,r){let{it:n}=e,{gen:s,compositeRule:i,allErrors:o}=n,a=vS(e,t,r);if(xS(s,a),!(i||o))$S(n,Tt.default.vErrors)}wS.reportExtraError=EF;function _F(e,t){e.assign(Tt.default.errors,t),e.if(Re._`${Tt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Re._`${Tt.default.vErrors}.length`,t),()=>e.assign(Tt.default.vErrors,null)))}wS.resetErrorsCount=_F;function PF({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw Error("ajv implementation error");let o=e.name("err");e.forRange("i",s,Tt.default.errors,(a)=>{if(e.const(o,Re._`${Tt.default.vErrors}[${a}]`),e.if(Re._`${o}.instancePath === undefined`,()=>e.assign(Re._`${o}.instancePath`,Re.strConcat(Tt.default.instancePath,i.errorPath))),e.assign(Re._`${o}.schemaPath`,Re.str`${i.errSchemaPath}/${t}`),i.opts.verbose)e.assign(Re._`${o}.schema`,r),e.assign(Re._`${o}.data`,n)})}wS.extendErrors=PF;function xS(e,t){let r=e.const("err",t);e.if(Re._`${Tt.default.vErrors} === null`,()=>e.assign(Tt.default.vErrors,Re._`[${r}]`),Re._`${Tt.default.vErrors}.push(${r})`),e.code(Re._`${Tt.default.errors}++`)}function $S(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(Re._`new ${e.ValidationError}(${t})`);else r.assign(Re._`${n}.errors`,t),r.return(!1)}var Ps={keyword:new Re.Name("keyword"),schemaPath:new Re.Name("schemaPath"),params:new Re.Name("params"),propertyName:new Re.Name("propertyName"),message:new Re.Name("message"),schema:new Re.Name("schema"),parentSchema:new Re.Name("parentSchema")};function vS(e,t,r){let{createErrors:n}=e.it;if(n===!1)return Re._`{}`;return jF(e,t,r)}function jF(e,t,r={}){let{gen:n,it:s}=e,i=[kF(s,r),RF(e,r)];return AF(e,t,i),n.object(...i)}function kF({errorPath:e},{instancePath:t}){let r=t?Re.str`${e}${Ul.getErrorPath(t,Ul.Type.Str)}`:e;return[Tt.default.instancePath,Re.strConcat(Tt.default.instancePath,r)]}function RF({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:Re.str`${t}/${e}`;if(r)s=Re.str`${s}${Ul.getErrorPath(r,Ul.Type.Str)}`;return[Ps.schemaPath,s]}function AF(e,{params:t,message:r},n){let{keyword:s,data:i,schemaValue:o,it:a}=e,{opts:l,propertyName:c,topSchemaRef:d,schemaPath:p}=a;if(n.push([Ps.keyword,s],[Ps.params,typeof t=="function"?t(e):t||Re._`{}`]),l.messages)n.push([Ps.message,typeof r=="function"?r(e):r]);if(l.verbose)n.push([Ps.schema,o],[Ps.parentSchema,Re._`${d}${p}`],[Tt.default.data,i]);if(c)n.push([Ps.propertyName,c])}});var jS=C(function(_S){Object.defineProperty(_S,"__esModule",{value:!0});_S.boolOrEmptySchema=_S.topBoolOrEmptySchema=void 0;var IF=Do(),MF=ye(),JF=gr(),DF={message:"boolean schema is false"};function LF(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)ES(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(JF.default.data);else t.assign(MF._`${n}.errors`,null),t.return(!0)}_S.topBoolOrEmptySchema=LF;function FF(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),ES(e);else r.var(t,!0)}_S.boolOrEmptySchema=FF;function ES(e,t){let{gen:r,data:n}=e;IF.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},DF,void 0,t)}});var Rf=C(function(kS){Object.defineProperty(kS,"__esModule",{value:!0});kS.getRules=kS.isJSONType=void 0;var HF=["string","number","integer","boolean","null","object","array"],VF=new Set(HF);function WF(e){return typeof e=="string"&&VF.has(e)}kS.isJSONType=WF;function BF(){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:{}}}kS.getRules=BF});var Af=C(function(CS){Object.defineProperty(CS,"__esModule",{value:!0});CS.shouldUseRule=CS.shouldUseGroup=CS.schemaHasRulesForType=void 0;function zF({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&AS(e,n)}CS.schemaHasRulesForType=zF;function AS(e,t){return t.rules.some((r)=>OS(e,r))}CS.shouldUseGroup=AS;function OS(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))}CS.shouldUseRule=OS});var Lo=C(function(JS){Object.defineProperty(JS,"__esModule",{value:!0});JS.reportTypeError=JS.checkDataTypes=JS.checkDataType=JS.coerceAndCheckDataType=JS.getJSONTypes=JS.getSchemaTypes=JS.DataType=void 0;var YF=Rf(),XF=Af(),ZF=Do(),xe=ye(),NS=we(),xi;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(xi||(JS.DataType=xi={}));function QF(e){let t=IS(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}JS.getSchemaTypes=QF;function IS(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(YF.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}JS.getJSONTypes=IS;function eq(e,t){let{gen:r,data:n,opts:s}=e,i=tq(t,s.coerceTypes),o=t.length>0&&!(i.length===0&&t.length===1&&XF.schemaHasRulesForType(e,t[0]));if(o){let a=Cf(t,n,s.strictNumbers,xi.Wrong);r.if(a,()=>{if(i.length)rq(e,t,i);else Tf(e)})}return o}JS.coerceAndCheckDataType=eq;var MS=new Set(["string","number","integer","boolean","null"]);function tq(e,t){return t?e.filter((r)=>MS.has(r)||t==="array"&&r==="array"):[]}function rq(e,t,r){let{gen:n,data:s,opts:i}=e,o=n.let("dataType",xe._`typeof ${s}`),a=n.let("coerced",xe._`undefined`);if(i.coerceTypes==="array")n.if(xe._`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,xe._`${s}[0]`).assign(o,xe._`typeof ${s}`).if(Cf(t,s,i.strictNumbers),()=>n.assign(a,s)));n.if(xe._`${a} !== undefined`);for(let c of r)if(MS.has(c)||c==="array"&&i.coerceTypes==="array")l(c);n.else(),Tf(e),n.endIf(),n.if(xe._`${a} !== undefined`,()=>{n.assign(s,a),nq(e,a)});function l(c){switch(c){case"string":n.elseIf(xe._`${o} == "number" || ${o} == "boolean"`).assign(a,xe._`"" + ${s}`).elseIf(xe._`${s} === null`).assign(a,xe._`""`);return;case"number":n.elseIf(xe._`${o} == "boolean" || ${s} === null
566
+ || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,xe._`+${s}`);return;case"integer":n.elseIf(xe._`${o} === "boolean" || ${s} === null
567
+ || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,xe._`+${s}`);return;case"boolean":n.elseIf(xe._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf(xe._`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf(xe._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf(xe._`${o} === "string" || ${o} === "number"
568
+ || ${o} === "boolean" || ${s} === null`).assign(a,xe._`[${s}]`)}}}function nq({gen:e,parentData:t,parentDataProperty:r},n){e.if(xe._`${t} !== undefined`,()=>e.assign(xe._`${t}[${r}]`,n))}function Of(e,t,r,n=xi.Correct){let s=n===xi.Correct?xe.operators.EQ:xe.operators.NEQ,i;switch(e){case"null":return xe._`${t} ${s} null`;case"array":i=xe._`Array.isArray(${t})`;break;case"object":i=xe._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=o(xe._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=o();break;default:return xe._`typeof ${t} ${s} ${e}`}return n===xi.Correct?i:xe.not(i);function o(a=xe.nil){return xe.and(xe._`typeof ${t} == "number"`,a,r?xe._`isFinite(${t})`:xe.nil)}}JS.checkDataType=Of;function Cf(e,t,r,n){if(e.length===1)return Of(e[0],t,r,n);let s,i=NS.toHash(e);if(i.array&&i.object){let o=xe._`typeof ${t} != "object"`;s=i.null?o:xe._`!${t} || ${o}`,delete i.null,delete i.array,delete i.object}else s=xe.nil;if(i.number)delete i.integer;for(let o in i)s=xe.and(s,Of(o,t,r,n));return s}JS.checkDataTypes=Cf;var sq={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?xe._`{type: ${e}}`:xe._`{type: ${t}}`};function Tf(e){let t=iq(e);ZF.reportError(t,sq)}JS.reportTypeError=Tf;function iq(e){let{gen:t,data:r,schema:n}=e,s=NS.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var HS=C(function(FS){Object.defineProperty(FS,"__esModule",{value:!0});FS.assignDefaults=void 0;var $i=ye(),fq=we();function pq(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)LS(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,i)=>LS(e,i,s.default))}FS.assignDefaults=pq;function LS(e,t,r){let{gen:n,compositeRule:s,data:i,opts:o}=e;if(r===void 0)return;let a=$i._`${i}${$i.getProperty(t)}`;if(s){fq.checkStrictMode(e,`default is ignored for: ${a}`);return}let l=$i._`${a} === undefined`;if(o.useDefaults==="empty")l=$i._`${l} || ${a} === null || ${a} === ""`;n.if(l,$i._`${a} = ${$i.stringify(r)}`)}});var yr=C(function(BS){Object.defineProperty(BS,"__esModule",{value:!0});BS.validateUnion=BS.validateArray=BS.usePattern=BS.callValidateCode=BS.schemaProperties=BS.allSchemaProperties=BS.noPropertyInData=BS.propertyInData=BS.isOwnProperty=BS.hasPropFunc=BS.reportMissingProp=BS.checkMissingProp=BS.checkReportMissingProp=void 0;var He=ye(),Nf=we(),zn=gr(),mq=we();function hq(e,t){let{gen:r,data:n,it:s}=e;r.if(Mf(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:He._`${t}`},!0),e.error()})}BS.checkReportMissingProp=hq;function gq({gen:e,data:t,it:{opts:r}},n,s){return He.or(...n.map((i)=>He.and(Mf(e,t,i,r.ownProperties),He._`${s} = ${i}`)))}BS.checkMissingProp=gq;function yq(e,t){e.setParams({missingProperty:t},!0),e.error()}BS.reportMissingProp=yq;function VS(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:He._`Object.prototype.hasOwnProperty`})}BS.hasPropFunc=VS;function If(e,t,r){return He._`${VS(e)}.call(${t}, ${r})`}BS.isOwnProperty=If;function bq(e,t,r,n){let s=He._`${t}${He.getProperty(r)} !== undefined`;return n?He._`${s} && ${If(e,t,r)}`:s}BS.propertyInData=bq;function Mf(e,t,r,n){let s=He._`${t}${He.getProperty(r)} === undefined`;return n?He.or(s,He.not(If(e,t,r))):s}BS.noPropertyInData=Mf;function WS(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}BS.allSchemaProperties=WS;function xq(e,t){return WS(t).filter((r)=>!Nf.alwaysValidSchema(e,t[r]))}BS.schemaProperties=xq;function $q({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,l,c){let d=c?He._`${e}, ${t}, ${n}${s}`:t,p=[[zn.default.instancePath,He.strConcat(zn.default.instancePath,i)],[zn.default.parentData,o.parentData],[zn.default.parentDataProperty,o.parentDataProperty],[zn.default.rootData,zn.default.rootData]];if(o.opts.dynamicRef)p.push([zn.default.dynamicAnchors,zn.default.dynamicAnchors]);let h=He._`${d}, ${r.object(...p)}`;return l!==He.nil?He._`${a}.call(${l}, ${h})`:He._`${a}(${h})`}BS.callValidateCode=$q;var vq=He._`new RegExp`;function wq({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,i=s(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:He._`${s.code==="new RegExp"?vq:mq.useFunc(e,s)}(${r}, ${n})`})}BS.usePattern=wq;function Sq(e){let{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(i,!0),o(()=>t.break()),i;function o(a){let l=t.const("len",He._`${r}.length`);t.forRange("i",0,l,(c)=>{e.subschema({keyword:n,dataProp:c,dataPropType:Nf.Type.Num},i),t.if(He.not(i),a)})}}BS.validateArray=Sq;function Eq(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((l)=>Nf.alwaysValidSchema(s,l))&&!s.opts.unevaluated)return;let o=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((l,c)=>{let d=e.subschema({keyword:n,schemaProp:c,compositeRule:!0},a);if(t.assign(o,He._`${o} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(He.not(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}BS.validateUnion=Eq});var XS=C(function(KS){Object.defineProperty(KS,"__esModule",{value:!0});KS.validateKeywordUsage=KS.validSchemaType=KS.funcKeywordCode=KS.macroKeywordCode=void 0;var Nt=ye(),js=gr(),Jq=yr(),Dq=Do();function Lq(e,t){let{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,a=t.macro.call(o.self,s,i,o),l=GS(r,n,a);if(o.opts.validateSchema!==!1)o.self.validateSchema(a,!0);let c=r.name("valid");e.subschema({schema:a,schemaPath:Nt.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}KS.macroKeywordCode=Lq;function Fq(e,t){var r;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:l}=e;Hq(l,t);let c=!a&&t.compile?t.compile.call(l.self,i,o,l):t.validate,d=GS(n,s,c),p=n.let("valid");e.block$data(p,h),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function h(){if(t.errors===!1){if(g(),t.modifying)zS(e);y(()=>e.error())}else{let v=t.async?m():b();if(t.modifying)zS(e);y(()=>qq(e,v))}}function m(){let v=n.let("ruleErrs",null);return n.try(()=>g(Nt._`await `),(j)=>n.assign(p,!1).if(Nt._`${j} instanceof ${l.ValidationError}`,()=>n.assign(v,Nt._`${j}.errors`),()=>n.throw(j))),v}function b(){let v=Nt._`${d}.errors`;return n.assign(v,null),g(Nt.nil),v}function g(v=t.async?Nt._`await `:Nt.nil){let j=l.opts.passContext?js.default.this:js.default.self,S=!(("compile"in t)&&!a||t.schema===!1);n.assign(p,Nt._`${v}${Jq.callValidateCode(e,d,j,S)}`,t.modifying)}function y(v){var j;n.if(Nt.not((j=t.valid)!==null&&j!==void 0?j:p),v)}}KS.funcKeywordCode=Fq;function zS(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,Nt._`${n.parentData}[${n.parentDataProperty}]`))}function qq(e,t){let{gen:r}=e;r.if(Nt._`Array.isArray(${t})`,()=>{r.assign(js.default.vErrors,Nt._`${js.default.vErrors} === null ? ${t} : ${js.default.vErrors}.concat(${t})`).assign(js.default.errors,Nt._`${js.default.vErrors}.length`),Dq.extendErrors(e)},()=>e.error())}function Hq({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function GS(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:Nt.stringify(r)})}function Vq(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")}KS.validSchemaType=Vq;function Wq({schema:e,opts:t,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw Error("ajv implementation error");let o=s.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 ${i}: ${o.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[i])){let l=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw Error(l)}}}KS.validateKeywordUsage=Wq});var t1=C(function(QS){Object.defineProperty(QS,"__esModule",{value:!0});QS.extendSubschemaMode=QS.extendSubschemaData=QS.getSubschema=void 0;var zr=ye(),ZS=we();function Gq(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,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:zr._`${e.schemaPath}${zr.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:zr._`${e.schemaPath}${zr.getProperty(t)}${zr.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${ZS.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw Error('either "keyword" or "schema" must be passed')}QS.getSubschema=Gq;function Kq(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==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:c,dataPathArr:d,opts:p}=t,h=a.let("data",zr._`${t.data}${zr.getProperty(r)}`,!0);l(h),e.errorPath=zr.str`${c}${ZS.getErrorPath(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=zr._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let c=s instanceof zr.Name?s:a.let("data",s,!0);if(l(c),o!==void 0)e.propertyName=o}if(i)e.dataTypes=i;function l(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}QS.extendSubschemaData=Kq;function Yq(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(i!==void 0)e.allErrors=i;e.jtdDiscriminator=t,e.jtdMetadata=r}QS.extendSubschemaMode=Yq});var Jf=C(function(rZ,r1){r1.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,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))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(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}});var s1=C(function(nZ,n1){var Gn=n1.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(){},s=r.post||function(){};zl(t,n,s,e,"",e)};Gn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Gn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Gn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Gn.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 zl(e,t,r,n,s,i,o,a,l,c){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,a,l,c);for(var d in n){var p=n[d];if(Array.isArray(p)){if(d in Gn.arrayKeywords)for(var h=0;h<p.length;h++)zl(e,t,r,p[h],s+"/"+d+"/"+h,i,s,d,n,h)}else if(d in Gn.propsKeywords){if(p&&typeof p=="object")for(var m in p)zl(e,t,r,p[m],s+"/"+d+"/"+Qq(m),i,s,d,n,m)}else if(d in Gn.keywords||e.allKeys&&!(d in Gn.skipKeywords))zl(e,t,r,p,s+"/"+d,i,s,d,n)}r(n,s,i,o,a,l,c)}}function Qq(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Fo=C(function(l1){Object.defineProperty(l1,"__esModule",{value:!0});l1.getSchemaRefs=l1.resolveUrl=l1.normalizeId=l1._getFullPath=l1.getFullPath=l1.inlineRef=void 0;var e5=we(),t5=Jf(),r5=s1(),n5=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s5(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Df(e);if(!t)return!1;return i1(e)<=t}l1.inlineRef=s5;var i5=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Df(e){for(let t in e){if(i5.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Df))return!0;if(typeof r=="object"&&Df(r))return!0}return!1}function i1(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,n5.has(r))continue;if(typeof e[r]=="object")e5.eachItem(e[r],(n)=>t+=i1(n));if(t===1/0)return 1/0}return t}function o1(e,t="",r){if(r!==!1)t=vi(t);let n=e.parse(t);return a1(e,n)}l1.getFullPath=o1;function a1(e,t){return e.serialize(t).split("#")[0]+"#"}l1._getFullPath=a1;var o5=/#\/?$/;function vi(e){return e?e.replace(o5,""):""}l1.normalizeId=vi;function a5(e,t,r){return r=vi(r),e.resolve(t,r)}l1.resolveUrl=a5;var l5=/^[a-z_][-a-z0-9._]*$/i;function c5(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=vi(e[r]||t),i={"":s},o=o1(n,s,!1),a={},l=new Set;return r5(e,{allKeys:!0},(p,h,m,b)=>{if(b===void 0)return;let g=o+h,y=i[b];if(typeof p[r]=="string")y=v.call(this,p[r]);j.call(this,p.$anchor),j.call(this,p.$dynamicAnchor),i[h]=y;function v(S){let P=this.opts.uriResolver.resolve;if(S=vi(y?P(y,S):S),l.has(S))throw d(S);l.add(S);let E=this.refs[S];if(typeof E=="string")E=this.refs[E];if(typeof E=="object")c(p,E.schema,S);else if(S!==vi(g))if(S[0]==="#")c(p,a[S],S),a[S]=p;else this.refs[S]=g;return S}function j(S){if(typeof S=="string"){if(!l5.test(S))throw Error(`invalid anchor "${S}"`);v.call(this,`#${S}`)}}}),a;function c(p,h,m){if(h!==void 0&&!t5(p,h))throw d(m)}function d(p){return Error(`reference "${p}" resolves to more than one schema`)}}l1.getSchemaRefs=c5});var wi=C(function(E1){Object.defineProperty(E1,"__esModule",{value:!0});E1.getData=E1.KeywordCxt=E1.validateFunctionCode=void 0;var p1=jS(),m1=Lo(),Lf=Af(),Gl=Lo(),h5=HS(),qo=XS(),Ff=t1(),ne=ye(),me=gr(),g5=Fo(),vn=we(),Ho=Do();function y5(e){if(y1(e)){if(b1(e),g1(e)){$5(e);return}}h1(e,()=>p1.topBoolOrEmptySchema(e))}E1.validateFunctionCode=y5;function h1({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},i){if(s.code.es5)e.func(t,ne._`${me.default.data}, ${me.default.valCxt}`,n.$async,()=>{e.code(ne._`"use strict"; ${u1(r,s)}`),x5(e,s),e.code(i)});else e.func(t,ne._`${me.default.data}, ${b5(s)}`,n.$async,()=>e.code(u1(r,s)).code(i))}function b5(e){return ne._`{${me.default.instancePath}="", ${me.default.parentData}, ${me.default.parentDataProperty}, ${me.default.rootData}=${me.default.data}${e.dynamicRef?ne._`, ${me.default.dynamicAnchors}={}`:ne.nil}}={}`}function x5(e,t){e.if(me.default.valCxt,()=>{if(e.var(me.default.instancePath,ne._`${me.default.valCxt}.${me.default.instancePath}`),e.var(me.default.parentData,ne._`${me.default.valCxt}.${me.default.parentData}`),e.var(me.default.parentDataProperty,ne._`${me.default.valCxt}.${me.default.parentDataProperty}`),e.var(me.default.rootData,ne._`${me.default.valCxt}.${me.default.rootData}`),t.dynamicRef)e.var(me.default.dynamicAnchors,ne._`${me.default.valCxt}.${me.default.dynamicAnchors}`)},()=>{if(e.var(me.default.instancePath,ne._`""`),e.var(me.default.parentData,ne._`undefined`),e.var(me.default.parentDataProperty,ne._`undefined`),e.var(me.default.rootData,me.default.data),t.dynamicRef)e.var(me.default.dynamicAnchors,ne._`{}`)})}function $5(e){let{schema:t,opts:r,gen:n}=e;h1(e,()=>{if(r.$comment&&t.$comment)$1(e);if(_5(e),n.let(me.default.vErrors,null),n.let(me.default.errors,0),r.unevaluated)v5(e);x1(e),k5(e)});return}function v5(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",ne._`${r}.evaluated`),t.if(ne._`${e.evaluated}.dynamicProps`,()=>t.assign(ne._`${e.evaluated}.props`,ne._`undefined`)),t.if(ne._`${e.evaluated}.dynamicItems`,()=>t.assign(ne._`${e.evaluated}.items`,ne._`undefined`))}function u1(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?ne._`/*# sourceURL=${r} */`:ne.nil}function w5(e,t){if(y1(e)){if(b1(e),g1(e)){S5(e,t);return}}p1.boolOrEmptySchema(e,t)}function g1({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 y1(e){return typeof e.schema!="boolean"}function S5(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)$1(e);P5(e),j5(e);let i=n.const("_errs",me.default.errors);x1(e,i),n.var(t,ne._`${i} === ${me.default.errors}`)}function b1(e){vn.checkUnknownRules(e),E5(e)}function x1(e,t){if(e.opts.jtd)return d1(e,[],!1,t);let r=m1.getSchemaTypes(e.schema),n=m1.coerceAndCheckDataType(e,r);d1(e,r,!n,t)}function E5(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&vn.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function _5(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)vn.checkStrictMode(e,"default is ignored in the schema root")}function P5(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=g5.resolveUrl(e.opts.uriResolver,e.baseId,t)}function j5(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function $1({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let i=r.$comment;if(s.$comment===!0)e.code(ne._`${me.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=ne.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(ne._`${me.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function k5(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=e;if(r.$async)t.if(ne._`${me.default.errors} === 0`,()=>t.return(me.default.data),()=>t.throw(ne._`new ${s}(${me.default.vErrors})`));else{if(t.assign(ne._`${n}.errors`,me.default.vErrors),i.unevaluated)R5(e);t.return(ne._`${me.default.errors} === 0`)}}function R5({gen:e,evaluated:t,props:r,items:n}){if(r instanceof ne.Name)e.assign(ne._`${t}.props`,r);if(n instanceof ne.Name)e.assign(ne._`${t}.items`,n)}function d1(e,t,r,n){let{gen:s,schema:i,data:o,allErrors:a,opts:l,self:c}=e,{RULES:d}=c;if(i.$ref&&(l.ignoreKeywordsWithRef||!vn.schemaHasRulesButRef(i,d))){s.block(()=>w1(e,"$ref",d.all.$ref.definition));return}if(!l.jtd)A5(e,t);s.block(()=>{for(let h of d.rules)p(h);p(d.post)});function p(h){if(!Lf.shouldUseGroup(i,h))return;if(h.type){if(s.if(Gl.checkDataType(h.type,o,l.strictNumbers)),f1(e,h),t.length===1&&t[0]===h.type&&r)s.else(),Gl.reportTypeError(e);s.endIf()}else f1(e,h);if(!a)s.if(ne._`${me.default.errors} === ${n||0}`)}}function f1(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)h5.assignDefaults(e,t.type);r.block(()=>{for(let i of t.rules)if(Lf.shouldUseRule(n,i))w1(e,i.keyword,i.definition,t.type)})}function A5(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(O5(e,t),!e.opts.allowUnionTypes)C5(e,t);T5(e,e.dataTypes)}function O5(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!v1(e.dataTypes,r))qf(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),I5(e,t)}function C5(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))qf(e,"use allowUnionTypes to allow union type keyword")}function T5(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Lf.shouldUseRule(e.schema,s)){let{type:i}=s.definition;if(i.length&&!i.some((o)=>N5(t,o)))qf(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function N5(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function v1(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function I5(e,t){let r=[];for(let n of e.dataTypes)if(v1(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function qf(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,vn.checkStrictMode(e,t,e.opts.strictTypes)}class Hf{constructor(e,t,r){if(qo.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=vn.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",S1(this.$data,e));else if(this.schemaCode=this.schemaValue,!qo.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",me.default.errors)}result(e,t,r){this.failResult(ne.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(ne.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(ne._`${t} !== undefined && (${ne.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?Ho.reportExtraError:Ho.reportError)(this,this.def.error,t)}$dataError(){Ho.reportError(this,this.def.$dataError||Ho.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Ho.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=ne.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=ne.nil,t=ne.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:i}=this;if(r.if(ne.or(ne._`${n} === undefined`,t)),e!==ne.nil)r.assign(e,!0);if(s.length||i.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==ne.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return ne.or(i(),o());function i(){if(r.length){if(!(t instanceof ne.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return ne._`${Gl.checkDataTypes(a,t,s.opts.strictNumbers,Gl.DataType.Wrong)}`}return ne.nil}function o(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return ne._`!${a}(${t})`}return ne.nil}}subschema(e,t){let r=Ff.getSubschema(this.it,e);Ff.extendSubschemaData(r,this.it,e),Ff.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return w5(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=vn.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=vn.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,ne.Name)),!0}}E1.KeywordCxt=Hf;function w1(e,t,r,n){let s=new Hf(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)qo.funcKeywordCode(s,r);else if("macro"in r)qo.macroKeywordCode(s,r);else if(r.compile||r.validate)qo.funcKeywordCode(s,r)}var M5=/^\/(?:[^~]|~0|~1)*$/,J5=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function S1(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return me.default.rootData;if(e[0]==="/"){if(!M5.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,i=me.default.rootData}else{let c=J5.exec(e);if(!c)throw Error(`Invalid JSON-pointer: ${e}`);let d=+c[1];if(s=c[2],s==="#"){if(d>=t)throw Error(l("property/index",d));return n[t-d]}if(d>t)throw Error(l("data",d));if(i=r[t-d],!s)return i}let o=i,a=s.split("/");for(let c of a)if(c)i=ne._`${i}${ne.getProperty(vn.unescapeJsonPointer(c))}`,o=ne._`${o} && ${i}`;return o;function l(c,d){return`Cannot access ${c} ${d} levels up, current level is ${t}`}}E1.getData=S1});var Vo=C(function(j1){Object.defineProperty(j1,"__esModule",{value:!0});class P1 extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}j1.default=P1});var Si=C(function(R1){Object.defineProperty(R1,"__esModule",{value:!0});var Vf=Fo();class k1 extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=Vf.resolveUrl(e,t,r),this.missingSchema=Vf.normalizeId(Vf.getFullPath(e,this.missingRef))}}R1.default=k1});var Bo=C(function(C1){Object.defineProperty(C1,"__esModule",{value:!0});C1.resolveSchema=C1.getCompilingSchema=C1.resolveRef=C1.compileSchema=C1.SchemaEnv=void 0;var jr=ye(),H5=Vo(),ks=gr(),kr=Fo(),A1=we(),V5=wi();class Wo{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:kr.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={}}}C1.SchemaEnv=Wo;function Bf(e){let t=O1.call(this,e);if(t)return t;let r=kr.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new jr.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;if(e.$async)a=o.scopeValue("Error",{ref:H5.default,code:jr._`require("ajv/dist/runtime/validation_error").default`});let l=o.scopeName("validate");e.validateName=l;let c={gen:o,allErrors:this.opts.allErrors,data:ks.default.data,parentData:ks.default.parentData,parentDataProperty:ks.default.parentDataProperty,dataNames:[ks.default.data],dataPathArr:[jr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:jr.stringify(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:jr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:jr._`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),V5.validateFunctionCode(c),o.optimize(this.opts.code.optimize);let p=o.toString();if(d=`${o.scopeRefs(ks.default.scope)}return ${p}`,this.opts.code.process)d=this.opts.code.process(d,e);let m=Function(`${ks.default.self}`,`${ks.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{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:l,validateCode:p,scopeValues:o._values};if(this.opts.unevaluated){let{props:b,items:g}=c;if(m.evaluated={props:b instanceof jr.Name?void 0:b,items:g instanceof jr.Name?void 0:g,dynamicProps:b instanceof jr.Name,dynamicItems:g instanceof jr.Name},m.source)m.source.evaluated=jr.stringify(m.evaluated)}return e.validate=m,e}catch(p){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw p}finally{this._compilations.delete(e)}}C1.compileSchema=Bf;function W5(e,t,r){var n;r=kr.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let i=z5.call(this,e,r);if(i===void 0){let o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(o)i=new Wo({schema:o,schemaId:a,root:e,baseId:t})}if(i===void 0)return;return e.refs[r]=B5.call(this,i)}C1.resolveRef=W5;function B5(e){if(kr.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Bf.call(this,e)}function O1(e){for(let t of this._compilations)if(U5(t,e))return t}C1.getCompilingSchema=O1;function U5(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function z5(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||Kl.call(this,e,t)}function Kl(e,t){let r=this.opts.uriResolver.parse(t),n=kr._getFullPath(this.opts.uriResolver,r),s=kr.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Wf.call(this,r,e);let i=kr.normalizeId(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Kl.call(this,e,o);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return Wf.call(this,r,a)}if(typeof(o===null||o===void 0?void 0:o.schema)!=="object")return;if(!o.validate)Bf.call(this,o);if(i===kr.normalizeId(t)){let{schema:a}=o,{schemaId:l}=this.opts,c=a[l];if(c)s=kr.resolveUrl(this.opts.uriResolver,s,c);return new Wo({schema:a,schemaId:l,root:e,baseId:s})}return Wf.call(this,r,o)}C1.resolveSchema=Kl;var G5=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Wf(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let l=r[A1.unescapeFragment(a)];if(l===void 0)return;r=l;let c=typeof r==="object"&&r[this.opts.schemaId];if(!G5.has(a)&&c)t=kr.resolveUrl(this.opts.uriResolver,t,c)}let i;if(typeof r!="boolean"&&r.$ref&&!A1.schemaHasRulesButRef(r,this.RULES)){let a=kr.resolveUrl(this.opts.uriResolver,t,r.$ref);i=Kl.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new Wo({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i;return}});var N1=C(function(cZ,Q5){Q5.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 Xf=C(function(uZ,H1){var e3=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),zf=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),t3=RegExp.prototype.test.bind(/^\d*$/u),Rs=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Gf=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),M1=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Kf=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),r3=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),Gt=Array(256);for(let t=0;t<256;t++)Gt[t]="%"+"0123456789ABCDEF"[t>>4]+"0123456789ABCDEF"[t&15];function Et(e){if(e<2048)return Gt[192|e>>6]+Gt[128|e&63];if(e<65536)return Gt[224|e>>12]+Gt[128|e>>6&63]+Gt[128|e&63];return Gt[240|e>>18]+Gt[128|e>>12&63]+Gt[128|e>>6&63]+Gt[128|e&63]}function n3(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 s3=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),i3=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),o3=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),a3=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l3(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){if(o3(e[t]))continue;if(e[t]==="%"&&t+2<e.length&&Rs(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function I1(e){let t=-1,r=0,n=-1,s=0;for(let a=0;a<e.length;a++)if(e[a]==="0"){if(n===-1)n=a;if(s++,s>r)r=s,t=n}else n=-1,s=0;if(r<2)return e.join(":");let i=e.slice(0,t).join(":"),o=e.slice(t+r).join(":");return i+"::"+o}function c3(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 s=r.concat(n),i=0;for(let a=0;a<s.length;a++){let l=s[a];if(l==="")return;if(l.indexOf(".")!==-1){if(a!==s.length-1||t!==-1&&n.length===0||!zf(l))return;i+=2;continue}if(!s3(l))return;s[a]=parseInt(l,16).toString(16),i++}if(t===-1){if(i!==8)return;return I1(s)}if(i>=8)return;let o=s.slice(0,r.length);for(let a=i;a<8;a++)o.push("0");for(let a=r.length;a<s.length;a++)o.push(s[a]);return I1(o)}function Uf(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&&i3(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(u3(n,":")<2)return{host:e,isIPV6:!1,error:t};let s="",i=n.indexOf("%");if(i!==-1){let a=n.slice(i,i+3).toLowerCase()==="%25"?3:1;if(s=n.slice(i+a),!l3(s))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,i)}let o=c3(n);if(o===void 0)return{host:e,isIPV6:!1,error:!0};return{host:o+(s?"%"+s:""),escapedHost:o+(s?"%25"+s:""),isIPV6:!0}}function u3(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function J1(e){let t=e,r=[],n=-1,s=0;while(s=t.length){if(s===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(s===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(s===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 d3(e){if(e===""||e[0]==="/")return J1(e);let t=e.split("/"),r=t.length-1,n=[],s=!1;for(let i=0;i<=r;i++){let o=t[i];if(o==="."||o===".."){if(o==="..")if(n.length!==0&&n[n.length-1]!=="..")n.pop();else n.push("..");s=i===r}else n.push(o)}if(s&&n[n.length-1]!=="..")n.push("");if(n.length===0||n[0]===""||n[0].includes(":"))n.unshift(".");return n.join("/")}var f3={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},p3=/[@/?#:]/g,m3=/[@/?#]/g;function D1(e,t){let r=t?m3:p3;return r.lastIndex=0,e.replace(r,(n)=>f3[n])}function L1(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 s=e.slice(n+1,n+3);if(Rs(s)){let i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));if(t&&Gf(o))r+=o;else r+="%"+i;n+=2;continue}}r+=e[n]}return r}function h3(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let s=e.slice(r+1,r+3);if(Rs(s)){let i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));if(o!=="."&&Gf(o))t+=o;else t+="%"+i;r+=2;continue}}if(M1(n))t+=n;else{let s=e.charCodeAt(r);if(s<128)t+=q1(s)?n:Gt[s];else if(s<55296||s>57343)t+=Et(s);else if(s<=56319&&r+1<e.length){let i=e.charCodeAt(r+1);if(i>=56320&&i<=57343)t+=Et(65536+(s-55296<<10)+(i-56320)),r++;else t+=Et(65533)}else t+=Et(65533)}}return t}function g3(e,t=!1){let r="",n=t&&e[0]!=="/";for(let s=0;s<e.length;s++){let i=e[s];if(i==="%"&&s+2<e.length){let o=e.slice(s+1,s+3);if(Rs(o)){r+="%"+o.toUpperCase(),s+=2;continue}}if(i==="/")n=!1;if(M1(i)&&(i!==":"||!n))r+=i;else{let o=e.charCodeAt(s);if(o<128)r+=Gt[o];else if(o<55296||o>57343)r+=Et(o);else if(o<=56319&&s+1<e.length){let a=e.charCodeAt(s+1);if(a>=56320&&a<=57343)r+=Et(65536+(o-55296<<10)+(a-56320)),s++;else r+=Et(65533)}else r+=Et(65533)}}return r}function Yf(e,t){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(s==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(Rs(i)){r+="%"+i.toUpperCase(),n+=2;continue}}if(t(s))r+=s;else{let i=e.charCodeAt(n);if(i<128)r+=Gt[i];else if(i<55296||i>57343)r+=Et(i);else if(i<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);if(o>=56320&&o<=57343)r+=Et(65536+(i-55296<<10)+(o-56320)),n++;else r+=Et(65533)}else r+=Et(65533)}}return r}function F1(e){return Yf(e,r3)}function y3(e){return Yf(e,Kf)}function b3(e){return Yf(e,Kf)}function q1(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 x3(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let s=e.slice(r+1,r+3);if(Rs(s)){let i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));if(Gf(o))t+=o;else t+="%"+i;r+=2;continue}}if(Kf(n))t+=n;else{let s=e.charCodeAt(r);if(s<128)t+=q1(s)?n:Gt[s];else if(s<55296||s>57343)t+=Et(s);else if(s<=56319&&r+1<e.length){let i=e.charCodeAt(r+1);if(i>=56320&&i<=57343)t+=Et(65536+(s-55296<<10)+(i-56320)),r++;else t+=Et(65533)}else t+=Et(65533)}}return t}function $3(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(Rs(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function v3(e){let t=[];if(e.userinfo!==void 0)t.push(F1(e.userinfo)),t.push("@");if(e.host!==void 0){let r=e.host;if(!zf(r)){let n=Uf(r);if(n.isIPV6!==!0&&n.isIPVFuture!==!0)r=L1(r,!0),n=Uf(r);if(n.isIPV6===!0||n.isIPVFuture===!0)r=`[${n.escapedHost}]`;else r=D1(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string"){let r=String(e.port);if(!t3(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}H1.exports={nonSimpleDomain:a3,recomposeAuthority:v3,reescapeHostDelimiters:D1,normalizePercentEncoding:L1,normalizePathEncoding:h3,serializePathEncoding:g3,normalizeQueryFragmentEncoding:x3,encodeUserinfo:F1,encodeQuery:y3,encodeFragment:b3,escapePreservingEscapes:$3,removeDotSegments:J1,removeDotSegmentsRelative:d3,isIPv4:zf,isUUID:e3,normalizeIPv6:Uf,stringArrayToHexStripped:n3}});var z1=C(function(dZ,U1){var{isUUID:w3}=Xf(),S3=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,E3=["http","https","ws","wss","urn","urn:uuid"];function _3(e){return E3.indexOf(e)!==-1}function Zf(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 V1(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function W1(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 P3(e){return e.secure=Zf(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function j3(e){if(e.port===(Zf(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 k3(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(S3);if(r&&r[0]===e.path){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=`${n}:${t.nid||e.nid}`,i=Qf(s);if(e.path=void 0,i)e=i.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function R3(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(),s=`${r}:${t.nid||n}`,i=Qf(s);if(i)e=i.serialize(e,t);let o=e,a=e.nss;return o.path=`${n||t.nid}:${a}`,t.skipEscape=!0,o}function A3(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!w3(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function O3(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var B1={scheme:"http",domainHost:!0,parse:V1,serialize:W1},C3={scheme:"https",domainHost:B1.domainHost,parse:V1,serialize:W1},Yl={scheme:"ws",domainHost:!0,parse:P3,serialize:j3},T3={scheme:"wss",domainHost:Yl.domainHost,parse:Yl.parse,serialize:Yl.serialize},N3={scheme:"urn",parse:k3,serialize:R3,skipNormalize:!0},I3={scheme:"urn:uuid",parse:A3,serialize:O3,skipNormalize:!0},Xl={http:B1,https:C3,ws:Yl,wss:T3,urn:N3,"urn:uuid":I3};Object.setPrototypeOf(Xl,null);function Qf(e){return e&&(Xl[e]||Xl[e.toLowerCase()])||void 0}U1.exports={wsIsSecure:Zf,SCHEMES:Xl,isValidSchemeName:_3,getSchemeHandler:Qf}});var aE=C(function(fZ,tc){var{normalizeIPv6:Z1,removeDotSegments:zo,removeDotSegmentsRelative:Q1,recomposeAuthority:M3,normalizePercentEncoding:ep,normalizePathEncoding:J3,serializePathEncoding:G1,normalizeQueryFragmentEncoding:K1,encodeQuery:D3,encodeFragment:L3,reescapeHostDelimiters:F3,isIPv4:eE,nonSimpleDomain:q3}=Xf(),{SCHEMES:tE,getSchemeHandler:tp}=z1(),rE=/^[A-Za-z][A-Za-z0-9+.-]*$/u,H3=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function Y1(e){let t=String(e);if(!rE.test(t))throw TypeError("URI scheme is malformed.");return t}function V3(e,t){if(typeof e==="string")e=Z3(e,t);else if(typeof e==="object")e=Ql(As(e,t),t);return e}function W3(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:s,malformedAuthorityOrPort:i,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:l,malformedScheme:c}=Zl(e,n),{parsed:d,malformedAuthorityOrPort:p,malformedPercentEncoding:h,malformedSchemeSpecific:m,malformedHost:b,malformedScheme:g}=Zl(t,n);if(i||p||o||h||a||m||l||b||c||g)throw Error(s.error||d.error||"URI is malformed.");let y=nE(s,d,n,!0),v=tp(r&&r.scheme||y.scheme),j=y.host,S=j!==void 0&&j!==""&&(eE(j)||Z1(j).isIPV6);if(iE(y,r||{},v,S))throw Error("URI host is malformed.");sE(y,r||{},v,S);let P=j&&j.indexOf("%")!==-1&&!/\P{ASCII}/u.test(j);if(y.error&&!P)throw Error(y.error);return n.skipEscape=!0,As(y,n)}function nE(e,t,r,n){let s={};if(!n)e=Ql(As(e,r),r),t=Ql(As(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=zo(t.path||""),s.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=zo(t.path||""),s.query=t.query;else{if(!t.path)if(s.path=e.path,t.query!==void 0)s.query=t.query;else s.query=e.query;else{if(t.path[0]==="/")s.path=zo(t.path);else{let i=e.userinfo!==void 0||e.host!==void 0||e.port!==void 0;if(i&&!e.path)s.path="/"+t.path;else if(!e.path)s.path=t.path;else s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;s.path=e.scheme===void 0&&!i&&s.path[0]!=="/"?Q1(s.path):zo(s.path)}s.query=t.query}s.userinfo=e.userinfo,s.host=e.host,s.port=e.port}s.scheme=e.scheme}return s.fragment=t.fragment,s}function B3(e,t,r){let n=X1(e,r),s=X1(t,r);return n!==void 0&&s!==void 0&&n===s}function As(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),s=[];if(r.scheme)r.scheme=Y1(r.scheme);let i=tp(n.scheme||r.scheme);if(i&&i.serialize)i.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,l=!n.skipEscape&&a;if(r.path!==void 0)if(!n.skipEscape)r.path=G1(r.path,l);else r.path=ep(r.path);if(n.reference!=="suffix"&&r.scheme)r.scheme=Y1(r.scheme),s.push(r.scheme,":");let c=M3(r);if(c!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(c),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let d=r.path;if(!n.absolutePath&&(!i||!i.absolutePath))d=a&&d[0]!=="/"?Q1(d):zo(d);if(a)d=G1(d,!0);if(c===void 0&&d[0]==="/"&&d[1]==="/")d="/%2F"+d.slice(2);s.push(d)}if(r.query!==void 0)s.push("?",D3(r.query));if(r.fragment!==void 0)s.push("#",L3(r.fragment));return s.join("")}var U3=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,z3=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,G3=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function K3(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 Uo(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 ec(e){return e[0]==="["&&e[e.length-1]==="]"}function Y3(e){let t=e[4];return Uo(e[3])||t!==void 0&&!ec(t)&&Uo(t)||Uo(e[6])||Uo(e[7])||Uo(e[8])}function sE(e,t,r,n){if(iE(e,t,r,n))return e.error=e.error||"URI host is malformed.",!0;if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!ec(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&q3(e.host)){let s;try{s=new URL("http://"+e.host)}catch(i){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+i,!0}if(!X3(s))return e.error=e.error||"URI host is malformed.",!0;e.host=s.hostname}return!1}function iE(e,t,r,n){return Boolean(e.host&&n===!1&&!ec(e.host)&&(t.domainHost||r&&r.domainHost)&&H3.test(e.host))}function X3(e){return e.username===""&&e.password===""&&e.port===""&&e.pathname==="/"&&e.search===""&&e.hash===""&&e.hostname!==""}function Zl(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},s=!1,i=!1,o=!1,a=!1,l=!1,c=!1,d=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let p=e.match(z3);if(p!==null&&p[1].indexOf("\\")!==-1)n.error="URI authority must not contain a literal backslash.",s=!0;let h=e.match(G3);if(h!==null){let b=h[1],g=b.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.",s=!0;else if(b.length!==g.length)n.error=n.error||"URI authority introducer must not contain whitespace.",s=!0}}let m=e.match(U3);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(rE.test(n.scheme))n.scheme=n.scheme.toLowerCase();else n.error=n.error||"URI scheme is malformed.",c=!0;if(i=Y3(m),i)n.error=n.error||"URI contains malformed percent-encoding.";if(isNaN(n.port))n.port=m[5];let b=K3(n,m);if(b!==void 0)n.error=n.error||b,s=!0;if(n.host)if(eE(n.host)===!1){let v=ec(n.host),j=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,S=Z1(n.host);if(d=S.isIPV6||S.isIPVFuture===!0,l=j&&(!v||S.error===!0),n.host=d?S.host:S.host.toLowerCase(),l)n.error=n.error||"URI host is malformed.",s=!0}else d=!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=tp(r.scheme||n.scheme);if(!l)a=sE(n,r,g,d);if(e.indexOf("%")!==-1&&n.host!==void 0&&!l){let y=d?n.host:ep(n.host,!0);if(!d)y=ep(y.toLowerCase());n.host=d||r.scheme!=="null"?F3(y,d):y}if(!g||g&&!g.skipNormalize){if(n.path)n.path=J3(n.path);if(n.query)n.query=K1(n.query);if(n.fragment)n.fragment=K1(n.fragment)}if(g&&g.parse){if(g.parse(n,r),g===tE.urn&&n.nid===void 0)o=!0}}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:c}}function Ql(e,t){return Zl(e,t).parsed}function Z3(e,t){return oE(e,t).normalized}function oE(e,t){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:o,malformedScheme:a}=Zl(e,t);return{normalized:n||s||i||o||a?e:As(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:o,malformedScheme:a}}function X1(e,t){if(typeof e!=="string"&&typeof e!=="object")return;let r;try{r=typeof e==="string"?e:As(e,t)}catch{return}let{normalized:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:l}=oE(r,t);return s||i||o||a||l?void 0:n}var rp={SCHEMES:tE,normalize:V3,resolve:W3,resolveComponent:nE,equal:B3,serialize:As,parse:Ql};tc.exports=rp;tc.exports.default=rp;tc.exports.fastUri=rp});var uE=C(function(cE){Object.defineProperty(cE,"__esModule",{value:!0});var lE=aE();lE.code='require("ajv/dist/runtime/uri").default';cE.default=lE});var ip=C(function(wn){Object.defineProperty(wn,"__esModule",{value:!0});wn.CodeGen=wn.Name=wn.nil=wn.stringify=wn.str=wn._=wn.KeywordCxt=void 0;var eH=wi();Object.defineProperty(wn,"KeywordCxt",{enumerable:!0,get:function(){return eH.KeywordCxt}});var Ei=ye();Object.defineProperty(wn,"_",{enumerable:!0,get:function(){return Ei._}});Object.defineProperty(wn,"str",{enumerable:!0,get:function(){return Ei.str}});Object.defineProperty(wn,"stringify",{enumerable:!0,get:function(){return Ei.stringify}});Object.defineProperty(wn,"nil",{enumerable:!0,get:function(){return Ei.nil}});Object.defineProperty(wn,"Name",{enumerable:!0,get:function(){return Ei.Name}});Object.defineProperty(wn,"CodeGen",{enumerable:!0,get:function(){return Ei.CodeGen}});var tH=Vo(),hE=Si(),rH=Rf(),Ko=Bo(),nH=ye(),Go=Fo(),rc=Lo(),sp=we(),dE=N1(),sH=uE(),gE=(e,t)=>new RegExp(e,t);gE.code="new RegExp";var iH=["removeAdditional","useDefaults","coerceTypes"],oH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),aH={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."},lH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},fE=200;function cH(e){var t,r,n,s,i,o,a,l,c,d,p,h,m,b,g,y,v,j,S,P,E,O,R,k,I;let D=e.strict,M=(t=e.code)===null||t===void 0?void 0:t.optimize,L=M===!0||M===void 0?1:M||0,B=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:gE,se=(s=e.uriResolver)!==null&&s!==void 0?s:sH.default;return{strictSchema:(o=(i=e.strictSchema)!==null&&i!==void 0?i:D)!==null&&o!==void 0?o:!0,strictNumbers:(l=(a=e.strictNumbers)!==null&&a!==void 0?a:D)!==null&&l!==void 0?l:!0,strictTypes:(d=(c=e.strictTypes)!==null&&c!==void 0?c:D)!==null&&d!==void 0?d:"log",strictTuples:(h=(p=e.strictTuples)!==null&&p!==void 0?p:D)!==null&&h!==void 0?h:"log",strictRequired:(b=(m=e.strictRequired)!==null&&m!==void 0?m:D)!==null&&b!==void 0?b:!1,code:e.code?{...e.code,optimize:L,regExp:B}:{optimize:L,regExp:B},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:fE,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:fE,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(j=e.messages)!==null&&j!==void 0?j:!0,inlineRefs:(S=e.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(P=e.schemaId)!==null&&P!==void 0?P:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(O=e.validateSchema)!==null&&O!==void 0?O:!0,validateFormats:(R=e.validateFormats)!==null&&R!==void 0?R:!0,unicodeRegExp:(k=e.unicodeRegExp)!==null&&k!==void 0?k:!0,int32range:(I=e.int32range)!==null&&I!==void 0?I:!0,uriResolver:se}}class nc{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,...cH(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new nH.ValueScope({scope:{},prefixes:oH,es5:t,lines:r}),this.logger=hH(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=rH.getRules(),pE.call(this,aH,e,"NOT SUPPORTED"),pE.call(this,lH,e,"DEPRECATED","warn"),this._metaOpts=pH.call(this),e.formats)dH.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)fH.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);uH.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=dE;if(r==="id")n={...dE},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(c,d){await s.call(this,c.$schema);let p=this._addSchema(c,d);return p.validate||i.call(this,p)}async function s(c){if(c&&!this.getSchema(c))await n.call(this,{$ref:c},!0)}async function i(c){try{return this._compileSchemaEnv(c)}catch(d){if(!(d instanceof hE.default))throw d;return o.call(this,d),await a.call(this,d.missingSchema),i.call(this,c)}}function o({missingSchema:c,missingRef:d}){if(this.refs[c])throw Error(`AnySchema ${c} is loaded but ${d} cannot be resolved`)}async function a(c){let d=await l.call(this,c);if(!this.refs[c])await s.call(this,d.$schema);if(!this.refs[c])this.addSchema(d,c,t)}async function l(c){let d=this._loading[c];if(d)return d;try{return await(this._loading[c]=r(c))}finally{delete this._loading[c]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw Error(`schema ${i} must be string`)}return t=Go.normalizeId(t||s),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 s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=mE.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Ko.SchemaEnv({schema:{},schemaId:r});if(t=Ko.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=mE.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=Go.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(yH.call(this,r,t),!t)return sp.eachItem(r,(s)=>np.call(this,s)),this;xH.call(this,t);let n={...t,type:rc.getJSONTypes(t.type),schemaType:rc.getJSONTypes(t.schemaType)};return sp.eachItem(r,n.type.length===0?(s)=>np.call(this,s,n):(s)=>n.type.forEach((i)=>np.call(this,s,n,i))),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((s)=>s.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,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),i=e;for(let o of s)i=i[o];for(let o in r){let a=r[o];if(typeof a!="object")continue;let{$data:l}=a.definition,c=i[o];if(l&&c)i[o]=yE(c)}}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,s=this.opts.addUsedSchema){let i,{schemaId:o}=this.opts;if(typeof e=="object")i=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=Go.normalizeId(i||r);let l=Go.getSchemaRefs.call(this,e,r);if(a=new Ko.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:l}),this._cache.set(a.schema,a),s&&!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 Ko.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{Ko.compileSchema.call(this,e)}finally{this.opts=t}}}nc.ValidationError=tH.default;nc.MissingRefError=hE.default;wn.default=nc;function pE(e,t,r,n="error"){for(let s in e){let i=s;if(i in t)this.logger[n](`${r}: option ${s}. ${e[i]}`)}}function mE(e){return e=Go.normalizeId(e),this.schemas[e]||this.refs[e]}function uH(){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 dH(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function fH(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 pH(){let e={...this.opts};for(let t of iH)delete e[t];return e}var mH={log(){},warn(){},error(){}};function hH(e){if(e===!1)return mH;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 gH=/^[a-z_$][a-z0-9_$:-]*$/i;function yH(e,t){let{RULES:r}=this;if(sp.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!gH.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 np(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:l})=>l===r);if(!o)o={type:r,rules:[]},i.rules.push(o);if(i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:rc.getJSONTypes(t.type),schemaType:rc.getJSONTypes(t.schemaType)}};if(t.before)bH.call(this,o,a,t.before);else o.rules.push(a);i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((l)=>this.addKeyword(l))}function bH(e,t,r){let n=e.rules.findIndex((s)=>s.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 xH(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=yE(t);e.validateSchema=this.compile(t,!0)}var $H={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function yE(e){return{anyOf:[e,$H]}}});var xE=C(function(bE){Object.defineProperty(bE,"__esModule",{value:!0});var SH={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};bE.default=SH});var oc=C(function(SE){Object.defineProperty(SE,"__esModule",{value:!0});SE.callRef=SE.getValidate=void 0;var _H=Si(),$E=yr(),Kt=ye(),_i=gr(),vE=Bo(),sc=we(),PH={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:l}=n,{root:c}=i;if((r==="#"||r==="#/")&&s===c.baseId)return p();let d=vE.resolveRef.call(l,c,s,r);if(d===void 0)throw new _H.default(n.opts.uriResolver,s,r);if(d instanceof vE.SchemaEnv)return h(d);return m(d);function p(){if(i===c)return ic(e,o,i,i.$async);let b=t.scopeValue("root",{ref:c});return ic(e,Kt._`${b}.validate`,c,c.$async)}function h(b){let g=wE(e,b);ic(e,g,b,b.$async)}function m(b){let g=t.scopeValue("schema",a.code.source===!0?{ref:b,code:Kt.stringify(b)}:{ref:b}),y=t.name("valid"),v=e.subschema({schema:b,dataTypes:[],schemaPath:Kt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function wE(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Kt._`${r.scopeValue("wrapper",{ref:t})}.validate`}SE.getValidate=wE;function ic(e,t,r,n){let{gen:s,it:i}=e,{allErrors:o,schemaEnv:a,opts:l}=i,c=l.passContext?_i.default.this:Kt.nil;if(n)d();else p();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let b=s.let("valid");s.try(()=>{if(s.code(Kt._`await ${$E.callValidateCode(e,t,c)}`),m(t),!o)s.assign(b,!0)},(g)=>{if(s.if(Kt._`!(${g} instanceof ${i.ValidationError})`,()=>s.throw(g)),h(g),!o)s.assign(b,!1)}),e.ok(b)}function p(){e.result($E.callValidateCode(e,t,c),()=>m(t),()=>h(t))}function h(b){let g=Kt._`${b}.errors`;s.assign(_i.default.vErrors,Kt._`${_i.default.vErrors} === null ? ${g} : ${_i.default.vErrors}.concat(${g})`),s.assign(_i.default.errors,Kt._`${_i.default.vErrors}.length`)}function m(b){var g;if(!i.opts.unevaluated)return;let y=(g=r===null||r===void 0?void 0:r.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)i.props=sc.mergeEvaluated.props(s,y.props,i.props)}else{let v=s.var("props",Kt._`${b}.evaluated.props`);i.props=sc.mergeEvaluated.props(s,v,i.props,Kt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)i.items=sc.mergeEvaluated.items(s,y.items,i.items)}else{let v=s.var("items",Kt._`${b}.evaluated.items`);i.items=sc.mergeEvaluated.items(s,v,i.items,Kt.Name)}}}SE.callRef=ic;SE.default=PH});var op=C(function(_E){Object.defineProperty(_E,"__esModule",{value:!0});var RH=xE(),AH=oc(),OH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",RH.default,AH.default];_E.default=OH});var jE=C(function(PE){Object.defineProperty(PE,"__esModule",{value:!0});var lc=ye(),Kn=lc.operators,ac={maximum:{okStr:"<=",ok:Kn.LTE,fail:Kn.GT},minimum:{okStr:">=",ok:Kn.GTE,fail:Kn.LT},exclusiveMaximum:{okStr:"<",ok:Kn.LT,fail:Kn.GTE},exclusiveMinimum:{okStr:">",ok:Kn.GT,fail:Kn.LTE}},TH={message:({keyword:e,schemaCode:t})=>lc.str`must be ${ac[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>lc._`{comparison: ${ac[e].okStr}, limit: ${t}}`},NH={keyword:Object.keys(ac),type:"number",schemaType:"number",$data:!0,error:TH,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(lc._`${r} ${ac[t].fail} ${n} || isNaN(${r})`)}};PE.default=NH});var RE=C(function(kE){Object.defineProperty(kE,"__esModule",{value:!0});var Yo=ye(),MH={message:({schemaCode:e})=>Yo.str`must be multiple of ${e}`,params:({schemaCode:e})=>Yo._`{multipleOf: ${e}}`},JH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:MH,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),a=i?Yo._`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:Yo._`${o} !== parseInt(${o})`;e.fail$data(Yo._`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};kE.default=JH});var CE=C(function(OE){Object.defineProperty(OE,"__esModule",{value:!0});function AE(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}OE.default=AE;AE.code='require("ajv/dist/runtime/ucs2length").default'});var NE=C(function(TE){Object.defineProperty(TE,"__esModule",{value:!0});var Os=ye(),FH=we(),qH=CE(),HH={message({keyword:e,schemaCode:t}){return Os.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>Os._`{limit: ${e}}`},VH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:HH,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?Os.operators.GT:Os.operators.LT,o=s.opts.unicode===!1?Os._`${r}.length`:Os._`${FH.useFunc(e.gen,qH.default)}(${r})`;e.fail$data(Os._`${o} ${i} ${n}`)}};TE.default=VH});var ME=C(function(IE){Object.defineProperty(IE,"__esModule",{value:!0});var BH=yr(),UH=we(),Pi=ye(),zH={message:({schemaCode:e})=>Pi.str`must match pattern "${e}"`,params:({schemaCode:e})=>Pi._`{pattern: ${e}}`},GH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:zH,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:l}=o.opts.code,c=l.code==="new RegExp"?Pi._`new RegExp`:UH.useFunc(t,l),d=t.let("valid");t.try(()=>t.assign(d,Pi._`${c}(${i}, ${a}).test(${r})`),()=>t.assign(d,!1)),e.fail$data(Pi._`!${d}`)}else{let l=BH.usePattern(e,s);e.fail$data(Pi._`!${l}.test(${r})`)}}};IE.default=GH});var DE=C(function(JE){Object.defineProperty(JE,"__esModule",{value:!0});var Xo=ye(),YH={message({keyword:e,schemaCode:t}){return Xo.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>Xo._`{limit: ${e}}`},XH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:YH,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Xo.operators.GT:Xo.operators.LT;e.fail$data(Xo._`Object.keys(${r}).length ${s} ${n}`)}};JE.default=XH});var FE=C(function(LE){Object.defineProperty(LE,"__esModule",{value:!0});var Qo=yr(),Zo=ye(),QH=we(),eV={message:({params:{missingProperty:e}})=>Zo.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Zo._`{missingProperty: ${e}}`},tV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:eV,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:a}=o;if(!i&&r.length===0)return;let l=r.length>=a.loopRequired;if(o.allErrors)c();else d();if(a.strictRequired){let m=e.parentSchema.properties,{definedProperties:b}=e.it;for(let g of r)if((m===null||m===void 0?void 0:m[g])===void 0&&!b.has(g)){let y=o.schemaEnv.baseId+o.errSchemaPath,v=`required property "${g}" is not defined at "${y}" (strictRequired)`;QH.checkStrictMode(o,v,o.opts.strictRequired)}}function c(){if(l||i)e.block$data(Zo.nil,p);else for(let m of r)Qo.checkReportMissingProp(e,m)}function d(){let m=t.let("missing");if(l||i){let b=t.let("valid",!0);e.block$data(b,()=>h(m,b)),e.ok(b)}else t.if(Qo.checkMissingProp(e,r,m)),Qo.reportMissingProp(e,m),t.else()}function p(){t.forOf("prop",n,(m)=>{e.setParams({missingProperty:m}),t.if(Qo.noPropertyInData(t,s,m,a.ownProperties),()=>e.error())})}function h(m,b){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(b,Qo.propertyInData(t,s,m,a.ownProperties)),t.if(Zo.not(b),()=>{e.error(),t.break()})},Zo.nil)}}};LE.default=tV});var HE=C(function(qE){Object.defineProperty(qE,"__esModule",{value:!0});var ea=ye(),nV={message({keyword:e,schemaCode:t}){return ea.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>ea._`{limit: ${e}}`},sV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:nV,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?ea.operators.GT:ea.operators.LT;e.fail$data(ea._`${r}.length ${s} ${n}`)}};qE.default=sV});var cc=C(function(WE){Object.defineProperty(WE,"__esModule",{value:!0});var VE=Jf();VE.code='require("ajv/dist/runtime/equal").default';WE.default=VE});var UE=C(function(BE){Object.defineProperty(BE,"__esModule",{value:!0});var ap=Lo(),yt=ye(),aV=we(),lV=cc(),cV={message:({params:{i:e,j:t}})=>yt.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>yt._`{i: ${e}, j: ${t}}`},uV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:cV,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=e;if(!n&&!s)return;let l=t.let("valid"),c=i.items?ap.getSchemaTypes(i.items):[];e.block$data(l,d,yt._`${o} === false`),e.ok(l);function d(){let b=t.let("i",yt._`${r}.length`),g=t.let("j");e.setParams({i:b,j:g}),t.assign(l,!0),t.if(yt._`${b} > 1`,()=>(p()?h:m)(b,g))}function p(){return c.length>0&&!c.some((b)=>b==="object"||b==="array")}function h(b,g){let y=t.name("item"),v=ap.checkDataTypes(c,y,a.opts.strictNumbers,ap.DataType.Wrong),j=t.const("indices",yt._`{}`);t.for(yt._`;${b}--;`,()=>{if(t.let(y,yt._`${r}[${b}]`),t.if(v,yt._`continue`),c.length>1)t.if(yt._`typeof ${y} == "string"`,yt._`${y} += "_"`);t.if(yt._`typeof ${j}[${y}] == "number"`,()=>{t.assign(g,yt._`${j}[${y}]`),e.error(),t.assign(l,!1).break()}).code(yt._`${j}[${y}] = ${b}`)})}function m(b,g){let y=aV.useFunc(t,lV.default),v=t.name("outer");t.label(v).for(yt._`;${b}--;`,()=>t.for(yt._`${g} = ${b}; ${g}--;`,()=>t.if(yt._`${y}(${r}[${b}], ${r}[${g}])`,()=>{e.error(),t.assign(l,!1).break(v)})))}}};BE.default=uV});var GE=C(function(zE){Object.defineProperty(zE,"__esModule",{value:!0});var lp=ye(),fV=we(),pV=cc(),mV={message:"must be equal to constant",params:({schemaCode:e})=>lp._`{allowedValue: ${e}}`},hV={keyword:"const",$data:!0,error:mV,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;if(n||i&&typeof i=="object")e.fail$data(lp._`!${fV.useFunc(t,pV.default)}(${r}, ${s})`);else e.fail(lp._`${i} !== ${r}`)}};zE.default=hV});var YE=C(function(KE){Object.defineProperty(KE,"__esModule",{value:!0});var ta=ye(),yV=we(),bV=cc(),xV={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ta._`{allowedValues: ${e}}`},$V={keyword:"enum",schemaType:"array",$data:!0,error:xV,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,l,c=()=>l!==null&&l!==void 0?l:l=yV.useFunc(t,bV.default),d;if(a||n)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(s))throw Error("ajv implementation error");let m=t.const("vSchema",i);d=ta.or(...s.map((b,g)=>h(m,g)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",i,(m)=>t.if(ta._`${c()}(${r}, ${m})`,()=>t.assign(d,!0).break()))}function h(m,b){let g=s[b];return typeof g==="object"&&g!==null?ta._`${c()}(${r}, ${m}[${b}])`:ta._`${r} === ${g}`}}};KE.default=$V});var cp=C(function(XE){Object.defineProperty(XE,"__esModule",{value:!0});var wV=jE(),SV=RE(),EV=NE(),_V=ME(),PV=DE(),jV=FE(),kV=HE(),RV=UE(),AV=GE(),OV=YE(),CV=[wV.default,SV.default,EV.default,_V.default,PV.default,jV.default,kV.default,RV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},AV.default,OV.default];XE.default=CV});var dp=C(function(QE){Object.defineProperty(QE,"__esModule",{value:!0});QE.validateAdditionalItems=void 0;var Cs=ye(),up=we(),NV={message:({params:{len:e}})=>Cs.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Cs._`{limit: ${e}}`},IV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:NV,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){up.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ZE(e,n)}};function ZE(e,t){let{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;let a=r.const("len",Cs._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(Cs._`${a} <= ${t.length}`);else if(typeof n=="object"&&!up.alwaysValidSchema(o,n)){let c=r.var("valid",Cs._`${a} <= ${t.length}`);r.if(Cs.not(c),()=>l(c)),e.ok(c)}function l(c){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:i,dataProp:d,dataPropType:up.Type.Num},c),!o.allErrors)r.if(Cs.not(c),()=>r.break())})}}QE.validateAdditionalItems=ZE;QE.default=IV});var fp=C(function(n_){Object.defineProperty(n_,"__esModule",{value:!0});n_.validateTuple=void 0;var t_=ye(),uc=we(),JV=yr(),DV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return r_(e,"additionalItems",t);if(r.items=!0,uc.alwaysValidSchema(r,t))return;e.ok(JV.validateArray(e))}};function r_(e,t,r=e.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=uc.mergeEvaluated.items(n,r.length,a.items);let l=n.name("valid"),c=n.const("len",t_._`${i}.length`);r.forEach((p,h)=>{if(uc.alwaysValidSchema(a,p))return;n.if(t_._`${c} > ${h}`,()=>e.subschema({keyword:o,schemaProp:h,dataProp:h},l)),e.ok(l)});function d(p){let{opts:h,errSchemaPath:m}=a,b=r.length,g=b===p.minItems&&(b===p.maxItems||p[t]===!1);if(h.strictTuples&&!g){let y=`"${o}" is ${b}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;uc.checkStrictMode(a,y,h.strictTuples)}}}n_.validateTuple=r_;n_.default=DV});var o_=C(function(i_){Object.defineProperty(i_,"__esModule",{value:!0});var FV=fp(),qV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>FV.validateTuple(e,"items")};i_.default=qV});var c_=C(function(l_){Object.defineProperty(l_,"__esModule",{value:!0});var a_=ye(),VV=we(),WV=yr(),BV=dp(),UV={message:({params:{len:e}})=>a_.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>a_._`{limit: ${e}}`},zV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:UV,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,VV.alwaysValidSchema(n,t))return;if(s)BV.validateAdditionalItems(e,s);else e.ok(WV.validateArray(e))}};l_.default=zV});var d_=C(function(u_){Object.defineProperty(u_,"__esModule",{value:!0});var br=ye(),dc=we(),KV={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}}`},YV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:KV,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:i}=e,o,a,{minContains:l,maxContains:c}=n;if(i.opts.next)o=l===void 0?1:l,a=c;else o=1;let d=t.const("len",br._`${s}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){dc.checkStrictMode(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){dc.checkStrictMode(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(dc.alwaysValidSchema(i,r)){let g=br._`${d} >= ${o}`;if(a!==void 0)g=br._`${g} && ${d} <= ${a}`;e.pass(g);return}i.items=!0;let p=t.name("valid");if(a===void 0&&o===1)m(p,()=>t.if(p,()=>t.break()));else if(o===0){if(t.let(p,!0),a!==void 0)t.if(br._`${s}.length > 0`,h)}else t.let(p,!1),h();e.result(p,()=>e.reset());function h(){let g=t.name("_valid"),y=t.let("count",0);m(g,()=>t.if(g,()=>b(y)))}function m(g,y){t.forRange("i",0,d,(v)=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:dc.Type.Num,compositeRule:!0},g),y()})}function b(g){if(t.code(br._`${g}++`),a===void 0)t.if(br._`${g} >= ${o}`,()=>t.assign(p,!0).break());else if(t.if(br._`${g} > ${a}`,()=>t.assign(p,!1).break()),o===1)t.assign(p,!0);else t.if(br._`${g} >= ${o}`,()=>t.assign(p,!0))}}};u_.default=YV});var fc=C(function(m_){Object.defineProperty(m_,"__esModule",{value:!0});m_.validateSchemaDeps=m_.validatePropertyDeps=m_.error=void 0;var pp=ye(),ZV=we(),ra=yr();m_.error={message:({params:{property:e,depsCount:t,deps:r}})=>pp.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>pp._`{property: ${e},
608
569
  missingProperty: ${n},
609
570
  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]
571
+ deps: ${r}}`};var QV={keyword:"dependencies",type:"object",schemaType:"object",error:m_.error,code(e){let[t,r]=e4(e);f_(e,t),p_(e,r)}};function e4({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function f_(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let o in t){let a=t[o];if(a.length===0)continue;let l=ra.propertyInData(r,n,o,s.opts.ownProperties);if(e.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(l,()=>{for(let c of a)ra.checkReportMissingProp(e,c)});else r.if(pp._`${l} && (${ra.checkMissingProp(e,a,i)})`),ra.reportMissingProp(e,i),r.else()}}m_.validatePropertyDeps=f_;function p_(e,t=e.schema){let{gen:r,data:n,keyword:s,it:i}=e,o=r.name("valid");for(let a in t){if(ZV.alwaysValidSchema(i,t[a]))continue;r.if(ra.propertyInData(r,n,a,i.opts.ownProperties),()=>{let l=e.subschema({keyword:s,schemaProp:a},o);e.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),e.ok(o)}}m_.validateSchemaDeps=p_;m_.default=QV});var x_=C(function(b_){Object.defineProperty(b_,"__esModule",{value:!0});var y_=ye(),n4=we(),s4={message:"property name must be valid",params:({params:e})=>y_._`{propertyName: ${e.propertyName}}`},i4={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:s4,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(n4.alwaysValidSchema(s,r))return;let i=t.name("valid");t.forIn("key",n,(o)=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),t.if(y_.not(i),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(i)}};b_.default=i4});var mp=C(function($_){Object.defineProperty($_,"__esModule",{value:!0});var pc=yr(),Rr=ye(),a4=gr(),mc=we(),l4={message:"must NOT have additional properties",params:({params:e})=>Rr._`{additionalProperty: ${e.additionalProperty}}`},c4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:l4,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=e;if(!i)throw Error("ajv implementation error");let{allErrors:a,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&mc.alwaysValidSchema(o,r))return;let c=pc.allSchemaProperties(n.properties),d=pc.allSchemaProperties(n.patternProperties);p(),e.ok(Rr._`${i} === ${a4.default.errors}`);function p(){t.forIn("key",s,(y)=>{if(!c.length&&!d.length)b(y);else t.if(h(y),()=>b(y))})}function h(y){let v;if(c.length>8){let j=mc.schemaRefOrVal(o,n.properties,"properties");v=pc.isOwnProperty(t,j,y)}else if(c.length)v=Rr.or(...c.map((j)=>Rr._`${y} === ${j}`));else v=Rr.nil;if(d.length)v=Rr.or(v,...d.map((j)=>Rr._`${pc.usePattern(e,j)}.test(${y})`));return Rr.not(v)}function m(y){t.code(Rr._`delete ${s}[${y}]`)}function b(y){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){m(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!mc.alwaysValidSchema(o,r)){let v=t.name("valid");if(l.removeAdditional==="failing")g(y,v,!1),t.if(Rr.not(v),()=>{e.reset(),m(y)});else if(g(y,v),!a)t.if(Rr.not(v),()=>t.break())}}function g(y,v,j){let S={keyword:"additionalProperties",dataProp:y,dataPropType:mc.Type.Str};if(j===!1)Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(S,v)}}};$_.default=c4});var E_=C(function(S_){Object.defineProperty(S_,"__esModule",{value:!0});var d4=wi(),w_=yr(),hp=we(),v_=mp(),f4={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;if(i.opts.removeAdditional==="all"&&n.additionalProperties===void 0)v_.default.code(new d4.KeywordCxt(i,v_.default,"additionalProperties"));let o=w_.allSchemaProperties(r);for(let p of o)i.definedProperties.add(p);if(i.opts.unevaluated&&o.length&&i.props!==!0)i.props=hp.mergeEvaluated.props(t,hp.toHash(o),i.props);let a=o.filter((p)=>!hp.alwaysValidSchema(i,r[p]));if(a.length===0)return;let l=t.name("valid");for(let p of a){if(c(p))d(p);else{if(t.if(w_.propertyInData(t,s,p,i.opts.ownProperties)),d(p),!i.allErrors)t.else().var(l,!0);t.endIf()}e.it.definedProperties.add(p),e.ok(l)}function c(p){return i.opts.useDefaults&&!i.compositeRule&&r[p].default!==void 0}function d(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},l)}}};S_.default=f4});var R_=C(function(k_){Object.defineProperty(k_,"__esModule",{value:!0});var __=yr(),hc=ye(),P_=we(),j_=we(),m4={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,a=__.allSchemaProperties(r),l=a.filter((g)=>P_.alwaysValidSchema(i,r[g]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&s.properties,d=t.name("valid");if(i.props!==!0&&!(i.props instanceof hc.Name))i.props=j_.evaluatedPropsToName(t,i.props);let{props:p}=i;h();function h(){for(let g of a){if(c)m(g);if(i.allErrors)b(g);else t.var(d,!0),b(g),t.if(d)}}function m(g){for(let y in c)if(new RegExp(g).test(y))P_.checkStrictMode(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function b(g){t.forIn("key",n,(y)=>{t.if(hc._`${__.usePattern(e,g)}.test(${y})`,()=>{let v=l.includes(g);if(!v)e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:j_.Type.Str},d);if(i.opts.unevaluated&&p!==!0)t.assign(hc._`${p}[${y}]`,!0);else if(!v&&!i.allErrors)t.if(hc.not(d),()=>t.break())})})}}};k_.default=m4});var O_=C(function(A_){Object.defineProperty(A_,"__esModule",{value:!0});var g4=we(),y4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(g4.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};A_.default=y4});var T_=C(function(C_){Object.defineProperty(C_,"__esModule",{value:!0});var x4=yr(),$4={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:x4.validateUnion,error:{message:"must match a schema in anyOf"}};C_.default=$4});var I_=C(function(N_){Object.defineProperty(N_,"__esModule",{value:!0});var gc=ye(),w4=we(),S4={message:"must match exactly one schema in oneOf",params:({params:e})=>gc._`{passingSchemas: ${e.passing}}`},E4={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:S4,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=r,o=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(c),e.result(o,()=>e.reset(),()=>e.error(!0));function c(){i.forEach((d,p)=>{let h;if(w4.alwaysValidSchema(s,d))t.var(l,!0);else h=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},l);if(p>0)t.if(gc._`${l} && ${o}`).assign(o,!1).assign(a,gc._`[${a}, ${p}]`).else();t.if(l,()=>{if(t.assign(o,!0),t.assign(a,p),h)e.mergeEvaluated(h,gc.Name)})})}}};N_.default=E4});var J_=C(function(M_){Object.defineProperty(M_,"__esModule",{value:!0});var P4=we(),j4={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((i,o)=>{if(P4.alwaysValidSchema(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(a)})}};M_.default=j4});var q_=C(function(F_){Object.defineProperty(F_,"__esModule",{value:!0});var yc=ye(),L_=we(),R4={message:({params:e})=>yc.str`must match "${e.ifClause}" schema`,params:({params:e})=>yc._`{failingKeyword: ${e.ifClause}}`},A4={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:R4,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)L_.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=D_(n,"then"),i=D_(n,"else");if(!s&&!i)return;let o=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),s&&i){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,c("then",d),c("else",d))}else if(s)t.if(a,c("then"));else t.if(yc.not(a),c("else"));e.pass(o,()=>e.error(!0));function l(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function c(d,p){return()=>{let h=e.subschema({keyword:d},a);if(t.assign(o,a),e.mergeValidEvaluated(h,o),p)t.assign(p,yc._`${d}`);else e.setParams({ifClause:d})}}}};function D_(e,t){let r=e.schema[t];return r!==void 0&&!L_.alwaysValidSchema(e,r)}F_.default=A4});var V_=C(function(H_){Object.defineProperty(H_,"__esModule",{value:!0});var C4=we(),T4={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)C4.checkStrictMode(r,`"${e}" without "if" is ignored`)}};H_.default=T4});var gp=C(function(W_){Object.defineProperty(W_,"__esModule",{value:!0});var I4=dp(),M4=o_(),J4=fp(),D4=c_(),L4=d_(),F4=fc(),q4=x_(),H4=mp(),V4=E_(),W4=R_(),B4=O_(),U4=T_(),z4=I_(),G4=J_(),K4=q_(),Y4=V_();function X4(e=!1){let t=[B4.default,U4.default,z4.default,G4.default,K4.default,Y4.default,q4.default,H4.default,F4.default,V4.default,W4.default];if(e)t.push(M4.default,D4.default);else t.push(I4.default,J4.default);return t.push(L4.default),t}W_.default=X4});var bp=C(function(z_){Object.defineProperty(z_,"__esModule",{value:!0});z_.dynamicAnchor=void 0;var yp=ye(),Q4=gr(),B_=Bo(),eW=oc(),tW={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>U_(e,e.schema)};function U_(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=yp._`${Q4.default.dynamicAnchors}${yp.getProperty(t)}`,i=n.errSchemaPath==="#"?n.validateName:rW(e);r.if(yp._`!${s}`,()=>r.assign(s,i))}z_.dynamicAnchor=U_;function rW(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:s,baseId:i,localRefs:o,meta:a}=t.root,{schemaId:l}=n.opts,c=new B_.SchemaEnv({schema:r,schemaId:l,root:s,baseId:i,localRefs:o,meta:a});return B_.compileSchema.call(n,c),eW.getValidate(e,c)}z_.default=tW});var xp=C(function(Z_){Object.defineProperty(Z_,"__esModule",{value:!0});Z_.dynamicRef=void 0;var Y_=ye(),sW=gr(),K_=oc(),iW={keyword:"$dynamicRef",schemaType:"string",code:(e)=>X_(e,e.schema)};function X_(e,t){let{gen:r,keyword:n,it:s}=e;if(t[0]!=="#")throw Error(`"${n}" only supports hash fragment reference`);let i=t.slice(1);if(s.allErrors)o();else{let l=r.let("valid",!1);o(l),e.ok(l)}function o(l){if(s.schemaEnv.root.dynamicAnchors[i]){let c=r.let("_v",Y_._`${sW.default.dynamicAnchors}${Y_.getProperty(i)}`);r.if(c,a(c,l),a(s.validateName,l))}else a(s.validateName,l)()}function a(l,c){return c?()=>r.block(()=>{K_.callRef(e,l),r.let(c,!0)}):()=>K_.callRef(e,l)}}Z_.dynamicRef=X_;Z_.default=iW});var tP=C(function(eP){Object.defineProperty(eP,"__esModule",{value:!0});var aW=bp(),lW=we(),cW={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)aW.dynamicAnchor(e,"");else lW.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};eP.default=cW});var nP=C(function(rP){Object.defineProperty(rP,"__esModule",{value:!0});var dW=xp(),fW={keyword:"$recursiveRef",schemaType:"string",code:(e)=>dW.dynamicRef(e,e.schema)};rP.default=fW});var iP=C(function(sP){Object.defineProperty(sP,"__esModule",{value:!0});var mW=bp(),hW=xp(),gW=tP(),yW=nP(),bW=[mW.default,hW.default,gW.default,yW.default];sP.default=bW});var lP=C(function(aP){Object.defineProperty(aP,"__esModule",{value:!0});var oP=fc(),$W={keyword:"dependentRequired",type:"object",schemaType:"object",error:oP.error,code:(e)=>oP.validatePropertyDeps(e)};aP.default=$W});var uP=C(function(cP){Object.defineProperty(cP,"__esModule",{value:!0});var wW=fc(),SW={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>wW.validateSchemaDeps(e)};cP.default=SW});var fP=C(function(dP){Object.defineProperty(dP,"__esModule",{value:!0});var _W=we(),PW={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)_W.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};dP.default=PW});var mP=C(function(pP){Object.defineProperty(pP,"__esModule",{value:!0});var kW=lP(),RW=uP(),AW=fP(),OW=[kW.default,RW.default,AW.default];pP.default=OW});var yP=C(function(gP){Object.defineProperty(gP,"__esModule",{value:!0});var Yn=ye(),hP=we(),TW=gr(),NW={message:"must NOT have unevaluated properties",params:({params:e})=>Yn._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},IW={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:NW,code(e){let{gen:t,schema:r,data:n,errsCount:s,it:i}=e;if(!s)throw Error("ajv implementation error");let{allErrors:o,props:a}=i;if(a instanceof Yn.Name)t.if(Yn._`${a} !== true`,()=>t.forIn("key",n,(p)=>t.if(c(a,p),()=>l(p))));else if(a!==!0)t.forIn("key",n,(p)=>a===void 0?l(p):t.if(d(a,p),()=>l(p)));i.props=!0,e.ok(Yn._`${s} === ${TW.default.errors}`);function l(p){if(r===!1){if(e.setParams({unevaluatedProperty:p}),e.error(),!o)t.break();return}if(!hP.alwaysValidSchema(i,r)){let h=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:hP.Type.Str},h),!o)t.if(Yn.not(h),()=>t.break())}}function c(p,h){return Yn._`!${p} || !${p}[${h}]`}function d(p,h){let m=[];for(let b in p)if(p[b]===!0)m.push(Yn._`${h} !== ${b}`);return Yn.and(...m)}}};gP.default=IW});var $P=C(function(xP){Object.defineProperty(xP,"__esModule",{value:!0});var Ts=ye(),bP=we(),JW={message:({params:{len:e}})=>Ts.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Ts._`{limit: ${e}}`},DW={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:JW,code(e){let{gen:t,schema:r,data:n,it:s}=e,i=s.items||0;if(i===!0)return;let o=t.const("len",Ts._`${n}.length`);if(r===!1)e.setParams({len:i}),e.fail(Ts._`${o} > ${i}`);else if(typeof r=="object"&&!bP.alwaysValidSchema(s,r)){let l=t.var("valid",Ts._`${o} <= ${i}`);t.if(Ts.not(l),()=>a(l,i)),e.ok(l)}s.items=!0;function a(l,c){t.forRange("i",c,o,(d)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:bP.Type.Num},l),!s.allErrors)t.if(Ts.not(l),()=>t.break())})}}};xP.default=DW});var wP=C(function(vP){Object.defineProperty(vP,"__esModule",{value:!0});var FW=yP(),qW=$P(),HW=[FW.default,qW.default];vP.default=HW});var EP=C(function(SP){Object.defineProperty(SP,"__esModule",{value:!0});var rt=ye(),WW={message:({schemaCode:e})=>rt.str`must match format "${e}"`,params:({schemaCode:e})=>rt._`{format: ${e}}`},BW={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:WW,code(e,t){let{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=e,{opts:l,errSchemaPath:c,schemaEnv:d,self:p}=a;if(!l.validateFormats)return;if(s)h();else m();function h(){let b=r.scopeValue("formats",{ref:p.formats,code:l.code.formats}),g=r.const("fDef",rt._`${b}[${o}]`),y=r.let("fType"),v=r.let("format");r.if(rt._`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,rt._`${g}.type || "string"`).assign(v,rt._`${g}.validate`),()=>r.assign(y,rt._`"string"`).assign(v,g)),e.fail$data(rt.or(j(),S()));function j(){if(l.strictSchema===!1)return rt.nil;return rt._`${o} && !${v}`}function S(){let P=d.$async?rt._`(${g}.async ? await ${v}(${n}) : ${v}(${n}))`:rt._`${v}(${n})`,E=rt._`(typeof ${v} == "function" ? ${P} : ${v}.test(${n}))`;return rt._`${v} && ${v} !== true && ${y} === ${t} && !${E}`}}function m(){let b=p.formats[i];if(!b){j();return}if(b===!0)return;let[g,y,v]=S(b);if(g===t)e.pass(P());function j(){if(l.strictSchema===!1){p.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${i}" ignored in schema at path "${c}"`}}function S(E){let O=E instanceof RegExp?rt.regexpCode(E):l.code.formats?rt._`${l.code.formats}${rt.getProperty(i)}`:void 0,R=r.scopeValue("formats",{key:i,ref:E,code:O});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,rt._`${R}.validate`];return["string",E,R]}function P(){if(typeof b=="object"&&!(b instanceof RegExp)&&b.async){if(!d.$async)throw Error("async format in sync schema");return rt._`await ${v}(${n})`}return typeof y=="function"?rt._`${v}(${n})`:rt._`${v}.test(${n})`}}}};SP.default=BW});var $p=C(function(_P){Object.defineProperty(_P,"__esModule",{value:!0});var zW=EP(),GW=[zW.default];_P.default=GW});var vp=C(function(PP){Object.defineProperty(PP,"__esModule",{value:!0});PP.contentVocabulary=PP.metadataVocabulary=void 0;PP.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];PP.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var AP=C(function(RP){Object.defineProperty(RP,"__esModule",{value:!0});var XW=op(),ZW=cp(),QW=gp(),eB=iP(),tB=mP(),rB=wP(),nB=$p(),kP=vp(),sB=[eB.default,XW.default,ZW.default,(0,QW.default)(!0),nB.default,kP.metadataVocabulary,kP.contentVocabulary,tB.default,rB.default];RP.default=sB});var NP=C(function(CP){Object.defineProperty(CP,"__esModule",{value:!0});CP.DiscrError=void 0;var OP;(function(e){e.Tag="tag",e.Mapping="mapping"})(OP||(CP.DiscrError=OP={}))});var Sp=C(function(MP){Object.defineProperty(MP,"__esModule",{value:!0});var ji=ye(),wp=NP(),IP=Bo(),oB=Si(),aB=we(),lB={message:({params:{discrError:e,tagName:t}})=>e===wp.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>ji._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},cB={keyword:"discriminator",type:"object",schemaType:"object",error:lB,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:i}=e,{oneOf:o}=s;if(!i.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 l=t.let("valid",!1),c=t.const("tag",ji._`${r}${ji.getProperty(a)}`);t.if(ji._`typeof ${c} == "string"`,()=>d(),()=>e.error(!1,{discrError:wp.DiscrError.Tag,tag:c,tagName:a})),e.ok(l);function d(){let m=h();t.if(!1);for(let b in m)t.elseIf(ji._`${c} === ${b}`),t.assign(l,p(m[b]));t.else(),e.error(!1,{discrError:wp.DiscrError.Mapping,tag:c,tagName:a}),t.endIf()}function p(m){let b=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:m},b);return e.mergeEvaluated(g,ji.Name),b}function h(){var m;let b={},g=v(s),y=!0;for(let P=0;P<o.length;P++){let E=o[P];if((E===null||E===void 0?void 0:E.$ref)&&!aB.schemaHasRulesButRef(E,i.self.RULES)){let R=E.$ref;if(E=IP.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,R),E instanceof IP.SchemaEnv)E=E.schema;if(E===void 0)throw new oB.default(i.opts.uriResolver,i.baseId,R)}let O=(m=E===null||E===void 0?void 0:E.properties)===null||m===void 0?void 0:m[a];if(typeof O!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||v(E)),j(O,P)}if(!y)throw Error(`discriminator: "${a}" must be required`);return b;function v({required:P}){return Array.isArray(P)&&P.includes(a)}function j(P,E){if(P.const)S(P.const,E);else if(P.enum)for(let O of P.enum)S(O,E);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function S(P,E){if(typeof P!="string"||P in b)throw Error(`discriminator: "${a}" values must be unique strings`);b[P]=E}}}};MP.default=cB});var JP=C(function(bQ,dB){dB.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 DP=C(function(xQ,fB){fB.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 LP=C(function($Q,pB){pB.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 FP=C(function(vQ,mB){mB.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 qP=C(function(wQ,hB){hB.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 HP=C(function(SQ,gB){gB.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 VP=C(function(EQ,yB){yB.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 WP=C(function(_Q,bB){bB.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 UP=C(function(BP){Object.defineProperty(BP,"__esModule",{value:!0});var xB=JP(),$B=DP(),vB=LP(),wB=FP(),SB=qP(),EB=HP(),_B=VP(),PB=WP(),jB=["/properties"];function kB(e){return[xB,$B,vB,wB,SB,t(this,EB),_B,t(this,PB)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,jB):n}}BP.default=kB});var Pp=C(function(Yt,_p){Object.defineProperty(Yt,"__esModule",{value:!0});Yt.MissingRefError=Yt.ValidationError=Yt.CodeGen=Yt.Name=Yt.nil=Yt.stringify=Yt.str=Yt._=Yt.KeywordCxt=Yt.Ajv2020=void 0;var AB=ip(),OB=AP(),CB=Sp(),TB=UP(),Ep="https://json-schema.org/draft/2020-12/schema";class na extends AB.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),OB.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(CB.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;TB.default.call(this,e),this.refs["http://json-schema.org/schema"]=Ep}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ep)?Ep:void 0)}}Yt.Ajv2020=na;_p.exports=Yt=na;_p.exports.Ajv2020=na;Object.defineProperty(Yt,"__esModule",{value:!0});Yt.default=na;var NB=wi();Object.defineProperty(Yt,"KeywordCxt",{enumerable:!0,get:function(){return NB.KeywordCxt}});var ki=ye();Object.defineProperty(Yt,"_",{enumerable:!0,get:function(){return ki._}});Object.defineProperty(Yt,"str",{enumerable:!0,get:function(){return ki.str}});Object.defineProperty(Yt,"stringify",{enumerable:!0,get:function(){return ki.stringify}});Object.defineProperty(Yt,"nil",{enumerable:!0,get:function(){return ki.nil}});Object.defineProperty(Yt,"Name",{enumerable:!0,get:function(){return ki.Name}});Object.defineProperty(Yt,"CodeGen",{enumerable:!0,get:function(){return ki.CodeGen}});var IB=Vo();Object.defineProperty(Yt,"ValidationError",{enumerable:!0,get:function(){return IB.default}});var MB=Si();Object.defineProperty(Yt,"MissingRefError",{enumerable:!0,get:function(){return MB.default}})});import{existsSync as xc,readFileSync as LB}from"node:fs";import{createRequire as zP}from"node:module";import{isAbsolute as FB,relative as qB,resolve as bc}from"node:path";import{fileURLToPath as GP,pathToFileURL as HB}from"node:url";function sa(e){return JSON.parse(LB(e,"utf8"))}async function KP(e){let t=bc(e),r=bc(t,"project.json"),n=bc(t,"project.schema.json");if(!xc(r))throw Error(`project.json not found in ${t}`);if(!xc(n))throw Error(`project.schema.json not found in ${t} — run \`jx schema\` to generate it from `+"project.json#/extensions");let s=sa(r),i=sa(n);i.$id=HB(n).href;let o;try{({default:o}=await Promise.resolve().then(() => kt(Pp(),1)))}catch(d){throw Error("Project validation requires ajv: bun add ajv",{cause:d})}let l=await new o({allErrors:!0,loadSchema:(d)=>VB(d,t),strict:!1}).compileAsync(i),c=l(s);return{errors:l.errors??null,valid:c}}async function VB(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=GP(e),n=qB(t,r);if(n.startsWith("..")||FB(n))throw Error(`Schema ref "${e}" escapes the project root ${t}`);if(xc(r))return sa(r);let s=n.split("\\").join("/"),i="node_modules/",o=s.lastIndexOf(i);if(o===-1)throw Error(`Schema ref "${e}" does not exist`);let a=s.slice(o+i.length),l;try{l=zP(bc(t,"package.json")).resolve(a)}catch{try{l=zP(import.meta.url).resolve(a)}catch(c){if(a.startsWith("@jxsuite/schema/")){let p=GP(new URL(`../${a.slice(16)}`,import.meta.url));if(xc(p))return sa(p)}throw Error(`Schema ref "${e}" does not exist and "${a}" is not resolvable from the project or the host`,{cause:c})}}return sa(l)}var YP=()=>{};function Kr(e){return ee(e.attributes)?e.attributes:{}}function _t(e,t){let r=Kr(e)[t];return N(r)?r:null}function nt(e){return N(e.tagName)?e.tagName.toLowerCase():""}function Mt(e,t="the popover"){let r=N(e.id)?e.id:_t(e,"id");if(r)return`#${r}`;let n=nt(e);return n===""?t:`the <${n}>`}function UB(e){let t=Kr(e).popover;return N(t)?t:null}function ZP(e){let t=new Set,r=new Set;for(let n of e){let s=n!==null&&N(n.tagName)?n.tagName:"";if(n===null||!s.includes("-"))continue;if(jp(n))t.add(s);let i=n.observedAttributes;if(Array.isArray(i)&&zB.every((o)=>i.includes(o)))r.add(s)}return{invokerTags:r,popoverTags:t}}function jp(e){return"popover"in Kr(e)||"popover"in e}function ia(e,t){return jp(e)||(t?.popoverTags?.has(nt(e))??!1)}function Xn(e){if(N(e.id)&&e.id!=="")return e.id;let t=_t(e,"id");return t===""?null:t}function*Gr(e,t=[],r=null,n){yield{enclosing:r,node:e,path:t};let s=ia(e,n)?e:r,{children:i}=e;if(Array.isArray(i)){for(let[l,c]of i.entries())if(F(c))yield*Gr(c,[...t,"children",l],s,n)}else if(ee(i)&&Ft(i.map))yield*Gr(i.map,[...t,"children","map"],s,n);let o=Ft(e.map)?e.map:null;if(o)yield*Gr(o,[...t,"map"],s,n);let a=ee(e.cases)?e.cases:{};for(let[l,c]of Object.entries(a))if(F(c))yield*Gr(c,[...t,"cases",l],s,n)}function kp(e,t){let r=[];for(let{node:n}of Gr(e,[],null,t)){if(!ia(n,t))continue;let s=Xn(n);if(s!==null&&!r.includes(s))r.push(s)}return r}function $c(e){return e.startsWith("@")}function QP(e){return e.startsWith(":")||e.startsWith("&")||e.startsWith(".")||e.startsWith("[")}function It(e,t){let r=e?.[t];if(r===void 0||ss(r)||Array.isArray(r))return null;return String(r)}function ej(e){for(let[t,r]of Object.entries(e??{})){if(!ss(r))continue;if(QP(t)&&t.includes(":popover-open")&&It(r,"display")!==null)return!0;if($c(t)&&ej(r))return!0}return!1}function tj(e){for(let[t,r]of Object.entries(e??{})){if(!ss(r))continue;if(QP(t)&&t.includes(":popover-open"))return!0;if($c(t)&&tj(r))return!0}return!1}function KB(e){return GB.some((t)=>It(e,t)!==null)}function YB(e){if(!e)return[];let t=[];for(let[r,n]of Object.entries(e))if($c(r)&&ss(n)&&It(n,"display")!==null)t.push(r);return t}function rj(e){if(!e)return[];let t=[],r=It(e,"transition");if(r!==null)t.push(r);for(let[n,s]of Object.entries(e))if($c(n)&&ss(s))t.push(...rj(s));return t}function XB(e){if(!e)return!1;if(It(e,"positionAnchor")!==null||It(e,"position-anchor")!==null)return!0;return["top","left","right","bottom","inset","insetBlockStart","insetInlineStart"].some((t)=>(It(e,t)??"").includes("anchor("))}function ZB(e){if(!e)return!1;if(It(e,"positionArea")!==null||It(e,"position-area")!==null||It(e,"positionTryFallbacks")!==null||It(e,"position-try-fallbacks")!==null)return!0;return Object.keys(e).some((t)=>t.startsWith("@supports"))}function nj(e,t){let r=[...Gr(e,[],null,t)],n=kp(e,t),s=r.some(({node:a})=>ia(a,t)),i=new Set;for(let{node:a}of r)if(XP.has(nt(a))){let l=_t(a,"popovertarget");if(l!==null)i.add(l)}let o=[];for(let{enclosing:a,node:l,path:c}of r)if(o.push(...QB(l,c,a,n,s,t)),jp(l))o.push(...eU(l,c,i));return o}function QB(e,t,r,n,s,i){let o=[],a=nt(e),l=_t(e,"popovertarget"),c=XP.has(a)||(i?.invokerTags?.has(a)??!1);if(l!==null&&!c)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. ${Ve}`,fix:"invoker",message:`<${a||"element"}> carries popovertarget, which only <button> and <input> support.`,path:t,rule:"invoker-not-button",severity:"error"}),o;if(l!==null){if(s&&!n.includes(l)){let d=n.length>0?`The popovers here are: ${n.map((p)=>`"${p}"`).join(", ")}. `:"";o.push({detail:`No element in this document declares \`popover\` with the id "${l}". ${d}A target that names nothing does nothing, silently. ${Ve}`,message:`popovertarget="${l}" names no popover in this document.`,path:t,rule:"target-missing",severity:"error"})}else if(r!==null&&Xn(r)!==null&&Xn(r)!==l)o.push({detail:`This control is inside ${Mt(r)} but targets "${l}". 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. ${Ve}`,message:`A control inside ${Mt(r)} targets "${l}" instead.`,path:t,rule:"target-mismatch",severity:"warn"})}if(a==="a"&&r!==null&&l===null){let d=_t(e,"href")??(N(e.href)?e.href:null),p=_t(e,"target")==="_blank",h=d!==null&&d.includes("#");if(p||h){let m=p?"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. ${Ve}`,message:`A link inside ${Mt(r)} does not dismiss it.`,path:t,rule:"link-does-not-dismiss",severity:"warn"})}}return o}function eU(e,t,r){let n=[],{style:s}=e,i=Mt(e),o=UB(e);if(o!==null&&o!==""&&!BB.some((c)=>c===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". ${Ve}`,fix:"mode",message:`${i} declares popover="${o}", which is not one of auto, manual or hint.`,path:t,rule:"invalid-mode",severity:"error"});else if($t(Kr(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". ${Ve}`,fix:"mode",message:`${i} writes popover as a boolean.`,path:t,rule:"invalid-mode",severity:"error"});let a=It(s,"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. ${Ve}`,fix:"display",message:`${i} sets display in its base rule.`,path:t,rule:"base-display",severity:"error"});for(let c of YB(s))n.push({detail:`The same defect as a base \`display\`, arriving through \`${c}\` 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. ${Ve}`,fix:"display",message:`${i} sets display inside ${c}.`,path:t,rule:"breakpoint-display",severity:"error"});if(It(s,"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. ${Ve}`,fix:"display",message:`${i} also hides itself with visibility.`,path:t,rule:"base-visibility",severity:"warn"});if(!tj(s))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. ${Ve}`,message:`${i} has no :popover-open rule.`,path:t,rule:"no-open-rule",severity:"warn"});else if(!ej(s)&&a===null&&KB(s))n.push({detail:`${i} 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\`. ${Ve}`,fix:"open-display",message:`${i} is laid out with flex or grid but never sets display.`,path:t,rule:"no-open-display",severity:"error"});for(let c of rj(s))if(c.includes("display")&&!c.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. ${Ve}`,message:`${i} transitions display but not overlay.`,path:t,rule:"cut-exit",severity:"warn"});break}if(XB(s)&&!ZB(s))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. ${Ve}`,message:`${i} is anchor-positioned with no fallback.`,path:t,rule:"unsafe-anchor",severity:"warn"});let l=Xn(e);if(l!==null&&!r.has(l))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. ${Ve}`,message:`${i} has no invoker in this document.`,path:t,rule:"no-invoker",severity:"warn"});return n}var BB,XP,zB,GB,Ve="See docs/framework/concepts/overlays.";var vc=q(()=>{ve();BB=["auto","manual","hint"],XP=new Set(["button","input"]);zB=["popovertarget","popovertargetaction","command","commandfor"];GB=["flexDirection","flex-direction","alignItems","align-items","justifyContent","justify-content","flexWrap","flex-wrap","gridTemplateColumns","grid-template-columns","gridTemplateRows","grid-template-rows","gap"]});function Ci(e,t){let r=Kr(e),n=t in r?r[t]:e[t];if(n===void 0||n===null)return{kind:"absent"};if(Ce(n)||ee(n))return{kind:"bound"};if(N(n))return n.includes("${")?{kind:"bound"}:{kind:"text",text:n};return{isTrue:n===!0,kind:"other"}}function Ai(e,t){let r=Ci(e,t);return r.kind==="text"&&r.text.trim()!==""?r.text:null}function Pt(e,t){return Ci(e,t).kind!=="absent"}function Zn(e){let t=Ci(e,"role");if(t.kind==="bound")return Oi;return t.kind==="text"?t.text.trim().toLowerCase().split(/\s+/)[0]:null}function wc(e){let t=Ci(e,"id");if(t.kind==="bound")return Oi;return t.kind==="text"&&t.text!==""?t.text:null}function xr(e,t){let r=Ci(e,t);return r.kind==="bound"||r.kind==="text"&&r.text.trim()!==""}function Sc(e){let t=e.textContent;if(N(t)){if(t.trim()!=="")return!0}else if(t!==void 0&&t!==null)return!0;if(xr(e,"aria-label")||Pt(e,"aria-labelledby"))return!0;if(nt(e)==="img"&&(xr(e,"alt")||xr(e,"title")))return!0;if(nt(e)==="slot")return!0;let{children:r}=e;if(Array.isArray(r)){for(let s of r)if(N(s)){if(s.trim()!=="")return!0}else if(F(s)&&Sc(s))return!0}else if(r!=null)return!0;if(ee(e.map))return!0;return(ee(e.cases)?Object.values(e.cases):[]).some((s)=>Ft(s)&&Sc(s))}function*Ri(e,t=[],r=[],n=[]){yield{node:e,path:t,roles:r,tags:n};let s=[...r,Zn(e)],i=[...n,nt(e)],{children:o}=e;if(Array.isArray(o)){for(let[a,l]of o.entries())if(F(l))yield*Ri(l,[...t,"children",a],s,i)}else if(ee(o)&&Ft(o.map))yield*Ri(o.map,[...t,"children","map"],s,i);if(Ft(e.map))yield*Ri(e.map,[...t,"map"],s,i);if(ee(e.cases)){for(let[a,l]of Object.entries(e.cases))if(F(l))yield*Ri(l,[...t,"cases",a],s,i)}}function oU(e){return e.some((t)=>t.includes("-"))}function Yr(e,t,r,n,s,i="error"){return{criterion:s,detail:`${n} ${tU}`,message:r,path:t,rule:e,severity:i}}function sj(e,t,r){if(r.includes("label"))return!0;if(e===Oi||t.bound)return!0;return e!==null&&t.ids.has(e)}function aU(e,t){let{node:r,path:n,tags:s}=e,i=nt(r),o=Zn(r);if(o==="bound")return null;if(xr(r,"aria-label")||Pt(r,"aria-labelledby")||xr(r,"title"))return null;let l=Mt(r,"the control"),c=(p)=>Yr("interactive-unnamed",n,`${l} has no accessible name.`,`A control with no name is announced as its role alone, so a reader hears "button" and nothing else. ${p}`,"4.1.2"),d=lU(r,i,t,s);if(d==="named"||d==="exempt")return null;if(o!==null&&rU.has(o))return Sc(r)?null:c("Give it text content, or an aria-label.");if(o!==null&&nU.has(o))return c("Give it an aria-label, or aria-labelledby naming its visible label.");if(o!==null)return null;if(i==="button"||i==="summary"||i==="a"&&Pt(r,"href"))return Sc(r)?null:c("Give it text content, or an aria-label.");if(d==="unnamed")return c("Give it a <label for> naming its id, or an aria-label.");if(d==="unnamed-value")return c("Give it a value, or an aria-label.");if(d==="unnamed-alt")return c("Give it an alt, or an aria-label.");return null}function lU(e,t,r,n){if(t==="area"){if(!Pt(e,"href"))return"none";return xr(e,"alt")?"named":"unnamed-alt"}if(t==="select"||t==="textarea")return sj(wc(e),r,n)||xr(e,"placeholder")?"named":"unnamed";if(t!=="input")return"none";let s=(Ai(e,"type")??"text").toLowerCase();if(s==="hidden"||Pt(e,"type")&&Ai(e,"type")===null)return"exempt";if(sU.has(s))return xr(e,"value")?"named":"unnamed-value";if(s==="image")return xr(e,"alt")?"named":"unnamed-alt";return sj(wc(e),r,n)||xr(e,"placeholder")?"named":"unnamed"}function uU(e){let{node:t,path:r,tags:n}=e,s=nt(t);if(!s.includes("-")||!n.some((i)=>cU.has(i)))return null;return Yr("custom-element-in-select",r,`<${s}> 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 dU(e){let{node:t,path:r}=e;if(nt(t)!=="img")return null;let n=Zn(t);if(n==="bound"||n==="presentation"||n==="none")return null;if(Pt(t,"alt")||xr(t,"aria-label")||Pt(t,"aria-labelledby"))return null;return Yr("img-alt-missing",r,`${Mt(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 pU(e,t){let{node:r,path:n}=e,s=[];for(let i of fU){let o=Ai(r,i);if(o===null)continue;for(let a of o.split(/\s+/))if(a!==""&&!t.has(a))s.push(Yr("aria-target-missing",n,`${Mt(r,"the element")} points ${i} 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 s}function mU(e,t,r){for(let n of ij.get(t)??[]){let s=r.get(n);if(s===void 0)continue;if(s.bound)return!0;if(e===Oi&&s.ids.size>0)return!0;if(e!==null&&e!==Oi&&s.ids.has(e))return!0}return!1}function hU(e,t){let{node:r,path:n,roles:s,tags:i}=e,o=Zn(r);if(o===null||o==="bound"||n.length===0||oU(i))return null;if(s.includes("bound")||mU(wc(r),o,t))return null;let a=Mt(r,"the element");if(o==="tab"&&!s.includes("tablist"))return Yr("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")&&!s.includes("menu")&&!s.includes("menubar"))return Yr("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"&&!s.includes("listbox")&&!i.includes("select")&&!i.includes("datalist"))return Yr("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 gU(e){let t=[];for(let{node:r}of Ri(e)){if(Zn(r)!=="tab")continue;let n=Ci(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 yU(e){let{node:t,path:r}=e;if(Zn(t)!=="tablist")return null;let n=gU(t);if(n===null||n.length===0||n.includes(!0))return null;return Yr("tablist-none-selected",r,`${Mt(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 bU(e){let{node:t,path:r}=e,n=Zn(t);if(!(nt(t)==="dialog"||n==="dialog"||n==="alertdialog")||n==="bound")return null;if(xr(t,"aria-label")||Pt(t,"aria-labelledby"))return null;return Yr("dialog-unnamed",r,`${Mt(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 $U(e){let{node:t,path:r}=e;if(!Pt(t,"aria-activedescendant"))return null;let n=nt(t);if(xU.has(n)||n==="a"&&Pt(t,"href")||Pt(t,"tabIndex")||Pt(t,"tabindex")||Pt(t,"contenteditable"))return null;return Yr("activedescendant-not-focusable",r,`${Mt(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 oj(e){let t=[...Ri(e)],r=new Set,n={bound:!1,ids:new Set},s=new Map,i=!1;for(let{node:a}of t){let l=Zn(a);if(l!==null&&iU.has(l)){let d=s.get(l)??{bound:!1,ids:new Set},p=Ai(a,"aria-owns");if(p===null)d.bound||=Pt(a,"aria-owns");else for(let h of p.split(/\s+/))if(h!=="")d.ids.add(h);s.set(l,d)}let c=wc(a);if(c===Oi)i=!0;else if(c!==null)r.add(c);if(nt(a)==="label"){let d=Ai(a,"for")??Ai(a,"htmlFor");if(d===null)n.bound||=Pt(a,"for")||Pt(a,"htmlFor");else n.ids.add(d)}}let o=[];for(let a of t){let l=[aU(a,n),dU(a),hU(a,s),uU(a),yU(a),bU(a),$U(a)];for(let c of l)if(c)o.push(c);if(!i)o.push(...pU(a,r))}return o}var tU="See docs/framework/concepts/accessibility.",Oi="bound",rU,nU,sU,ij,iU,cU,fU,xU;var aj=q(()=>{ve();vc();rU=new Set(["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab","treeitem"]),nU=new Set(["combobox","listbox","searchbox","slider","spinbutton","textbox"]),sU=new Set(["button","reset","submit"]),ij=new Map([["menuitem",["menu","menubar"]],["menuitemcheckbox",["menu","menubar"]],["menuitemradio",["menu","menubar"]],["option",["listbox"]],["tab",["tablist"]]]),iU=new Set([...ij.values()].flat());cU=new Set(["select","jx-select"]);fU=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"];xU=new Set(["button","input","select","textarea"])});function Rp(e){return nt(e)==="dialog"}function lj(e){return e.startsWith("--")}function jU(e){let t=[];for(let{node:r}of Gr(e)){let n=Xn(r);if(Rp(r)&&n!==null&&!t.includes(n))t.push(n)}return t}function kU(e){let t=e.oncommand;return t!==void 0&&t!==null}function RU(e,t){for(let{node:r}of Gr(e)){if(r===e)continue;let n=nt(r);if(n==="button"){let s=_t(r,"command"),i=_t(r,"commandfor");if(s!==null&&(s==="close"||s==="request-close")&&(i===null||i===t))return!0}if(n==="form"&&_t(r,"method")?.toLowerCase()==="dialog")return!0}return!1}function uj(e,t){let r=[...Gr(e,[],null,t)],n=jU(e),s=kp(e,t),i=n.length>0||s.length>0,o=new Map,a=new Map;for(let{node:c}of r){let d=Xn(c);if(d!==null&&!o.has(d))o.set(d,c);if(nt(c)==="button"){let p=_t(c,"commandfor"),h=_t(c,"command");if(p!==null){let m=a.get(p)??new Set;m.add(h??""),a.set(p,m)}}}let l=[];for(let{node:c,path:d}of r)if(l.push(...AU(c,d,o,n,s,i,t)),Rp(c))l.push(...OU(c,d,a));return l}function AU(e,t,r,n,s,i,o){let a=[],l=nt(e),c=o?.invokerTags?.has(l)??!1,d=_t(e,"command"),p=_t(e,"commandfor");if(!(d!==null||p!==null||("command"in Kr(e))||("commandfor"in Kr(e))))return a;let m=Mt(e,"the element");if(!PU.has(l)&&!c)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. ${Ve}`,fix:"invoker",message:`<${l||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),a;if(d!==null&&!EU.has(d)&&!lj(d))return a.push({detail:`\`command\` is an enumerated attribute taking ${cj.map((b)=>`\`${b}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${Ve}`,message:`${m} declares command="${d}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),a;if(p!==null){let b=r.get(p),g=n.includes(p),y=s.includes(p);if(!b&&i){let v=[...n,...s].map((j)=>`"${j}"`).join(", ");return a.push({detail:`No element in this document has the id "${p}". The dialogs and popovers here are: ${v}. A commandfor that names nothing does nothing, silently. ${Ve}`,message:`commandfor="${p}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),a}if(d!==null&&b){if(vU.has(d)&&!Rp(b))a.push({detail:`\`${d}\` acts on a <dialog>, and "${p}" is ${y?"a popover":`a <${nt(b)||"element"}>`}. The click is ignored. ${y?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${Ve}`,message:`${m} sends ${d} to "${p}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(wU.has(d)&&!ia(b,o))a.push({detail:`\`${d}\` acts on a popover, and "${p}" is ${g?"a dialog":`a <${nt(b)||"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."} ${Ve}`,message:`${m} sends ${d} to "${p}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(lj(d)&&!kU(b))a.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${p}" 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. ${Ve}`,message:`${m} sends ${d} to "${p}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return a}function OU(e,t,r){let n=[],s=Mt(e,"the dialog"),i=Xn(e),{style:o}=e,a=_t(e,"closedby");if(a!==null&&!_U.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. ${Ve}`,message:`${s} declares closedby="${a}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if(It(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. ${Ve}`,fix:"display",message:`${s} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let l=i===null?void 0:r.get(i),c=_t(e,"open")!==null||Kr(e).open===!0||e.open===!0;if(i!==null&&!l?.has("show-modal")&&!c)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. ${Ve}`,message:`${s} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(l?.has("show-modal")&&a==="none"&&!RU(e,i))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"\`. ${Ve}`,message:`${s} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return n}var cj,vU,wU,SU,EU,_U,PU;var dj=q(()=>{ve();vc();cj=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],vU=new Set(["show-modal","close","request-close"]),wU=new Set(["toggle-popover","show-popover","hide-popover"]),SU=["any","closerequest","none"],EU=new Set(cj),_U=new Set(SU),PU=new Set(["button"])});var vj=C(function(xj){Object.defineProperty(xj,"__esModule",{value:!0});xj.formatNames=xj.fastFormats=xj.fullFormats=void 0;function Xr(e,t){return{validate:e,compare:t}}xj.fullFormats={date:Xr(hj,Tp),time:Xr(Op(!0),Np),"date-time":Xr(fj(!0),yj),"iso-time":Xr(Op(),gj),"iso-date-time":Xr(fj(),bj),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:JU,"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:WU,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:DU,int32:{type:"number",validate:qU},int64:{type:"number",validate:HU},float:{type:"number",validate:mj},double:{type:"number",validate:mj},password:!0,binary:!0};xj.fastFormats={...xj.fullFormats,date:Xr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Tp),time:Xr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Np),"date-time":Xr(/^\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,yj),"iso-time":Xr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,gj),"iso-date-time":Xr(/^\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,bj),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};xj.formatNames=Object.keys(xj.fullFormats);function CU(e){return e%4===0&&(e%100!==0||e%400===0)}var TU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,NU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function hj(e){let t=TU.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&CU(r)?29:NU[n])}function Tp(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var Ap=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Op(e){return function(r){let n=Ap.exec(r);if(!n)return!1;let s=+n[1],i=+n[2],o=+n[3],a=n[4],l=n[5]==="-"?-1:1,c=+(n[6]||0),d=+(n[7]||0);if(c>23||d>59||e&&!a)return!1;if(s<=23&&i<=59&&o<60)return!0;let p=i-d*l,h=s-c*l-(p<0?1:0);return(h===23||h===-1)&&(p===59||p===-1)&&o<61}}function Np(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 gj(e,t){if(!(e&&t))return;let r=Ap.exec(e),n=Ap.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 Cp=/t|\s/i;function fj(e){let t=Op(e);return function(n){let s=n.split(Cp);return s.length===2&&hj(s[0])&&t(s[1])}}function yj(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 bj(e,t){if(!(e&&t))return;let[r,n]=e.split(Cp),[s,i]=t.split(Cp),o=Tp(r,s);if(o===void 0)return;return o||Np(n,i)}var IU=/\/|:/,MU=/^(?:[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 JU(e){return IU.test(e)&&MU.test(e)}var pj=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function DU(e){return pj.lastIndex=0,pj.test(e)}var LU=-2147483648,FU=2147483647;function qU(e){return Number.isInteger(e)&&e<=FU&&e>=LU}function HU(e){return Number.isInteger(e)}function mj(){return!0}var VU=/[^\\]\\Z/;function WU(e){if(VU.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var Ej=C(function(Sj){Object.defineProperty(Sj,"__esModule",{value:!0});var UU=op(),zU=cp(),GU=gp(),KU=$p(),wj=vp(),YU=[UU.default,zU.default,(0,GU.default)(),KU.default,wj.metadataVocabulary,wj.contentVocabulary];Sj.default=YU});var _j=C(function(YQ,ZU){ZU.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 jj=C(function(Xt,Mp){Object.defineProperty(Xt,"__esModule",{value:!0});Xt.MissingRefError=Xt.ValidationError=Xt.CodeGen=Xt.Name=Xt.nil=Xt.stringify=Xt.str=Xt._=Xt.KeywordCxt=Xt.Ajv=void 0;var QU=ip(),e6=Ej(),t6=Sp(),Pj=_j(),r6=["/properties"],Ec="http://json-schema.org/draft-07/schema";class oa extends QU.default{_addVocabularies(){if(super._addVocabularies(),e6.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(t6.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Pj,r6):Pj;this.addMetaSchema(e,Ec,!1),this.refs["http://json-schema.org/schema"]=Ec}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ec)?Ec:void 0)}}Xt.Ajv=oa;Mp.exports=Xt=oa;Mp.exports.Ajv=oa;Object.defineProperty(Xt,"__esModule",{value:!0});Xt.default=oa;var n6=wi();Object.defineProperty(Xt,"KeywordCxt",{enumerable:!0,get:function(){return n6.KeywordCxt}});var Ti=ye();Object.defineProperty(Xt,"_",{enumerable:!0,get:function(){return Ti._}});Object.defineProperty(Xt,"str",{enumerable:!0,get:function(){return Ti.str}});Object.defineProperty(Xt,"stringify",{enumerable:!0,get:function(){return Ti.stringify}});Object.defineProperty(Xt,"nil",{enumerable:!0,get:function(){return Ti.nil}});Object.defineProperty(Xt,"Name",{enumerable:!0,get:function(){return Ti.Name}});Object.defineProperty(Xt,"CodeGen",{enumerable:!0,get:function(){return Ti.CodeGen}});var s6=Vo();Object.defineProperty(Xt,"ValidationError",{enumerable:!0,get:function(){return s6.default}});var i6=Si();Object.defineProperty(Xt,"MissingRefError",{enumerable:!0,get:function(){return i6.default}})});var Rj=C(function(kj){Object.defineProperty(kj,"__esModule",{value:!0});kj.formatLimitDefinition=void 0;var l6=jj(),Ar=ye(),Qn=Ar.operators,_c={formatMaximum:{okStr:"<=",ok:Qn.LTE,fail:Qn.GT},formatMinimum:{okStr:">=",ok:Qn.GTE,fail:Qn.LT},formatExclusiveMaximum:{okStr:"<",ok:Qn.LT,fail:Qn.GTE},formatExclusiveMinimum:{okStr:">",ok:Qn.GT,fail:Qn.LTE}},c6={message:({keyword:e,schemaCode:t})=>Ar.str`should be ${_c[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ar._`{comparison: ${_c[e].okStr}, limit: ${t}}`};kj.formatLimitDefinition={keyword:Object.keys(_c),type:"string",schemaType:"string",$data:!0,error:c6,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:i}=e,{opts:o,self:a}=i;if(!o.validateFormats)return;let l=new l6.KeywordCxt(i,a.RULES.all.format.definition,"format");if(l.$data)c();else d();function c(){let h=t.scopeValue("formats",{ref:a.formats,code:o.code.formats}),m=t.const("fmt",Ar._`${h}[${l.schemaCode}]`);e.fail$data(Ar.or(Ar._`typeof ${m} != "object"`,Ar._`${m} instanceof RegExp`,Ar._`typeof ${m}.compare != "function"`,p(m)))}function d(){let h=l.schema,m=a.formats[h];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw Error(`"${s}": format "${h}" does not define "compare" function`);let b=t.scopeValue("formats",{key:h,ref:m,code:o.code.formats?Ar._`${o.code.formats}${Ar.getProperty(h)}`:void 0});e.fail$data(p(b))}function p(h){return Ar._`${h}.compare(${r}, ${n}) ${_c[s].fail} 0`}},dependencies:["format"]};var u6=(e)=>(e.addKeyword(kj.formatLimitDefinition),e);kj.default=u6});var Tj=C(function(aa,Cj){Object.defineProperty(aa,"__esModule",{value:!0});var Ni=vj(),f6=Rj(),Dp=ye(),Aj=new Dp.Name("fullFormats"),p6=new Dp.Name("fastFormats"),Lp=(e,t={keywords:!0})=>{if(Array.isArray(t))return Oj(e,t,Ni.fullFormats,Aj),e;let[r,n]=t.mode==="fast"?[Ni.fastFormats,p6]:[Ni.fullFormats,Aj],s=t.formats||Ni.formatNames;if(Oj(e,s,r,n),t.keywords)(0,f6.default)(e);return e};Lp.get=(e,t="full")=>{let n=(t==="fast"?Ni.fastFormats:Ni.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function Oj(e,t,r,n){var s,i;(s=(i=e.opts.code).formats)!==null&&s!==void 0||(i.formats=Dp._`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}Cj.exports=aa=Lp;Object.defineProperty(aa,"__esModule",{value:!0});aa.default=Lp});import{existsSync as Ij,readFileSync as Mj,readdirSync as Jj,statSync as Dj}from"node:fs";import{createRequire as m6}from"node:module";import{join as Lj,relative as Fp,resolve as qp}from"node:path";async function b6(){try{let{default:e}=await Promise.resolve().then(() => kt(Pp(),1)),{default:t}=await Promise.resolve().then(() => kt(Tj(),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 Fj(e,t={}){let r=qp(e),n=[],s=[],i=0;for(let S of["project.schema.json","document.schema.json"]){let P=qp(r,S);if(!Ij(P))continue;i+=1;let E=la(P),O=$6(E);if(O.length>0)n.push({errors:O.map(({reason:R,ref:k})=>({message:`$ref "${k}" ${R} — committed entry documents must be self-contained `+"single-resource schemas; regenerate with `jx schema`"})),file:S})}if(n.length>0)return{checked:i,issues:n,lint:s,valid:!1};let o=await KP(r);if(i+=1,!o.valid)n.push({errors:o.errors??[],file:"project.json"});let{addFormats:a,Ajv:l}=await b6(),{document:c}=await Kv(r,{write:!1}),d=new l({allErrors:!0,ownProperties:!0,strict:!1});a(d);let p=d.compile(c),h=ZP(Nj(r).flatMap((S)=>{try{return[JSON.parse(Mj(S,"utf8"))]}catch{return[]}}));for(let S of h6)for(let P of Vj(qp(r,S))){if(P.endsWith(".class.json"))continue;i+=1;let E=la(P);if(p(E))s.push(...x6(E,Fp(r,P),h));else n.push({errors:p.errors??[],file:Fp(r,P)})}let m=new l({allErrors:!0,ownProperties:!0,strict:!1});a(m);let b=m.compile(hf());for(let S of Nj(r)){i+=1;let P=la(S);if(!b(P))n.push({errors:b.errors??[],file:Fp(r,S)})}let{config:g}=kn(r),y=await jn(r,g),v=m6(import.meta.url);for(let S of y.extensions)for(let P of["project","document","fields"]){let E=S.schemas[P];if(!E)continue;i+=1;let O=new l({allErrors:!0,ownProperties:!0,strict:!1});a(O);for(let R of y6){let k=v.resolve(R);O.addSchema(la(k))}try{O.compile(la(E))}catch(R){n.push({errors:[{message:R instanceof Error?R.message:String(R)}],file:`${S.specifier} (${P} fragment)`})}}let j=t.strict===!0&&s.some((S)=>S.severity==="error");return{checked:i,issues:n,lint:s,valid:n.length===0&&!j}}function la(e){return JSON.parse(Mj(e,"utf8"))}function x6(e,t,r){let n=[];for(let s of nj(e,r))n.push({...Hp(s),file:t,source:"popover"});for(let s of uj(e,r))n.push({...Hp(s),file:t,source:"dialog"});for(let s of oj(e))n.push({...Hp(s),criterion:s.criterion,file:t,source:"accessibility"});return n}function Hp(e){return{detail:e.detail,message:e.message,path:e.path,rule:e.rule,severity:e.severity}}function qj(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 $6(e){let t=[],r=new Set,n=(i)=>{let o=e;for(let a of i.slice(1).split("/")){if(a==="")continue;let l=a.replaceAll("~1","/").replaceAll("~0","~");if(!F(o))return!1;if(o=o[l],o===void 0)return!1}return!0},s=(i)=>{if(!ee(i)||r.has(i))return;r.add(i);let o=i.$ref;if(N(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,l]of Object.entries(i)){if(!v6.has(a))continue;if(Array.isArray(l))for(let c of l)s(c);else if(ee(l)){if(s(l),Hj.has(a))for(let c of Object.values(l))s(c)}}};return s(e),t}function Vj(e){if(!Ij(e))return[];let t=[];for(let r of Jj(e)){let n=Lj(e,r);if(Dj(n).isDirectory())t.push(...Vj(n));else if(r.endsWith(".json"))t.push(n)}return t.toSorted()}function Nj(e){let t=[],r=(n)=>{for(let s of Jj(n)){if(g6.has(s))continue;let i=Lj(n,s);if(Dj(i).isDirectory())r(i);else if(s.endsWith(".class.json"))t.push(i)}};return r(e),t.toSorted()}function Wj(e){let t=[];for(let r of e.issues){t.push(`${r.file}:`);for(let n of r.errors){let s=ee(n)?n:{},{instancePath:i,message:o}=s;t.push(` - ${i||"/"}: ${o??JSON.stringify(n)}`)}}return t}var h6,g6,y6,Hj,v6;var Bj=q(()=>{F0();YP();aj();dj();vc();ve();sn();Hi();tf();h6=["components","pages","layouts"],g6=new Set(["node_modules","dist",".git"]),y6=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"];Hj=new Set(["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"]),v6=new Set([...Hj,"additionalItems","additionalProperties","allOf","anyOf","contains","contentSchema","else","if","items","not","oneOf","prefixItems","propertyNames","then","unevaluatedItems","unevaluatedProperties"])});rr();import{relative as Vp,resolve as Uj}from"node:path";async function w6(){let e=process.argv.slice(2),[t]=e;if(!t||t==="--help"||t==="-h")console.log(`Usage: jx <command> [options]
611
572
 
612
573
  Commands:
613
574
  build [root] Build a Jx site to dist/
@@ -623,8 +584,8 @@ Options:
623
584
  --port <n> dev/preview: port to listen on (default 3000 / 4173)
624
585
  --dry-run db push: print the statements without executing them
625
586
  --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(`
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};
587
+ --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,s=e.slice(r?2:1),i=new Set,o=[],a,l;for(let p=0;p<s.length;p+=1){let h=s[p];if(h==="--connection")p+=1,a=s[p];else if(h==="--port"){p+=1;let m=Math.trunc(Number(s[p]??""));if(Number.isFinite(m)&&m>=0)l=m}else if(h.startsWith("--"))i.add(h);else o.push(h)}let[c]=o,d=Uj(c??".");if(r){if(n!=="push")console.error(`Unknown db subcommand: ${n??"(none)"}
588
+ Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let p=i.has("--dry-run");try{await Promise.resolve().then(() => km());let m={dryRun:p};if(a!==void 0)m.connection=a;let{results:b,bindingsPatched:g,wranglerPath:y}=await jm(d,m);for(let v of b){let j=v.applied?"applied":"dry-run";console.log(`${v.connection} (${v.provider}) — ${v.tables.length} table(s), ${v.statements.length} statement(s) [${j}]`);for(let S of v.statements)console.log(` ${S}`);for(let S of v.warnings)console.warn(` warning: ${S}`)}if(g&&y)console.log(`Updated bindings in ${Vp(d,y)}`)}catch(h){console.error(`db push failed: ${Ee(h)}`),process.exit(1)}return}if(t==="build"){let p=i.has("--verbose"),h=!i.has("--no-clean");console.log(`Building site from ${d}...`);try{await Promise.resolve().then(() => Rv());let b=await Sv(d,{clean:h,verbose:p});if(b.errors.length>0){console.error(`
589
+ Build completed with ${b.errors.length} error(s):`);for(let g of b.errors)console.error(` - ${g}`);process.exit(1)}console.log(`
590
+ Done: ${b.routes} routes → ${b.files} files`)}catch(m){console.error(`Build failed: ${Ee(m)}`),process.exit(1)}}else if(t==="dev")try{await Promise.resolve().then(() => Ov());Av(d,l)}catch(p){console.error(Ee(p)),process.exit(1)}else if(t==="preview"){let{existsSync:p}=await import("node:fs"),h=Uj(d,"dist");if(!p(h))console.error(`No build output at ${h} — run \`jx build\` first.`),process.exit(1);await Promise.resolve().then(() => Iv());let b=l??4173;Nv(h,b),console.log(`Previewing ${h} at http://localhost:${b}`)}else if(t==="schema")try{await Promise.resolve().then(() => tf());let{projectSchemaPath:h,documentSchemaPath:m}=await Gv(d);console.log(`Wrote ${Vp(d,h)}`),console.log(`Wrote ${Vp(d,m)}`)}catch(p){console.error(`Schema generation failed: ${Ee(p)}`),process.exit(1)}else if(t==="validate")try{await Promise.resolve().then(() => Bj());let b=await Fj(d,{strict:i.has("--strict")}),g=qj(b);if(b.valid){console.log(`Project is valid (${b.checked} files checked in ${d})`);for(let y of g)console.log(y)}else{console.error(`Project is INVALID (${d}):`);for(let y of[...Wj(b),...g])console.error(y);process.exit(1)}}catch(p){console.error(`Validation failed: ${Ee(p)}`),process.exit(1)}else console.error(`Unknown command: ${t}
591
+ Run "jx --help" for usage.`),process.exit(1)}var vee=w6();export{vee as ready};